spec

Software for Diffraction

Mclennan

Mclennan Motor Controllers

DESCRIPTION

spec works with several models of Mclennan motor controllers. The PM301, PM341 and PM381 are supported, as are the newer PM600 and PM608 models. The even more recent PM1000 is compatible with and should be configured as PM600. All use serial interfaces.

spec also supports the PM595 model which uses a CANbus interface. This model was created specifically for use at at the ANKA synchrotron (now the KIT Light Source). The documentation below is only for the serial interface models.

The PM381 and PM608 are multiplexed devices, meaning that although the controller is associated with more than one motor, only one of the motors can be active at a time. For these multiplexed models, users can enter commands to move more than one of the motors and spec will automatically sequence the moves, starting the next motor in the group when the previous finishes its move.

Encoder support is included in two forms. With the PM341_E and PM600_E controller types, spec will read the encoder value to get the current position. With the PM341_E and PM600_P controller type, spec will also enable position maintenance for the controller. Servo mode is not currently implemented.

DEVICE CONFIGURATION

The Device screen of the edconf program (normally run from the config macro) is used to select the controller type and to assign parameters. Possibilities for controller include:

Motor and Counter Device Configuration (Not CAMAC)

 MOTORS      DEVICE   ADDR  <>MODE  NUM                       <>TYPE U#
 0  YES  /dev/ttyS0     <>    9600   10  Mclennan PM301/381 (Serial)  0
 1  YES  motor:5555 SOCKET    9600   10      Mclennan PM600 (Serial)  1
 2  YES  /dev/ttyS2     <>    9600  160      Mclennan PM608 (Serial)  2

The "DEVICE" column is the serial device node, or if the "ADDR" column is set to SOCKET, the resolvable host name or IP address with port number.

The baud rate setting in the "MODE" column must match the hardware configuration switches, which allow for rates of 4800, 9600, 19200 or 38400.

The "NUM" field is not used, and can be set to any value.

On the Motor screen, the Mclennan controllers types are PM301, PM341_E, PM341_P, PM381, PM595, PM600, PM600_E and PM600_P. PM600 is appropriate for both the PM600 and the PM1000. PM341_E and PM600_E indicates "checking stepper mode", while PM341_P and PM600_P indicate "closed loop stepper mode", The P is for position maintenance.

Of the PM301, PM341 and PM381 models, only the PM341 supports encoders.

The "unit/channel" configuration can be used for non-multiplexed controllers, and is needed if there is more than one Mclennan unit on the Device screen. If only one is configured, it is unit zero. The channel number is the controller address as set with the hardware configuration switches. If "unit/channel" isn't configured and there is just one unit, consecutive address are assigned automatically starting from zero.

The "unit/module/channel" configuration is required for the multiplexed models. The unit numbers start at zero and are assigned to match units on the Device screen. The module number is the controller address, and the channel number is from 1 to 8.

PARAMETERS

A number of non-standard optional parameters are recognized for the Mclennan controllers. Some are only available on the PM600/608/1000 models, while some are also available with the PM301/341/381 models. Type p on the Motor screen of the configuration editor to reach the screen for configuring the following parameters. See the corresponding Mclennan controller manual for details on the meaning and use of the following parameters.

"creep_steps"
Number of creep steps at end of a move. PM600 and PM301.
"proportional_gain"
Proportional gain coefficient in closed-loop mode. PM600 only.
"encoder_numerator"
Numerator for encoder ratio.
"encoder_denominator"
Denominator for encoder ratio.
"feedforward"
Velocity feedforward servo coefficient. PM600 only.
"sum_gain"
Sum servo coefficient. PM600 only.
"velocity_feedback"
Magnitude of velocity feedback signal derived from encoder for servo motors. PM600 only.
"extra_velocity_feedback"
Coefficient for auxiliary encoder in servo mode. PM600 only.
"settling_time"
Settling time. PM600 and PM301.
"stall_threshold"
Stall threshold in percent. PM600 only.
"timeout"
Sets end of move time-out check in milliseconds. PM600 and PM301.
"tracking_window"
Sets step difference for active move window with encoders. PM600 and PM301.
"window"
Sets step difference for end-of-move check with encoders. PM600 and PM301.

The standard optional parameters "DC settle time" and "DC proportional gain" on the first optional parameter screen can also be used rather than "settling_time" and "proportional_gain", respectively.

Parameter values will be programmed on the controller on the first move after startup or a reconfig or at the next move if a value has been changed with motor_par(). The motor_par() "update" and "dump" options will update the controller immediately.

FUNCTIONS

The following motor_par() options are available for the Mclennan controllers.

motor_par(mne, "update" [, arg])
Checks if the values of any of the programmable parameters have been changed using motor_par() and updates the controller with the new values. Otherwise, the parameters will be updated on the first move.
motor_par(mne, "dump")
Displays the result of the QA (query all) command, which is a list of all parameters and their current values from the controller. The command does an equivalent of the "update" action first, to ensure that the controller values match those set in spec.

The following commands can be used to send arbitrary ASCII messages to the controller and read the response.

motor_par(mne, "send", cmd)
Sends the command string cmd to the motor channel mne. The controller address and carriage return terminator will be added to the command.
motor_par(mne, "read", cmd)

Sends a command as above and returns the reply. For example:

SPEC> p motor_par(0, "read", "OC")
2000
motor_par(mne, "usend", cmd)
Sends the command string cmd to the controller associated with motor mne, but does not add the controller address or terminator. Note, though, all Mclennan commands require the controller address to precede the command letters.
motor_par(mne, "uread", cmd)

Sends a command as above and returns the reply. For example:

SPEC> p motor_par(0, "uread", "1OC\r")
2000