motor: changed XPS driver to read back theoretical position as well as actual position. Now the default motorAxisPosition is the theory pos

ition. This brings it into line with the PMAC driver.
This commit is contained in:
mp49
2011-05-20 16:00:30 +00:00
parent 5f421e9a03
commit 5eb4b18d5c
+8 -1
View File
@@ -1178,6 +1178,7 @@ static void XPSPoller(XPSController *pController)
int anyMoving;
int forcedFastPolls=0;
double actualVelocity, theoryVelocity, acceleration;
double theoryPosition=0;
timeout = pController->idlePollPeriod;
epicsEventSignal(pController->pollEventId); /* Force on poll at startup */
@@ -1296,16 +1297,22 @@ static void XPSPoller(XPSController *pController)
}
status = GroupPositionSetpointGet(pAxis->pollSocket,
pAxis->positionerName,
1,
&theoryPosition);
status = GroupPositionCurrentGet(pAxis->pollSocket,
pAxis->positionerName,
1,
&pAxis->currentPosition);
if (status != 0) {
PRINT(pAxis->logParam, MOTOR_ERROR, "XPSPoller: error calling GroupPositionCurrentGet[%d,%d], status=%d\n", pAxis->card, pAxis->axis, status);
motorParam->setInteger(pAxis->params, motorAxisCommError, 1);
} else {
motorParam->setInteger(pAxis->params, motorAxisCommError, 0);
motorParam->setDouble(pAxis->params, motorAxisPosition, (pAxis->currentPosition/pAxis->stepSize));
motorParam->setDouble(pAxis->params, motorAxisPosition, (theoryPosition/pAxis->stepSize));
motorParam->setDouble(pAxis->params, motorAxisEncoderPosn, (pAxis->currentPosition/pAxis->stepSize));
}