EFeru / hoverboard-sideboard-hack-STM

Hoverboard sideboard hack for STM32 boards
GNU General Public License v3.0
48 stars 42 forks source link
accelerometer blue-pill dmp euler gd32 gyroscope hoverboard imu mems mpu-6050 sensor-fusion sideboard stm32

hoverboard-sideboard-hack-STM

Build status License: GPL v3 paypal

This repository implements the firmware for the hoveboard sideboards. The hoveboard comes with two identical sideboards that can be flashed with this firmware.

► If you have a GD32 sideboard check-out the repo hoverboard-sideboard-hack-GD


Table of Contents


Hardware

The original sideboard hardware supports one 4-pin cable that originally was connected to the hoveboard mainboard. It breaks out GND, 12/15V and USART. Additionally, two ports are used to connect to the LED boards. On the back of the board, two Photo Interrupter Optical Switches can be found, originally used to detect if a human is standing on the hoverboard. sideboard

The LED boards consist of colored LEDs (blue, red, green, orange) used for design and to inform the user about the current hoverboard state. Below the pinout of the LED boards is shown. ledboard

The sideboard brain is an STM32F103C8T6 with the pinout shown in the follwing figure: MCU_pinout

A very important component of the sideboard is the IMU MPU-6050 from Invensense. The MPU-6050 determines the board orientation by combining a 3-axis gyroscope and a 3-axis accelerometer on the same silicon die, together with an onboard Digital Motion Processor™ (DMP™), which processes complex 6-axis MotionFusion algorithms. The DMP™ offers many features, such as:

The MPU-6050 pinout and orientation of axes is shown in the follwing figure: MPU6050_pinout

For more details see the MPU-6050 datasheet and MPU-6050 registers.


Example Variants

This firmware offers currently these variants (selectable in platformio.ini or config.h):

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


Flashing

On the sideboard, there is a debugging header with GND, 3V3, SWDIO and SWCLK. Connect GND, SWDIO and SWCLK to your ST-Link V2 programmer. The 3V3 can be either obtained by connecting the pin to the ST-Link programmer or powering the sideboard with 12/15V.

If you have never flashed your sideboard before, the MCU is probably locked. To unlock the flash, check-out the wiki page How to Unlock MCU flash.

To build and flash choose one of the following methods:

Method 0: Using GitHub Fork

Method 1: Using Platformio IDE (recommended)

Method 2: Using Keil uVision

Method 3: Using Linux CLI


Wiring iBUS Receiver

An RC transmitter (Flysky FS-i6S or FS-i6X) can be connected to the sideboard using an FS-iA6B receiver as shown in the following schematic:

wiring_iBUS_pic


3D Visualization Demo

By converting Quaternions to Euler angles, we can make a 3D visualization example in Processing as shown below. For this Demo VARIANT_DEBUG was used.

sketch_pic


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