Hoverboard Robotics Tutorial Part 2: Hacking the Control Board Firmware

Ғылым және технология

If you find my videos helpful, you can say thank you and help me to make more tutorials with a cup of coffee or by picking up a copy of Practical Robotics in C++. Thank you for your support!
www.buymeacoffee.com/practica...
Practical Robotics in C++: amzn.to/3CJAqHs
Joystick: amzn.to/3qvE579
ST-Link V2 programmer: amzn.to/3wb43R0
As an Amazon Associate I earn from qualifying purchases.
In this video, I cover how to hack to the control board with new firmware so you can configure it to respond to a joystick or serial commands instead of its normal hoverboard behavior programmed at the factory.
** LINKS FROM THE VIDEO **
ROS Hoverboard Control: • Hoverboard Robotics Tu...
Joystick Hoverboard Control: • Hoverboard Robotics Tu...
Niklas Fauth Firmware: github.com/NiklasFauth/hoverb...
Niklas Fauth/Jan Henrik Moving Objects video: • GPN18 - HowTo: Moving ...
Emanuel Feru Firmware: github.com/EmanuelFeru/hoverb...
********************************
** Try These Chip Unlocking Commands **
openocd -f interface/stlink-v2.cfg -f target/stm32f1x.cfg -c init -c "reset halt" -c "stm32f1x unlock 0"
openocd -f interface/stlink-v2.cfg -f target/stm32f1x.cfg -c init -c "reset halt" -c "mww 0x40022004 0x45670123" -c "mww 0x40022004 0xCDEF89AB" -c "mww 0x40022008 0x45670123" -c "mww 0x40022008 0xCDEF89AB" -c "mww 0x40022010 0x220" -c "mww 0x40022010 0x260" -c "sleep 100" -c "mww 0x40022010 0x230" -c "mwh 0x1ffff800 0x5AA5" -c "sleep 1000" -c "mww 0x40022010 0x2220" -c "sleep 100" -c "mdw 0x40022010" -c "mdw 0x4002201c" -c "mdw 0x1ffff800" -c targets -c "halt" -c "stm32f1x unlock 0"
openocd -f interface/stlink-v2.cfg -f target/stm32f1x.cfg -c init -c "reset halt" -c "mww 0x40022004 0x45670123" -c "mww 0x40022004 0xCDEF89AB" -c "mww 0x40022008 0x45670123" -c "mww 0x40022008 0xCDEF89AB" -c targets -c "halt" -c "stm32f1x unlock 0"
**********************************************
Practical Robotics in C++ : learn to build autonomous robots. Now available on Amazon in most markets, or the publisher's web store!
Amazon U.S.: www.amazon.com/dp/9389423465/...
Barnes and Noble:
www.barnesandnoble.com/w/prac...
BPB Publications:
bpbonline.com/products/practi...
Amazon Canada:
www.amazon.ca/Practical-Robot...
Amazon UK:
www.amazon.co.uk/Practical-Ro...
Amazon Germany:
www.amazon.de/Practical-Robot...
Amazon Italy:
www.amazon.it/Practical-Robot...
Amazon Mexico:
www.amazon.com.mx/Practical-R...
Amazon Japan:
www.amazon.co.jp/-/en/Lloyd-B...
Amazon Australia:
www.amazon.com.au/Practical-R...
Practical Robotics in C++ teaches real autonomous robotics without the reader needing a university degree to follow the tutorials. Features the Raspberry Pi. Topics covered include:
- Choosing and setting up a computer for robotics
- Electronics for Robotics
- Buying, building, and hacking robots
- Motors: Different types, how to control them
- Communications with sensors and other devices
- Robot control theory and controller design
- Mapping and Autonomous Path-Planning
- Autonomous motion
- Robot tracking and localization
- Sensors for robotics
- Computer Vision
- Sensor Fusion
- Final project: Build and program a complete autonomous robot!
*****************************************************************************

