Skip to content

McLennan motors

Adrian Potter edited this page Nov 11, 2016 · 10 revisions

Mclennan motors

This page is intended to contain any useful notes specific to McLennan motors. For more general notes about motors, look at the motion control pages.

Velocity

The McLennan motor velocity is set with the VELOn IOC macros. The value set is in mm/second. The motor resolution is set with the MRESn IOC macros and as in units of mm/step. The velocity value set on the device will be the velocity divided by the motor resolution, and will be in units of step/second.

Acceleration

Acceleration is far less intuitive than velocity. The acceleration value on the device is the acceleration in units of step/s^2. It is calculated as the IOC macro values of velocity divided by the product of the motor resolution and acceleration. The IOC macro acceleration is therefore the number of seconds under linear acceleration to reach maximum speed.

Setting the motor offset

Note that this applies equally to other motor types.

Sometimes it is desirable to change the reported position of the motor without it physically moving, effectively changing the origin of the axis. This can be achieved through EPICS by applying an offset to the reported motor position. In order to apply a fixed offset:

  1. Start the motor IOC
  2. Go into the Motors perspective in the client
  3. Bring up the OPI for the desired motor by double clicking the relevant square in the table
  4. Click on More details...
  5. In the Calibration section, switch Cal from use to set
  6. Either
    1. Change the Off field to apply an offset to the current position
    2. Change the current position directly by changing the MoveAbs User field in the Drive section
  7. Don't forget to switch the Cal field back to Use once you're done or the motor won't move.

Homing

The McLennan driver is currently set so that it will execute a constant velocity (CV) move to the next limit switch at a velocity equal to the base velocity. The base velocity is set to match the main velocity set via the IOC macros at startup. This can be edited in the motor details panel.

Configuring axes

When configuring a particular axis, an axes.cmd file is required in C:\Instrument\Settings\config\[INSTMACHINE]\mclennan. See the the motion control pages for additional details. It is often desirable to set up a number of axes depending which controller, and which axis is in use. There are specific environment variables set up to let you do this. The following example shows a stretching rig set up on MOT0201 and a linear sample changer on MOT0101:

$(IFMTRCTRL1)$(IFAXIS1) dbLoadRecords("$(AXIS)/db/axis.db","P=$(MYPVPREFIX)MOT:,AXIS=STACK:LIN,mAXIS=MTR0101")
$(IFMTRCTRL2)$(IFAXIS1) dbLoadRecords("$(AXIS)/db/axis.db","P=$(MYPVPREFIX)MOT:,AXIS=STRETCH:LIN,mAXIS=MTR0201")

You can see the environment variables being used at the start of the line. The available variables are:

IFMTRCTRLn: The line is run if the controller number for the motor is n where n is between 1 and 24. This corresponds to the MTRCTRL IOC macro. IFAXISn: The line is run if the axis number for the motor is n where n is between 1 and 8. This corresponds to the AXISn=yes IOC macro.

Note that the equivalent IFNOT... environment variables also exist but are typically of less use.

Also note that the two environment variables combine as an and operation when used in this form. That is, the line will only execute if both conditions are met. There is currently no way to combine the environment variable with an or operator.

Clone this wiki locally