Go to file
Kenn Sebesta 5ccde377f3 [Utils] split into math and system utilities 2022-03-23 18:46:31 -04:00
ChibiOS_3.0.5 [Make] use proper powershell script block formatting. 2022-03-21 08:12:57 -04:00
Project [Project][Qt Creator] Point project kit toward `qt_creator_configure` kit 2022-03-02 16:56:18 -05:00
appconf Use bitfields for CAN-messages and support two different CAN status rates 2022-03-11 18:08:28 +01:00
applications Added lisp remote support 2022-03-13 10:15:24 +01:00
blackmagic Fix blackmagic.mk line termination 2022-02-19 11:55:11 +07:00
encoder As5047 encoder fixes 2022-02-28 14:30:48 +01:00
hwconf Changed ADC sampling order on some phase shunt hardwares 2022-03-23 22:53:30 +01:00
imu Added function to set the IMU yaw for drift compensation 2022-03-09 23:35:06 +01:00
libcanard Use bitfields for CAN-messages and support two different CAN status rates 2022-03-11 18:08:28 +01:00
lispBM Lisp GPIO-support 2022-03-13 22:53:25 +01:00
lora Decreased stack sizes to save ram 2022-01-16 21:57:12 +01:00
lzo Renamed compression to lzo, added observer offset parameter 2022-01-12 12:27:45 +01:00
make [Make][Tools] Reliably get the compiler version 2022-03-23 12:52:48 -04:00
mcconf High-performance and silent HFI 2022-03-23 15:04:30 +01:00
nrf Decreased stack sizes to save ram 2022-01-16 21:57:12 +01:00
qmlui Collected luna-files in one place, removed some old files 2021-12-31 12:27:36 +01:00
tests [Unit test] Use compiler-specific double-->single flags 2022-03-14 13:15:55 -04:00
.gdbinit gdb: Added command to dump entire stm32 flash to bin file. 2022-02-10 14:38:32 +01:00
.gitignore [.gitignore] Add Qt Project files to .gitignore 2022-03-02 16:56:18 -05:00
.travis.yml Squashed 'lispBM/lispBM/' content from commit 748477b9 2022-01-29 17:26:45 +01:00
CHANGELOG High-performance and silent HFI 2022-03-23 15:04:30 +01:00
CONTRIBUTING Correct spelling, broken links, and missing parameters in documentation 2021-05-07 15:27:50 -07:00
Makefile [Make] use proper powershell script block formatting. 2022-03-21 08:12:57 -04:00
README.md [Readme][Windows] Fix typo 2022-03-14 07:34:03 -04:00
bms.c Added new BMS counters 2021-04-08 22:34:01 +02:00
bms.h Added BMS module 2020-10-22 08:32:51 +02:00
board.c FW3.28: dual throttle curves, ntc beta factor config, board file added 2017-09-06 21:13:28 +02:00
board.h FW3.28: dual throttle curves, ntc beta factor config, board file added 2017-09-06 21:13:28 +02:00
buffer.c Handle subnormal numbers in float serialization 2021-06-09 19:20:48 +02:00
buffer.h FW 3.7 2016-11-04 15:18:34 +01:00
chconf.h Added stack checks 2022-01-17 22:15:48 +01:00
comm_can.c Added CAN status message 6 with ADC and PPM values 2022-03-13 20:56:26 +01:00
comm_can.h Added CAN status message 6 with ADC and PPM values 2022-03-13 20:56:26 +01:00
comm_usb.c Decreased stack sizes to save ram 2022-01-16 21:57:12 +01: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 lisp remote support 2022-03-13 10:15:24 +01:00
commands.h Lisp updates, imu refactoring and rate check 2022-02-28 14:29:59 +01:00
conf_general.c Use bitfields for CAN-messages and support two different CAN status rates 2022-03-11 18:08:28 +01:00
conf_general.h Updated beta number 2022-03-23 22:56:23 +01:00
confgenerator.c High-performance and silent HFI 2022-03-23 15:04:30 +01:00
confgenerator.h Fixed silent hfi current offset, added high performance hfi mode, changed vesc6 current sampling, only use HT interrupt if the currents are first in the ADC vector 2022-03-23 22:26:05 +01:00
crc.c merge 2021-01-13 08:57:36 -08:00
crc.h Remove ST CRC library but keep using hardware-accelerated CRC32. 2019-04-16 19:13:01 -03:00
datatypes.h Fixed silent hfi current offset, added high performance hfi mode, changed vesc6 current sampling, only use HT interrupt if the currents are first in the ADC vector 2022-03-23 22:26:05 +01:00
digital_filter.c FW 3.7 2016-11-04 15:18:34 +01:00
digital_filter.h FW 3.7 2016-11-04 15:18:34 +01:00
eeprom.c Adapt flash operations to MCU voltage 2022-03-01 11:54:25 +01:00
eeprom.h Adapt flash operations to MCU voltage 2022-03-01 11:54:25 +01:00
events.c Added event logging 2021-06-15 12:56:38 +02:00
events.h Added event logging 2021-06-15 12:56:38 +02:00
firmware_metadata.h Added fwinfo terminal command 2022-03-07 15:39:37 +01:00
flash_helper.c Faster motor enable after flash operations 2022-03-13 17:49:41 +01:00
flash_helper.h Updated linker script and flash helpers to get 128k extra code space. Note that this requires the updated bootloader with compression support. 2022-01-18 20:31:24 +01:00
gpdrive.c Add defines for bottom/top gate driver input polarity. (#425) 2022-03-02 10:12:00 +01:00
gpdrive.h Major 2019 update 2019-02-18 19:30:19 +01:00
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 Lisp I2C driver 2022-02-24 01:19:09 +01:00
irq_handlers.c First round of cleanup 2022-02-19 18:51:34 +01:00
isr_vector_table.h Ported to ChibiOS 3, refactoring, cleanup, added safe start delay after fault for PPM app, removed unused ST libraries 2015-10-08 23:09:39 +02:00
ld_eeprom_emu.ld Updated linker script and flash helpers to get 128k extra code space. Note that this requires the updated bootloader with compression support. 2022-01-18 20:31:24 +01:00
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 Update main.c 2022-02-21 17:12:20 +09:00
main.h Dual motor shutdown fix 2021-08-20 14:59:36 +02:00
mc_interface.c Faster motor enable after flash operations 2022-03-13 17:49:41 +01:00
mc_interface.h Updated lispbm, fixed dual motor flash motor stop 2022-02-13 15:18:22 +01:00
mcpwm.c Add defines for bottom/top gate driver input polarity. (#425) 2022-03-02 10:12:00 +01:00
mcpwm.h Release motor fix when cc_min_current is 0 2022-01-19 18:52:45 +01:00
mcpwm_foc.c Fixed silent hfi current offset, added high performance hfi mode, changed vesc6 current sampling, only use HT interrupt if the currents are first in the ADC vector 2022-03-23 22:26:05 +01:00
mcpwm_foc.h Added raw and imu lisp commands 2022-02-06 23:12:05 +01:00
mcuconf.h Adapt flash operations to MCU voltage 2022-03-01 11:54:25 +01: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
package_firmware.py Added HW410 5mOhm fw to vesc tool 2022-03-07 20:56:46 +01:00
packet.c Fixed typo (that had no effect, as that large packets are not used). Fixes #261 2021-02-28 20:34:05 +01:00
packet.h Cleanup 2021-01-13 21:51:55 +01:00
pi_stm32.cfg Removed software servo driver, fixed hw servo driver to work with all hardwares 2018-02-28 10:22:25 +01:00
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 FW 3.7 2016-11-04 15:18:34 +01:00
servo_simple.c Made servo output a config option 2021-03-31 16:28:46 +02:00
servo_simple.h Made servo output a config option 2021-03-31 16:28:46 +02:00
shutdown.c Made odometer persist after firmware updates, added hw runtime counter 2021-04-11 19:36:11 +02: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 Shorter 16-bit spi_bb delay. NOTE: This is a temporary fix, the spi_bb driver needs a rewrite at some point to support different polarities, phases, speeds etc. 2022-02-20 23:38:01 +01:00
spi_bb.h Shorter 16-bit spi_bb delay. NOTE: This is a temporary fix, the spi_bb driver needs a rewrite at some point to support different polarities, phases, speeds etc. 2022-02-20 23:38:01 +01:00
stm32-bv_openocd.cfg first commit 2014-01-09 15:20:26 +01:00
stm32f4xx_conf.h Restore capability of enabling parameter assertion of peripheral libraries 2019-01-28 16:47:10 -03:00
terminal.c Added CAN status message 6 with ADC and PPM values 2022-03-13 20:56:26 +01:00
terminal.h First lisp integration with vesc tool and enabled lisp by default 2022-01-29 03:36:34 +01:00
timeout.c Decreased stack sizes to save ram 2022-01-16 21:57:12 +01:00
timeout.h Added kill switch support 2021-06-13 13:46:27 +02:00
timer.c IMU improvements 2021-08-22 11:51:03 +02: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_math.c [Utils] split into math and system utilities 2022-03-23 18:46:31 -04:00
utils_math.h [Utils] split into math and system utilities 2022-03-23 18:46:31 -04:00
utils_sys.c [Utils] split into math and system utilities 2022-03-23 18:46:31 -04:00
utils_sys.h [Utils] split into math and system utilities 2022-03-23 18:46:31 -04:00
virtual_motor.c First round of cleanup 2022-02-19 18:51:34 +01: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

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!

Check the supported boards by typing make

[Firmware]
     fw   - Build firmware for default target
                            supported boards are: 100_250 100_250_no_limits 100_500...

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

Prerequisites

On Ubuntu (Linux)/macOS

  • Tools: git, wget, and make
  • Additional Linux requirements: libgl-dev and libxcb-xinerama0
  • Helpful Ubuntu commands:
sudo apt install git build-essential libgl-dev libxcb-xinerama0 wget git-gui
  • Helpful macOS tools:
brew install stlink
brew install openocd

On Windows

Install Dev environment and build

On Ubuntu (Linux)/MacOS

Open up a terminal

  1. git clone http://github.com/vedderb/bldc.git
  2. cd bldc
  3. Continue with On all platforms

On Windows

  1. Open up a Windows Powershell terminal (Resist the urge to run Powershell as administrator, that will break things)
  2. Type choco install make
  3. git clone http://github.com/vedderb/bldc
  4. cd bldc
  5. Continue with On all platforms

On all platforms

  1. git checkout origin/master
  2. make arm_sdk_install
  3. make <-- Pick out the name of your target device from the supported boards list. For instance, I have a Trampa VESC 100/250, so my target is 100_250
  4. make 100_250 <-- This will build the VESC 100/250 firmware and place it into the bldc/builds/100_250/ directory

Other tools

Linux Optional - 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

IDE

Prerequisites

On macOS/Linux

  • python3, and pip

On Windows

All platforms

  1. pip install aqtinstall
  2. make qt_install

Upload to VESC

  1. Build and flash the bootloader first
  2. Then _flash to the target of your choice. So for instance, for the VESC 100/250:
make 100_250_flash

Method 2 - Upload Firmware via VESC tool through USB

  1. Clone and build the firmware in .bin format as in the above Build instructions

In VESC tool

  1. Connect to the VESC
  2. Navigate to the Firmware tab on the left side menu
  3. Click on Custom file tab
  4. Click on the folder icon to select the built firmware in .bin format (e.g. build/100_250/100_250.bin)
[ Reminder : It is normal to see VESC disconnects during the firmware upload process ]
[ Warning : DO NOT DISCONNECT POWER/USB to VESC during the upload process, or you will risk bricking your VESC ]
[ Warning : ONLY DISCONNECT your VESC 10s after the upload loading bar completed and "FW Upload DONE" ]
  1. Press the upload firmware button (downward arrow) on the bottom right to start upload the selected firmware.
  2. Wait for 10s after the loading bar completed (Warning: unplug sooner will risk bricking your VESC)
  3. The VESC will disconnect itself after new firmware is uploaded.

In case you bricked your VESC

you will need to upload a new working firmware to the VESC.
However, to upload a firmware to a bricked VESC, you have to use a SWD Debugger.

Contribute

Head to the forums to get involved and improve this project. Join the Discord for real-time support and chat

License

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