All Projects → EFeru → hoverboard-firmware-hack-FOC

EFeru / hoverboard-firmware-hack-FOC

Licence: GPL-3.0 License
With Field Oriented Control (FOC)

Programming Languages

c
50402 projects - #5 most used programming language
assembly
5116 projects

Projects that are alternatives of or similar to hoverboard-firmware-hack-FOC

FpOC
FPGA-based Field Oriented Control (FOC) for driving BLDC/PMSM motor.
Stars: ✭ 138 (-65.5%)
Mutual labels:  motor, field-oriented-control, bldc, foc
iBLDC
月更或者年更。志在做一个纯粹的、包含软硬件的、功率涵盖从小到大的 方案,查阅 n^2 的各方资料,对 BLDC&PMSM 进行一个大综合、大整理,查阅、比较和整理 大量的 网络教程、大厂手册、开源解决方案,在这里形成 原理和解决方案 的打通式介绍。
Stars: ✭ 84 (-79%)
Mutual labels:  bldc, foc
BLDC DRV
无刷电机矢量驱动板
Stars: ✭ 58 (-85.5%)
Mutual labels:  bldc, foc
Cheap-FOCer
BLDC Motor Controller based on the VESC 4.12 hardware
Stars: ✭ 61 (-84.75%)
Mutual labels:  field-oriented-control, foc
EBiCS Firmware
Free FOC firmware for Lishui E-Bike-Controllers
Stars: ✭ 45 (-88.75%)
Mutual labels:  bldc, foc
menu-control
🍔 Menu and breadcrumb components for Nette framework (@nette)
Stars: ✭ 26 (-93.5%)
Mutual labels:  control
toggle-switch-control
Toggle switch control for WPF & Silverlight
Stars: ✭ 77 (-80.75%)
Mutual labels:  control
ngx-scroll-to-first-invalid
Directive to scroll to first invalid form control inside an Angular form on submit
Stars: ✭ 27 (-93.25%)
Mutual labels:  control
control
Control in C++
Stars: ✭ 17 (-95.75%)
Mutual labels:  control
granblue-automation-android
Educational application written in Kotlin aimed at automating user-defined workflows for the mobile game, "Granblue Fantasy", using MediaProjection, AccessibilityService, and OpenCV.
Stars: ✭ 26 (-93.5%)
Mutual labels:  control
VirtualCapsuleEndoscopy
VR-Caps: A Virtual Environment for Active Capsule Endoscopy
Stars: ✭ 59 (-85.25%)
Mutual labels:  control
perfekt
Release, changelog and version your packages with perfe(k)t 👌 ease!
Stars: ✭ 15 (-96.25%)
Mutual labels:  control
Collab-Hub
Collaboration Tool for Remote Performance Data
Stars: ✭ 14 (-96.5%)
Mutual labels:  control
Laden
SwiftUI loading indicator view
Stars: ✭ 23 (-94.25%)
Mutual labels:  control
IC-Imaging-Control-Samples
Windows Sample in C#, C++, Python, LabVIEW and Java
Stars: ✭ 53 (-86.75%)
Mutual labels:  control
Modiy
Modiy is an open-source hardware interface for modular synthesis.
Stars: ✭ 21 (-94.75%)
Mutual labels:  control
curb
Code for "An Online Algorithm to Reduce the Spread of Misinformation in Social Networks", WSDM 2018
Stars: ✭ 24 (-94%)
Mutual labels:  control
QuadrotorFly
This is a dynamic simulation for quadrotor UAV
Stars: ✭ 61 (-84.75%)
Mutual labels:  control
ColorPicker
Customizable Color Picker control for WPF
Stars: ✭ 57 (-85.75%)
Mutual labels:  control
sanic-motor
simple motor wrapper for sanic
Stars: ✭ 51 (-87.25%)
Mutual labels:  motor

hoverboard-firmware-hack-FOC

Build Status License: GPL v3 paypal

This repository implements Field Oriented Control (FOC) for stock hoverboards. Compared to the commutation method, this new FOC control method offers superior performance featuring:

  • reduced noise and vibrations
  • smooth torque output and improved motor efficiency. Thus, lower energy consumption
  • field weakening to increase maximum speed range

Table of Contents

For the hoverboard sideboard firmware, see the following repositories:

For the FOC controller design, see the following repository:

Videos:


Hardware

mainboard_pinout

The original Hardware supports two 4-pin cables that originally were connected to the two sideboards. They break out GND, 12/15V and USART2&3 of the Hoverboard mainboard. Both USART2&3 support UART, PWM, PPM, and iBUS input. Additionally, the USART2 can be used as 12bit ADC, while USART3 can be used for I2C. Note that while USART3 (right sideboard cable) is 5V tolerant, USART2 (left sideboard cable) is not 5V tolerant.

