diff --git a/site_ansto/motor_dmc2280.c b/site_ansto/motor_dmc2280.c index 197e4abb..f8cfa9a5 100644 --- a/site_ansto/motor_dmc2280.c +++ b/site_ansto/motor_dmc2280.c @@ -1746,9 +1746,7 @@ static void DMCState_Idle(pDMC2280Driv self, pEvtEvent event) { pAsyncTxn pCmd = event->event.msg.cmd; if (self->subState == 1) { /* Status Response */ int iRet; - long lDelta, lprecision; - float fprecision; - + long lDelta; iRet = rspStatus(self, pCmd->inp_buf); if (iRet == 0) break; @@ -1759,16 +1757,11 @@ static void DMCState_Idle(pDMC2280Driv self, pEvtEvent event) { return; } /* if the motor moved, update any observers */ - MotorGetPar(self->pMot, "precision", &fprecision); - if (self->abs_encoder) { + if (self->abs_encoder) lDelta = fabs(self->currCounts - self->lastCounts); - lprecision = (long) (fprecision * self->cntsPerX + 0.5); - } else { + else lDelta = fabs(self->currSteps - self->lastSteps); - lprecision = (long) (fprecision * self->stepsPerX + 0.5); - } - - if (lDelta > lprecision) { + if (lDelta > 10) { set_lastMotion(self, self->currSteps, self->currCounts); report_motion(self); }