2020-02-07 14:57:44 +01:00
2020-02-07 14:57:44 +01:00
2020-02-07 14:57:44 +01:00
2020-02-07 14:57:44 +01:00
2020-02-07 14:57:44 +01:00
2020-02-07 14:57:44 +01:00
2020-02-07 14:57:44 +01:00
2020-02-07 14:57:44 +01:00
2020-02-07 14:57:44 +01:00
2020-02-07 14:57:44 +01:00
2020-02-07 14:57:44 +01:00
2020-02-07 14:57:44 +01:00
2020-02-07 14:57:44 +01:00
2020-02-07 14:57:44 +01:00
2020-02-07 14:57:44 +01:00

hoverboard-sideboard-hack-GD

[![Build Status](link to travis) 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.

The sideboards comes in two MCU flavours:


Hardware

sideboard

The original sideboard hardware supports one 4-pin cable that originally were connected to the hoveboard mainboard. They break 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.

The GD32F130C6T6 pinout is shown in the follwing figure: MCU_pinout

The sideboards, also called sensor boards, feature an 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:

  • Accelerometer and Gyroscop raw data output
  • Quaternion output
  • Temperature output
  • Pedometer
  • Interrupts on gesture events such as Tap on all axes or Orientation change
  • Low-power modes
  • Self-test and calibration

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

For more details check-out the MPU-6050 datasheet and MPU-6050 registers.


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 never flashed your sideboard before, the MCU is probably locked. To unlock the flash, check-out the wiki page.

Then, choose one of the following ways for building and flashing the firmware:

In (Keil uVision)[https://www.keil.com/download/product/], open the sideboard-hack.uvproj, click Build Target (or press F7), then click Load Code (or press F8).

2. Using Ubuntu

Prerequisites: install ST-Flash utility.

To build the firmware, type:

make

then you can simply flash the firmware by typing:

make flash

Note: If someone finds a way to build and flash the GD32 MCU via (Platformio)[https://platformio.org/] please let me know.


Example Variants

This firmware offers currently these variants (selectable in (config.h)[/Inc/config.h]):

  • VARIANT_DEBUG: In this variant the user can interact with sideboard via a Serial Monitor to observe and check the capabilities of the sideboard.
  • VARIANT_HOVERBOARD: In this variant the sideboard is communicating with the mainboard of a hoverboard using the (FOC firmware repository)[link]. !This Variant is not yet fully tested!

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

--

3D Visualization Demo

By calculating the Euler orientation angles from Quaternions, we can make a simple 3D visualization example (see sketch) in Processing as shown below:

sketch_pic

-- ##Contributions

Every contribution to this repository is highly appriciated! 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, check-out the link below: paypal

Description
No description provided
Readme GPL-3.0 104 MiB
Languages
C 98%
Assembly 1.6%
Makefile 0.4%