From 524696a8d01675d6ecf25bdc036169997d0d6fbf Mon Sep 17 00:00:00 2001 From: Freddie Akeroyd Date: Fri, 26 Nov 2021 18:23:29 +0000 Subject: [PATCH] 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. --- motorApp/MotorSrc/motorRecord.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/motorApp/MotorSrc/motorRecord.cc b/motorApp/MotorSrc/motorRecord.cc index 4550d68e..bcf629da 100644 --- a/motorApp/MotorSrc/motorRecord.cc +++ b/motorApp/MotorSrc/motorRecord.cc @@ -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)) ) )