CANBUS Digital Control
The Digital Control feature allows various aspects of the motor controller to be controlled via CANBUS. These include:
- Virtual activation of 'buttons' like REVERSE, IN/OUT, or QUICKSTOP
- Virtual control of Throttle
- Virtual control of the Max Speed Pot
Once configured, the external controller simply sends periodic Digital Control Messages to the motor controller. It is recommended that the messages be sent periodically rather than only upon change, to allow for the possibility of a lost or missed message due to CANBUS noise, etc. A period of 50ms is often used and provides adequate responsiveness for most applications.
Configuring Digital Control Mode
Note that depending on model, the controller may be shipped pre-configured for digital control. This section provides details for users who need to adjust or enable digital control.
Set CAN Control Options
CANBUS Digital Control Options will be set to the desired options. For example, if it is desired that motion is inhibited unless Digital Control messages are being received, set the quickstop and/or zero throttle bits of this item. As a result, unless valid Digital Control messages are being received, the motor will not move an the Reason for Stop indication will include 'Digital Stop Active'
Set Motor Control Options
Configuration Register 0x0357 determines whether Digital Throttle is enabled, and/or Analog Throttle is enabled. Possible values for bits 2:0:
000: Allow Analog Throttle Only
001: Use Analog Throttle, but control buttons (like forward/reverse) using digital CAN messages
101: Use both Analog Throttle and Digital Buttons and Digital Throttle. Depending on the CAN control Options, Digital Throttle may be set to override Analog Throttle. Or, Digital Throttle may be configured to act as a Max Speed Pot (gain value) for the Analog Throttle.
111: Use Digital Throttle and control buttons
Configuration Register 0x031F: If the Digital Pot is to be used as a Max Speed Pot, set bit 6.
Motor Control Commands
Digital Throttle
The Digital throttle is also referred to as the Digital Pot. The Digital Pot command must be sent out every 50msec. When the commands stop the Digital throttle automatically goes to 0. There are several options to stop the motor when commands cease to be sent. See Digital Control Options for information on how to enable or disable throttle shut off and/or quick stop after throttle commands cease to be sent. This function (0x50), is a write only command and no response is returned.
B0 | [ B1 ] | [ B2 ] | [ B3 ] |
---|---|---|---|
0x50 | Digital Pot | Digital Buttons | Digital Mode |
[ ] means optional data. However all data previous to the last value sent must be populated. All missing data fields after the last byte sent are ignored.
NOTE: For dual motor controllers this command only affects the motor associated with the ID used.
Digital Pot
Throttle Value 0-255. This is the same value as Digital Throttle. See Digital Throttle.
The Throttle Value is an 8-bit number that equals the desired throttle setting. 0 is off and 1 or greater can start the motor moving. However, the motor may not shut off if used in conjunction with manual/virtual throttle unless they are set to deadband.
Digital Buttons
NOTE: All bits are set to 1 by default. All features are active low.
Bit Mask | Command | Description |
---|---|---|
0x01 | Reserved | Set to 1 |
0x02 | Reserved | Set to 1 |
0x04 | Reserved | Set to 1 |
0x08 | Reserved | Set to 1 |
0x10 | Quick Stop | Motor stops when set to zero. The stop diagnostic byte in status FF03 will either indicate "Digital STOP" (0x03) or "Waiting for deadband" (0x0C). In either case the throttle(s) must be set to deadband or 0 to restart the motor. See Stop Diagnostics for more information on stop values. |
0x20 | Reverse | Set to 0 to reverse the motor if controller is in manual or mixed throttle mode. Use bits 0 and 1 if in full digital throttle mode. |
0x40 | Indoor/Outdoor | Set to 0 for indoor mode. Set to 1 for outdoor mode. |
0x80 | Brake Release | Set to 0 to release brake. |
Digital Mode
NOTE: All bits are set to 1 by default. All features are active low.
Bit Mask | Command | Description |
---|---|---|
0x01 | Seat Switch | Clear this bit to make seat active. If throttling up of any kind is attempted the stop diagnostic byte in status FF03 will indicate "Waiting for deadband" (0x0C) The throttle(s) should be set to deadband or 0 to until this bit is set. |
0x02 | Horn | Set to 0 to sound horn |
0x04 | Reserved | Set to 1 |
0x08 | Reserved | Set to 1 |
0x10 | Echo 0x50 Commands | Set to 0 to make all digital throttle (0x50) commands be echoed back to the host |
0x20 | Reserved | Set to 1 |
0x40 | Reserved | Set to 1 |
0x80 | Reserved | Set to 1 |
Examples
Set Digital throttle to 25% PWM:
Command: 10EF8090 50 40 0x40 = 64 = 25% PWM
Set Digital throttle to zero and set buttons to run forward
Command: 10EF8090 50 00 FF 0x00 = 0 = 0% PWM
Set Digital throttle to 50% and set buttons to run reverse and mode to FF
Command: 10EF8090 50 80 DF FF 0x80 = 128 = 50% PWM
Refresh CAN Timeout without changing any settings
Command: 10EF8090 50
Special Diagnostic Commands
Special diagnostic information on motor faults can be found by reading special RAM registers.
Register | Function | Description |
---|---|---|
0106 | DiagosticWarnings | 0x00 No Warnings 0x81 EEPROM Revision Error 0x82 Calibration Error |
0107 | FET Test | Test for motor opens and shorts 0x00 No faults 0x18 - 0x1F Faults during "No FET" test 0x38 - 0x3F Faults during "One FET" test 0x48 - 0x4B Faults during "FET Pairs" test 0x4C - 0x4F Open Motor Faults |