Skip to content
/ bldc Public
forked from vedderb/bldc

Firmware for STM32 based Electronic Speed Controller

Notifications You must be signed in to change notification settings

derlucas/bldc

This branch is 20 commits ahead of, 3016 commits behind vedderb/bldc:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ec2f224 · Oct 21, 2017
Oct 8, 2015
Oct 16, 2017
Oct 21, 2017
Oct 16, 2017
Oct 21, 2017
Sep 6, 2017
Sep 4, 2017
Oct 21, 2017
Oct 16, 2017
Sep 4, 2017
Oct 16, 2017
Oct 21, 2017
Sep 6, 2017
Sep 6, 2017
Nov 6, 2016
Nov 4, 2016
Dec 8, 2015
Sep 4, 2017
Sep 4, 2017
Nov 4, 2016
Nov 4, 2016
Sep 6, 2017
Nov 4, 2016
Oct 21, 2017
Sep 4, 2017
Oct 21, 2017
Oct 16, 2017
Nov 4, 2016
Nov 4, 2016
Oct 21, 2017
Nov 4, 2016
Nov 4, 2016
Oct 5, 2015
Nov 4, 2016
Sep 4, 2017
Nov 4, 2016
Sep 4, 2017
Nov 4, 2016
Apr 27, 2016
Sep 4, 2017
Oct 8, 2015
Oct 8, 2015
Nov 4, 2016
Nov 4, 2016
Nov 4, 2016
Nov 4, 2016
Sep 4, 2017
Oct 21, 2017
Oct 21, 2017
Sep 6, 2017
Sep 4, 2017
Sep 21, 2017
Sep 4, 2017
Sep 4, 2017
Sep 21, 2017
Sep 21, 2017
Oct 21, 2017
Oct 17, 2017
Nov 4, 2016
Nov 4, 2016
Nov 4, 2016
Nov 4, 2016
Nov 4, 2016
Nov 4, 2016
Jan 9, 2014
Oct 8, 2015
Oct 21, 2017
Sep 4, 2017
Nov 4, 2016
Nov 4, 2016
Sep 18, 2017
Sep 6, 2017
Nov 4, 2016
Nov 4, 2016

Repository files navigation

BLDC - Electronic Speed Controller Firmware

This is the source code for the Electronic Speed Controllers(ESC) like VESC©, FOCBOX, ESK1.1, OLLIN ESC1.1 and probably others.

This fork is based on Benjamin Vedders bldc Firmware. So mostly his work and kudos to him.

In this fork i removed the trademark stuff i don't like and add my wanted features. Please see my esc_tool repository for a compatible *ESC tool to configure your *ESC.

eBike - Pedelec App

Currently i'm implementing a new application for Electric vehicles (app_ev). There are options for analog inputs for Accelleration and Braking. Inputs for PAS Detector and Wheel Rotation detectors.

The goal is to be able to replace regular eBike controllers with this *ESC and have all the nice config options we like.

With this App, you are able to make a legal eBike (some countries need detection for pedaling etc).

Current working status (roughly):

  • Support for Analog Throttle + Braking
  • Support for PAS Sensor (on PPM connector)
  • Support for s-LCD3 Display
    • Display Speed, Wattage, Battery
    • "Gear" Selection (Mode 0-5)
    • Power Assisted Push Mode
  • Support for config via my esc_tool (see https://github.com/derlucas/esc_tool)

Current todo:

  • Testing everything
  • LCD Implementation sometimes hangs/crashes/fails
  • implement wheel rotation sensor on some spare IO (e.g. SWDIO) (needed for motors with freewheel)
  • implement max speed from Display (read wheel diameter from display + wheel_factor)
  • even more testing

Maybe features in future:

  • implement torque sensors like Sempu SP-B3.0 and others
  • enable more display config parameters to change stuff in controller (P and C params)
  • make the code cleaner and the display stuff more modular
  • maybe add another Display Type (send me some)
  • make a custom PCB with all needed connectors and higher voltage support

Documentation

You need to download the bldc firmware and the esc_tool from github. Currently there is no release, so you need to compile the code by yourself. (See vedders Documentation about compiling)

Start the new esc_tool and connect to you *ESC. It will warn you about old firmware. Upload the firmware of this repo, reboot *ESC and reconnect. You can then select the EV application (it is enabled by default by now) and make your settings to your needs.

Settings:
  • General
  • Ramping: Global Ramping (incl PAS and Thumb Throttle)
  • Display Enable: If using the s-LCD3
  • Wheel factor: factor between eRPM and real wheel RPM (eRPM/RPM)
  • Enable PAS Mode: select if you want to use PAS. If enabled you connect a PAS sensor to PPM input. Only if pedaling is detected, the motor will spin. (except of cause power assisted push)
  • Use Pulses Input: select if you have a motor with freewheel and want to use a speed sensor. If disabled, the motor eRPM will be used for displaying the speed. (option only needed with a Display)
  • Use throttle: if enabled, the ADC1 pin is used as Throttle
  • Use throttle brake: if enabled, the ADC2 pin is used as brake. This only makes sense if you are not using a motor with freewheel.
  • Use display Vmax: if enabled, the *ESC will use the Speed limit configured into the Display.
  • Power Mode 1-5: Set the wanted percentage of current (relative to max motor current) for each "gear"(mode).
  • Push Assist mode 6: configure percentage of current and max speed for the power assisted push function. You have to enter eRPM. (TODO: fill in a formula wheelsize+km/h+gearratio+motorpoles = eRPM)
  • Mapping
    • the usual analog input mapping like in the ADC app
  • Throttle curve
    • the usual throttle curve like in the other apps. Be aware: the curve also affects the current levels in the Power Modes 1-5
Wiring / Connections:
  • Throttle Accelleration: GND - ADC1 - 3.3V
  • Braking (analog): GND - ADC2 - 3.3V
  • PAS Sensor: GND - PPM (3pin header) - 3.3V + Pullup between Signal and 3.3V
  • Display (s-LCD3):
    • Red: +48V
    • Blue: Control (use with AntiSpark Switch to turn on *ESC)
    • Black: GND
    • Green (Data1): RX
    • Yellow (Data2): TX

About

Firmware for STM32 based Electronic Speed Controller

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 81.4%
  • C++ 9.3%
  • Objective-C 5.9%
  • Makefile 2.5%
  • Assembly 0.8%
  • Shell 0.1%