| VESC | Default VESC CAN-bus. Required for CAN forwarding and configuring multiple VESC-based devices using VESC Tool. |
| UAVCAN | Basic implementation of uavcan.equipment.esc. See https://dronecan.github.io for more info. |
| Comm Brigde | Bridge CAN-bus to commands. Useful for using VESC Tool as a generic CAN interface and debugger. |
| Unused | CAN-frames are not processed and just ignored. Custom applications and scripts can still process CAN-frames. This is similar to Comm Bridge, but the received frames are not forwarded using commands. |
By default there is a timeout that stops the motor when nothing has been received on the CAN-bus for more than 0.5 seconds. The timeout value can be changed in VESC Tool under App Settings -> General. Settings it to 0 disables the timeout, but it is strongly recommended to not disable it in case something goes wrong with the communication link. There is also a timeout brake current that can be configured on that page that can be used to brake the motor when timeout occurs. By default it is 0, which just releases the motor.
To prevent timeouts it is recommended to keep sending the desired commands over and over at a fixed rate, e.g. 50 Hz.
The VESC CAN-mode supports basic commands that fit in a single CAN-frame as well as everything in https://github.com/vedderb/bldc/blob/master/comm/commands.c by splitting up the commands into multiple frames. The basic commands are described in this document. For a full and precise description of the protocol it is best to look at the source code https://github.com/vedderb/bldc/blob/master/comm/comm_can.c.
### Frame Format
The VESC CAN-frames all use 29-bit extended IDs. The ID of the receiver as well as the command ID is embedded in the extended ID of the CAN-frame as:
The data bytes in the CAN-frame depend on the command. The VESC CAN ID can be set in VESC Tool under **App Settings -> General -> VESC ID**. Each VESC-based device will only accept commands if VESC ID is set to its ID in the CAN-frame.
### Single-Frame (simple) Commands
All simple CAN-commands have 4 data bytes which represent the argument for the commands as a 32-bit big endian signed number with scaling.
Example: the command CAN_PACKET_SET_CURRENT has command id 1 and scaling 1000. The CAN-frame for setting the current to 51 A on VESC ID 23 would look like the following:
* Same as above, but also sets the off delay. Note that this command uses 6 bytes now. The off delay is useful to set to keep the current controller running for a while even after setting currents below the minimum current.
To receive motor status (RPM, Voltage, Current etc.) status commands can be activated from VESC Tool under **App Settings -> General -> CAN Status Messages Rate x**. Two sets of messages can be enabled where each set is transmitted at a specified rate. Each set can contain any combination of status messages. Using two rates is useful for not congesting the bus with messages that are not needed as often, which can be sent at a lower rate.
There are 6 different status messages available with the following data:
**What happends when sending commands outside of range?**
- When sending commands outside of range they will be truncated at the range limit. For example, if the maximum braking current is set to 50A and CAN_PACKET_SET_CURRENT_BRAKE is sent with 60A the value will be truncated and 50A will be used.