This repository implements Field Oriented Control (FOC) for hoverboards witch two boards Master and Slave. The boards communicate with each other via UART2, The motors are controlled via UART1 on the master board and Arduino. Communication diagram The left bldc motor was cut from the original program.
The software is being tested.! More info: https://github.com/EFeru/hoverboard-firmware-hack-FOC/issues/364
YOUTUBE:
Compared to the commutation method, this new FOC control method offers superior performance featuring:
The originals are MM32 processors. We need to replace them with STM32. The program is used to support the STM32F103CBT6 processor. More information can be found in the docs.
Board pinouts: Slave / Master
I am trying to create a 4-wheeled vehicle. Initial sketch idea: (rigid without turning the wheels) using 2 howerboards for the wheels, communication will be made using uart and esp32. Currently, I was thinking about the actual position in space of the vehicle and came to the conclusion that the best solution would be to use the DW1000. In the future, there may be a lidar sensor. A lawn mower will be installed on the wheels to mow the lawn automatically. I invite you to the docs tab there are more photos from the construction.
To do:
In this firmware 3 control types are available, it can be set in config.h file via CTRL_TYP_SEL parameter:
0
. Recommended for most applications with a sitting human driver.To explore the controller without a Matlab/Simulink installation click on the link below:
https://eferu.github.io/bldc-motor-control-FOC/
VARIANT_ADC: The motors are controlled by one potentiometer connected to the white cable (connector hall). EnableMotors will turn on automatically.
VARIANT_USART: The motors are controlled via serial protocol (e.g. on USART1). The commands can be sent from an Arduino. Check out the hoverserial as an example sketch.
VARIANT_PPM: RC remote control with PPM Sum signal. Reciver connect to pin RX USATR1. Ch1: MasterSpeed, Ch2: SlaveSpeed, Ch3: EnableMotors, Ch4: -, Ch5: Button1, Ch6: Button2. When Button_Support is disabled, EnnableMotors will be enabled automatically.
VARIANT_PWM: RC remote control with PWM signal. PWM signal 1 (MasterSpeed) connect to TX USART1, PWM signal 2 (SlaveSpeed) connect to RX USART1. EnableMotors will turn on automatically.
Of course the firmware can be further customized for other needs or projects.