Skip to content
/ bldc Public
forked from vedderb/bldc

Modified VESC control firmware for Pedal-assist Implementation

Notifications You must be signed in to change notification settings

doh38/bldc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VESC Firmware for Ebike

Screenshot from 2023-07-25 21-04-25

This is a better implementation of the PAS_app, it includes:

  • 3 wire pas support
  • 4 wires (quadrature) support
  • 4 wires with torque sensor by hall dephasing support
  • 3&4 wires + torque sensor come in a few (WIP right now and will first use the throttle input)
  • new PAS handlings (BASIC, HALL TORQUE, CADENCE, TORQUE SENSOR, CAN TORUE SENSOR)
  • speed limit (little PID) in the PAS app which use current to reduce speed (I ditched the rpm ratio thing as it was unreliable and too complicated)
  • external speed sensor speed support
  • brake support (especially for mid motors right now) with separated ramping
  • faster PAS which takes pedal rpm to calculate time out
  • Modified adc-pas implementation to re-route adc in the pas app (and benefit from adc setup but also from speed limit)
  • Most of the settings/parameters are accessible in LISP
  • And of course full Eggrider suppor (Fw 2.7+ so you will need to wait or contact us directly), with level of assist, speed limit change per assist level, standard power/current/regen...etc settings directly from app (similar to what we have for ASI right now)
  • Specific HW conf for the FS-75200 (which is one of my test VESC)

All of this is totally WIP right now, but should stable really soon. Updates will be referenced here.

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
  3. Open Qt Creator IDE installed in tools/Qt/Tools/QtCreator/bin/qtcreator
  4. With Qt Creator, open the vesc firmware Qt Creator project, named vesc.pro. You will find it in Project/Qt Creator/vesc.pro
  5. The IDE is configured by default to build 100_250 firmware, this can be changed in the bottom of the left panel, there you will find all hardware variants supported by VESC

Upload to VESC

Method 1 - Flash it using an STLink SWD debugger

  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

Tags

Every firmware release has a tag. They are created as follows:

git tag -a [version] [commit] -m "VESC Firmware Version [version]"
git push --tags

License

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

About

Modified VESC control firmware for Pedal-assist Implementation

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 94.9%
  • Assembly 1.8%
  • Makefile 1.0%
  • C++ 0.7%
  • NewLisp 0.7%
  • Common Lisp 0.4%
  • Other 0.5%