diff --git a/site_ansto/instrument/sans/config/motors/motor_configuration.tcl b/site_ansto/instrument/sans/config/motors/motor_configuration.tcl index 57bb9161..8f6cb237 100644 --- a/site_ansto/instrument/sans/config/motors/motor_configuration.tcl +++ b/site_ansto/instrument/sans/config/motors/motor_configuration.tcl @@ -1,5 +1,5 @@ -# $Revision: 1.31 $ -# $Date: 2009-12-10 03:57:53 $ +# $Revision: 1.32 $ +# $Date: 2009-12-11 01:39:12 $ # Author: Ferdi Franceschini (ffr@ansto.gov.au) # Last revision by: $Author: ffr $ @@ -328,8 +328,8 @@ Motor det $motor_driver_type [params \ action MC1\ axis G\ units mm\ - hardlowerlim 320\ - hardupperlim 19345\ + hardlowerlim 488\ + hardupperlim 19320\ maxSpeed 40\ maxAccel 5\ maxDecel 10\ @@ -340,8 +340,8 @@ Motor det $motor_driver_type [params \ det part detector det long_name detector_y det precision 1 -det softlowerlim 350 -det softupperlim 19330 +det softlowerlim 500 +det softupperlim 19310 det home 350.5 det speed 40 det Blockage_Fail 0 diff --git a/site_ansto/motor_dmc2280.c b/site_ansto/motor_dmc2280.c index afbc9362..edea4efc 100644 --- a/site_ansto/motor_dmc2280.c +++ b/site_ansto/motor_dmc2280.c @@ -485,11 +485,17 @@ static int motDecel(pDMC2280Driv self, double axisDecel) { * \return the motor position in physical units */ static double motPosit(pDMC2280Driv self) { - double fPos; - if (self->abs_encoder) - fPos = (self->currCounts - self->absEncHome) / self->cntsPerX + self->fHome; - else - fPos = (self->currSteps - self->motorHome) / self->stepsPerX + self->fHome; + double fPos, curr, home, counts; + if (self->abs_encoder) { + curr = self->currCounts; + home = self->absEncHome; + counts = self->cntsPerX; + } else { + curr = self->currSteps; + home = self->motorHome; + counts = self->stepsPerX; + } + fPos = (curr - home) / counts + self->fHome; return fPos; }