motor: XPS model 3 driver. set the motorStatusHome and motorStatusHomed MSTA bits correctly. Also added in support in the driver to keep track of referencing mode.

This commit is contained in:
mp49
2011-07-29 10:30:32 +00:00
parent 48e99a40e6
commit 3a65e1060d
2 changed files with 27 additions and 1 deletions
+26 -1
View File
@@ -194,6 +194,9 @@ XPSAxis::XPSAxis(XPSController *pC, int axisNo, const char *positionerName, doub
/* And we need to implement this in Asyn layer. */
getPID();
/* Used to keep track of referencing mode in the driver.*/
referencingMode_ = 0;
/* Wake up the poller task which will make it do a poll,
* updating values for this axis to use the new resolution (stepSize_) */
pC_->wakeupPoller();
@@ -562,7 +565,29 @@ asynStatus XPSAxis::poll(bool *moving)
setDoubleParam(pC_->motorLowLimit_, (lowLimit_/stepSize_));
}
setIntegerParam(pC_->motorStatusHome_, (axisStatus_ == 11) ? 1 : 0);
/*Set the ATHM signal.*/
if (axisStatus_ == 11) {
if (referencingMode_ == 0) {
setIntegerParam(pC_->motorStatusHome_, 1);
} else {
setIntegerParam(pC_->motorStatusHome_, 0);
}
} else {
setIntegerParam(pC_->motorStatusHome_, 0);
}
/*Set the HOMED signal.*/
if ((axisStatus_ >= 10 && axisStatus_ <= 21) ||
(axisStatus_ == 44) || (axisStatus_ == 45) || (axisStatus_ == 47)) {
if (referencingMode_ == 0) {
setIntegerParam(pC_->motorStatusHomed_, 1);
} else {
setIntegerParam(pC_->motorStatusHomed_, 0);
}
} else {
setIntegerParam(pC_->motorStatusHomed_, 0);
}
if ((axisStatus_ >= 0 && axisStatus_ <= 9) ||
(axisStatus_ >= 20 && axisStatus_ <= 42)) {
/* Not initialized, homed or disabled */
+1
View File
@@ -82,6 +82,7 @@ class XPSAxis : public asynMotorAxis
double deferredPosition_;
int deferredMove_;
int deferredRelative_;
int referencingMode_;
friend class XPSController;
};