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🔗

TX CAN Messages🔗

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)🔗

07POSITION815POSITION1623VELOCITY2431VELOCITY3239VELOCITY4047VELOCITY4855FAULT
Resolver Packet🔗

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)🔗

07STATE89101112131415OVCISNS_LOCOVTTSNS_LOCHVN_NP_OVNP_HVP_OVRDC_FLTHVIL_FLT1623FAULT DATA2431FAULT DATA3239FAULT DATA4047FAULT DATA4855MESSAGE HEARTBEAT TIMESTAMP5663MESSAGE HEARTBEAT TIMESTAMP
State ID Packet🔗

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)🔗

07RESPONSE815RETURN CODE
EEPROM Set Response Packet🔗

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)🔗

07FIELD815DATA1623DATA2431DATA3239DATA
EEPROM Get Response Packet🔗

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)🔗

07ID815ID1623ID2431IQ3239IQ4047IQ4855TORQUE5663TORQUE
DQ Currents Packet🔗

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)🔗

07PHASE_A815PHASE_A1623PHASE_B2431PHASE_B3239PHASE_C4047PHASE_C
PWM Duty Cycles Packet🔗

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)🔗

07D_INTEGRAL815D_INTEGRAL1623D_INTEGRAL2431D_INTEGRAL3239Q_INTEGRAL4047Q_INTEGRAL4855Q_INTEGRAL5663Q_INTEGRAL
DQ PID Integral Packet🔗

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)🔗

07ELECTRICAL_ANGLE815ELECTRICAL_ANGLE1623ELECTRICAL_ANGLE2431ELECTRICAL_ANGLE3239ELECTRICAL_VELOCITY4047ELECTRICAL_VELOCITY4855ELECTRICAL_VELOCITY5663ELECTRICAL_VELOCITY
Electrical Angle Packet🔗

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)🔗

07RESERVED_DEBUG_DATA_A815RESERVED_DEBUG_DATA_A1623RESERVED_DEBUG_DATA_A2431RESERVED_DEBUG_DATA_A3239RESERVED_DEBUG_DATA_B4047RESERVED_DEBUG_DATA_B4855RESERVED_DEBUG_DATA_B5663RESERVED_DEBUG_DATA_B
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)🔗

07GPIO_DATA
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.

07TEMPERATURE_1815TEMPERATURE_11623TEMPERATURE_22431TEMPERATURE_23239TEMPERATURE_34047TEMPERATURE_34855TEMPERATURE_45663TEMPERATURE_4
Temperature Data🔗

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.

07EXT_RTD_VAL815EXT_RTD_VAL1623EXT_RTD_VAL2431EXT_RTD_VAL
Temperature Data🔗

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)🔗

07I_COARSE_C815I_COARSE_C1623I_COARSE_C2431I_COARSE_C3239I_FINE_C4047I_FINE_C4855I_FINE_C5663I_FINE_C
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)🔗

07I_COARSE_B815I_COARSE_B1623I_COARSE_B2431I_COARSE_B3239I_FINE_B4047I_FINE_B4855I_FINE_B5663I_FINE_B
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)🔗

07I_COARSE_A815I_COARSE_A1623I_COARSE_A2431I_COARSE_A3239I_FINE_A4047I_FINE_A4855I_FINE_A5663I_FINE_A
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)🔗

07V_NEUTRAL_POINT815V_NEUTRAL_POINT1623V_NEUTRAL_POINT2431V_NEUTRAL_POINT3239V_BUS4047V_BUS4855V_BUS5663V_BUS
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)🔗

07RESERVED815RESERVED
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🔗

RX CAN Messages🔗

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)🔗

07COMMAND815DATA1623DATA2431DATA3239DATA
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 Table🔗

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)🔗

07FIELD815DATA1623DATA2431DATA3239DATA4047RESERVED4855RESERVED5663RESERVED
EEPROM Set Parameter Packet🔗

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)🔗

07FIELD815RESERVED1623RESERVED2431RESERVED3239RESERVED4047RESERVED4855RESERVED5663RESERVED
EEPROM Set Parameter Packet🔗

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