Typically, the mainboard brain is an STM32F103RCT6, however some mainboards feature a GD32F103RCT6 which is also supported by this firmware.

For the reverse-engineered schematics of the mainboard, see 20150722_hoverboard_sch.pdf


FOC Firmware

In this firmware 3 control types are available:

  • Commutation
  • SIN (Sinusoidal)
  • FOC (Field Oriented Control) with the following 3 control modes:
    • VOLTAGE MODE: in this mode the controller applies a constant Voltage to the motors. Recommended for robotics applications or applications where a fast motor response is required.
    • SPEED MODE: in this mode a closed-loop controller realizes the input speed target by rejecting any of the disturbance (resistive load) applied to the motor. Recommended for robotics applications or constant speed applications.
    • TORQUE MODE: in this mode the input torque target is realized. This mode enables motor "freewheeling" when the torque target is 0. Recommended for most applications with a sitting human driver.

Comparison between different control methods

Control method Complexity Efficiency Smoothness Field Weakening Freewheeling Standstill hold
Commutation - - ++ n.a. n.a. +
Sinusoidal + ++ ++ +++ n.a. +
FOC VOLTAGE ++ +++ ++ ++ n.a. +(2)
FOC SPEED +++ +++ + ++ n.a. +++
FOC TORQUE +++ +++ +++ ++ +++(1) n.a(2)

(1) By enabling ELECTRIC_BRAKE_ENABLE in config.h, the freewheeling amount can be adjusted using the ELECTRIC_BRAKE_MAX parameter.
(2) The standstill hold functionality can be forced by enabling STANDSTILL_HOLD_ENABLE in config.h.

In all FOC control modes, the controller features maximum motor speed and maximum motor current protection. This brings great advantages to fulfil the needs of many robotic applications while maintaining safe operation.

Field Weakening / Phase Advance

  • By default the Field weakening is disabled. You can enable it in config.h file by setting the FIELD_WEAK_ENA = 1
  • The Field Weakening is a linear interpolation from 0 to FIELD_WEAK_MAX or PHASE_ADV_MAX (depeding if FOC or SIN is selected, respectively)
  • The Field Weakening starts engaging at FIELD_WEAK_LO and reaches the maximum value at FIELD_WEAK_HI
  • The figure below shows different possible calibrations for Field Weakening / Phase Advance Field Weakening
  • If you re-calibrate the Field Weakening please take all the safety measures! The motors can spin very fast!

Parameters

  • All the calibratable motor parameters can be found in the 'BLDC_controller_data.c'. I provided you with an already calibrated controller, but if you feel like fine tuning it feel free to do so
  • The parameters are represented in Fixed-point data type for a more efficient code execution
  • For calibrating the fixed-point parameters use the Fixed-Point Viewer tool
  • The controller parameters are given in this table

Example Variants

  • VARIANT_ADC: The motors are controlled by two potentiometers connected to the Left sensor cable (long wired)
  • VARIANT_USART: The motors are controlled via serial protocol (e.g. on USART3 right sensor cable, the short wired cable). The commands can be sent from an Arduino. Check out the hoverserial.ino as an example sketch.
  • VARIANT_NUNCHUK: Wii Nunchuk offers one hand control for throttle, braking and steering. This was one of the first input device used for electric armchairs or bottle crates.
  • VARIANT_PPM: RC remote control with PPM Sum signal.
  • VARIANT_PWM: RC remote control with PWM signal.
  • VARIANT_IBUS: RC remote control with Flysky iBUS protocol connected to the Left sensor cable.
  • VARIANT_HOVERCAR: The motors are controlled by two pedals brake and throttle. Reverse is engaged by double tapping on the brake pedal at standstill. See HOVERCAR wiki.
  • VARIANT_HOVERBOARD: The mainboard reads the two sideboards data. The sideboards need to be flashed with the hacked version. The balancing controller is not yet implemented.
  • VARIANT_TRANSPOTTER: This is for transpotter build, which is a hoverboard based transportation system. For more details on how to build it check here and here.
  • VARIANT_SKATEBOARD: This is for skateboard build, controlled using an RC remote with PWM signal connected to the right sensor cable.

Of course the firmware can be further customized for other needs or projects.


Wiki

Please check the wiki for Getting Started and for Troubleshooting


Projects and Links


Stargazers

Stargazers over time


Contributions

Every contribution to this repository is highly appreciated! Feel free to create pull requests to improve this firmware as ultimately you are going to help everyone.

If you want to donate to keep this firmware updated, please use the link below:

paypal


Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].