CAN Bus Digital Control

The Digital Control feature allows various aspects of the motor controller to be controlled via CAN Bus. These include:

  • Virtual activation of 'buttons' like REVERSE, IN/OUT, or QUICKSTOP
  • Virtual control of Throttle
  • Virtual control of the Max Speed potentiometer

Once configured, the external control module 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 CAN Bus 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 Bus Control Options

The CAN Bus Digital Control Options must 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 Bus messages

101: Use both Analog Throttle and Digital Buttons and Digital Throttle (Mixed Throttle). Depending on the CAN Bus control Options, Digital Throttle may be set to override Analog Throttle. Or, Digital Throttle may be configured to act as a Max Speed potentiometer (gain value) for the Analog Throttle.

111: Use Digital Throttle and control buttons

Configuration Register 0x031F: If the Digital Throttle is to be used as a Max Speed potentiometer (Mixed Throttle), set bit 6.

Digital Motor Control Commands

It is possible to control the motor speed and direction over CAN Bus. By default this feature is disabled. See Digital Control Options for more information. Once the feature is enabled the motor can be run with 'as needed' commands or it can be made to stop when repeated Digital Throttle commands cease to be sent. If stopping is desired, the commands must be sent at least every 450 milliseconds by default or faster. The timeout can be changed, see Timer Configuration. When the commands stop, the Digital Throttle can be made to go to 0 or a quickstop can be implemented. 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.

Warning

Do not send CAN bus commands faster than every 20 milliseconds.

Digital Throttle

The Digital throttle is also referred to as the Digital Potentiometer. This value of 0-255 will determine the PWM of the motor from 0-100% of the max speed setting. This function (0x50), is a write only command and no response is returned unless the echo option is enabled in the Digital Control Options.

B0 [ B1 ] [ B2 ] [ B3 ]
0x50 Digital Throttle Digital Buttons Digital Mode

[B#] means optional data. However, all data previous to the last value sent must be populated with meaningful data. All missing data fields after the last byte sent are ignored. Any data after the B3 byte is echoed back if echoing is enabled.

Note

For dual motor controllers this command only affects the motor associated with the ID used.

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 external EM 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 (User is sitting on seat). If throttling up of any kind is attempted the stop diagnostics 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 Bus Timeout without changing any settings

Command:    10EF8090 50