spec

Software for Diffraction

kosmos

Kohzu Kosmos Series Aries/Lynx Motor Controllers

DESCRIPTION

spec supports the Kohzu Kosmos series Aries/Lynx motor controllers over socket and serial interfaces. The Aries is the master unit that includes the communication interfaces. The Lynx controllers are subsidiary units linked to the Aries over a proprietary interconnect.

See www.kohzuprecision.com for details on the hardware.

CONFIGURATION

Configure the controller on the Devices screen of the hardware configuration editor along the following lines:

Motor and Counter Device Configuration (Not CAMAC)

 MOTORS        DEVICE   ADDR  <>MODE  NUM                 <>TYPE U#
 0  YES  kosmos:12321                   8  Kohzu KOSMOS (Socket)  0
 1  YES    /dev/ttyS0     <>  115200   32  Kohzu KOSMOS (Serial)  1

The example shows configuration for both socket and serial interfaces. For the socket interface, the DEVICE column needs an IP address or a resolvable host name. The port number is optional. If missing, the default port, 12321, will be used.

On the Motor screen choose either KOSMOS or KOSMOS_E as the controller type, where the latter indicates encoder support. If using an encoder, the encoder steps per deg/mm parameter on the second optional parameter screen should be entered if the encoder resolution differs from the motor resolution.

When using encoders, spec defaults to using relative moves. If the nonstandard optional parameter "encoder_move_mode" is created on the optional parameter screen (type p) and given the value "absolute", encoder moves will use absolute positioning. Also, when using an encoder spec uses the RDE command to read the current position rather than the RDP command.

If using an encoder that produces a fluctuating position, one might want to set the hardware read mode to "always" + "premove", so that spec always has the current position when accessing angles. In addition, one might also want to either enter a finite number of steps for the readback slop parameter, or include the "no query" option in the hardware read mode. Otherwise, fluctuations in the encoder position will generate many motor position discrepancy messages that require a response.

SYSTEM SETTINGS

The controller firmware includes 41 system settings parameters for each axis identified by numbers between 1 and 99. These parameters can be displayed and changed with the functions described below.

SPEED TABLES

The controller firmware also includes 12 speed tables (numbered from 0 to 11) that contain different sets of motion profile parameters. Move commands include a parameter to specify a speed table to use for that move. The speed table functionality is not particularly useful to spec. spec always uses speed table 0 for regular moves and speed table 1 for home search moves, updating the speed table values as needed.

When the values for base rate (start speed), slew rate (maximum speed) or acceleration time change, spec updates speed table 0 or 1. The speed tables also contain values for deceleration time and the acceleration profile type. If the optional "deceleration" parameter is set for a particular motor, spec will use that value. Otherwise the deceleration time is programmed to be the same as the acceleration time. spec doesn't program the acceleration pattern and will use the value present in the firmware speed table. Generally the default trapezoidal pattern is fine.

The speed table values can be displayed as described below.

INITIALIZATION SEQUENCE

If the nonstandard optional motor parameter "init_sequence" is set in the config file for a KOSMOS motor, spec will send associated commands to the controller during hardware initialization based on the contents of that string. (Non-standard optional parameters are set from the configuration editor by typing a p from the motor screen.)

The only function supported in "init_sequence" is to assign values to the system settings parameters. The syntax of the string is par#=val, where # is the parameter number and val is the value to be assigned. Multiple assignments can be included in the string using a semicolon (;) as separator. For example:

par2=11; par16=6000; par33=10; par34=9; par35=1; par99=0

assigns values to five parameters. Spaces between entries or surrounding the equals sign are optional.

FUNCTIONS

motor_par(mne, "settings")

The "settings" option will display the parameters for the motor mne along the following lines:

 1              Origin offset:  0 steps
 2                Origin type:  11 (default 3)
 3          Origin scan speed:  500 Hz
 6             Motor prescale:  0
 7         Rotation direction:  Normal (0)
 8                 Limit swap:  Standard (0)
 9               Pulse method:  2CLK (2)
