You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Inc/config.h
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@
16
16
17
17
// Battery voltage calibration: connect power source. see <How to calibrate>. write value nr 5 to BAT_CALIB_ADC. make and flash firmware. then you can verify voltage on value 6 (devide it by 100.0 to get calibrated voltage).
18
18
#defineBAT_CALIB_REAL_VOLTAGE 43.0 // input voltage measured by multimeter
19
-
#defineBAT_CALIB_ADC 1704 // adc-value measured by mainboard (value nr 4 on UART debug output)
19
+
#defineBAT_CALIB_ADC 1704 // adc-value measured by mainboard (value nr 5 on UART debug output)
20
20
21
21
#defineBAT_NUMBER_OF_CELLS 10 // normal Hoverboard battery: 10s
22
22
#defineBAT_LOW_LVL1_ENABLE 0 // to beep or not to beep, 1 or 0
//#define CONTROL_PPM // use PPM-Sum as input. disable DEBUG_SERIAL_USART2!
62
+
//#define CONTROL_PPM // use PPM-Sum as input. disable CONTROL_SERIAL_USART2!
63
63
//#define PPM_NUM_CHANNELS 6 // total number of PPM channels to receive, even if they are not used.
64
64
65
65
// ###### CONTROL VIA TWO POTENTIOMETERS ######
66
66
// ADC-calibration to cover the full poti-range: connect potis to left sensor board cable (0 to 3.3V) (do NOT use the red 15V wire in the cable!). see <How to calibrate>. turn the potis to minimum position, write value 1 to ADC1_MIN and value 2 to ADC2_MIN. turn to maximum position and repeat it for ADC?_MAX. make, flash and test it.
67
-
#defineCONTROL_ADC// use ADC as input. disable DEBUG_SERIAL_USART2!
67
+
#defineCONTROL_ADC// use ADC as input. disable CONTROL_SERIAL_USART2!
68
68
#defineADC1_MIN 0 // min ADC1-value while poti at minimum-position (0 - 4095)
69
69
#defineADC1_MAX 4095 // max ADC1-value while poti at maximum-position (0 - 4095)
70
70
#defineADC2_MIN 0 // min ADC2-value while poti at minimum-position (0 - 4095)
This repo contains open source firmware for generic Hoverboard Mainboards.
6
8
The firmware you can find here allows you to use your Hoverboard Hardware (like the Mainboard, Motors and Battery) for cool projects like driving armchairs, person-tracking transportation robots and every other application you can imagine that requires controlling the Motors.
To build the firmware, just type "make". Make sure you have specified your gcc-arm-none-eabi binary (version 7 works, there is a version that does not!) location in the Makefile ("PREFIX = ..."). Right to the STM32, there is a debugging header with GND, 3V3, SWDIO and SWCLK. Connect GND, SWDIO and SWCLK to your SWD programmer, like the ST-Link found on many STM devboards.
36
+
To build the firmware, just type "make". Make sure you have specified your gcc-arm-none-eabi binary location in the Makefile ("PREFIX = ...") (version 7 works, there is a version that does not!) (if the ons in linux repos do not work, use the official version: https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads). Right to the STM32, there is a debugging header with GND, 3V3, SWDIO and SWCLK. Connect GND, SWDIO and SWCLK to your SWD programmer, like the ST-Link found on many STM devboards.
37
+
38
+
Do not power the mainboard from the 3.3V of your programmer! This has already killed multiple mainboards.
26
39
27
40
Make sure you hold the powerbutton or connect a jumper to the power button pins while flashing the firmware, as the STM might release the power latch and switches itself off during flashing. Battery > 36V have to be connected while flashing.
28
41
@@ -46,6 +59,10 @@ Then you can simply flash the firmware:
@@ -56,7 +73,7 @@ If the motors do something, but don't rotate smooth and quietly, try to use an a
56
73
57
74
Nunchuck not working: Use the right one of the 2 types of nunchucks. Use i2c pullups.
58
75
59
-
Nunchuck or PPM working bad: The i2c bus and PPM signal are very sensitive to emv distortions of the motor controller. They get stronger the faster you are. Keep cables short, use shielded cable, use ferrits, stabalize voltage in nunchuck or reviever, add i2c pullups. To many errors leads to very high accelerations which triggers the protection board within the battery to shut everything down.
76
+
Nunchuck or PPM working bad: The i2c bus and PPM signal are very sensitive to emv distortions of the motor controller. They get stronger the faster you are. Keep cables short, use shielded cable, use ferrits, stabilize voltage in nunchuck or reviever, add i2c pullups. To many errors leads to very high accelerations which triggers the protection board within the battery to shut everything down.
60
77
61
78
Most robust way for input is to use the ADC and potis. It works well even on 1m unshielded cable. Solder ~100k Ohm resistors between ADC-inputs and gnd directly on the mainboard. Use potis as pullups to 3.3V.
62
79
@@ -67,8 +84,16 @@ Most robust way for input is to use the ADC and potis. It works well even on 1m
67
84
68
85
Have a look at the config.h in the Inc directory. That's where you configure to firmware to match your project.
69
86
Currently supported: Wii Nunchuck, analog potentiometer and PPM-Sum signal from a RC remote.
87
+
A good example of control via UART, eg. from an Arduino or raspberryPi, can be found here:
If you need additional features like a boost button, have a look at the while(1) loop in the main.c
71
91
92
+
### Additional Hardware
93
+
94
+
*[breakout/interconnect boards](https://github.com/Jan--Henrik/hoverboard-breakout) Breakout/Interconnection boards for hoverboard hacking.
95
+
72
96
### Projects based on it
73
97
*[bobbycar-optimized firmware](https://github.com/larsmm/hoverboard-firmware-hack-bbcar) based on this one with driving modes, acceleration ramps and some other features
74
98
*[wheel chair](https://github.com/Lahorde/steer_speed_ctrl) controlled with a joystick or using a CC2650 sensortag to control it over bluetooth with pitch/roll.
99
+
*[TranspOtterNG](https://github.com/Jan--Henrik/transpOtterNG) TranspOtter is an open source semi self driving transportation platform based on hoverboard hardware
0 commit comments