CPR CAN Protocol V2 UserGuide en
CPR CAN Protocol V2 UserGuide en
for
Closed Loop motor controller
Version 1.5
July 17, 2024
© Commonplace Robotics GmbH
CONTENTS
Contents
2 Introduction 4
2.1 Brief description of the protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2 Communication procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.3 Communication parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.4 Configuration software ModuleCtrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.5 Demo software with sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3 CAN Messages 6
3.1 Motion commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.1.1 Position CMD 0x14 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.1.2 Velocity CMD 16bit 0x25 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.1.3 Torque CMD 0x16 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.2 Response to motion commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.3 Process CMD 0x01 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.3.1 Reset Error 0x06 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.3.2 Set position to 0 0x08 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.3.3 Enable Motor 0x09 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.3.4 Disable Motor 0x0A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.3.5 Referencing 0x0B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.3.6 Rotor alignment 0x0C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.3.7 Ping 0xCC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.3.8 EEPROM write enable 0xCD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.4 Parameter V2 0x94 & 0x96 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.4.1 Save parameters 0x94 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.4.2 Read parameters 0x96 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.5 Special CAN messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.5.1 Startup message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.5.2 Environmental parameters 0x12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.5.3 Extended error messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.5.4 Output encoder position . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.1 Contact
Internet: [Link]
This documentation supplements the product documentation of the motor controllers. Knowledge
of this documentation is assumed.
2 Introduction
The calculation of acceleration ramps and the interpolation between target points takes place in the
controller, not in the motor controller. The controller sends the target position to the motor controller
at short intervals of 10 to 50 ms.
The operation is thus comparable to the CANopen operation mode IPO or CSP. An operation mode
like CANopen ProfilePosition is not supported.
In addition to transmitting the position or speed specifications, the controllers can be parameterized
via the protocol.
2. Start of a cyclically called function which sends a position specification every 20 ms (chapter
3.1.1)
3. Aligning the positions of motorcontroller and master software. There are two options:
Reset the current position to 0 (Chapter 3.3.2). Initialization of the setpoint position in the
master software also with 0.
This option is recommended for the first tests.
Reading the current motor position from the CAN message answers (Chapter 3.2) and using
this position as current setpoint position in the master software.
This option is recommended for real applications.
5. Enable axis (chapter 3.3.3) so that error byte in response shows 0x00 (chapter 3.2).
6. Slowly change the target position in the cyclically sent position specification. The axis now
follows the preset.
The following graphic shows the movement from 0 to 800 tics. The interpolation with acceleration
and deceleration ramps takes place in the controller, which sends the target positions marked by
points cyclically to the motor controller.
800
400
200
0
0 100 200 300
Time [ms]
[Link]
tware_ModuleCtrl
[Link]
ocolDemoClient
Included is a VisualStudio2019 project in CSharp that connects to and drives a motor controller. All
source files are included, these can be used as a starting point for your own development.
To run the code and test your own applications you need the following components:
3 CAN Messages
The Position CMD puts the axis into the positioning mode. This mode is comparable with the CANopen
operating mode IPO or CSP. The specification of the position is done in Encodertics. The motor con-
troller tries to reach the target position as fast as possible, no path with target speed and acceleration
ramps is calculated. If the target position is too far away from the current position, this can lead to
unexpected behavior or a shutdown.
DIn +
errorCode Position Current
Flags
The motor controller sends an error byte in every CANV2 response. This can define various error
states.
7 6 5 4 3 2 1 0
TEMP Over temperature The temperature of the motor controller or the motor is
above the defined value in the parameters.
ESTOP Emergency stop / no voltage The voltage at the motor controller is below the set limit
value. This may indicate a defective fuse or emergency
stop.
MNE Motor not activated The movement of the motor is not enabled, it is not in
control.
COM Communication failure The motor controller requires CAN messages at regular
intervals. If the distance between the messages is too
large or the messages do not arrive, the motor controller
stops the movement.
LAG Following error The motor controller monitors the following error, if this
is greater than the value set in the parameters, the motor
controller stops the movement.
ENC Encoder error The motor controller has detected an encoder error. Er-
rors can be triggered by both the motor or the output en-
coder.
DRV Driver error A driver error can have various causes. One possible
cause is exceeding the maximum speed from the parame-
ters. With the closedloop motor controllers, the error also
occurs with problems with the initial rotor position.
OC Over current The RMS current in the motor controller was above the
allowed value in the parameters.
The byte field for the inputs as well as the referencing flags of the motor controller is differentiated in
the nibble. The low nibble contains the inputs, the high nibble the referencing flags.
7 6 5 4 3 0
0x01 0x06
This message must be sent to the controller 2 times within 20 ms. This command sets the Current to
0. The controller then goes into an error state.
0x01 0x09
Deactivate motor. The power output stage switches off the current to the motor.
No Safe Stop!
, This function does not represent a safe stop. It is possible that the motor con-
tinues to be supplied with voltage.
0x01 0x0A
Request for referencing. The message must be sent to the motor controller several times.
0x01 0x0B
0x01 0x0B
5. Error from motor controller Referencing active. Referencing of the axis is already active.
CAN-ID = BoardID + 2
0 1 2 3 4 5 6 7
For the operation of closed loop motor controllers it is necessary that they know the initial rotor ori-
entation. This can be recalibrated by the following command. This command must also be sent
twice.
0x01 0x0C
0 1 2 3 4 5 6 7
0x01 0x0C
0x01 0xCC
Before parameters can be stored on the motor controller, the EEPROM must be enabled with this
message. The motor controller does not respond to this message.
0 1
0x01 0xCD
0 1 3 4 5 6 7
0 1 3 4 5 6 7
When the motor controllers are started, they send a defined message. This message helps to identify
the motor controller.
CAN-ID = BoardID + 2
0 4 5 6 7
Restart HW-
0x01020304 Version
cause Ident
The following values are implemented for the identification of the board:
DIN-RAIL CL BLDC 0x50 Closed Loop BLDC motor controller for DIN rail mount-
ing with CPR backplane bus
DIN-RAIL CL STEPPER 0x51 Closed Loop stepper motor controller for DIN rail mount-
ing with CPR backplane bus
ON-AXIS CL BLDC 0x52 Closed Loop integrated motor controller for on axis
mounting
DIN-RAIL CL DC 0x53 Closed Loop DC motor controller for DIN rail mounting
with CPR backplane bus
dsPIC33EP128GM Boot loader 0x89 Boot loader for motor controller dsPIC33
dsPIC33EP256GM Boot loader 0x8A Boot loader for motor controller dsPIC33
dsPIC33EP128MC Boot loader 0x8B Boot loader for motor controller dsPIC33
dsPIC33EP256MC Boot loader 0x8C Boot loader for motor controller dsPIC33
The motor controller sends a message once per second with the current voltage, as well as the motor
and board temperature.
CAN-ID = BoardID + 3
0 1 2 3 4 5 6 7
The motor controller sends a message with the detailed status information once per second. For an
evaluation of the individual bytes please use the configuration software ModuleControl.
CAN-ID = BoardID + 2
0 1 2 3 4 5 6 7
The Igus Rebel is equipped with on-axis motor controllers, the axes have an output encoder. If the
output encoder is parameterized, the motor controller sends the output position once per second.
CAN-ID = BoardID + 2
0 1 2 3 4 5 6 7
Deg r ee
Encoder Position Position of the output drive in 100