10                Pulse logic:  Positive (0)
11                   Backlash:  0 steps
12              Backlash type:  Before CW move (0)
13                Soft limits:  Disabled (0)
14            Plus soft limit:  134217727 steps
15        Negative soft limit:  -134217728 steps
16              Maximum speed:  6000 Hz (default 50000)
17                    Unknown:  0
18                    Unknown:  0
21                Limit logic:  Normally closed (0)
22                 NORG logic:  Normally closed (0)
23                  ORG logic:  Normally closed (0)
31         Encoder multiplier:  4
32           Encoder prescale:  0
33    Encoder ratio numerator:  10 (default 1)
34  Encoder ratio denominator:  9 (default 1)
35          Encoder direction:  Reversed (1) (default 0)
36            Encoder Z logic:  Negative (1)
37         Encoder sync write:  Enabled (1)
38             Encoder filter:  ON (0)
41      Encoder feedback type:  OFF (0)
42     Encoder feedback range:  1
43        Encoder retry count:  100
44   Encoder feedback timeout:  100 msec
51             Trigger source:  Motor pulse (0)
52               Trigger edge:  Rising (0)
53      Trigger pulse divider:  1
54    Trigger encoder divider:  1
55        Trigger pulse width:  1000 usec (3)
56              Trigger logic:  Positive (0)
61                Motor power:  ON (1)
62                 Motor type:  Stepper (0)
63                Servo alarm:  Disabled (0)
65             Microstep type:  M1 (0)
99                  Stop type:  Decelerate (0)

The number ID of the settings is shown in the first column. All settings values are numeric. For settings where spec displays a descriptive value, the corresponding numeric value is shown in parenthesis. If the setting is different than the firmware default value, the default value is also shown.

motor_par(mne, "par#" [, val])
Sets or returns the value of the system settings parameter with the number specified by #.
motor_par(mne, "speed_table")

Displays the current values for the firmware speed tables for motor mne as follows:

Num    Base    Slew Accel Decel Pattern A_pulse D_pulse
  0     500    1000    16    16    Trap     119     119
  1     500    2000    20    20    Trap     249     249
  2     500    3000    24    24    Trap     419     419
  3     500    3000    28    28    Trap     489     489
  4     500    3000    32    32    Trap     559     559
  5     500    3000    36    36    Trap     629     629
  6     500    3000    40    40    Trap     699     699
  7     500    3000    44    44    Trap     769     769
  8     500    3000    48    48    Trap     839     839
  9     500    3000    52    52    Trap     909     909
 10      10    3000    50    15 S-shape     752     225
 11       1     200     1     1 S-shape       1       1

The Accel and Decel columns are in units of 10 msec. Note that the values used by spec are in milliseconds, so are ten times larger. The A_pulse and D_pulse columns are the number of motors pulses to be issued during the acceleration and deceleration phases of the move.

The following command pass-through options are available, but should not be needed.

motor_par(mne, "send", cmd)
Sends the string cmd to the Kosmos controller associated with motor mne. Note, spec will add the axis number and other command delimiters as needed.
motor_par(mne, "read", cmd)
Sends the string cmd to the Kosmos controller associated with motor mne, and returns the reply. Note, spec will add the axis number and other command delimiters as needed.
motor_par(mne, "usend", cmd)

Sends the string cmd to the Kosmos controller associated with motor mne. The command prefix (for serial lines) and terminators will be added, but no axis number will be added. For example, this command:

p motor_par(mne, "usend", "WOT3/1")

will set general output pin number 3 to ON.

motor_par(mne, "uread", cmd)

Sends the string cmd to the Kosmos controller associated with motor mne, and returns the reply. The command prefix (for serial lines) and terminators will be added, but no axis number will be added. For example, this command:

p motor_par(mne, "uread", "RMC")

will return the MAC address of the controller.