Set detector y lower limit for Quokka

Improve precision of motor position calculation.

r2844 | ffr | 2009-12-11 12:39:12 +1100 (Fri, 11 Dec 2009) | 3 lines
This commit is contained in:
Ferdi Franceschini
2009-12-11 12:39:12 +11:00
committed by Douglas Clowes
parent 82475e1dec
commit 3abd3effa2
2 changed files with 17 additions and 11 deletions

View File

@@ -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

View File

@@ -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;
}