From b10b1608b2bb158bed1e9a4648d552b892a62eef Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Thu, 17 May 2012 11:02:53 +1000 Subject: [PATCH] Creep last encoder count by steps-per-count/10 instead of one, for motors with large steps-per-count r3544 | dcl | 2012-05-17 11:02:53 +1000 (Thu, 17 May 2012) | 1 line --- site_ansto/motor_dmc2280.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/site_ansto/motor_dmc2280.c b/site_ansto/motor_dmc2280.c index c6c49c2d..1cb96063 100644 --- a/site_ansto/motor_dmc2280.c +++ b/site_ansto/motor_dmc2280.c @@ -593,8 +593,11 @@ static int motCreep(pDMC2280Driv self, double target) { offset = offset - fabs(self->stepsPerX * self->creep_offset); else { /* if closer than one count, single step else go half way */ - if (offset <= fabs(self->stepsPerX / self->cntsPerX)) - offset = 1; + if (offset <= fabs(self->stepsPerX / self->cntsPerX)) { + offset = offset / 10; + if (offset < 1) + offset = 1; + } else offset = offset / 2; }