Go to file
Frank Severinsen 5ad4378567 WIP, Current status DAC output 2020-08-18 19:16:13 +02:00
ChibiOS_3.0.5 Updated ChibiOS to 3.0.5 2020-03-21 20:14:20 +01:00
appconf Add all the variables 2020-07-03 20:33:15 -07:00
applications Merge remote-tracking branch 'vedderb/dev_fw_5_02' into balance_3 2020-07-09 01:06:02 -07:00
blackmagic More blackmagic support and rebuilt firmwares 2020-07-06 17:20:45 +02:00
build_all More blackmagic support and rebuilt firmwares 2020-07-06 17:20:45 +02:00
compression Add miniLZO lossless compressor/decompressor source files 2019-10-25 17:37:35 -03:00
hwconf WIP, Current status DAC output 2020-08-18 19:16:13 +02:00
imu Fix noisy IMU signal 2020-08-14 20:13:32 -07:00
libcanard FW4.00: HFI and many updates, see changelog 2020-01-28 19:46:19 +01:00
mcconf Revert "Revert "Add ramp input to the speed PID loop."" 2020-07-02 12:31:01 +02:00
nrf added custom HW file, support for ID pins, and fixed circular include 2020-07-21 10:54:04 +02:00
tests/packet_recovery
.gitignore ignore project config files 2020-03-16 14:58:23 -07:00
.travis.yml
CHANGELOG Fixed bug introduced in PR and calculate motor current from magnitude of both axes 2020-07-21 09:23:48 +02:00
CONTRIBUTING
Makefile Added BMI160 SPI support 2020-07-02 12:00:12 +02:00
README.md Add MacOS environment configuration guide 2019-09-21 23:16:50 +08:00
board.c
board.h
buffer.c
buffer.h
chconf.h Major restructuring for dual motor support, and added unity hw files 2020-03-16 18:32:39 +01:00
comm_can.c added 140/300 hw and comm_can fix 2020-08-13 13:53:29 +02:00
comm_can.h Updated observer gain scaling, and implemented CAN shutdown on unity hw config 2020-03-21 01:05:42 +01:00
comm_usb.c fix USB freezing on windows bug 2020-03-22 09:36:14 -07:00
comm_usb.h FW 3.66: Many changes, see changelog 2020-01-12 21:25:21 +01:00
comm_usb_serial.c FW 3.66: Many changes, see changelog 2020-01-12 21:25:21 +01:00
comm_usb_serial.h FW 3.66: Many changes, see changelog 2020-01-12 21:25:21 +01:00
commands.c Added CHUK_CTRL_TYPE_CURRENT_BIDIRECTIONAL, some fixes on last PR 2020-05-03 22:35:37 +02:00
commands.h Some Fixes in prevoius PR 2020-04-02 16:26:59 +02:00
conf_general.c Improved flux linkage measurement 2020-04-16 09:12:08 +02:00
conf_general.h WIP, Current status DAC output 2020-08-18 19:16:13 +02:00
confgenerator.c Add confgen and running states 2020-07-04 00:11:20 -07:00
confgenerator.h Add confgen and running states 2020-07-04 00:11:20 -07:00
crc.c Fixed flash CRC check 2019-04-18 22:30:01 +02:00
crc.h Remove ST CRC library but keep using hardware-accelerated CRC32. 2019-04-16 19:13:01 -03:00
datatypes.h Add all the variables 2020-07-03 20:33:15 -07:00
digital_filter.c
digital_filter.h
eeprom.c Major restructuring for dual motor support, and added unity hw files 2020-03-16 18:32:39 +01:00
eeprom.h Major restructuring for dual motor support, and added unity hw files 2020-03-16 18:32:39 +01:00
encoder.c Axiom: fix resolver error detection 2020-03-25 16:56:48 -03:00
encoder.h Leave debug mode on NRF5x after SWD upload, more TS5700N8501 encoder features, more CAN baud rates 2020-02-01 00:37:25 +01:00
flash_helper.c FW3.59. Many updates, see changelog for details 2019-09-03 20:39:05 +02:00
flash_helper.h FW3.59. Many updates, see changelog for details 2019-09-03 20:39:05 +02:00
gpdrive.c Added mutex to DRV SPI driver, moved fault stop to thread, smooth current ramping for sensor and flux linkage detection 2020-04-03 20:12:12 +02:00
gpdrive.h
halconf.h FW 3.66: Many changes, see changelog 2020-01-12 21:25:21 +01:00
i2c_bb.c Fixed current offset fault bug, added support for multiple IMUs and ICM-20948 2019-05-03 19:55:36 +02:00
i2c_bb.h Fixed current offset fault bug, added support for multiple IMUs and ICM-20948 2019-05-03 19:55:36 +02:00
irq_handlers.c Added mutex to DRV SPI driver, moved fault stop to thread, smooth current ramping for sensor and flux linkage detection 2020-04-03 20:12:12 +02:00
isr_vector_table.h
ld_eeprom_emu.ld Fixed flash CRC check 2019-04-18 22:30:01 +02:00
led_external.c
led_external.h
ledpwm.c Major restructuring for dual motor support, and added unity hw files 2020-03-16 18:32:39 +01:00
ledpwm.h added custom HW file, support for ID pins, and fixed circular include 2020-07-21 10:54:04 +02:00
main.c Only init IMU once so it doesn't override UART on reboot 2020-04-28 20:49:09 -07:00
mc_interface.c remove comment on motor temp 2020-07-28 13:04:39 -07:00
mc_interface.h Added mutex to DRV SPI driver, moved fault stop to thread, smooth current ramping for sensor and flux linkage detection 2020-04-03 20:12:12 +02:00
mcpwm.c Added mutex to DRV SPI driver, moved fault stop to thread, smooth current ramping for sensor and flux linkage detection 2020-04-03 20:12:12 +02:00
mcpwm.h Set new tachometer value interface added. 2019-12-07 21:07:05 +05:00
mcpwm_foc.c Merge pull request #197 from powerdesigns/MTPA_hall_detection 2020-07-24 23:18:12 +02:00
mcpwm_foc.h Improved flux linkage measurement 2020-04-16 09:12:08 +02:00
mcuconf.h added custom HW file, support for ID pins, and fixed circular include 2020-07-21 10:54:04 +02:00
mempools.c Fix warning: missing braces around initializer 2020-05-09 11:56:52 +08:00
mempools.h Major restructuring for dual motor support, and added unity hw files 2020-03-16 18:32:39 +01:00
packet.c
packet.h
pi_stm32.cfg
servo_dec.c Detect FOC fix, adc brake multi fix, make ppm pulses invalid above 150 percent 2019-07-01 17:17:49 +02:00
servo_dec.h
servo_simple.c added custom HW file, support for ID pins, and fixed circular include 2020-07-21 10:54:04 +02:00
servo_simple.h
shutdown.c Added support for HW60_MK3 and disable shutdown when watchdog runs slowly 2019-12-09 10:57:33 +01:00
shutdown.h Added support for HW60_MK3 and disable shutdown when watchdog runs slowly 2019-12-09 10:57:33 +01:00
spi_bb.c some cleanup 2020-07-21 08:50:09 +02:00
spi_bb.h some cleanup 2020-07-21 08:50:09 +02:00
stm32-bv_openocd.cfg
stm32f4xx_conf.h
terminal.c Improved flux linkage measurement 2020-04-16 09:12:08 +02:00
terminal.h FW3.59. Many updates, see changelog for details 2019-09-03 20:39:05 +02:00
timeout.c Major restructuring for dual motor support, and added unity hw files 2020-03-16 18:32:39 +01:00
timeout.h
timer.c 75/300 R2 support, terminal sync cmd, IMU support, option to disable permanent UART, collected timer functions in one place 2019-03-10 14:57:42 +01:00
timer.h 75/300 R2 support, terminal sync cmd, IMU support, option to disable permanent UART, collected timer functions in one place 2019-03-10 14:57:42 +01:00
utils.c Prevent power switch from working when stormcore gets too hot. Fix bug in median filter. 2020-08-10 09:28:07 -07:00
utils.h Made motor temperature lpf slower, and added median motor temperature lpf to HWs with adc mux 2020-04-18 09:48:25 +02:00
virtual_motor.c Fix virtual motor to work with latest Vesc v5. 2020-06-20 13:36:56 -03:00
virtual_motor.h Fix virtual motor to work with latest Vesc v5. 2020-06-20 13:36:56 -03:00
worker.c Major restructuring for dual motor support, and added unity hw files 2020-03-16 18:32:39 +01:00
worker.h Major restructuring for dual motor support, and added unity hw files 2020-03-16 18:32:39 +01:00
ws2811.c
ws2811.h

