Fix negative backlash with relative moves in a negative direction

A negative BDST was correctly applied to negative direction moves
if moves are absolute. When retries are enabled all moves become
relative and backlash was not applied correctly for negative direction
moves.
This commit is contained in:
Freddie Akeroyd
2021-11-26 18:23:29 +00:00
parent 8fdd35dc11
commit 524696a8d0
+1 -1
View File
@@ -2410,7 +2410,7 @@ static RTN_STATUS do_work(motorRecord * pmr, CALLBACK_VALUE proc_ind)
}
/* IF move is in preferred direction, AND, current position is within backlash range. */
else if ((preferred_dir == true) &&
((use_rel == true && relbpos <= 1.0) ||
((use_rel == true && ((pmr->bdst >= 0 && relbpos <= 1.0) || (pmr->bdst < 0 && relbpos >= 1.0))) ||
(use_rel == false && (fabs(newpos - currpos) <= rbdst1))
)
)