CAN Protocol🔗
This page describes the CAN protocol the user can use to interact with the motor controller. This includes TX and RX. The Steinmetz motor controller uses Standard CAN IDs. In future versions, the ability to customize the communication protocol will be possible.
Note
By default all words are packed as little-endian.
TX (Emitted from Motor Controller)🔗
Summary🔗
CAN ID |
CAN Message Name |
Brief Description |
|---|---|---|
0x012 |
Resolver |
Raw data from resolver to digital converter. |
0x016 |
State ID |
The state of the state machine see: State Machine |
0x01c |
EEPROM Set Response |
Response/ACK when writing to EEPROM. |
0x01d |
EEPROM Get Response |
Response/ACK when reading from EEPROM. |
0x020 |
DQ Currents |
Computed DQ current data. |
0x021 |
PWM Duty Cycles |
Phase A, B and C switching duty cycles. |
0x022 |
DQ PID Integral |
Computed integral term for DQ PID loop. |
0x025 |
Electrical Angle |
Processed information on Electrical Angle |
0x029 |
Switching Misc Data |
Extra telemetry data from switching. |
0x306 |
GPIO State |
External GPIO Data |
0x310-0x31B |
Temperature Data |
Individual Thermistor Data |
0x320-0x324 |
Current and Voltage Sensor Readings |
Phase Current and Voltage Sense Readings |
0x012 (Resolver)🔗
Data Word |
Description |
Scaling (Divide by X to get real value) |
Datatype |
|---|---|---|---|
POSITION |
Resolver Position in Degrees |
100 |
u16 |
VELOCITY |
Resolver Rotational Velocity in Degrees per second |
100 |
i32 |
FAULT |
The Fault bits in the resolver to digital converter. The resolver used is the AD2S1210, see AD2S1210 datasheet, for detailed description of the fault register. |
N/A |
u8 |
0x016 (State ID)🔗
Data Word |
Description |
Scaling (Divide by X to get real value) |
Datatype |
|---|---|---|---|
STATE |
State ID |
N/A |
u8 |
FAULT BITS |
Bitfield describing fault state |
N/A |
u8 |
OVC |
Phase current magnitude exceeded configured overcurrent threshold |
N/A |
N/A |
ISNS_LOC |
Internal communication issue to current sense ADC |
N/A |
N/A |
OVT |
Transistor temperature exceeded configured overtemperature threshold |
N/A |
N/A |
TSNS_LOC |
Internal communication issue to temperature sense ADC |
N/A |
N/A |
HVN_NP_OV |
Voltage across capacitor from HV- to neutral point exceeded configured threshold, indicates risk of FET damage |
N/A |
N/A |
NP_HVP_OV |
Voltage across capacitor from neutral point to HV+ exceeded configured threshold, indicates risk of FET damage |
N/A |
N/A |
RDC_FLT |
The resolver has a fault, specific details in 0x012 (Resolver) |
N/A |
N/A |
HVIL_FLT |
One or more HV connectors are not properly seated. This check can be enabled/disabled in the EEPROM Configuration |
N/A |
N/A |
FAULT DATA |
Extra debugging data for fault |
N/A |
f32 |
MESSAGE HEARTBEAT TIMESTAMP |
Milliseconds since last heartbeat. Saturates at 65535ms. |
1 |
u16 |
0x01c (EEPROM Set Response)🔗
Data Word |
Description |
Scaling (Divide by X to get real value) |
Datatype |
|---|---|---|---|
FIELD |
Returns the field that was attempted to be written to. If the request was reset to default this field will be 0xFF. |
N/A |
u8 |
RETURN CODE |
If RETURN CODE = 0x00 then successfully written, else it failed. Typical failure code is 0xFF |
N/A |
u8 |
0x01d (EEPROM Get Response)🔗
Data Word |
Description |
Scaling (Divide by X to get real value) |
Datatype |
|---|---|---|---|
FIELD |
Returns the ID of the field that was requested |
N/A |
u8 |
DATA |
Returns the data from the field. |
N/A |
field-dependent (f32 default) |
0x020 (DQ Currents)🔗
Data Word |
Description |
Scaling (Divide by X to get real value) |
Datatype |
|---|---|---|---|
ID |
Current in the D axis in amperes (signed) |
1000 |
i24 |
IQ |
Current in the Q axis in amperes (signed) |
1000 |
i24 |
TORQUE |
Estimated Torque being delivered based on Torque Constant and Q current. (Newton-Metres). (Currently this saturates, will be improved in next firmware revision, use IQ for a better torque estimation) |
1000 |
i24 |
0x021 (PWM Duty Cycles)🔗
Data Word |
Description |
Scaling (Divide by X to get real value) |
Datatype |
|---|---|---|---|
PHASE_A |
Duty cycle of Phase A. Duty cycle is the percentage of time that the high FET is on in every switching cycle. |
100 |
i16 |
PHASE_B |
Duty cycle of Phase B. Duty cycle is the percentage of time that the high FET is on in every switching cycle. |
100 |
i16 |
PHASE_C |
Duty cycle of Phase C. Duty cycle is the percentage of time that the high FET is on in every switching cycle. |
100 |
i16 |
0x022 (DQ PID Integral)🔗
Data Word |
Description |
Scaling (Divide by X to get real value) |
Datatype |
|---|---|---|---|
D_INTEGRAL |
The accumulated integral term for the D side of the PID loop |
1 |
f32 |
Q_INTEGRAL |
The accumulated integral term for the Q side of the PID loop |
1 |
f32 |
0x025 (Electrical Angle)🔗
Data Word |
Description |
Scaling (Divide by X to get real value) |
Datatype |
|---|---|---|---|
ELECTRICAL_ANGLE |
The electrical angle of the motor. Used in the DQZ transforms. Stored as degrees. |
100 |
i32 |
ELECTRICAL_VELOCITY |
The electrical velocity of the motor. Used in the DQZ transforms. Stored in degrees per seconds. |
100 |
i32 |
0x029 (Switching Misc Data)🔗
Data Word |
Description |
Scaling (Divide by X to get real value) |
Datatype |
|---|---|---|---|
RESERVED_DEBUG_DATA_A |
|||
RESERVED_DEBUG_DATA_B |
0x306 (GPIO State)🔗
Data Word |
Description |
Scaling (Divide by X to get real value) |
Datatype |
|---|---|---|---|
GPIO_DATA |
To be implemented |
N/A |
N/A |
0x310-0x31B (Temperature Data)🔗
Indexed as (0x310 + n) where n is the nth group of temperature readings.
Data Word |
Description |
Scaling (Divide by X to get real value) |
Datatype |
|---|---|---|---|
TEMPERATURE_1 |
Temperature reading from 1 thermistor in Celsius |
100 |
i16 |
TEMPERATURE_2 |
Temperature reading from 1 thermistor in Celsius |
100 |
i16 |
TEMPERATURE_3 |
Temperature reading from 1 thermistor in Celsius |
100 |
i16 |
TEMPERATURE_4 |
Temperature reading from 1 thermistor in Celsius |
100 |
i16 |
0x31C (External RTD interface)🔗
Indexed as (0x310 + n) where n is the nth group of temperature readings.
Data Word |
Description |
Scaling (Divide by X to get real value) |
Datatype |
|---|---|---|---|
EXT_RTD_VAL |
Temperature reading from external PT1000 RTD in Celsius. Can alternately report resistance – configurable in EEPROM Configuration. |
100 |
i32 |
0x320 (Current Sense Phase C)🔗
Data Word |
Description |
Scaling (Divide by X to get real value) |
Datatype |
|---|---|---|---|
I_COARSE_C |
Coarse current readings from Phase C in Amperes. |
1,000,000 |
i32 |
I_FINE_C |
Fine current readings from Phase C in Amperes. |
1,000,000 |
i32 |
0x321 (Current Sense Phase B)🔗
Data Word |
Description |
Scaling (Divide by X to get real value) |
Datatype |
|---|---|---|---|
I_COARSE_B |
Coarse current readings from Phase B in Amperes. |
1,000,000 |
i32 |
I_FINE_B |
Fine current readings from Phase B in Amperes. |
1,000,000 |
i32 |
0x322 (Current Sense Phase A)🔗
Data Word |
Description |
Scaling (Divide by X to get real value) |
Datatype |
|---|---|---|---|
I_COARSE_A |
Coarse current readings from Phase A in Amperes. |
1,000,000 |
i32 |
I_FINE_A |
Fine current readings from Phase A in Amperes. |
1,000,000 |
i32 |
0x323 (Voltage Sense)🔗
Data Word |
Description |
Scaling (Divide by X to get real value) |
Datatype |
|---|---|---|---|
V_NEUTRAL_POINT |
Voltage from V- to Neutral Point in Volts. |
1,000,000 |
i32 |
V_BUS |
Voltage from V- to V+ in Volts. |
1,000,000 |
i32 |
0x324 (Current Sense ADC Debug)🔗
Data Word |
Description |
Scaling (Divide by X to get real value) |
Datatype |
|---|---|---|---|
RESERVED |
N/A |
RX (Received by Motor Controller)🔗
Summary🔗
CAN ID |
CAN Message Name |
Brief Description |
|---|---|---|
0x019 |
Command Packet |
Command packet. Used to traverse state machine and command torque/speed. |
0x01a |
EEPROM Set Parameter |
Write parameter to EEPROM. |
0x01b |
EEPROM Get Parameter |
Read parameter to EEPROM. |
0x019 (Command Packet)🔗
Data Word |
Description |
Scaling (Divide by X to get real value) |
Datatype |
|---|---|---|---|
COMMAND |
Command sent from user. See Command Table below. |
N/A |
u8 |
DATA |
The data supplement used with the command packet. i.e in torque control the desired torque. |
0.1 Nm (torque control) or 1 degree per second (velocity control) |
i32 |
Command ID |
Command Description |
Data Description |
Data Scaling (Divide by X to get real value) |
|---|---|---|---|
0x00 |
DISABLE. This tells the motor controller to enter a disable state. This should take the motor controller into the ReadyToSwitch state. |
DATA unused, leave as 0x00 |
N/A |
0x01 |
Enable (Torque Control). This instructs the motor controller to go into torque control mode. It will transition to ActivelySwitching and attempt to drive a desired torque. |
DATA is desired torque in Newton-Metres |
1 |
0x02 |
Enable (Velocity Control). This instructs the motor controller to go into velocity control mode. It will transition to ActivelySwitching and attempt to drive a desired velocity. |
DATA is desired velocity in degrees per second. |
1 |
0xFF |
Clear Faults. Attempt to clear non-latching faults of motor controller. See State Machine |
DATA unused, leave as 0x00 |
N/A |
0x01a (EEPROM Set Parameter)🔗
Data Word |
Description |
Scaling (Divide by X to get real value) |
Datatype |
|---|---|---|---|
FIELD |
ID of the desired parameter to modify |
N/A |
u8 |
DATA |
Data to be written to EEPROM parameter. |
N/A |
field-dependent, default f32 |
RESERVED |
Reserved data, leave as 0x00. |
N/A |
N/A |
0x01b (EEPROM Get Parameter)🔗
Data Word |
Description |
Scaling (Divide by X to get real value) |
Datatype |
|---|---|---|---|
FIELD |
ID of the desired parameter to read |
N/A |
u8 |
RESERVED |
Reserved data, leave as 0x00. |
N/A |
N/A |