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 |
0x31D |
Fault Trigger NP Cap Voltages |
NP cap voltage readings that triggered latched overvoltage faults. Only sent when one of those faults is latched. |
0x31E |
Fault Trigger Current/Temp |
Current and temperature readings that triggered latched current/overtemp faults. Only sent when a relevant fault is latched. |
0x31F |
Fault Trigger HV Undervoltage |
HV bus voltage reading that triggered the HV undervoltage fault. Only sent when that fault is latched. |
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. See State Machine for details |
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 |
DC_PH_FLT |
The controller thinks a motor phase is not properly connected to the motor controller. The relevant thresholds can be modified in the EEPROM Configuration |
N/A |
N/A |
HV_UV_FLT |
Undervoltage on the HV bus. The threshold can be altered in the EEPROM Configuration |
N/A |
N/A |
RESERVED |
Reserved |
N/A |
f32 |
MESSAGE HEARTBEAT TIMESTAMP |
Milliseconds since last heartbeat. Saturates at 65535ms. |
1 |
u16 |
Note
When a fault occurs, the corresponding bit will latch high. The bit will not clear until a Clear Faults command is issued via the 0x019 (Command Packet).
Additionally, while a fault bit is latched high, the motor controller will transmit packets indicating the worst-case value seen while the fault was latched (see 0x31D (Fault Trigger NP Cap Voltages), 0x31E (Fault Trigger Current/Temp), 0x31F (Fault Trigger HV Undervoltage)).
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 |
A RETURN CODE =
|
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_HIGH |
Percentage of switching cycle for which phase A is in the high switching state (connected to HV+) |
255 |
u8 |
PHASE_A_MID |
Percentage of switching cycle for which phase A is in the mid switching state (connected to inverter’s neutral point) |
255 |
u8 |
PHASE_B_HIGH |
Percentage of switching cycle for which phase B is in the high switching state (connected to HV+) |
255 |
u8 |
PHASE_B_MID |
Percentage of switching cycle for which phase B is in the mid switching state (connected to inverter’s neutral point) |
255 |
u8 |
PHASE_C_HIGH |
Percentage of switching cycle for which phase C is in the high switching state (connected to HV+) |
255 |
u8 |
PHASE_C_MID |
Percentage of switching cycle for which phase C is in the mid switching state (connected to inverter’s neutral point) |
255 |
u8 |
As all of the percentages must add up to 100%, the values for PHASE_A_LOW, PHASE_B_LOW, and PHASE_C_LOW can be calculated.
For example, using pre-scaling values, PHASE_A_LOW = 255 - PHASE_A_HIGH - PHASE_A_MID
0x022 (DQ PID Integral + DC Current estimate)🔗
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 (in Volts) |
10 |
i16 |
Q_INTEGRAL |
The accumulated integral term for the Q side of the PID loop (in Volts) |
10 |
i16 |
DC_BUS_CURRENT |
Estimated DC link current draw in Amperes |
1000 |
i24 |
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 |
0x31D (Fault Trigger NP Cap Voltages)🔗
Only transmitted when at least one NP cap overvoltage fault (HVN_NP_OV or NP_HVP_OV in 0x016 (State ID)) is latched. Fields for faults that have not triggered are reported as 0.
Data Word |
Description |
Scaling (Divide by X to get real value) |
Datatype |
|---|---|---|---|
GND_TO_NP_TRIGGER_V |
Highest voltage across the capacitor from GND to neutral point that triggered the HVN_NP_OV fault, in Volts. Corresponds to |
1,000,000 |
i32 |
NP_TO_DCBUS_TRIGGER_V |
Highest voltage across the capacitor from neutral point to HV+ that triggered the NP_HVP_OV fault, in Volts. Corresponds to |
1,000,000 |
i32 |
0x31E (Fault Trigger Current/Temp)🔗
Only transmitted when at either of the OVC or OVT faults are latched in 0x016 (State ID). Fields for faults that have not triggered are reported as 0.
Data Word |
Description |
Scaling (Divide by X to get real value) |
Datatype |
|---|---|---|---|
OVERTEMP_TRIGGER_C |
Highest transistor temperature that triggered the OVT fault, in Celsius. |
100 |
i16 |
OVERCURRENT_TRIGGER_A |
Highest magnitude phase current that triggered the OVC fault, in Amperes. |
1,000,000 |
i32 |
0x31F (Fault Trigger HV Undervoltage)🔗
Only transmitted when the HV undervoltage fault (HV_UV_FLT in 0x016 (State ID)) is latched.
Data Word |
Description |
Scaling (Divide by X to get real value) |
Datatype |
|---|---|---|---|
HV_UV_TRIGGER_V |
Lowest HV bus voltage that triggered the HV_UV_FLT fault, in Volts. Corresponds to |
1,000,000 |
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 |