DiamondLightSource / pmac

Driver for the Delta Tau PMAC motion controller family.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feed rate error on kinematic

rleoni opened this issue · comments

Hello, how are you?

I'm using PMAC IOC and need some help. I'm getting erro of feed rate belowe the limit when I enable kinematic on .cmd file. Is there any problem with my configuration? how can I fix this error?


".cmd file"

epicsEnvSet("PPMAC_CS2_PORT", "CS2")

#****************************************************************************************

ATTACH TO THE SSH PORT

drvAsynPowerPMACPortConfigure("$(PPMAC_SSH_PORT)", "$(PPMAC_IP)", "xxxxx", "xxxxxx", "0", "0", "0")

#****************************************************************************************

CONFIGURE MODEL 3 CONTROLLER DRIVER

pmacCreateController("$(PPMAC_PORT)", "$(PPMAC_SSH_PORT)", 0 , 8, 100, 1000)

#****************************************************************************************

CREATE THE MODEL 3 MOTION AXIS DRIVERS

pmacCreateAxes("$(PPMAC_PORT)", 8)

#****************************************************************************************

SET UP FOR RUNNING COORDINATE SYSTEMS

pmacCreateCS("$(PPMAC_CS1_PORT)", "$(PPMAC_PORT)", 1, 1)

##****************************************************************************************

CREATE COORDINATE SYSTEMS AXES

pmacCreateCSAxes("$(PPMAC_CS1_PORT)", 9)

##****************************************************************************************

SET COORDINATE SYSTEM 1 SCALE FACTOR

pmacSetCoordStepsPerUnit("$(PPMAC_CS1_PORT)", 7, 1)
pmacSetCoordStepsPerUnit("$(PPMAC_CS1_PORT)", 8, 1)

"Kinematic"

open forward (1)
if (KinVelEna) callsub 100;
KinAxisUsed = KinEnaAxisX | KinEnaAxisY
N100: if(1) {
//A = angle relative to center; B = center offset
KinPosAxisX = 0.5 * (KinPosMotor5 + KinPosMotor6)
KinPosAxisY = 0.5 * (KinPosMotor5 - KinPosMotor6)
}
else
{
//Error message for different call paths:
if (Ldata.Status &40) {
Coord[1].ErrorStatus = 255; // User-set aborting error
}
else {
KinPosAxisX = sqrt(-1); // Return 'NaN'
KinPosAxisY = sqrt(-1); // Return 'NaN'
}
}
return;
close


Try setting the feedrate on CS2 to 100 with
&2%100
and verify that it has been set with
&2%

If the above fails then more explanation may be required:

There is some code in the driver that sets all feedrates to 0 if one of the feedrates is below a threshold. On power pmac this sometimes causes issues if the code is monitoring more CS than are a set up. To work around this you can set the feedrate limit to 0 with caput 0 to PV $(P):FEEDRATE_LIMIT"

Hello Gilesknap,

Thanks for your help.

Before trying, I checked feedrate for CS2 and it was fine (100). I tried to run IOC and get feedrate below limit error. So I closed IOC, used &2%100 command and I was able to run IOC without any problems.

There is something that drop feedrate. Is it possible that during the inicialization of the IOC, it is changing feedrate?

PS: In driver I couldn't find any code that sets feedrate.

Is it possible that during the inicialization of the IOC, it is changing feedrate?

Yes the code I mentioned above will do this. It is probably setting your CS2 to 0% since it sees one of the other CS has feedrate below threshold. I'm not sure that this is a very helpful feature and I'll look at removing it.

The code in question is in pmacController.cpp function mediumUpdate. Look for the message that prints 'Coordinate System %d feed rate below limit'.

If after startup you set the PVs
$(P):FEEDRATE_LIMIT 0
$(P):FEEDRATE 100

It should work around the issue for now

Hello Gilesknap,

Thank you very much for help and workaround.