/VESC_CAN_bus_native_esp32

Arduino framework library for interfacing with VESC esc through CAN bus. USES ESP32 native tranceiver

Primary LanguageC++MIT LicenseMIT

VESC library for CAN bus control using native esp32 CAN bus tranceiver

image Tis library is based on craigg96 vesc_can_bus_arduino library (https://github.com/craigg96/vesc_can_bus_arduino). Interpretation of can messages is left the same as it was in craiggs96 library, but instead of MCP2515 driver library it uses native arduino CAN bus library (https://github.com/sandeepmistry/arduino-CAN) which supports native ESP32 CAN bus tranceiver (SJA1000).

The VESC platform is the gold standard for brushless motor control for skateboards and ebikes. This library allows you to use the can bus instead of UART (see solidgeek vescuart library) to communicate with the VESC which is more reliable and allows the single UART port on most arduinos to be free for debugging.

Realtime Data Messages

Parameter
rpm
inpVoltage
dutyCycleNow
avgInputCurrent
avgMotorCurrent
tempFET
tempMotor
WattHours

Command Messages

Parameter
erpm
dutycycle
current

To use the library out of the box, the vesc tool must be configured to walues shown below. VESC ID = 10 CAN STATUS_MESSAGE_MODE = CAN_STATUS_1_2_3_4_5 CAN Baud Rate = CAN_BAUD_250K

Place the .h and .cpp file in the same folder as the .ino file to use this library with no changes.

To do

  • Add support for multiple VESC esc on the same can bus ( currently only 1 esc is supported). This also includes support for diffrent VESC id's.
  • Creagte a method to update the value only when coresponding can message is recived.
  • Add instructions on how to use the library and what are the hardvare options (WIKI).

LONGSHOT Add support to all of the vesc can bus features.

Credits

DEPENDENCIES

LICENSE

MIT - https://opensource.org/license/mit/