Motor ConfigurationFerdi Franceschini2007-02-12 14:24Configuration exampleMotors are configured by following this patternSetup the host and port of the controllerMake the motor queueSet the home value for the absolute encoderSet the motor configuration parametersMotor configuration examplefrom
ics1-echidna.nbi.ansto.gov.au:/usr/local/sics/server/config/motors/motor_configuration.tcl# Setup addresses of Galil DMC2280 controllers.
set dmc2280_controller1(host) mc1-$animal
set dmc2280_controller1(port) pmc1-$animal
...
MakeAsyncQueue mc1 DMC2280 $dmc2280_controller1(host) \
$dmc2280_controller1(port)
...
#Measured absolute encoder reading at home position
set mphi_Home 7781389
...
# Monochromator phi, Tilt 1, upper
Motor mphi $motor_driver_type [params \
asyncqueue mc1\
absEnc 1\
absEncHome $mphi_Home\
axis A\
cntsPerX -8192\
hardlowerlim -2\
hardupperlim 2\
maxSpeed 1\
maxAccel 1\
maxDecel 1\
stepsPerX -25000\
units degrees]
setHomeandRange -motor mphi -home 0 -lowrange 2 -uprange 2
mphi speed 1
mphi movecount $move_count
mphi precision 0.05
mphi part crystal
mphi long_name phi
Configuration checklistAlways use a positive number for the motor steps conversion multiplier.If the encoder
counts decrease when the motor steps increase then the encoder counts conversion
multiplier must be negative.For each axis with an absolute encoderHow many motor steps are there per degree or mm?How many encoder counts are there per degree or mm?Move the motor a positive number of steps.If the encoder counts has
increased then set the stepsPerX positive
otherwise negative.If encoder counts decrease when motor steps increase then set the sign of
cntsPerX to the opposite sign of stepsPerX, otherwise the sign should be the
same.What is the encoder reading at the home position?For each axis without an absolute encoderHow many motor steps are there per degree or mm?Move the motor a positive number of steps.If the axis moved in the
positive direction according to the coordinate conventions then set the
stepsPerX positive otherwise
negative.Set axis home position.Make sure the axis HOME routine has been run. The axis should
be at the lower limit and the motor defined position should be
zero, ie TDx returns zero.Drive the axis to the home position and set motorHome to TDxFor all axesCheck that maxSpeed, maxAccel, and maxDecel are sane. NOTE: The initial
speed, accel and decel will be set to the maximum values.If an axis should not be powered down after each move then set
noPowerSave=1.SlitsThe zero position for the slits is defined when the slits are closed but not
overlapping. Since the slit motors don't have absolute encoders we need to define a
zero reference for counting motor steps, we will call this reference the motorHome.
The motorHome is set when the slits are fully open, there is a home subroutine
(called #HOME) on the DMC2280 controller which can be called to set this position
for you.The homing code on the controller fully opens the slits and then sets the position
as zero.Run #HOME command on controller, ie XQ #HOME,1UseuCheck that the command has completed with MG _XQ1, a value of -1 means the
command has finished otherwise it displays the current line number.After the #HOME command has completed check that the defined motor
positions has been set to zero by executing TDEFGHrun gap to zero, set lowerlims to -ve val if there is a gap, then run gap
to -ve witdh.Read position for each slit and set it as the "motorHome" parameter in the
sics configuration file.TestingCheck communications to all four controllers.Try to run motor past limits.Does SICS reject the command?Run motors to limits.Does it move in the right direction?Does it stop
where expected?Run motor to home position.Does it stop where expected?Set limitsSet homeSet softzeroSet sign (direction of motion)Set speedSet accelerationSet decelerationConfiguration referenceabsEnc integerSet to 1 if the axis has an absolute encoderabsEncHome integerThe calibrated "home" position in encoder countsRequired if absEnc = 1axis valThe DMC2280 motor controller can control up to eight axesAllowed val one of: cntsPerX integerNumber of absolute encoder counts per unit of movement
along/about the axis of motionhardlowerlim integerHardware lower limit for motorhardupperlim integerHardware upper limit for motormaxAccel valMaximum allowed acceleration in units per
second2maxDecel valMaximum allowed deceleration in units per
second2maxSpeed valSpeed in units per secondmotorHome integerThe calibrated "home" position in motor steps. You only need to set this
if the axis does not have an absolute encodermotOffDelay integerNumber of msec to wait before switching off a motor after a moveDefault = noPowerSavevalBy default a motor will switch off after a move. If you set this to 1 the
motor will stay on.Allowed val one of: (default)stepsPerX valNumber of motor steps per unit of movement along/about
the axis of motionunits valThe units of motion for the axis, eg for phi or
two-theta, for translationAllowed val one of: