backlash preseek made internal
r1891 | dcl | 2007-04-19 15:56:56 +1000 (Thu, 19 Apr 2007) | 2 lines
This commit is contained in:
@@ -109,6 +109,7 @@ typedef struct __MoDriv {
|
|||||||
pNWTimer airpad_timer; /**< timer waiting for airpad action to complete */
|
pNWTimer airpad_timer; /**< timer waiting for airpad action to complete */
|
||||||
pNWTimer motor_timer; /**< motor off timer */
|
pNWTimer motor_timer; /**< motor off timer */
|
||||||
int debug;
|
int debug;
|
||||||
|
int preseek; /**< Flag = 1 if current move is a backlash preseek */
|
||||||
} DMC2280Driv, *pDMC2280Driv;
|
} DMC2280Driv, *pDMC2280Driv;
|
||||||
|
|
||||||
int DMC2280MotionControl = 1; /* defaults to enabled */
|
int DMC2280MotionControl = 1; /* defaults to enabled */
|
||||||
@@ -712,18 +713,24 @@ static int DMC2280RunCommon(pDMC2280Driv self,float fValue){
|
|||||||
snprintf(BGx, CMDLEN, "BG%c", axis);
|
snprintf(BGx, CMDLEN, "BG%c", axis);
|
||||||
target = fValue - self->home;
|
target = fValue - self->home;
|
||||||
|
|
||||||
if (self->backlash_offset > FLT_EPSILON) {
|
if (self->preseek)
|
||||||
if (target > self->lastPosition) {
|
self->preseek = 0;
|
||||||
target += self->backlash_offset;
|
else {
|
||||||
if (target > self->fUpper)
|
if (self->backlash_offset > FLT_EPSILON) {
|
||||||
target = self->fUpper;
|
if (target > self->lastPosition) {
|
||||||
|
self->preseek = 1;
|
||||||
|
target += self->backlash_offset;
|
||||||
|
if (target > self->fUpper)
|
||||||
|
target = self->fUpper;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
else if (self->backlash_offset < -FLT_EPSILON) {
|
||||||
else if (self->backlash_offset < -FLT_EPSILON) {
|
if (target < self->lastPosition) {
|
||||||
if (target < self->lastPosition) {
|
self->preseek = 1;
|
||||||
target += self->backlash_offset;
|
target += self->backlash_offset;
|
||||||
if (target < self->fLower)
|
if (target < self->fLower)
|
||||||
target = self->fLower;
|
target = self->fLower;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1187,7 +1194,13 @@ static int DMC2280Status(void *pData){
|
|||||||
}
|
}
|
||||||
#endif
|
#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
|
* must determine when and how to shut off the motor
|
||||||
*/
|
*/
|
||||||
if (self->settle) {
|
if (self->settle) {
|
||||||
|
|||||||
Reference in New Issue
Block a user