Skip to content
The code for my custom BLDC controller.
Branch: master
Clone or download
Latest commit 8619ccf Jul 2, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ChibiOS_3.0.2 Remove ST CRC library but keep using hardware-accelerated CRC32. Apr 16, 2019
appconf Some fixes for previous PR Jul 1, 2019
applications Updated compiled FWs Jul 1, 2019
blackmagic Fixed flash CRC check Apr 18, 2019
build_all Updated compiled FWs Jul 1, 2019
hwconf Axiom: Individual IGBT temperature monitoring May 9, 2019
imu Added ICM-20948 callback to state struct May 6, 2019
libcanard Major 2019 update Feb 18, 2019
mcconf Rename sin/cos m_conf structure fields Apr 9, 2019
nrf FW 3.53: Limit foc_current_filter_const range, 1Mbit/de NRF speed, lo… Mar 20, 2019
tests/packet_recovery Major 2019 update Feb 18, 2019
.gitignore Add gitigore Oct 8, 2015
.travis.yml Increase traveis build coverage to most hardware versions Jan 31, 2019
CHANGELOG Some fixes for previous PR Jul 1, 2019
CONTRIBUTING Major 2019 update Feb 18, 2019
Makefile Added make rule to clear option bytes May 19, 2019
README.md Axiom control board support Apr 27, 2019
board.c FW3.28: dual throttle curves, ntc beta factor config, board file added Sep 6, 2017
board.h FW3.28: dual throttle curves, ntc beta factor config, board file added Sep 6, 2017
buffer.c Shifting signed 32-bit value by 31 bits is undefined behaviour Jan 25, 2019
buffer.h FW 3.7 Nov 4, 2016
chconf.h FW 2.3: MAJOR UPDATE: FOC!! Dec 8, 2015
comm_can.c Added CAN status msg 5, fixed issue 94, use defaul HW parameters afte… May 16, 2019
comm_can.h Added CAN status msg 5, fixed issue 94, use defaul HW parameters afte… May 16, 2019
comm_usb.c Commands restructuring for thread safety, 75/300 vreg fix, fixed rela… Mar 4, 2019
comm_usb.h Major 2019 update Feb 18, 2019
comm_usb_serial.c FW3.28: dual throttle curves, ntc beta factor config, board file added Sep 6, 2017
comm_usb_serial.h FW 3.7 Nov 4, 2016
commands.c Added CAN status msg 5, fixed issue 94, use defaul HW parameters afte… May 16, 2019
commands.h Commands restructuring for thread safety, 75/300 vreg fix, fixed rela… Mar 4, 2019
conf_general.c Detect FOC fix, adc brake multi fix, make ppm pulses invalid above 15… Jul 1, 2019
conf_general.h Some fixes for previous PR Jul 1, 2019
conf_mc_app_default.h Autogenerated config parsing with signatures, fixed previous PRs Mar 1, 2019
confgenerator.c Some fixes for previous PR Jul 1, 2019
confgenerator.h Some fixes for previous PR Jul 1, 2019
crc.c Fixed flash CRC check Apr 18, 2019
crc.h Remove ST CRC library but keep using hardware-accelerated CRC32. Apr 16, 2019
datatypes.h Rebuild the firmwares Jun 30, 2019
digital_filter.c FW 3.7 Nov 4, 2016
digital_filter.h FW 3.7 Nov 4, 2016
eeprom.c Do not write flash memory if MCU VDD is below 2.9V Jan 10, 2019
eeprom.h Added support for storing hw-specific and custom variables in EEPROM Apr 19, 2019
encoder.c Move sin/cos signal pin definitions to hwconf/ Apr 8, 2019
encoder.h Add SinCos encoder checks and fault management Apr 2, 2019
flash_helper.c Fixed flash CRC check Apr 18, 2019
flash_helper.h Continuous flash memory integrity check running on background Apr 17, 2019
gpdrive.c 75/300 R2 support, terminal sync cmd, IMU support, option to disable … Mar 10, 2019
gpdrive.h Major 2019 update Feb 18, 2019
halconf.h Major 2019 update Feb 18, 2019
i2c_bb.c Fixed current offset fault bug, added support for multiple IMUs and I… May 3, 2019
i2c_bb.h Fixed current offset fault bug, added support for multiple IMUs and I… May 3, 2019
irq_handlers.c Some fixes after the merge Feb 19, 2019
isr_vector_table.h Ported to ChibiOS 3, refactoring, cleanup, added safe start delay aft… Oct 8, 2015
ld_eeprom_emu.ld Fixed flash CRC check Apr 18, 2019
led_external.c Fix shadowed variables. Add -Wshadow. Jan 28, 2019
led_external.h FW 3.7 Nov 4, 2016
ledpwm.c FW 3.7 Nov 4, 2016
ledpwm.h FW 3.7 Nov 4, 2016
main.c Fixed flash CRC check Apr 18, 2019
mc_interface.c Merge branch 'Axiom-board-support' of https://github.com/powerdesigns… May 4, 2019
mc_interface.h Resolve merge conficts with major 2019 release Feb 18, 2019
mcpwm.c 75/300 R2 support, terminal sync cmd, IMU support, option to disable … Mar 10, 2019
mcpwm.h Major 2019 update Feb 18, 2019
mcpwm_foc.c Merge branch 'Axiom-board-support' of https://github.com/powerdesigns… May 4, 2019
mcpwm_foc.h Detect current sensor failures Apr 20, 2019
mcuconf.h Resolve merge conficts with major 2019 release Feb 18, 2019
packet.c Major 2019 update Feb 18, 2019
packet.h Major 2019 update Feb 18, 2019
pi_stm32.cfg Removed software servo driver, fixed hw servo driver to work with all… Feb 28, 2018
servo_dec.c Detect FOC fix, adc brake multi fix, make ppm pulses invalid above 15… Jul 1, 2019
servo_dec.h FW 3.7 Nov 4, 2016
servo_simple.c Removed software servo driver, fixed hw servo driver to work with all… Feb 28, 2018
servo_simple.h FW 3.7 Nov 4, 2016
stm32-bv_openocd.cfg first commit Jan 9, 2014
stm32f4xx_conf.h Restore capability of enabling parameter assertion of peripheral libr… Jan 28, 2019
terminal.c Merge branch 'Axiom-board-support' of https://github.com/powerdesigns… May 4, 2019
terminal.h First official commit after the VESC Project release Sep 4, 2017
timeout.c Autogenerated config parsing with signatures, fixed previous PRs Mar 1, 2019
timeout.h Extend watchdog coverage with IWDG, a watchdog running from an indepe… Jan 24, 2019
timer.c 75/300 R2 support, terminal sync cmd, IMU support, option to disable … Mar 10, 2019
timer.h 75/300 R2 support, terminal sync cmd, IMU support, option to disable … Mar 10, 2019
utils.c Major 2019 update Feb 18, 2019
utils.h Resolve merge conficts with major 2019 release Feb 18, 2019
virtual_motor.c Merge pull request #90 from powerdesigns/virtual-motor-update May 4, 2019
virtual_motor.h Add command to connect a virtual motor with configurable parameters Apr 6, 2019
ws2811.c
ws2811.h FW 3.7 Nov 4, 2016

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 an Ubuntu machine, 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

Build and flash the bootloader

Build

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

You can’t perform that action at this time.