backlash preseek made internal

r1891 | dcl | 2007-04-19 15:56:56 +1000 (Thu, 19 Apr 2007) | 2 lines
This commit is contained in:
Douglas Clowes
2007-04-19 15:56:56 +10:00
parent 34da43b4ee
commit 8b27116358

View File

@@ -109,6 +109,7 @@ typedef struct __MoDriv {
pNWTimer airpad_timer; /**< timer waiting for airpad action to complete */
pNWTimer motor_timer; /**< motor off timer */
int debug;
int preseek; /**< Flag = 1 if current move is a backlash preseek */
} DMC2280Driv, *pDMC2280Driv;
int DMC2280MotionControl = 1; /* defaults to enabled */
@@ -712,8 +713,12 @@ static int DMC2280RunCommon(pDMC2280Driv self,float fValue){
snprintf(BGx, CMDLEN, "BG%c", axis);
target = fValue - self->home;
if (self->preseek)
self->preseek = 0;
else {
if (self->backlash_offset > FLT_EPSILON) {
if (target > self->lastPosition) {
self->preseek = 1;
target += self->backlash_offset;
if (target > self->fUpper)
target = self->fUpper;
@@ -721,11 +726,13 @@ static int DMC2280RunCommon(pDMC2280Driv self,float fValue){
}
else if (self->backlash_offset < -FLT_EPSILON) {
if (target < self->lastPosition) {
self->preseek = 1;
target += self->backlash_offset;
if (target < self->fLower)
target = self->fLower;
}
}
}
if (1 == self->abs_endcoder) {
absEncHome = self->absEncHome;
@@ -1187,7 +1194,13 @@ static int DMC2280Status(void *pData){
}
#endif
/*
* When we get here, the motion has completed and we
* When we get here, the motion has completed
*/
if (self->preseek) {
DMC_RunCommon(self, self->fTarget);
return HWBusy;
}
/* and we
* must determine when and how to shut off the motor
*/
if (self->settle) {