README.md

VESC firmware

License: GPL v3 Travis CI Status Codacy Badge Contributors Watchers Stars Forks

An open source motor controller firmware.

This is the source code for the VESC DC/BLDC/FOC controller. Read more at https://vesc-project.com/

Supported boards

All of them!

Make sure you select your board in conf_general.h

//#define HW_SOURCE "hw_40.c"
//#define HW_HEADER "hw_40.h"

//#define HW_SOURCE "hw_45.c"
//#define HW_HEADER "hw_45.h"

//#define HW_SOURCE "hw_46.c" // Also for 4.7
//#define HW_HEADER "hw_46.h" // Also for 4.7

//#define HW_SOURCE "hw_48.c"
//#define HW_HEADER "hw_48.h"

//#define HW_SOURCE "hw_49.c"
//#define HW_HEADER "hw_49.h"

//#define HW_SOURCE "hw_410.c" // Also for 4.11 and 4.12
//#define HW_HEADER "hw_410.h" // Also for 4.11 and 4.12

#define HW_SOURCE "hw_60.c"
#define HW_HEADER "hw_60.h"

//#define HW_SOURCE "hw_r2.c"
//#define HW_HEADER "hw_r2.h"

//#define HW_SOURCE "hw_victor_r1a.c"
//#define HW_HEADER "hw_victor_r1a.h"

