Motor Configuration Ferdi Franceschini 2007-02-12 14:24 Configuration example Motors are configured by following this pattern Setup the host and port of the controller Make the motor queue Set the home value for the absolute encoder Set the motor configuration parameters Motor configuration example from 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 checklist Always 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 encoder How 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 encoder How 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 TDx For all axes Check 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. Slits The 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,1Useu Check 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 TDEFGH run 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. Testing Check 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 limits Set home Set softzero Set sign (direction of motion) Set speed Set acceleration Set deceleration Configuration reference absEnc integer Set to 1 if the axis has an absolute encoder absEncHome integer The calibrated "home" position in encoder counts Required if absEnc = 1 axis val The DMC2280 motor controller can control up to eight axes Allowed val one of: cntsPerX integer Number of absolute encoder counts per unit of movement along/about the axis of motion hardlowerlim integer Hardware lower limit for motor hardupperlim integer Hardware upper limit for motor maxAccel val Maximum allowed acceleration in units per second2 maxDecel val Maximum allowed deceleration in units per second2 maxSpeed val Speed in units per second motorHome integer The calibrated "home" position in motor steps.  You only need to set this if the axis does not have an absolute encoder motOffDelay integer Number of msec to wait before switching off a motor after a move Default = noPowerSave val By 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 val Number of motor steps per unit of movement along/about the axis of motion units val The units of motion for the axis, eg for phi or two-theta, for translation Allowed val one of: