Go to file
rodale75 80d504edaf hw_rd2: Adjustments of guard- & get-temperature function-naming.
And also, some minor adjustments of the configuration parameters.

Change-Id: Ic56430dcf13cc47e6d6df1fcc19e09941b2e6d91
2021-11-12 11:16:00 +01:00
ChibiOS_3.0.5 Updated ChibiOS to 3.0.5 2020-03-21 20:14:20 +01:00
appconf IMU improvements 2021-08-22 11:51:03 +02:00
applications Added fast moving average filter approximation, updated ADC app to use it 2021-10-31 13:40:43 +01:00
blackmagic blackmagic: Support more nrf5 target revisions 2021-10-13 15:14:53 +02:00
build_all Added 100/500 to build script 2021-11-10 14:18:34 +01:00
compression Add miniLZO lossless compressor/decompressor source files 2019-10-25 17:37:35 -03:00
hwconf hw_rd2: Adjustments of guard- & get-temperature function-naming. 2021-11-12 11:16:00 +01:00
imu [Utils] Change convenience multiplication factors into convenience MACROs 2021-10-13 14:18:05 -04:00
libcanard Disable CAN status messages when rate is set to 0 2021-05-03 19:37:49 +02:00
lora connect lora to packet/command structure 2021-04-11 20:22:54 +02:00
mcconf Added MTPA modes 2021-10-24 18:10:00 +02:00
nrf Disable vesc remote control by default and enable it after pairing 2021-06-15 12:58:10 +02:00
qmlui Custom UI support 2021-04-24 22:36:00 +02:00
tests Improved overvoltage protection 2021-11-10 14:19:48 +01:00
.gitignore Update UAVCAN drivers, Add UAVCAN boot loader support. Add UAVCAN parameter support. Update get node info responses 2021-03-25 16:58:45 -06:00
.travis.yml Increase traveis build coverage to most hardware versions 2019-01-31 20:59:10 -03:00
CHANGELOG Improved overvoltage protection 2021-11-10 14:19:48 +01:00
CONTRIBUTING Correct spelling, broken links, and missing parameters in documentation 2021-05-07 15:27:50 -07:00
Makefile make: Added size-rule. 2021-11-12 11:10:15 +01:00
README.md Update README.md 2021-04-12 00:01:30 -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 Major restructuring for dual motor support, and added unity hw files 2020-03-16 18:32:39 +01:00
comm_can.c Changed CAN_PACKET_POLL_ROTOR_POS to respond with the controller id 2021-08-30 10:36:08 +02:00
comm_can.h Added position PID offset support and KD_PROC term 2021-07-11 20:19:26 +02:00
comm_usb.c merge 2021-01-13 08:57:36 -08: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 raw sample mode 2021-10-18 21:45:47 +02:00
commands.h Custom UI support 2021-04-24 22:36:00 +02:00
conf_general.c Updated inductance calculation, include motor saliency in observer, separate setting for MTPA 2021-10-24 13:25:12 +02:00
conf_general.h Improved overvoltage protection 2021-11-10 14:19:48 +01:00
confgenerator.c Added MTPA modes 2021-10-24 18:10:00 +02:00
confgenerator.h Added MTPA modes 2021-10-24 18:10:00 +02: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 Update with new BMS commands 2021-11-09 13:33:28 +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 Major restructuring for dual motor support, and added unity hw files 2020-03-16 18:32:39 +01:00
eeprom.h Made odometer persist after firmware updates, added hw runtime counter 2021-04-11 19:36:11 +02:00
encoder.c [Utils] Change convenience multiplication factors into convenience MACROs 2021-10-13 14:18:05 -04:00
encoder.h Renamed encoder functions, moved fault generation 2021-07-31 10:53:15 +02: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
flash_helper.c Added kill switch support 2021-06-13 13:46:27 +02:00
flash_helper.h Dynamic QML-script write support 2021-05-01 13:28:46 +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 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 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 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 Fixed flash CRC check 2019-04-18 22:30:01 +02: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 Moved LED control to its own thread 2021-11-01 08:52:18 +01:00
main.h Dual motor shutdown fix 2021-08-20 14:59:36 +02:00
mc_interface.c Improved overvoltage protection 2021-11-10 14:19:48 +01:00
mc_interface.h Added raw sample mode 2021-10-18 21:45:47 +02:00
mcpwm.c [Utils] Change convenience multiplication factors into convenience MACROs 2021-10-13 14:18:05 -04:00
mcpwm.h Set new tachometer value interface added. 2019-12-07 21:07:05 +05:00
mcpwm_foc.c Disable HFI start in braking mode 2021-11-08 22:48:15 +01:00
mcpwm_foc.h Give D-axis current priority when limiting current, added mcpwm_foc_set_current_off_delay 2021-04-14 22:29:50 +02:00
mcuconf.h - Add driver for SX1278 LoRa boards, eg. HopeRF RFM95W (driver by Wojciech Domski, https://github.com/wdomski/SX1278) 2021-03-27 14:15:22 +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
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 BMI160 SPI fixes 2021-06-26 15:12:30 +02:00
spi_bb.h some cleanup 2020-07-21 08:50:09 +02: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 Merge pull request #352 from kubark42/convenience_math 2021-10-15 22:35:47 +02:00
terminal.h FW3.59. Many updates, see changelog for details 2019-09-03 20:39:05 +02:00
timeout.c Ignore commands when kill switch is active 2021-06-20 16:46:56 +02: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.c Added hall sensor interpolation ERPM config option 2020-10-22 08:37:32 +02:00
utils.h Added fast moving average filter approximation, updated ADC app to use it 2021-10-31 13:40:43 +01:00
virtual_motor.c [Utils] Change convenience multiplication factors into convenience MACROs 2021-10-13 14:18:05 -04: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!

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. Recommended version gcc-arm-none-eabi-7-2018-q2

Method 1 - Through Official GNU Arm Embedded Toolchain Downloads

  1. Go to GNU Arm Embedded Toolchain Downloads
  2. Locate and Download version gcc-arm-none-eabi-7-2018-q2 for your machine
    GNU Arm Embedded Toolchain: 7-2018-q2-update June 27, 2018
    Linux 64-bit version can be downloaded from here
  3. Unpack the archive in the file manager by right-clicking on it and select "extract here"
  4. Change directory to the unpacked folder, unpack it in /usr/local by execute the following command
    cd gcc-arm-none-eabi-7-2018-q2-update-linux  
    sudo cp -RT gcc-arm-none-eabi-7-2018-q2-update/ /usr/local  
    

Method 2 - Through apt install

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

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

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

Clone and build the firmware

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

Upload to VESC

Build and flash the bootloader first

make upload

Method 2 - Upload Firmware via VESC tool through USB

  1. Clone and build the firmware in .bin format

Reminder : Remember to select your board in [conf_general.h]

git clone https://github.com/vedderb/bldc.git vesc_firmware
cd vesc_firmware
#make build/your_firmware_name_here.bin
make build/VESC_fw.bin 

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. VESC_fw.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.

License

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