//#define HW_SOURCE "hw_das_rs.c"
//#define HW_HEADER "hw_das_rs.h"

//#define HW_SOURCE "hw_axiom.c"
//#define HW_HEADER "hw_axiom.h"

//#define HW_SOURCE "hw_rh.c"
//#define HW_HEADER "hw_rh.h"

//#define HW_SOURCE "hw_tp.c"
//#define HW_HEADER "hw_tp.h"

//#define HW_SOURCE "hw_75_300.c"
//#define HW_HEADER "hw_75_300.h"

//#define HW_SOURCE "hw_mini4.c"
//#define HW_HEADER "hw_mini4.h"

//#define HW_SOURCE "hw_das_mini.c"
//#define HW_HEADER "hw_das_mini.h"

//#define HW_SOURCE "hw_uavc_qcube.c"
//#define HW_HEADER "hw_uavc_qcube.h"

//#define HW_SOURCE "hw_uavc_basic.c"
//#define HW_HEADER "hw_uavc_basic.h"

There are also many other options that can be changed in conf_general.h

Prerequisites

On Ubuntu

Install the gcc-arm-embedded toolchain

sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
sudo apt update
sudo apt install gcc-arm-embedded

Add udev rules to use the stlink v2 programmer without being root

wget vedder.se/Temp/49-stlinkv2.rules
sudo mv 49-stlinkv2.rules /etc/udev/rules.d/
sudo udevadm trigger

On MacOS

Go to the GNU ARM embedded toolchain downloads Website and select the mac version, download it and extract it to your user directory.

Append the bin directory to your $PATH. For example:

export PATH="$PATH:/Users/your-name/gcc-arm-none-eabi-8-2019-q3-update/bin/"

Install stlink and openocd

brew install stlink
brew install openocd

Build

Build and flash the bootloader first

Clone and build the firmware

git clone https://github.com/vedderb/bldc.git vesc_firmware
cd vesc_firmware
make

Flash it using an STLink SWD debugger

make upload

Contribute

Head to the forums to get involved and improve this project.

License

The software is released under the GNU General Public License version 3.0