my online compiler: hoverboard firmware with bidirectional serial communication

  Рет қаралды 3,935

robo durden

robo durden

5 жыл бұрын

pionierland.de/hoverhack
Arduino Pro Mini 3.3V source: pionierland.de/hoverhack/hove...

Пікірлер: 85
@janrottiers9420
@janrottiers9420 4 жыл бұрын
Hi, First of all very nice work and great compiler! I flashed the main board with your RoboDurden firmware and works fine. Since I'm working on a lab power supply I did the calibration on 20V and set the corrected values in the config file (bat_calib_real and bat_calib_adc) as per calibration proces. I also educed the cut off voltage for the battery to match the 20V power. I'm running your Arduino program and works fine however the only thing is that I get far more CRC errors ('X') in the feedback on my screen than you. Any idea what could be the cause? Could it be motor interference? Cheers
@robodurden
@robodurden 4 жыл бұрын
i am in a hurry at the moment. I fear that i also get more crc errors in real time conditions. Maybe sometimes even a few seconds before new realtime data reaches the Arduino. No big problem for me but i would be happy if YOU find an improvement. Tell me your ideas then i might be happy to get involved :-)
@A-tech
@A-tech 4 жыл бұрын
hi, great compiler, im using a firmware version called bewegungsappar, im not sure which one it came from and has no config file so i cant compare, im using 2x DAC from an arduino to act as potentiometers, it has forwards, reverse and steers by changing speed between the 2 wheels, i see in the NiklasFauth version it has a motor test mode that over rides all controls, can i just delete that part to make it use potentiometer input then i can use that version instead? also it mentions using button 1, which i assume would be a push button to the arduino, then the arduino sending 0 or 1 to the ADC1 pin? are there other pins that can be used as inputs? any help with this would be great, i also have a youtube channel doing hoverboard motor things, thanks
@robodurden
@robodurden 4 жыл бұрын
Simply click the ADC preset that my online compiler generates and the config.h is modified accordingly. The control_test will be removed and the control_adc be activated. The button1 is only a boost mode when potentiometer is at full throttle ? Watch the long video from Niklas.. For Arduino controller I would advise my RoboDurden uart fork..
@jesperbergvall7714
@jesperbergvall7714 4 жыл бұрын
Hi Robo! Again thanks for your excellent on line compiler! I want to control my HB wheels with an arduino in an robot project. What version do you recommend I use, "p-h-a-i-l" or "bipropellant". On the github it says that "p-h-a-i-l" is obsolete.
@robodurden
@robodurden 4 жыл бұрын
I control my controller with an Arduino Pro Mini 3.3V and I definitely recommend my fork of the obsolete PHIL fork. Simply select the RoboDurden code at my online compiler. Then also follow the link to my GitHub and download the Arduino example code :-) Let me know when you run into trouble.
@jesperbergvall7714
@jesperbergvall7714 4 жыл бұрын
@@robodurden Thanks! I'll play with it tonight. I'm building a robot lawnmower and I will try to modify the "ArduMower" project code to control HB-wheels instead of PWM control and geared motors as they use today. www.ardumower.de
@csqgb9801
@csqgb9801 Жыл бұрын
why my board gyroscope not work at all when i connect with SWD?
@notbotdotnet
@notbotdotnet 4 жыл бұрын
Thanks for all the effort you put in! Still, I can't get the Serial Communication to work, even after digging deep in the main.c - everything is set up fine, communication happens, and the motors turn on, they even change direction when supposed to, BUT at a steady speed. No acceleration, no deceleration. I can confirm that data goes through, but somehow it seems not to get parsed correctly. Feedback in the Serial Monitor is flawless and shows the constant speed: speedL: 0.00 speedR: 0.00 skippedL: 0 skippedR: 0 °C: 22 U: 25.29 lA: 0.28 rA: 0.16 speedL: -0.49 speedR: -0.51 skippedL: 0 skippedR: 0 °C: 22 U: 25.54 lA: 0.32 rA: 0.16 speedL: -0.99 speedR: -0.96 skippedL: 0 skippedR: 0 °C: 22 U: 25.79 lA: 0.28 rA: 0.16 speedL: -1.48 speedR: -1.32 skippedL: 0 skippedR: 0 °C: 22 U: 26.02 lA: 0.36 rA: 0.44 speedL: -2.00 speedR: -1.80 skippedL: 0 skippedR: 0 °C: 22 U: 26.25 lA: 0.14 rA: 0.32 speedL: -2.39 speedR: -2.18 skippedL: 0 skippedR: 0 °C: 22 U: 26.47 lA: 0.38 rA: 0.24 speedL: -2.53 speedR: -2.53 skippedL: 0 skippedR: 0 °C: 22 U: 26.68 lA: 0.38 rA: 0.32 speedL: -3.33 speedR: -3.15 skippedL: 0 skippedR: 0 °C: 22 U: 26.87 lA: 0.62 rA: 0.30 speedL: -3.21 speedR: -3.03 skippedL: 0 skippedR: 0 °C: 22 U: 27.01 lA: 0.50 rA: 0.10 speedL: -3.44 speedR: -3.13 skippedL: 0 skippedR: 0 °C: 22 U: 27.19 lA: 0.70 rA: 0.10 speedL: -3.04 speedR: -3.03 skippedL: 0 skippedR: 0 °C: 22 U: 27.37 lA: 0.38 rA: -0.04 speedL: -3.07 speedR: -3.15 skippedL: 0 skippedR: 0 °C: 22 U: 27.54 lA: 0.18 rA: 0.06 speedL: -3.76 speedR: -3.20 skippedL: 0 skippedR: 0 °C: 22 U: 27.71 lA: 0.48 rA: 0.28 speedL: -3.46 speedR: -3.24 skippedL: 0 skippedR: 0 °C: 22 U: 27.87 lA: 0.56 rA: 0.38 speedL: -3.09 speedR: -3.06 skippedL: 0 skippedR: 0 °C: 22 U: 28.01 lA: 0.40 rA: 0.26 speedL: -3.14 speedR: -3.04 skippedL: 0 skippedR: 0 °C: 22 U: 28.15 lA: 0.54 rA: 0.36 speedL: -3.08 speedR: -3.20 skippedL: 0 skippedR: 0 °C: 22 U: 28.30 lA: 0.48 rA: 0.12 speedL: -3.31 speedR: -3.16 skippedL: 0 skippedR: 0 °C: 22 U: 28.43 lA: -0.08 rA: 0.70 speedL: -3.09 speedR: -3.18 skippedL: 0 skippedR: 0 °C: 22 U: 28.57 lA: 0.06 rA: 0.26 speedL: -3.39 speedR: -3.21 skippedL: 0 skippedR: 0 °C: 22 U: 28.69 lA: 0.54 rA: 0.10 speedL: -3.21 speedR: -3.02 skippedL: 0 skippedR: 0 °C: 22 U: 28.81 lA: 0.32 rA: 0.72 Any ideas would be appreciated! ADC control btw works fine...
@notbotdotnet
@notbotdotnet 4 жыл бұрын
Ah nice, after 2 days of debugging, as soon as you dare to ask sb, you find the solution. Seems steer and speed are mixed up in the example .ino or there is a switch in config that I missed. Sorry to bothered you. =)
@robodurden
@robodurden 4 жыл бұрын
@@notbotdotnet yes I know this law too good. It is because once you asked you start thinking how the other one would tackle the problem and this gives you new ideas. Will check the ino. Would be nice if you were a bit more concrete on the supposed bug. And take a look at the new firmware I added. I guess I will switch over to it myself when I find the time. It also has a reliable serial protocol but probably superior efficiency.
@notbotdotnet
@notbotdotnet 4 жыл бұрын
@@robodurden Switching to the oop version? Was not sure whether this is finished already. Will give it a try! The "bug" is easily described: If I switch steer and speed in Send(), like: oCmd.steer = iSpeed; oCmd.speed = 0; everything works like a charm.
@robodurden
@robodurden 4 жыл бұрын
@@notbotdotnet NOT the OO-demo, i meant github.com/EmanuelFeru/hoverboard-firmware-hack-FOC Sorry i can not understand your bug behaviour. Maybe you swaped steer and speed in the struct definition either in the .ino or main.c - while testing. I use that exact Send() function for the Arduino Mini 3.3V in my solar car and my official main.c and it works correctly.
@notbotdotnet
@notbotdotnet 4 жыл бұрын
OK. That's untrue, either. With the original setting, it reacts on steer as supposed, it just does not seem to react on speed in any predictable way. Is there, by any chance, an option to just set motorspeedL and motorspeedR? This would be the most useful mode for most of the people I guess, as with that up and running you could build whatever you want on top...
@ashwinar4753
@ashwinar4753 4 жыл бұрын
hey, I wish to serially send data from jetson nano to stm32 ,is there any code available for jetson serial to send speed ,steer and crc values. 2)How should i send them,by integers or by bytes?
@robodurden
@robodurden 4 жыл бұрын
Get a cheap USB uart module and learn how send data via Linux serial out to it. When you succeeded receiving the data with the module you can use my firmware and study my Arduino code example.
@mdaravee
@mdaravee Жыл бұрын
is it possible to use flash using Arduino nano as ST LINK ?
@robodurden
@robodurden Жыл бұрын
asking google led me to git.jeelabs.org/embello/tree/projects/ask/stm32f1init Poor-man’s boot loader upload jeelabs.org/book/1546c/index.html But that seems to be the serial upload protocol and not the normal JTAG / SWD these $2 stlink-v2 clones use. I can not help you any further.
@mazenbahy5012
@mazenbahy5012 4 жыл бұрын
Hi! I have tried ur firmware and ur arduino code example and it working very well and I can steer the robot. But I wanna to steer the robot by giving it vr and vl by myself or by giving it angular and linear speed. I tried to search into the firmware code to see where you convert speed and angle to vr and vl so I can send them the values directly but I can see nothing. Can u give some ideas! or solution! Best Regards and thanks again.
@robodurden
@robodurden 4 жыл бұрын
speedL and speedR are set in main.c: at lines 472+ github.com/RoboDurden/hoverboard-firmware-hack/blob/master/src/main.c#L472 But you should stay with speed and steer and send speed = (vr+vrl)/2 and steer = (vr-vl)/2
@qazqaz6215
@qazqaz6215 4 жыл бұрын
Ни фига не понял, но круто!!!
@bekirbostanci
@bekirbostanci 4 жыл бұрын
can you show how do you connect arduino pins to mainboard please
@robodurden
@robodurden 4 жыл бұрын
In my hoverserial, Arduino pin 8 is set to be RX and pin 9 is set to be TX The Arduino RX has to be connected with the hoverboard TX and the Arduino TX with the RX of the hoverboard connector In my config.h by default the #define CONTROL_SERIAL_NAIVE_USART3 is enabled, so pin 8 has to be connected with the blue cable of the "right sensor board" and pin 9 with green cable of that right sensor cable. the right sensor cable is the short one i think. Have a look at raw.githubusercontent.com/NiklasFauth/hoverboard-firmware-hack/master/pinout.png and understand what i have just explained. Of course the GND pin of the arduino has to be connected to black GND wire of the sensor cable. Do not connect an positive voltage and make sure your arduino runs on 3.3V only and not on 5V !
@jesperbergvall7714
@jesperbergvall7714 4 жыл бұрын
I tried your Arduino code and it works like you show in the video clip. The wheels are running forward and then backward. But, your code is to complicated for me to understand and modify. There are no explanation or comments in the code what the different lines do. How would the simplest code for sending speed and steer look like? I might be better of going analog due to lack of brain cells. But that's not as fun :-)
@robodurden
@robodurden 4 жыл бұрын
If my hoverserial.ino is working then you only need to replace the lines in the loop function with your code. Simply call my void Send(int16_t iSpeed) Function where 1000 is full speed forward and -1000 is full speed backwards. If you need steer you can easily modify that simple function.
@speedox3771
@speedox3771 4 жыл бұрын
Could you do a video for the Wii nunchuck pacifically I already subscribed so I would know when you post it
@robodurden
@robodurden 4 жыл бұрын
i have no game equipment so can do no such video :-/ But i could show a message to ask for such a video to all users that choose that compile option on my online compiler :-)
@speedox3771
@speedox3771 4 жыл бұрын
@@robodurden thank you that would be appreciated I've done destroyed 4 hoverboard motherboard
@robodurden
@robodurden 4 жыл бұрын
@@speedox3771 as I live outdoors in that solar car it will take a few days to implement such a message System. You should search all the githubs that focus on that nunchuck controllers. There you should find your answers. I can only say that this controller is said to use the i2c bus. So search for 'Arduino Nunchuck' and you should find code to communicate via a cheap Arduino board. Then you can advance to connect the nunchuck to your fifth hoverboard controller and be confident to not burn it again..
@ramaprashath6324
@ramaprashath6324 4 жыл бұрын
For an application i need the motor to just spin forward and backward using serial communication from Arduino. i just tried different serial USART firmware combination from your website but nothing worked.which firmware combination will work for my application
@robodurden
@robodurden 4 жыл бұрын
I strongly recommend my RoboDurden fork (not the oo sketch) as it has a stable uart protocol and arduino code example. Try CONTROL_SERIAL_NAIVE_USART2 then you still have debug output on usart3. Make sure you do NOT apply 5V to usart2 (usb-uart module do so even they are jumpered to 3.3V). Only speed and no steer is exactly my solar car use case shown in this video (Arduino pro mini 3.3V, beware that esp8266 has non working softwareserial) :-)
@ramaprashath6324
@ramaprashath6324 4 жыл бұрын
@@robodurden Bro its working!!!! thanks for making it lot easier for us.for your Arduino pro mini 3.3V code it just spins forward for a while and switch to backwards. what command should be send to make it spin forward on "void send" .
@robodurden
@robodurden 4 жыл бұрын
@@ramaprashath6324 take a look at the loop function to understand how I use my send function to spin the motor forwards and backwards :-) Then start playing yourself.
@ramaprashath6324
@ramaprashath6324 4 жыл бұрын
@@robodurdenIn void send there is no command to make it spin backwards. whether this code is to just spin forward and backward ?
@robodurden
@robodurden 4 жыл бұрын
@@ramaprashath6324 simply read my previous answer again :-)
@mycodetemplates7782
@mycodetemplates7782 4 жыл бұрын
Please help, I just follow step by step you tutorial but I will try can't show serial data from sensor and just 1 wheels turn around..how the problem?? I'm using esp8266
@robodurden
@robodurden 4 жыл бұрын
I had the same problem with Esp8266 because softwareserial was not working correctly. I suggest you first connect a usb-uart module to verify that my firmware indeed sends back the motor data. Then you might try some custom softwareserial libraries out there. But you better move on to the Esp32 anyway. Then you have at least two hardware serials. You can also try the hardware serial of the esp8266 but that might conflict with debug output. When only one motor is spinning, you either send a wrong steer command, the motor is defective or the controller board broken. Try switching the motors to verify that the motors/board is not the problem.
@mycodetemplates7782
@mycodetemplates7782 4 жыл бұрын
@@robodurden thanks for your respond, I have try switching the motor but no problem the motor, seems to be the problem from the connection cable to the motor..if my motherboard is damaged ??? Because when I press the button on/off led in motherboard can't off
@robodurden
@robodurden 4 жыл бұрын
@@mycodetemplates7782 you should first install the original firmware from Niklas and choose the demo setup where motors only spin backwards and forwards. Then you can see if the controller board is defective. The on/off button is a bit strange. I too can not turn off the board but have to shut down the supply voltage.
@mycodetemplates7782
@mycodetemplates7782 4 жыл бұрын
@@robodurden if I use Niklas firmware...I not use esp8266 for spin, will default to spin?
@robodurden
@robodurden 4 жыл бұрын
@@mycodetemplates7782 select the Niklas firmware in my online compiler and make sure these lines are active (no // before the #define): // ###### MOTOR TEST MODE ###### // slowly move both wheels forward and backward, ignoring all inputs #define CONTROL_MOTOR_TEST #define CONTROL_MOTOR_TEST_MAX_SPEED 300 // sweep slowly from -MAX_SPEED to MAX_SPEED (0 - 1000)
@user-oi2xo8ve8q
@user-oi2xo8ve8q 4 жыл бұрын
Hi can some one help me about PPM.I am configurating it's on config.h but nothing is moved.i tyr so many times.
@robodurden
@robodurden 4 жыл бұрын
Ppm is not pwm! For ppm use the original Niklas firmware. first compile without modifications to see the test mode working. Watch my first Video tutorial here. Also use a USB UART module to read the logging data. I have no rc controller so I never tested ppm.
@user-oi2xo8ve8q
@user-oi2xo8ve8q 4 жыл бұрын
@@robodurden I knew about ppm and pmw, I connected arduino joystick for test and it worked well. Thank you for reply, will be testing more time)) On the Nikolaus github repo he wrote about two taps to enabled ppm mode i don't know what is it.
@robodurden
@robodurden 4 жыл бұрын
@@user-oi2xo8ve8q post link to the text so I can read these lines :-)
@user-oi2xo8ve8q
@user-oi2xo8ve8q 4 жыл бұрын
@@robodurden Thanks for debug idea. Acl(potantetiometr) work fine see in debug some number.I checked the working ppm with my arduino it also good. But the board doesn't see the signal from PPM device)If you can give me some advice i will appreciate you.
@robodurden
@robodurden 4 жыл бұрын
@@user-oi2xo8ve8q search the main.c for CONTROL_PPM and understand the debug output. Check the ppm input with dso oscilloscope.
@jesperbergvall7714
@jesperbergvall7714 4 жыл бұрын
Have you tried to add EmanuelFerus HoverHack to your online compiler? github.com/EmanuelFeru/hoverboard-firmware-hack He uses sinusoidal algorithm to drive the motors that I would like to try. I relay like your online compiler it saves me a lot of headache when trying to understand the "make" thing... Have you tried your Solar Car in the streets yet?
Building a Giant 3D printer to 3D print myself
17:14
Ivan Miranda
Рет қаралды 437 М.
Custom Keyboard From Scratch Part 2
17:13
Casual Coders
Рет қаралды 35 М.
THEY WANTED TO TAKE ALL HIS GOODIES 🍫🥤🍟😂
00:17
OKUNJATA
Рет қаралды 20 МЛН
когда повзрослела // EVA mash
00:40
EVA mash
Рет қаралды 4,1 МЛН
Became invisible for one day!  #funny #wednesday #memes
00:25
Watch Me
Рет қаралды 52 МЛН
hoverboard motor with chain drive
9:34
robo durden
Рет қаралды 7 М.
Intro to Hardware Reversing: Finding a UART and getting a shell
12:07
Tony Gambacorta
Рет қаралды 882 М.
Hacker's Guide to UART Root Shells
17:40
Flashback Team
Рет қаралды 466 М.
Better Split Hoverboard Gen2 GD32 Autodetect
8:38
robo durden
Рет қаралды 304
SHOCKING New AI DESTROYS GPT-4o (Open-Source Voice AI!)
8:17
AI Revolution
Рет қаралды 8 М.
Gearless Magnet Bike
17:57
Tom Stanton
Рет қаралды 6 МЛН
Controlling 3 Stepper Motors with the AccelStepper Library for Arduino
11:49
PART 52 || DIY Wireless Switch forElectronic Lights - Easy Guide!
1:01
HUBAB__OFFICIAL
Рет қаралды 30 МЛН
Хотела заскамить на Айфон!😱📱(@gertieinar)
0:21
Взрывная История
Рет қаралды 5 МЛН
ПОКУПКА ТЕЛЕФОНА С АВИТО?🤭
1:00
Корнеич
Рет қаралды 3,7 МЛН