ANROT Tutorial

ANROT CANopen Integration Notes

Key CANopen defaults, TPDO mappings, and common configuration commands with EDS and DBC downloads.

Updated Jan 1, 2025 Products 5
  • canopen
  • tutorial
  • protocol

CAN communication protocol

Protocol Support

Protocol / frameSupportScope of this tutorial
CANopen NMT / SDO / TPDOSupportedCovers CANopen defaults, TPDO mapping, and common SDO settings.
EDS / CANopen DBCSupportedThe downloads provide EDS and DBC files for integration.
ANROT UART binary (0x91, 0x62, 0x63)Not applicableThis is not a UART example; use the Python, Qt C++, or Ubuntu serial tutorials for those frames.

The CAN interface of this product complies with the following standards:

  • The CAN interface conforms to the CANopen protocol, all communications use standard data frames, only use PTO1-4 to transmit data, all transmissions use standard data frames, and do not receive remote frames and extended data frames
  • All PTOs use asynchronous timing trigger mode.
  • Provide EDS file download: canopen.eds

CANopen Default Settings

CANopen Default ConfigurationValues ​​
CAN Baud Rate500KHz
CANopen Node ID8
Initialization StateOperational
Heartbeat PackNone
TPDO output rate10Hz - 200Hz (per TPDO)

CANopen TPDO

| PTO Channel | PTO Frame ID | Length (DLC) | PTO Transmission Mode | Asynchronous Output Frequency (Hz) | Send Data | Description | | ------- | -------- | ----------- | ---------------- | --- ----------------- | -------- | ----------------------- ------------------------------------- | | TPDO1 | 0x180+ID | 6 | Asynchronous timing (0xFE) | 100 | Acceleration | The data type is (int16, low byte first, 2 bytes per axis, 6 bytes in total), respectively X, Y, Z axis acceleration, the unit is mG (0.001 gravitational acceleration) | | TPDO2 | 0x280+ID | 6 | Asynchronous timing (0xFE) | 100 | Angular velocity | Data type is (int16, low byte first, 2 bytes per axis, 6 bytes in total), respectively X, Y, Z axis angular velocity, the unit is 0.1DPS (°/s) | | TPDO3 | 0x380+ID | 6 | Asynchronous timing (0xFE) | 100 | Euler angle | The data type is (int16, low byte first, 2 bytes per axis, 6 bytes in total), The order is Roll: Roll, Pitch: Pitch, Yaw: Yaw. The unit is 0.01° | | TPDO4 | 0x480+ID | 8 | Asynchronous timing (0xFE) | 100 | Quaternion | $$ q_{w} \ q_{x}\ q_{y}\ q_{z}$$ respectively. The result after the unit quaternion is expanded by a factor of 10,000. For example, when the quaternion is 1,0,0,0, output 10000,0,0,0. | | TPDO5 | 0x680+ID | 4 | Asynchronous timing (0xFE) | 20 | Air pressure | Unit Pa |

Examples of common commands in CANOpen interface

1. Enable data output (open asynchronous trigger)

To send standard CANopen protocol frames, use the NMT: Start Remote Node command:

ID=0x000,DLC=2,DATA=0x01,0x08

Where 0x01 is the Start Remote Node command, 0x08 is the node ID

2. Modify CAN baud rate, output rate and output frame information

The following location of the data dictionary stores the manufacturer’s parameter configuration data, which can be modified by sending fast SDO commands through CANopen, save when power off, and take effect after power on again.

| data dictionary location | suboffset | name | value type | default value | description | | ------------ | ------ | -------- | --------- | ------ | --- ------------ | | 0x2100 | 0 | CAN_BAUD | INTEGER32 | 500000 | CAN bus baud rate | | 0x2101 | 0 | NodeID | INTEGER32 | 8 | Node ID |

The above configuration operations all use fast SDO to write the data dictionary, where the TPDO channel and its corresponding parameter index are:

