CAN protocol¶
CAN 2.0, 1 Mbit/s, 11-bit identifiers. The identifier carries the node ID (bits 10 to 7, 0 to 15), the command ID (bits 6 to 1, 0 to 63) and, in frames from the driver, the error bit (bit 0). Over CAN explains how the pieces are used; this page lists them.
Three kinds of message:
- Send_… — the host sends data to the driver. A few are answered (the motion commands with Respond_data_pack_1, the gripper command with Respond_Gripper_data_pack); most are not.
- Send_Respond_… — the host asks for data with a remote frame (RTR bit set, no data) under the command ID; the driver answers with a data frame under the same command ID.
- Respond_… — frames only the driver sends.
Multi-byte values are big-endian (data[0] first); floats are IEEE 754 single precision; bits inside a byte are numbered from the most significant bit (bit 7 first).
Every message¶
| ID | Message | Direction | Length | Group |
|---|---|---|---|---|
| 0 | Send_ESTOP | host → driver | 0 | System |
| 1 | Send_Clear_Error | host → driver | 0 | System |
| 2 | Send_data_pack_1 | host → driver | 2, 5, 8 | Motion |
| 3 | Respond_data_pack_1 | driver → host | 8 | Motion |
| 4 | Send_data_pack_PD | host → driver | 8 | Motion |
| 5 | Respond_data_pack_2 | driver → host | 0 | Motion |
| 6 | Send_data_pack_2 | host → driver | not implemented | Motion |
| 7 | Respond_data_pack_3 | driver → host | 0 | Motion |
| 8 | Send_data_pack_3 | host → driver | not implemented | Motion |
| 9 | Respond_Heartbeat | driver → host | 0 | Status requests |
| 10 | Send_Respond_Ping | host → driver as a remote frame, driver → host as a data frame | 0 (remote) / 0 | Status requests |
| 11 | Send_CAN_ID | host → driver | 1 | System |
| 12 | Send_Idle | host → driver | 0 | System |
| 13 | Send_Save_config | host → driver | 0 | System |
| 14 | Send_Reset | host → driver | 0 | System |
| 15 | Send_Watchdog | host → driver | 5 | System |
| 16 | Send_PD_Gains | host → driver | 8 | Gains and limits |
| 17 | Send_Current_Gains | host → driver | 8 | Gains and limits |
| 18 | Send_Velocity_Gains | host → driver | 8 | Gains and limits |
| 19 | Send_Position_Gains | host → driver | 4 | Gains and limits |
| 20 | Send_Limits | host → driver | 8 | Gains and limits |
| 21 | Send_Iq | host → driver | not implemented | Motion |
| 22 | Send_Kt | host → driver | 4 | Gains and limits |
| 23 | Send_Respond_Temperature | host → driver as a remote frame, driver → host as a data frame | 0 (remote) / 2 | Status requests |
| 24 | Send_Respond_Voltage | host → driver as a remote frame, driver → host as a data frame | 0 (remote) / 2 | Status requests |
| 25 | Send_Respond_Device_Info | host → driver as a remote frame, driver → host as a data frame | 0 (remote) / 7 | Status requests |
| 26 | Send_Respond_State_of_Errors | host → driver as a remote frame, driver → host as a data frame | 0 (remote) / 2 | Status requests |
| 27 | Send_Respond_Iq_data | host → driver as a remote frame, driver → host as a data frame | 0 (remote) / 2 | Status requests |
| 28 | Send_Respond_Encoder_data | host → driver as a remote frame, driver → host as a data frame | 0 (remote) / 8 | Status requests |
| 29 | Send_Cyclic_command | host → driver | not implemented | System |
| 30 | Send_Heartbeat_Setup | host → driver | 4 | System |
| 31 | Send_data_pack_HALL | host → driver | 4 | Motion |
| 32 | Respond_data_hall | driver → host | 4 | Motion |
| 33 | Send_Respond_Kt | host → driver as a remote frame, driver → host as a data frame | 0 (remote) / 4 | Status requests |
| 34 | Send_Voltage_Limit | host → driver | 4 | Gains and limits |
| 35 | Send_Settings | host → driver | 0 | System |
| 60 | Respond_Gripper_data_pack | driver → host | 4 | Gripper |
| 61 | Send_gripper_data_pack | host → driver | 0, 5 | Gripper |
| 62 | Send_gripper_calibrate | host → driver | 0 | Gripper |
By group¶
- Motion: the motion commands and their answers, HALL homing
- Gains and limits: the loop gains, the limits, Kt
- Status requests: temperature, voltage, identity, errors, current, encoder, Kt, the heartbeat
- System: node ID, E-stop, idle, save, reset, clear, watchdog, heartbeat setup, settings
- Gripper: the gripper command, calibration and the gripper state
The Python library¶
Every message the host can send has a method of the same name in Spectral_BLDC.SpectralCAN, listed in
Python library.
Tools and downloads¶
Build or decode a CAN frame, and download this firmware's JSON and DBC definitions.
Comments
Found a mistake on this page? Edit it on GitHub · Report it · Get help · This page as Markdown · llms.txt · The whole manual as PDF