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 $ # $Revision: 1.32 $
# $Date: 2009-12-10 03:57:53 $ # $Date: 2009-12-11 01:39:12 $
# Author: Ferdi Franceschini (ffr@ansto.gov.au) # Author: Ferdi Franceschini (ffr@ansto.gov.au)
# Last revision by: $Author: ffr $ # Last revision by: $Author: ffr $
@@ -328,8 +328,8 @@ Motor det $motor_driver_type [params \
action MC1\ action MC1\
axis G\ axis G\
units mm\ units mm\
hardlowerlim 320\ hardlowerlim 488\
hardupperlim 19345\ hardupperlim 19320\
maxSpeed 40\ maxSpeed 40\
maxAccel 5\ maxAccel 5\
maxDecel 10\ maxDecel 10\
@@ -340,8 +340,8 @@ Motor det $motor_driver_type [params \
det part detector det part detector
det long_name detector_y det long_name detector_y
det precision 1 det precision 1
det softlowerlim 350 det softlowerlim 500
det softupperlim 19330 det softupperlim 19310
det home 350.5 det home 350.5
det speed 40 det speed 40
det Blockage_Fail 0 det Blockage_Fail 0

View File

@@ -485,11 +485,17 @@ static int motDecel(pDMC2280Driv self, double axisDecel) {
* \return the motor position in physical units * \return the motor position in physical units
*/ */
static double motPosit(pDMC2280Driv self) { static double motPosit(pDMC2280Driv self) {
double fPos; double fPos, curr, home, counts;
if (self->abs_encoder) if (self->abs_encoder) {
fPos = (self->currCounts - self->absEncHome) / self->cntsPerX + self->fHome; curr = self->currCounts;
else home = self->absEncHome;
fPos = (self->currSteps - self->motorHome) / self->stepsPerX + self->fHome; counts = self->cntsPerX;
} else {
curr = self->currSteps;
home = self->motorHome;
counts = self->stepsPerX;
}
fPos = (curr - home) / counts + self->fHome;
return fPos; return fPos;
} }