| PTO channel | PTO frame ID | TPDO parameter index address (default definition of CANopen protocol) | | ------- | -------- | -------------------------------- ----- | | TPDO1 | 0x180+ID | 0x1800 | | TPDO2 | 0x280+ID | 0x1801 | | TPDO3 | 0x380+ID | 0x1802 | | TPDO4 | 0x480+ID | 0x1803 | | TPDO5 | 0x680+ID | 0x1804 |

Example 1: Modify CAN baud rate

Modify the CAN baud rate to 125K, then send:

ID=0x608 ,DLC=8,DATA=23,00,21,00,48,E8,01,00(ID=0x608, standard data frame of length 8)

  • ID=0x608 is the fast write SDO address, of which 8 is the default node ID. After modifying the node ID, make corresponding changes. For example, after CANopenID is changed to 9, ID=0x609.
  • 0x23 write four byte instruction for SDO
  • 0x00, 0x21 is write 0x2100 index
  • 0x00 sub-index position, default 0
  • (4-7)0x00, 0x01, 0xE8, 0x48 = (0x00<<24) + (0x01<<16) + (0xE8<<8) + 0x48 = 125000

Modify the CAN baud rate to 250K, send:

23,00,21,00,90,D0,03,00

Modify the CAN baud rate to 1M and send:

23 00 21 00 40 42 0F 00

Example 2: Modify Node ID

If the device CANopen node ID is changed to 9, send:

ID=0x608 ,DLC=8,DATA=23,01,21,00,09,00,00,00

  • 0x23 write four byte instruction for SDO
  • 0x01, 0x21 is write 0x2101 index
  • 0x09 0x00, 0x00, 0x00 = (0x00<<24) + (0x00<<16) + (0x00<<8) + 0x09 = 9

Notice:

  1. ID modification range: 1-64

  2. After modifying the node ID, it will take effect after powering on again, and after sending the start node command (for example, the node start command data becomes 01 09) and the SDO command (the sending CAN frame ID becomes 0x609), pay attention to the new address

Example 3: Modify/Enable/Disable Data Output Rate

Send standard CANopen protocol frames and use standard fast SDO commands: (This configuration takes effect immediately)

Modify the output rate of TPDO3 (Eulerian angle) to 20Hz (output every 50ms):

ID=0x608 ,DLC=8,DATA=2B,02,18,05,32,00,00,00

in

  • 0x2B write two byte instruction for SDO
  • 0x02, 0x18 is to write 0x1802 index,
  • 0x05 is the sub-index
  • 0x00, 0x32= (0x00<<8) + 0x32 = 50 (unit is ms), add 0 if it is missing.

Modify the TPDO1 (acceleration) output rate to 10Hz (output every 100ms):

2B 00 18 05 64 00 00 00

Modify the TPDO2 (angular velocity) output rate to 5Hz (output every 200ms):

2B 01 18 05 C8 00 00 00

The TPDO output can also be turned off by modifying the output rate (output every 0ms means turning off):

Set the timing output of TPDO2 (angular velocity) to 0

2B,01,18,05,00,00,00,00

Set TPDO1 (acceleration) output rate to 0

2B 00 18 05 00 00 00 00

Set TPDO3 (Eulerian angles) output rate to 0

2B 02 18 05 00 00 00 00

Set TPDO4 (quaternion) output rate to 0

2B 03 18 05 00 00 00 00

Example 4: Turn on/off site

Nodes can be turned on and off using the NMT commands StartRemoteNode and StopRemoteNode:

  • Open node: ID:0,DLC:2,DATA:01 08 where 01 is the command to open the node, 08 is the node ID (factory default is 8)
  • Shutdown node: ID:0,DLC:2,DATA:02 08 where 02 is the shutdown node command, 08 is the node ID (factory default is 8)
Example 5: Configure TPDO in synchronous mode

First close all TPDOs (set the TPDO output rate to 0) as in Example 4, and then send CANopen synchronization frames:

CANopen sync frame: ID:80 DLC:0, DATA:null

3. Precautions

  • All configuration changes will take effect after power on again