The uniserv CAN bus interface specification¶
uniserv CAN Bus Protocol¶
Node-ID¶
One UniDrive device controls one undulator axle. The undulator always has a gap drive with a number of axles and some undulators have a shift drive with a number of axles. The axles have a NODE-ID starting with 1. All axles are numbered continuously, starting with 1:
Gap Drive: Axle 1 .. n, NODE-ID 1..n
Shift Drive: Axle 1.. m, NODE-ID n+1 .. n+m
CANOpen sync object¶
Note
The CAN sync object has a length of 0 bytes, it doesn’t contain any further data.
CAN object ID : 0x80
Function : The is the CAN sync object. When the IOC sends this
object, all UniDrive devices reply by sending their
PDO Tx objects. The usual rate at which this is sent
is 10 Hz.
CANOpen PDO variables¶
Note
All variables described here are 32 bit integers.
Here is the PDO specification:
IDCP name : CAN_BROADCAST
uniserv name : CAN_BROADCAST
CAN object ID : 0x500
Type : PDO Rx
UniDrive register: 20.21
Function : Drive command
Bits : Bit 28 - Bit 31 : axle group
1 for "gap" and 2 for "shift"
Bit 8 - Bit 27 : counter, must be incremented by
one for each new command
Bit 0 - Bit 8 : Command code, these are the possible values:
NOP 0
RESET 1
F_RESET 2
POS_RESET 4
STOP 10
RUN 11
SETBRAKE 20
IDCP name : CAN_BROADCAST_EXTRA
uniserv name : CAN_MAX_TIME
CAN object ID : 0x508
Type : PDO Rx
UniDrive register: 20.22
Function : Max. movement time of the axle with
the longest way to go in milliseconds
Bits : Bit 28 - Bit 31 : axle group
1 for "gap" and 2 for "shift"
Bit 0 - Bit 27 : The maximum movement time in
milliseconds. Velocities of axles are
*reduced* to match this time. This is
needed for all axles to arrive at their
destination at the same time. If the
time is set to 0, the axles do not adapt
their velocity.
IDCP name : CAN_BROADCAST_DATA
uniserv name : CAN_DATA_ITEM
CAN object ID : 0x510 (Gap), 0x511 (Shift)
Type : PDO Rx
UniDrive register: 20.23
Function : This is used to load motion tables onto the drive
with the motion table (mt) protocol.
IDCP name : CAN_BROADCAST_SPEED
uniserv name : CAN_SPEED_VAR
CAN object ID : 0x518
Type : PDO Rx
UniDrive register: 20.24
Function : Speed multiplier for gap and shift.
Bit 0 - Bit 15: Multiplier for gap
Bit 16 - Bit 31: Multiplier for shift
All bits set (0xFFFF = 65535) mean factor=1.0
IDCP name : CAN_BASE_STAT
uniserv name : CAN_STATUS
CAN object ID : 0x520 + NODE-ID
Type : PDO Tx
UniDrive register: 20.25
Function : status word.
Bits : Bit 0 - Bit 7: Status, these are the values:
PREINIT 40
PWON 50
STOP 0
RUN 1
ERR 30
Bit 8 - Bit 15: Stop counter, incremented by one
each time the status changes from RUN to
STOP
Bit 16 - Bit 23: Start counter, incremented by one
each time the status changes from (NOT RUN)
to RUN
Bit 24 - Bit 31: Watchdog counter, incremened by one
each time the UniDrive sends a new status
IDCP name : CAN_BASE_POS
uniserv name : CAN_CURR_POS
CAN object ID : 0x540 + NODE-ID
Type : PDO Tx
UniDrive register: 20.26
Function : current position in increments
IDCP name : CAN_BASE_XPOS
uniserv name : CAN_TABLE_DELTA
CAN object ID : 0x560 + NODE-ID
Type : PDO Tx
UniDrive register: 20.27
Function : difference of wanted position and actual position
when moving with a motion table
CANOpen SDO variables¶
Note
All variables described here are 32 bit integers.
The CAN Object IDs are calculated from the node ID of the drive according to the CANOpen standard.
This means that the outgoing CAN object on the UniDrive is:
0x600 + NODE-ID
The incoming CAN object on the UniDrive is:
0x580 + NODE-ID
Here is the list of all SDO variables:
IDCP name : CAN_SDO_AX_BRAKE
UniDrive Var : CAN_BRAKE
Type : SDO
UniDrive register: 20.35
Index/Subindex : 2014, 23
Function : activate or release brake
Values : 0 : release
1 : activate
IDCP name : CAN_SDO_AX_ACT
UniDrive Var : CAN_ACTIVATED
Type : SDO
UniDrive register: 20.34
Index/Subindex : 2014, 22
Function : activate axle
Values : 1: axle is active
0: axle ignores "RUN" command
IDCP name : CAN_SDO_AX_VEL
UniDrive Var : CAN_VEL
Type : SDO
UniDrive register: 20.36
Index/Subindex : 2014, 24
Function : set velocity
Values : CAN_VEL= v[mm/s] / abs(PI2GAP) * VELTOCAN
PI2GAP : gap : v_pi2gap_factor in StructuredData or
PI_TO_GAP_FACT in file idcpNN.config.tab
shift: h_pi2gap_factor in StructuredData or
PI_TO_GAP_FACT2 in file idcpNN.config.tab
VELTOCAN: gap : v_vel_to_can_facts in StructuredData or
VEL_TO_CAN_FACTS in file idcpNN.config.tab
shift: h_vel_to_can_facts in StructuredData or
VEL_TO_CAN_FACTS2 in file idcpNN.config.tab
IDCP name : CAN_SDO_AX_TBMOD
UniDrive Var : CAN_TABLE_MODE
Type : SDO
UniDrive register: 20.37
Index/Subindex : 2014, 25
Function : specify movement mode
Values : 0: constant velocity
1: change velocity according to motion table
2: change velocity according to CAN_VEL and CAN_SPEED_VAR
IDCP name : CAN_SDO_AX_BRAKE_RBK
UniDrive Var : BRAKE_BIT
Type : SDO
UniDrive register: 18.31
Index/Subindex : 2012, 1f
Function : Brake state readback, see also CAN_BRAKE
Values : 0 : activated
1 : released
IDCP name : CAN_SDO_AX_HTH
UniDrive Var : HEALTH
Type : SDO
UniDrive register: 10.01
Index/Subindex : 200a 01
Function : "drive healthy" bit readback
Values : 0: error
1: OK
IDCP name : CAN_SDO_AX_CMD
UniDrive Var : CAN_CMD
Type : SDO
UniDrive register: 20.30
Index/Subindex : 2014 1e
Function : direct command for a single axle,
currently not used
IDCP name : CAN_SDO_AX_VER
UniDrive Var : CAN_VERSION
Type : SDO
UniDrive register: 20.33
Index/Subindex : 2014 21
Function : uniserv version. The date is coded in a single integer
in the form YYMMDDhhm.
IDCP name : CAN_SDO_AX_VER_L
UniDrive Var : CAN_VERSION_L
Type : SDO
UniDrive register: 20.19
Index/Subindex : 2014 13
Function : uniserv version, last digit. From the date YYMMDDhhmm this
is the last digit of the minutes ('mm').
IDCP name : CAN_SDO_AX_ERR
UniDrive Var : CAN_ERR
Type : SDO
UniDrive register: 20.38
Index/Subindex : 2014 26
Function : current error code, also used by the IOC to reset an
error by writing to this variable
Values :
ERR_NONE 0 : no error
ERR_ACT 1 : currently not used
ERR_POS 2 : axle at wrong position
ERR_CTNET 3 : PLC signals error
ERR_SWITCH 4 : end position switch reached
ERR_ENA 5 : PLC has disabled drive
ERR_BRK 6 : trying to move although brake is activated
IDCP name : CAN_SDO_AX_DST
UniDrive Var : CAN_DEST
Type : SDO
UniDrive register: 20.31
Index/Subindex : 2014 1f
Function : Destination position
Values : CAN_DEST= ( dest[mm] - OFFSET ) / PI2GAP
PI2GAP : gap : v_pi2gap_factor in StructuredData or
PI_TO_GAP_FACT in file idcpNN.config.tab
shift: h_pi2gap_factor in StructuredData or
PI_TO_GAP_FACT2 in file idcpNN.config.tab
OFFSET : gap : v_pi2gap_offset in StructuredData or
PI_TO_GAP_OFFSET in file idcpNN.config.tab
shift: h_pi2gap_offset in StructuredData or
PI_TO_GAP_OFFSET2 in file idcpNN.config.tab
IDCP name : CAN_SDO_AX_STT
UniDrive Var : CAN_STATUS
Type : SDO
UniDrive register: 20.25
Index/Subindex : 2014 19
Function : the CAN status, see CAN_STATUS further above.
This SDO variable is written by the IOC when
an error is resetted.
IDCP name : CAN_SDO_AX_APS
UniDrive Var : CAN_CURR_IPOS
Type : SDO
UniDrive register: 20.39
Index/Subindex : 2014 27
Function : The raw value from the position measurement system
IDCP name : CAN_SDO_AX_OFF
UniDrive Var : CAN_POS_OFFSET
Type : SDO
UniDrive register: 20.40
Index/Subindex : 2014 28
Function : The offset value to the raw position CAN_CURR_IPOS
IDCP name : CAN_SDO_AX_DDF
UniDrive Var : CAN_DEST_DIFF
Type : SDO
UniDrive register: 20.32
Index/Subindex : 2014 20
Function : difference between set position and current position
IDCP name : CAN_SDO_AX_POS
UniDrive Var : CAN_CURR_POS
Type : SDO
UniDrive register: 20.26
Index/Subindex : 2014 1a
Function : The current position after the offset is added.
CAN_CURR_POS is also a PDO variable.
IDCP name : CAN_SDO_AX_VST
UniDrive Var : CAN_VAR_STATUS
Type : SDO
UniDrive register: 20.29
Index/Subindex : 2014 1d
Function : The current status word, this can also be written to to
reset an "ERR" status.
Values :
PREINIT 40
PWON 50
STOP 0
RUN 1
ERR 30
IDCP name : CAN_SDO_AX_TST
UniDrive Var : CAN_TABLE_STATUS
Type : SDO
UniDrive register: 20.28
Index/Subindex : 2014 1c
Function : Motion table transfer status
Values :
MT_STATUS_TRANSMITTING : -1
MT_STATUS_OK : 0
MT_STATUS_CHECKSUM_ERROR : 1
MT_STATUS_LENGTH_ERROR : 2
How to move an axle¶
Note: All variable names here are UniDrive Variables. You find their specification above at “PDO variables” or “SDO variables”.
Note 2: The command in variable CAN_BROADCAST is sent to all axles. Depending on their destination, the state of CAN_ACTIVATED and the axle group setting (see CAN_BROADCAST) other axles will be effected by the command, too.
Set the velocity with CAN_VEL
Write the destination to CAN_DEST
Write the maximum movement time to CAN_MAX_TIME
If brake is active, relase the brake. First write “release” to CAN_BRAKE. Then write “SETBRAKE” to CAN_BROADCAST.
Write “RUN” to CAN_BROADCAST.