Skip to content

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 Configuration item #9 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 0x57 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 0x1F: If the Digital Pot is to be used as a Max Speed Pot, set bit 6.

Motor Control Commands

0x16 Digital Control

Use the Digital Control command to control motor speed, direction or to implement a quick stop as well as other remote control features. This is similar to the 0x50 digital throttle command except that the Digital Pot and Digital Buttons value positions are swapped. Since the parameters are optional this command is ideal if you want to change direction without sending the Digital Mode or Digital Pot values. This command also has a response that is useful to verify reception of the command.

Parameter: 0x16 (Note: Resets CAN Timeout)
B0 B1 B2 [ B3 ] [ B4 ] [ B5 ]
0x49 {OP} {Parameter} Digital Buttons Digital Mode Digital Pot

[ ] 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 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 the controller is in mixed throttle mode or full digital throttle mode. NOTE: This bit has no effect if the reverse pin is active and analog or mixed mode is used.
0x40 Indoor/Outdoor Set to 0 for indoor mode. Set to 1 for outdoor mode.
0x80 Reserved Set to 1

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 Reserved Set to 1
0x04 Reserved Set to 1
0x08 Reserved Set to 1
0x10 Reserved Set to 1
0x20 Reserved Set to 1
0x40 Reserved Set to 1
0x80 Reserved Set to 1

Digital Pot

Digital throttle value 0-255. This is the same value as Digital Throttle. See Digital Throttle.

The Digital 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.

Examples

Set to drive forward at 50% throttle

Command:    10EF8090 50 80 FF FF           Digital forward with 50% throttle
Wait 50msec.
Command:    10EF8090 50 80                 Continue moving (FF FF optional)
Wait 50msec.
Command:    10EF8090 50 80                 Continue moving
Repeat Digital Pot command as long as needed.       

Set to drive reverse at 20% throttle

Command:    10EF8090 50 00 FF FF           Stop first
Wait until motor stops.
Command:    10EF8090 50 40 DF FF           Digital reverse with 25% throttle
Wait 50msec.
Command:    10EF8090 50 40                 Continue moving (DF FF optional)
Wait 50msec.
Command:    10EF8090 50 40                 Continue moving
Repeat Digital Pot command as long as needed.       

Refresh CAN Timeout without changing any settings

Command:    10EF8090 50                    Repeat every 50msec        

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 Reserved Set to 1

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 Reserved Set to 1
0x04 Reserved Set to 1
0x08 Reserved Set to 1
0x10 Reserved Set to 1
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