12
Can proToCol desCrIpTIon
This section describes the CAN communication particulars for those wishing to create their own
interface with the motor controller over CAN bus. Default CAN bus speed is 250kbps and uses
format 2.0B. The motor controller is intended to always be on the end of a CAN bus, so has a 120Ω
termination resistor built-in. (Please contact us if you require a controller with different bus settings
or data formats.)
There are four different CAN frames used by the motor controller:
frame Id
description
direction
50
Status / operating information
Tx
51
Set Throttle
Rx
52
Receive (or request) settings
Rx
53
Transmit settings
Tx
The Status frame is transmitted by the motor controller at 10Hz, and contains 8 unsigned bytes:
byte
description
1
Low four bits are controller type (1 = MC600C, 2 = MC1000C, 3-15 reserved)
High four bits contain code for any errors (see below)
2
Battery voltage, in volts
3
Battery current, x5 amps
4
Motor voltage, in volts
5
Motor current, x5 amps
6
Internal temperature in ˚C
7
Throttle level, 0-100%
8
Actual output to power stage (0-255)
The following error codes may be reported in the top four bits of status frame byte 1:
0
No error / all OK
6
Overvoltage on HV (>175V)
1
Controller sleeping
7
Low logic supply voltage (<8V)
2
Power stage “desaturation”
8
Throttle error / mismatch
3
Faulty current sensor
9
Thermal cutback (>70˚C)
4
Faulty temperature sensor
10
Thermal shutdown (~90˚C)
5
Undervoltage on HV (<8V)
To set the controller’s throttle level via CAN bus, simply send a single unsigned byte on frame ID
51, with a range of 0 (zero throttle) to 255 (full throttle). When in use, the CAN throttle overrides
any throttle connected to the controller’s 4-pin plug. However for safety the CAN throttle has a
250 millisecond timeout – that is, if the controller does not receive a updated throttle information
within 250ms of the previous CAN throttle frame, it will revert to the primary throttle input. For
smoothness and reliability, we recommend sending CAN throttle updates at around 10Hz.
To ask the controller to transmit its current settings, send a zero-byte data frame on ID 52
(Receive settings). The controller will return 8 unsigned bytes on frame ID 53 (Transmit Settings),
as described in the table below:
byte
description
valid range
1
Minimum battery voltage (V)
8-150
2
Maximum motor voltage (V)
1-180
3
Maximum motor current (x10A)
0-100
4
Maximum battery current (x10A)
0-100
5
Throttle algorithm
0-4, 0-4, 0-4
6
Throttle type
1-3
7
Idle voltage (V)
0-12
8
Idle current (x10A)
0-20
The same 8-byte data format is used for sending new settings to the motor controller, using frame
ID 52 (Receive settings). Note that if any of the parameters are outside the valid ranges above,
the entire settings update will be rejected.