Firmware Compatibility - EFeru/hoverboard-firmware-hack-FOC GitHub Wiki
Mainboard
The mainboards with a STM32F103RCT6/STM32F103RET6 or a GD32F103RCT6 should be supported by this firmware. For the reverse-engineered schematics of the mainboard, see 20150722_hoverboard_sch.pdf.
Some boards have 6 wires on the hall sensors cable, with an additional white wire. For those you can use the alternate mapping by changing parameter BOARD_VARIANT in config.h ⚠️ The sideboard on the right hand side is powered with battery voltage on those boards⚠️
It could be that your mainboard was designed differently, please check if the pin mapping is matching with the one in this section.
:toolbox: Troubleshooting
- Motors are cogging/not running in a smooth way - please try to swap the phases. Usually, color-correct mapping (blue to blue, green to green, yellow to yellow) works fine. However, some hoverboards have a different layout then others, and this might be the reason your motor isn't spinning well. It could also be that a defective mosfet is not turning ON
- In speed mode, wheels are running at maximum speed - find the right mapping for hall sensors, firmware probably measures a speed with opposite sign
- With hovercar variant in torque mode, braking actually accelerates - find the right mapping for hall sensors, firmware probably measures a speed with opposite sign
- If you have a problem on a single motor, try to swap the motors to understand if the problem is coming from the board or the wheel. Some boards have a different phase mapping or current sensing on one the wheels (discussed here )
In general, if you have doubts about you mainboard's compatibility:
- Try sinusoidal control type with ADC variant first for your tests, this will prove phases/halls are mapped to the right pins
- Then try FOC control type and voltage mode with ADC variant, this will prove phase current sensing is also working fine, this is mandatory for FOC
- Then you can try FOC control type and Speed control mode with ADC variant, this will prove the phases/hall sensor sequence is correct and speed/direction measurement is accurate
Pin Mapping
This is the pin mapping this firmware is using, you might have to adapt it to your board variant in defines.h file
Name | PinBoard Variant 0 | Alternate MappingBoard Variant 1 | Comment |
---|---|---|---|
SWCLK | PA14 | Used for programming | |
SWDIO | PA13 | Used for programming | |
TX/ADC1/PWM | PA2 | Left sensor cable | |
RX/ADC2/PWM/PPM/IBUS | PA3 | Left sensor cable | |
TX/SCL/PWM | PB10 | Right sensor cable | |
RX/SDA/PWM/PPM/IBUS | PB11 | Right sensor cable | |
LED | PB2 | Missing on some of the boards | |
BUZZER | PA4 | PC13 | Used for diagnostic beepsMissing on some of the boards |
HALL LEFT U | PB5 | ||
HALL LEFT V | PB6 | ||
HALL LEFT W | PB7 | ||
HALL RIGHT U | PC10 | ||
HALL RIGHT V | PC11 | ||
HALL RIGHT W | PC12 | ||
PHASE LEFT U HIGH | PC6 | ||
PHASE LEFT U LOW | PA7 | ||
PHASE LEFT V HIGH | PC7 | ||
PHASE LEFT V LOW | PB0 | ||
PHASE LEFT W HIGH | PC8 | ||
PHASE LEFT W LOW | PB1 | ||
PHASE RIGHT U HIGH | PA8 | ||
PHASE RIGHT U LOW | PB13 | ||
PHASE RIGHT V HIGH | PA9 | ||
PHASE RIGHT V LOW | PB14 | ||
PHASE RIGHT W HIGH | PA10 | ||
PHASE RIGHT W LOW | PB15 | ||
LEFT_DC_CUR | PC0 | Used to measure Left motor DC current with a 3.5mΩ or 2x7mΩ shuntsMissing on some of the boards, so no dc current limitation | |
LEFT_U_CUR | PA0 | Used to measure phase current for FOC through low-side Mosfet RDSon as shunt resistor | |
LEFT_V_CUR | PC3 | Used to measure phase current for FOC through low-side Mosfet RDSon as shunt resistor | |
RIGHT_DC_CUR | PC1 | Used to measure Right motor DC current with a 3.5mΩ or 2x7mΩ shuntsMissing on some of the boards, so no dc current limitation | |
RIGHT_U_CUR | PC4 | Used to measure phase current for FOC through low-side Mosfet RDSon as shunt resistor | |
RIGHT_V_CUR | PC5 | Used to measure phase current for FOC through low-side Mosfet RDSon as shunt resistor | |
DCLINK | PC2 | PA1 | Used to measure Battery voltage with adc through a voltage divider |
OFF | PA5 | PC15 | Used to maintain the latch on, released to power off |
BUTTON | PA1 | PB9 | To power on/offTo trigger auto-calibrationTo set current and speed limits on the goTo change cable length on transpotter |
CHARGER | PA12 | PA11 | Not used in the firmware at the moment |
Other boards
Artery boards
Those boards are the cheapest and more common ones available on Aliexpress now, it has a AT32F403RCT6 or AT32F413RCT7 chip, but is not compatible with FOC firmware. Please check following firmware for AT32F403RCT6 and AT32F413RCT7.
Splitboards
For split boards with a STM32F130C8T6, GD32F130C8T6 or GD32F130C6T6 chip, please check following Firmware.
For split boards with a GD32F103C8T6, please check following Firmware
For split boards with a MM32SPIN05/06/25, please check following Firmware
For split boards with a GD32F130K6 chip, please check the progress on following repository.