Пікірлер: 65

  • @gbabe8023
    @gbabe8023 Жыл бұрын

    These video series are gold, thank you so much for them

  • @victorreppeto7050
    @victorreppeto70503 ай бұрын

    I don't know how many people have told you this but you're very good at explaining these instructions. You're very succinct and it makes it very easy to follow what you're saying.

  • @rukey3001
    @rukey30012 жыл бұрын

    Awesome… 👏 can’t wait for next video..

  • @robertgreen9236
    @robertgreen92362 жыл бұрын

    Thank you for the great video series, it's prompted me to look into ROS more seriously! Just a note that if the board is powered from battery, then the 3V3 jumper should be disconnected from the ST-Link adapter. Hasn't happened to me but Feru/Fauth mention in wiki that it can damage board if both the 36V battery and the 3V3 debug line are connected.

  • @PracticalRobotics

    @PracticalRobotics

    2 жыл бұрын

    What I understood is not to try to power the board from the programmer, so I've tried to take care to power the board before plugging in the st-link. I have failed at remembering at times, though, and it is in fact safest to just not connect that 3.3v wire. I wish KZread would let us overlay corrections to existing videos. Hopefully people read your comment - thank you!

  • @tjaartkotze4394
    @tjaartkotze43942 жыл бұрын

    Love the way you share. Thanks

  • @davebooth9871
    @davebooth98712 жыл бұрын

    Brilliant video, very useful for GPIO labelling (which I found lacking on the original github). One thing I'd mention, I struggled with "Low Power Mode" errors when using windows ST Link application. Ended up resolving that by upgrading the USB ST Link V2 device's firmware using the ST Link app, then it worked on flashing the hoverboard firmware.

  • @PracticalRobotics

    @PracticalRobotics

    2 жыл бұрын

    That's interesting! I have not tried the Windows ST Link app - thank you for helping any others avoid a little headache!

  • @GoatZilla
    @GoatZilla Жыл бұрын

    When you pull the PCB to solder the header on, that's a good time to thread the existing frame mounting holes on the aluminum backing for M5.

  • @marosmartin7762
    @marosmartin77622 жыл бұрын

    It works great! I have changed TX to pin 3 on Arduino UNO, than I calibrate howerboard and it starts running, great :)

  • @PracticalRobotics

    @PracticalRobotics

    2 жыл бұрын

    Glad you figured it out!

  • @marosmartin7762

    @marosmartin7762

    2 жыл бұрын

    @@PracticalRobotics Thanks much :) I have one question regarding rc control, I do not understand this comment in firmware config.h "Right sensor board cable. Connect PA2 to channel 1 and PA3 to channel 2 on receiver." Right sensor is PB10 and PB11 and 5V tolerant not PA2 and PA3, it is good commented? or is there a mistake?

  • @crystygiura8094

    @crystygiura8094

    Жыл бұрын

    Hi, i don't understand how should I connect the pins to arduino and change the code

  • @adeebazadsheriff
    @adeebazadsheriff Жыл бұрын

    Hey there. @6:22 Which software/editor did you use to do the git clone thing?

  • @marosmartin7762
    @marosmartin77622 жыл бұрын

    I have found this: 3 beeps "(low pitch): Serial communication timeout. Check possible reasons/troubleshooting tips in the wiki section for USART variant", I try to check it :)

  • @aleksey4314
    @aleksey4314 Жыл бұрын

    Hello, do you know how to invert the rotation of one of the motor? I use USART option with arduino. I tried to add #define INVERT_L_DIRECTION from another setting, but nothing changes.

  • @KnutMenschenfreund
    @KnutMenschenfreundАй бұрын

    Thanks a lot for the great tutorial! I have two questions: 1) Can I buy any hoverboard from Ebay/Amazon to run the alternative firmware? I.e. do all versions have more or less the same main board compatible to the available hacked firmware? 2) Does the hoverboard controller board support precise monitoring of the motor angle? I.e. are the hall sensors read as analog values to compute the exact position rather than just six 1/0 states per magetic cycle? And do the alternative firmewares, such as the FOC control provide these information? I am going to build a robot that should also be able to move rather slow but with very high precission, say in the rage of a few milimeters, to pic up very small objects and I wonder if the hoverboard is a good basis for my project.

  • @WhyNotCycles
    @WhyNotCycles Жыл бұрын

    Hello! Great tutorial! Very useful and understandable. For my project I am trying to use a 7s, 29v battery. I change the settings (BAT_CALIB_REAL_VOLTAGE & BAT_CELLS) but I don't know what else to do to avoid automatic shutdown. I was trying to find BAT_CALIB_ADC for my set up, but I couldn't find a way to successfully connect through the right side serial cable to the computer to read the value of this Any suggestions are more than grateful! Thanks again.

  • @PracticalRobotics

    @PracticalRobotics

    Жыл бұрын

    Hi, you need to adjust the values in config.h on lines 83-88. The 3 digit numbers are tenths of volts (390 = 39.0 volts, etc). Line 88 is set to shut down at 33.7 volts. Find safe and acceptable voltages for your battery and change those 3 digit values and you should be good to go.

  • @stiripescurtpedoi6241
    @stiripescurtpedoi62412 ай бұрын

    Can you use the controllers on the original board but not with the hacked uC but with an arduino board?

  • @pomanprod
    @pomanprod Жыл бұрын

    I discovered that if you connect the 3.3V on the four new pins you will fry your board. Better to remove the power on button and connect the two pins together to keep the board powered on while you are flashing.

  • @dicoalexiss.1878

    @dicoalexiss.1878

    6 ай бұрын

    can i program the board without the battery plug in? (the hoverboard that I bought have battery issues)

  • @pomanprod

    @pomanprod

    6 ай бұрын

    I tried to do it without battery but couldn’t do it. Maybe plug the charger in?

  • @davebooth9871
    @davebooth98712 жыл бұрын

    Notes from trying to get this to work myself: Use an arduino UNO. Mega does NOT work without code change as software serial pins have known limits on that device. Also You mention it uses TX pin. To be specific, the TX pin used is a software pin and is actually digital pin 3, not the pin marked TX on the board.

  • @PracticalRobotics

    @PracticalRobotics

    2 жыл бұрын

    Thank you for catching that! Pins 2 for RX and 3 for TX are the pins that I used but for some reason I thought that I made the change when I programmed the Arduino I've been using a while back. I don't have a Mega around to test, but I think changing line 34 in the hoverserial.ino sketch to SoftwareSerial HoverSerial(0,1); should make it work with the labeled RX, TX pins on Uno, Mega, and Nano at least.

  • @jdow1234567
    @jdow1234567 Жыл бұрын

    Very useful video. I'd like to follow along but I've only been able to find hoverboards with split control boards (I've bought 4 now). Can you give the manufacturer and model of the hoverboards you've used that have the single board controller? Much appreciated!

  • @chriswf

    @chriswf

    Жыл бұрын

    Yeah a lot of hoverboard brands don't allow flashing :( They don't have the pins for it. I've switched to using an ECS that detects hall sensors ($16 on Ebay or Amazon).

  • @harishrajamani4922
    @harishrajamani49222 жыл бұрын

    I'm trying to flash but gd32f103c8t6 is not getting flash. Any suggestions how to do it properly step by step to write the firmware

  • @ouedzemdigital933
    @ouedzemdigital9338 ай бұрын

    Hello , please can you put the link of the firmware complied for control using USART3

  • @c.ciprian6143
    @c.ciprian61432 жыл бұрын

    Thumb up and sucribed. Could you please confirm that hall sensor are enabled and not canceled. I am asking beacause of the same speed while avance fwd and bckwrd. Great video!

  • @PracticalRobotics

    @PracticalRobotics

    2 жыл бұрын

    Thanks! I am certain the hall sensors are in use. The device is perfectly capable of the same speed forward or reverse, it just depends on what signal you are sending it.

  • @raybalmer5966
    @raybalmer59662 жыл бұрын

    Great video, I ordered your book, can't wait to get it. Everything is working with the joystick input on the left cable (3.3v) side but I can not change the config.h file to used the right cable (5v) side. In the config.h file I uncommect line 16 to use the variant ADC (comment line 14 variant usart). Next in section Variant ADC settings line 264. I make sure line 293 & 294 are uncommected (#define control serial usart 3 & #define feedback serial usart 3). What am I forgetting?

  • @PracticalRobotics

    @PracticalRobotics

    2 жыл бұрын

    Thanks! I don't think it matters for this part but just to be sure I look at the right one, are you using Feru or Makarov firmware? And are you trying to input serial to usart3? If so, also uncomment line 287 #define DUAL_INPUTS. If you are wanting debug serial data out, make sure 287 IS commented and uncomment 299 #define DEBUG_SERIAL_USART3 if it is not already.

  • @raybalmer5966

    @raybalmer5966

    2 жыл бұрын

    @@PracticalRoboticsI am using Feru and the main interest is to connect the arudino uno two outputs to the right cable (long cable & 5volt input). Question, does dual input mean like a joystick? I didn't have the dual input uncomment with the joystick left cable. I don't need debug.

  • @PracticalRobotics

    @PracticalRobotics

    2 жыл бұрын

    @@raybalmer5966 ​ Dual input means you want to use both the left input for one type of control and the right input for another type of control. Like.. left for joystick (ADC) and right for serial control. What do you mean "Arduino two outputs?" Do you mean with the rx and tx serial? If so, you want to use variant USART, not variant ADC (unless you also intend to hook up potentiometers to the left inputs aka usart2). You don't want to define dual inputs unless you have both hooked up - leaving the adc floating will probably make things go nuts (see video 3b kzread.info/dash/bejne/o2hpk7mddbPRmtI.html). For just sending serial commands via arduino, define variant usart and define both control and feedback usart3. Make sure you comment out anything in that section defining usart2.

  • @mirekcolakov1730
    @mirekcolakov17302 жыл бұрын

    Great video, thank you. I followed it all and managed to flash it via my Rpi4, but Im afraid damaged the motherboard. It just does not power up now. Also, any idea how to flash the hoverboard that has no central motherboard just two boards on the sides?? do I have to flash both? Thanks

  • @PracticalRobotics

    @PracticalRobotics

    2 жыл бұрын

    Hmm... I'm not sure since I can't see your setup. Did you hold the power button in during the programming? And just to clarify, when you are powering the board on, are you pressing and releasing the button or putting some sort of jumper? The action to power on/off should be just a momentary connection/button press. With those out of the way, at 7:45 I mention an option for alternate pin mapping. I haven't seen a board that needed it yet but it must exist - if you can reflash the board and get jolly good and it still won't power up, perhaps you have one that has the alternate pin mapping. If so, you'd need to change the line "#define BOARD_VARIANT 0" to "#define BOARD_VARIANT 1" and hopefully that fixes it. Tracing the pin mappings is a tedious process but that is the safest way to be sure.

  • @PracticalRobotics

    @PracticalRobotics

    2 жыл бұрын

    For the split control boards, there is at least one firmware hack for those at github.com/flo199213/Hoverboard-Firmware-Hack-Gen2, but none of the three hoverboards I've seen with split main boards have boards that match the photos in that project. Instead of taking the time to trace the STM32 pins to see if it would still work or to make the necessary pin number changes, I just bought a combined board for $25-30 U.S. The combined board is more suitable for ROS robotics (or at least the work needed to implement is drastically reduced because much of it is already done) so that is all I've bothered to mess with.

  • @mirekcolakov1730

    @mirekcolakov1730

    2 жыл бұрын

    @@PracticalRobotics thanks for your answer, I had big plans with the motors and have 8 of them now. I wanted to avoid buying the expensive controller or the cheap one that is not precise...otherwise YES I did hold down the power button. Also I did try the BOARD_VARIANT 1 no success... the board I think is bad also resists the wheels being pushed btw. I tried to connect Arduino just as you did, but nothing happened at all.

  • @brooklyn_uav4589
    @brooklyn_uav45892 жыл бұрын

    Awsome video how long b4 the next video drop?

  • @PracticalRobotics

    @PracticalRobotics

    2 жыл бұрын

    Thanks! I have the footage shot but had to deal with a big emergency home repair - I hope to have it edited and released by this weekend!

  • @brooklyn_uav4589

    @brooklyn_uav4589

    2 жыл бұрын

    @@PracticalRobotics Sorry to here that hopefully the repairs went well.

  • @PracticalRobotics

    @PracticalRobotics

    2 жыл бұрын

    @Booklyn_UAV : Part 3A is up! kzread.info/dash/bejne/c6yOpM6yo8SWnto.html

  • @bartvanderhaagen986
    @bartvanderhaagen986 Жыл бұрын

    I think this tutorial is bringing such a great opportunity for a lot of people to get into robotics cheap and not to hard to start, with. This could make the robotics community grow fast. Thanks for sharing and I hope to find you on LinkedIn

  • @raybalmer5966
    @raybalmer59662 жыл бұрын

    Thank you for a very useful video. I tried to program a new mother board using windows 7 with bad results. Could I get you to program a board for me, I will send the board to you or if you wish, I would be glad to purchase the board from you. I was wanting to build my uncle a hoveboard wheel chair that he could use with a joystick. The firmware looks very good, but I need a working mother board. Thanks you.

  • @PracticalRobotics

    @PracticalRobotics

    2 жыл бұрын

    I'd be willing to help but I am concerned that there are often things in the firmware that will need tweaking as the build and testing progress. Speeds might need to be adjusted and recently someone who built a riding thing mentioned that the board shuts down if the rider goes from full speed to letting go of the joystick, presumably because of overcurrent. Although I doubt a wheelchair should ever go 20+ kph, if we need to make adjustments to the firmware, test, and repeat I'm afraid it won't work very well long distance.

  • @yohanaxelmorenosanchez
    @yohanaxelmorenosanchez2 ай бұрын

    In case someone is struggling with the serial communications with the Arduino / RPI, connect the ground of the hoverboard motherboard to the ground of the Arduino /rpi, otherwise you will become inconsistent communication and weird behaviour, is you are using a buck converter or sharing the same power from the motherboard you do not belong to the simple mortals I am talking to 😅

  • @pogssolabaofficial1452
    @pogssolabaofficial1452 Жыл бұрын

    Good day, I'd watched a lot of your videos regarding hoverboard firmware hacked and followed your video on how to install the firmware hack into the motherboard. But unfortunately the motor only runs forward and reverse and I couldn't turn it right and left. Since I'm not good in computer, is possible if you could help me program my hoverboard to run the way it should be. Just send you the motherboard and program the firmware. And let me know how much charge for your service. Sorry I'm not that good in computer. Thank you very much

  • @marosmartin7762
    @marosmartin77622 жыл бұрын

    Hi, great video :) But I have issue :( I have flashed the firmware from Platformio with sucess result, also I change on Arduino UNO to SoftwareSerial HoverSerial(0,1); But when I connect all together and turn the board on, the board still makes noise "beep beep beep" in cycles, where may be the problem?? Thanks :)

  • @user-ql5lu8mp5n

    @user-ql5lu8mp5n

    2 жыл бұрын

    Hi , i also have this problem , you solved this ?

  • @marosmartin7762

    @marosmartin7762

    2 жыл бұрын

    @@user-ql5lu8mp5n Hi, I had no serial communication, that is the reason of 3 times "Beep". Now all works for me.

  • @gbabe8023

    @gbabe8023

    Жыл бұрын

    @@marosmartin7762 how did you manage to stablish it? im faceing the same issue, just 3 "beeps", have a nice day :))

  • @marosmartin7762

    @marosmartin7762

    Жыл бұрын

    @@gbabe8023 Hi, you have no UART signal, you have to check if you have correct UART Arduino connection

  • @user-ql5lu8mp5n
    @user-ql5lu8mp5n2 жыл бұрын

    Hi , i did this project and after connect arduino the hoverboard only beeping and not wheels moving Help please

  • @PracticalRobotics

    @PracticalRobotics

    2 жыл бұрын

    Hi, beeping usually indicates either not enough voltage to the board or the hall sensors not connected. Check for loose wires!

  • @bratan007

    @bratan007

    2 жыл бұрын

    Try port D3 on Arduino instead of TX

  • @stiripescurtpedoi6241

    @stiripescurtpedoi6241

    2 ай бұрын

    Ok, I just want to use the controllers that already are on the original board, can I bypass the hoverboard uC brain and use arduino to spin the motors? I don't want to buy two controllers as there are already in the hoverboard electronic. Thanks.

  • @mirekcolakov1730
    @mirekcolakov17302 жыл бұрын

    What I was trying to ask is How do I know I destroyed the motherboard. If flashing was successful and I can do it again, getting the jolly good message, does that mean the board is still alive??

  • @PracticalRobotics

    @PracticalRobotics

    2 жыл бұрын

    I had one board go bad (I think due to my dropping a screw while it was powered). That board would still flash and give me jolly good, but would not move the motors (It would, for some reason, still resist being pushed). It still gave me the power on and power off sounds though.

  • @mirekcolakov1730

    @mirekcolakov1730

    2 жыл бұрын

    @@PracticalRobotics I literally just now found out that the USART 3 red and black cables are swapped!! I hope this will lead me somewhere. Thanks a lot Im very excited about the whole thing, and this was a big setback

  • @mirekcolakov1730

    @mirekcolakov1730

    2 жыл бұрын

    @@PracticalRobotics And now I compiled again and found that if I try to flash and connect stink into raspberry it makes the rip display go black and act weird. When I measured voltage between the 3.3V and GND on the motherboard header, when its powered and jumper is connecting the switch, it only reads 0.25V and slowly decreases ... do you think THAT is a proof that the board is dead??

  • @PracticalRobotics

    @PracticalRobotics

    2 жыл бұрын

    @@mirekcolakov1730 Ah...good find that the wires were swapped, be careful of that red wire on the USART - DANGER for you FTDI or Raspberry Pi or Arduino!. Sad news that it does sound like the board is dead. Or..at least the 3.3V regulator is dead. Your symptoms all sound like on my board that went bad although I didn't go as far as to check voltage at the 3.3v. This makes sense, though - the programmer can power the chip to program it and give you a jolly good, but without the 3.3v regulator on the board it can't work when trying to operate. I'd be curious if your board would work if you used another 3.3v regulator or buck converter powered from the red 14v wire on one of the USARTs and connected the 3.3 out to the 3.3v pin on the programming header. I don't have time to test on my broken board right now. (I would definitely use NOT use anything off your computer's USB... I would use something you won't be too sad about burning up if you have a more serious short). If that works you could do a hack solder-job to make it permanent or track down the regulator on board. In Niklas Fauth's video I think he may point out the regulators. There are also schematics in Feru's firmware Github.

  • @KamalNathan121212

    @KamalNathan121212

    2 жыл бұрын

    @@mirekcolakov1730 Hey i think we have the same board my cables were swapped too... readin your comments really helped. But i have a problem now... when i switch ON the board both motors spins constantly and the datas are shown in serial monitor but the commands to control is not working. isn't it "Send(steer,speed)" ? i'm using arduino mega with Serial1 it just wont respond to the commands... did i miss somthing? please help

  • @roxyu3384
    @roxyu33842 жыл бұрын

    Hacking is something different… you just flash a firmware bro

  • @mogamadtromp9374
    @mogamadtromp9374 Жыл бұрын

    Hi, Thanks for a great tutorial. I came so far as to clear the stm32 chip. I got ready to flash the new firmware, went into the “~/hoverboard-firmware-hack-FOC” directory and typed in “make”. I got an error which was saying the following: /bin/sh: 1: arm-none-eabi-gcc: not found make: *** [Makefile: 152: build/stm32f1xx_hal flash.o] Error 127 How can I resolve this error?

Келесі