Arduino project - Your Arduino Balancing Robot (YABR) - Part 3 - explaining the code

Поділитися
Вставка
  • Опубліковано 2 гру 2024

КОМЕНТАРІ • 159

  • @IncroyablesExperiences
    @IncroyablesExperiences 7 років тому +40

    Great video as always! You must be the only guy in the world who really make true engineering with Arduino... Both in coding and physics, it's pretty cool, congrats ;)

    • @hidoHido-vm4en
      @hidoHido-vm4en 7 років тому

      vous n'avez pas poster des nouveaux vidéos, j'ai attendu et je vois conditionnement vos vidéos, tes calculs la façons d’expliqué pas seulement théoriquement comme a enseignement marocain , mais aussi pratiquement, avez vos des nouveaux? un contact ? virement, vous nos manquer.

  • @KarstenFuhst
    @KarstenFuhst 7 років тому +1

    Electronic stuff has partly arrived, rest is in transit from China. I have made the frame from PMMA yesterday with the lasercutter at Hafven, the maker space in Hannover. Thanks for the teaching!

  • @richardfirthucsb
    @richardfirthucsb 7 років тому

    Thanks again for making this. I made this robot and haven't got it working yet, but the process of going through your code has already taught me a lot of new stuff.

  • @4lexDeLaCruz
    @4lexDeLaCruz 7 років тому +8

    Good job, this is one of the best arduino videos I've ever seen.

  • @GRIDSLER
    @GRIDSLER 4 роки тому

    Man: your channel es incredibly serious and rigorous.
    MY RESPECTS !!

  • @he1i0s
    @he1i0s 7 років тому +8

    Hey Joop, I found that system looks smoother (especially on low speeds) when I use 'left_motor = 5000/(pid_output_left);' (same for right) instead of piece of code with '405 - (1/(pid_output_left + 9)) * 5500; ... 400-pid_output_left etc'. I was confused about 405, 9, 5500 and figured out that it is better to use pid output as frequency (which is linear function of speed!) instead of pulse length (which is non-linear). So, after that we have freq like 5..400, and calculate pulse length=(1/freq)*1000 miliseconds, and step count: pulse_length/(20 microseconds). 20 microseconds is period of interrupt. In other words, it is 5000/pid_output_left.
    Why it is not 50000? it should be 50000, but we need extra speed, so we just use 10x faster, 5000.

    • @pawes7476
      @pawes7476 2 роки тому

      Can you show it in program? :D

  • @medvidekkrupicka1404
    @medvidekkrupicka1404 7 років тому +1

    One more thing to code: The postiton of the robot must only reflect the commads from the radio control, nothing else should matter. So if the robot is moved by external force (pushed or by gravity on a slope), it should remeber the number of steps needed to stabilize and move the same exact number of steps in oposite direction.
    Very nice video series. Very explanatory. Kudos!

    • @Joop_Brokking
      @Joop_Brokking  7 років тому +2

      I made the code as easy as possible so others can understand it and make there own features. The code is just to get you started and motivated to explore and learn.

    • @saxmanjosh
      @saxmanjosh 7 років тому

      You can't do that using only the hardware shown here. You would need encoders on each wheel

  • @Optasia3D
    @Optasia3D 7 років тому +1

    Really a incredible work. Will try make it. Have ordered parts. Till now all other discriptions give me less information. Great job.

  • @solidhit2
    @solidhit2 7 років тому

    Your videos are among the best, please don't stop making them.

  • @plymouthrovadventures.646
    @plymouthrovadventures.646 3 роки тому

    A fantastic set of videos on building this Balancing robot. Parts ordered. Will try and add a App control device to the code. Maybe a RC option as well.

  • @benjaminmclaws3477
    @benjaminmclaws3477 6 років тому +7

    I am curious what the 400 means in the code.

  • @pircdcd
    @pircdcd 7 років тому

    Thank for your share, I'd like to make an auto balancing robot for educational purpose and your code is the most efficient and clear I ever seen. Congrats.

  • @mostafaelshafie4550
    @mostafaelshafie4550 2 роки тому

    You're THE best at this!

  • @CreativeProductionzz
    @CreativeProductionzz 7 років тому +5

    It would be really interested if you could make a video about sending video from a camera with an arduino and a wifi chip or Bluetooth.

  • @pablocarlini8217
    @pablocarlini8217 7 років тому

    Greate Video. Building one today. One thing about diode current, motor current and diode current are not correlated as you explain because motor voltage is much lower than battery voltage...

  • @ghanshyambhat9978
    @ghanshyambhat9978 5 років тому

    Have you considered adding velocity feedback using the pulse count that drives the wheels as a proxy for velocity? Velocity feedback may improve stability of the robot and perhaps allow you to set velocity as a control input to the robot.

  • @Pavana_sai
    @Pavana_sai 7 років тому

    No doubt zoop you are rocking once again..

  • @EdwinFairchild
    @EdwinFairchild 3 роки тому +1

    great video, unfortunately for those of us not looking to copy and paste his code , some parts specially the mathematics is left unexplained.

  • @ahmedallam9612
    @ahmedallam9612 7 років тому

    Hello there Mr Joob, u are more than professional, thanks so much , keep uploading, great work

  • @eamonnculliton100
    @eamonnculliton100 5 років тому +2

    Hi, I was just wondering how to use the code you just want the bot to stand and not use a remote. say move forward from within the code. Its for a project I'm doing. I'm fine with it all except I'm not sure how to separate the controller pid code from the rest. Thanks

  • @ycmgxekwa
    @ycmgxekwa 7 років тому

    Brilliant tutorial and your editing skills are impressive.

  • @jorenbuyens3316
    @jorenbuyens3316 3 роки тому

    ik heb 1 klein vraagje. Is er een reden dat het laatste gedeelte, namelijk het stuk dat de puls uitvoert en de richting verandert, niet meer in de void loop staat?

  • @anonymus6267
    @anonymus6267 3 роки тому

    This is great. I will totaly 3D print some kind of robot and do somthing like this. I will try to combine this with ROS. The robot will then be able to map the room and travel from point A to B. Thanks

  • @steverichab
    @steverichab 4 роки тому

    Hello, I just completed both the balancing robot and the nun chuck. Both the robot and the remote pass the hardware test and the robot balances very well at start up. When I try the nun chuck control the robot does not respond. I know this a 2 year old project but I just discovered it and love it. I suspected it is the 2.4 gig serial transmitter so I replace them and still get no response and I am having trouble finding example programs to test them. Note I am using exactly the units specified and would really appreciate some advice on troubleshooting this last problem. Thanks in advance!

  • @phil9808
    @phil9808 7 років тому +1

    Hi Joop
    First of all I would like to thank you, this is brilliant, I built one. But, Can I ask if it is possible to change the 2.4ghz transceiver to a normal hobby R/C transmitter/receiver,
    Instead of the nunchuck and if so how ?, I am new to code and not very good
    Thank You

  • @zx10rheinzi
    @zx10rheinzi 5 років тому +1

    Sorry Joop, I appreciate your work and your very good explanation but the schematic here in your Part 3 - YABR-Video(3:56min) is NOT the same like the schematic in your web-site...! Here is the "FAULT"-PIN connected and at the schematic in your web-site the FAULT-PIN is NOT connected ! ...... Wich one should I use ? .......The web-site schematic don't work, connections are checked many times....current is set to 150mA....MPU-value is about 865.....-but motors do not move(NEMA17) . Now I'm not shure if I followed the "incomplet" schematic or the bigger Steppers are the reason for not working........Tomorrow I will try the Part3-Video-Schematic...........

    • @Joop_Brokking
      @Joop_Brokking  5 років тому

      Download the schematics from here: www.brokking.net/yabr_downloads.html
      The fault pin should not be connected. If you Google "DRV8825" you will find schematics that you can try.

  • @cagneymoreau4216
    @cagneymoreau4216 6 років тому

    7:02 is a bit confusing because it uses the number 8200. This number is approximately 8,192 according to mpu documents and I believe should be calibrated? or it may change the angle calculation. Took me a second to figure out that this number was coming from page 13 of mpu 6050 datasheet
    BTW, another awesome video!!

  • @ghanshyambhat9978
    @ghanshyambhat9978 5 років тому

    Hi Joop: My robot balances, but does not stay balanced. After a couple of minutes, it takes off, though I am using your code.
    I am wondering if I need to add velocity feedback using encoders or as I suggested in my earlier comment use the pulse count as a proxy for velocity feedback. I have tried using the pulse count as velocity feedback, but have not had any luck. I may have to spend more time fine tuning it. Your comments will be appreciated.

  • @nicshan
    @nicshan 4 роки тому

    hi! I've found some parameters were not declared in the code. e.g. TWBR, TCCR2A, TCCR2B , any reason? thanks.

  • @ranulfo102
    @ranulfo102 7 років тому

    AMIGO VOCÊ REALMENTE É UM EXPERT NESSE ASSUNTO, ADMIRO MUITO SUA INTELIGENCIA, TE DOU OS PARABÉNS POR SEUS VÍDEOS. SÓ FICO TRITE É PELO FATO DE NÃO ENTENDER SUA LÍNGUA. QUERIA MUITO MONTAR ESSE ROBÔ.
    ESPERO QUE O UA-cam BOLE UMA MANEIRA DE TRADUZIR OS VÍDEOS EM ÁUDIO, SERIA FANTÁSTICO

  • @keesnuyt8365
    @keesnuyt8365 7 років тому +2

    This is what your brain learns to do when you balance a broomstick ;) Again, an excellent video in this series.

    • @Joop_Brokking
      @Joop_Brokking  7 років тому +2

      The beauty is that the brain is indeed self learning. How cool is that ;-)

    • @thunderbolt997
      @thunderbolt997 7 років тому

      the brain is a very good programmer :D

  • @SamuelSoare
    @SamuelSoare 7 років тому

    outstanding work! you convinced me to subscribe

  • @sharedinventions
    @sharedinventions 7 років тому

    Very nice explanation. Thanks! I might recommend you my SoftTimer Arduino library as you can set a Task there to be run at every 4ms.

  • @pr.ahmedgaga5264
    @pr.ahmedgaga5264 7 років тому

    good job and interesting explanation of this part of code

  • @SithaSek
    @SithaSek 6 років тому

    Can you make the detail explaination about the step motor driver chip you used? thank for your great tutorials.

  • @dave-j-k
    @dave-j-k 3 роки тому

    Great project and great video - very open and easy to follow, thanks. How easy would you feel it is for a beginner to port this to MicroPython on a Pi Pico?

  • @muhammadtarek5592
    @muhammadtarek5592 5 років тому

    Hi Joop,
    thank you for that great video ,I wonder if I can use steppers with 3.75 degrees step, if yes, are there any modifications that should be applied to the code?

  • @steve8939123
    @steve8939123 7 років тому +1

    Hello, Can I substitute the Pro Mini in the robot for a Nano without making any software changes?
    Thanks.

  • @tienievanrooyen1580
    @tienievanrooyen1580 4 роки тому

    Good day Joop I realy like your projects, I am building the same robot that you have build but I want to run the robot with Bluetooth from my phone ,,,,,, is it possible to install HC-05 Bluetooth instead of the serial connection and do I still have to put the R1 resistor in line ore can I remove it
    what part of the code do I have to change or remove to replace with Bluetooth code
    Ad again thank you for your good projects

  • @feferos78
    @feferos78 3 роки тому

    Thanks joop for your vidéos, great PID code, i have made one with a pro mini 8mhz drived with bluetooth /android and an other with DC motors. Great job !

  • @MateuszKryszczak
    @MateuszKryszczak 7 років тому

    Have you checked, that the main loop executes in less than 4ms (osciloscope or signal analyzer)? It's seems to be quite long and there is a lot of floating point math, which is really slow.
    Great project, congrats.

    • @Joop_Brokking
      @Joop_Brokking  7 років тому +2

      Yes, I checked it. Floats are slow but not that slow :-)

  • @ryanruthrhona
    @ryanruthrhona 7 років тому +2

    Hi Joop. So I ended up building the robot a little modified in terms of the structure but almost similar. I have not place the battery yet at the top (so it is not top heavy) as I am testing the robot using an external power supply. What I have noticed is while the robot balances, it seems to be running forward continuously. How can i prevent this from happening? One more thing I have noticed is that the hardware calibration value for the MPU6050 keeps changing every time I run the hardware test code. Any idea why?

    • @Joop_Brokking
      @Joop_Brokking  7 років тому

      Make sure it's completely still when running the calibration. And it's normal that you get slight variations when you do this.
      The robot can only work when it's not connected to any wires. So make sure you get a battery and place it on top. Otherwise the robot will keep moving.

  • @gyoosuhnjee8698
    @gyoosuhnjee8698 7 років тому

    Hello. Thanks a lot for you. I've done YABR about 10 days ago. It's a good balancing car!!! I used RF trans&receiver with joystick as signal sender. The Kysan_Nema17_stepper motor as a actuator. The rest is same with you. Ah, The timer interrupt is good idea!
    (Very sorry not to be about YABR area) I have a question about YMFC auto altitude process.
    I had totally understood your YMFC code. Its flying is perfect!
    I've got data from barometer according to its sample rate . . . about 50hz. And calculated PID value, which is 'pid_output_altitude' . I've added the value each esc_1, 2, 3, 4.
    esc_1 = throttle - pid_output_pitch + pid_output_roll - pid_output_yaw + pid_output_altitude;
    esc_2 = throttle + pid_output_pitch + pid_output_roll + pid_output_yaw + pid_output_altitude;
    esc_3 = throttle + pid_output_pitch - pid_output_roll - pid_output_yaw + pid_output_altitude;
    esc_4 = throttle - pid_output_pitch - pid_output_roll + pid_output_yaw + pid_output_altitude;
    Is it right process? Thanks a lot although any other trivial help!

    • @Joop_Brokking
      @Joop_Brokking  7 років тому +1

      You have to fix the throttle first and then change it with the calculated PID value.

    • @gyoosuhnjee8698
      @gyoosuhnjee8698 7 років тому

      I did it already through try and errors. Thanks. Because of your advice and hints in the video and blog, I always obtain energy. Thanks again. Nowadays I am writing RTH function with HMC5883 & GPS. It's hard to write my own code without any help. (In fact your help is only one.) When I calculate the direction of Quad, the PID control is likely also needed. Is it right?

  • @anderskihlstrom9777
    @anderskihlstrom9777 7 років тому

    Hi, I am following your interesting MPU6050-projects on UA-cam. I am currently building a Segway clone, using MPU6050. But I try to use the onboard Digital Motion Processor to read the filtered pitch angle directly. I am curious why people dont seem to be using the DMP-values. What are your experiences? Is there a catch maybe?

    • @Joop_Brokking
      @Joop_Brokking  7 років тому +1

      I never tried the DMP because when I was starting with the MPU-6050 the library was reversed engineered and not very stable. And more important, I like to make/write my own IMU :-)

  • @billkendall7464
    @billkendall7464 6 років тому

    Thanks for the video! This really helps understand how your code works. That said, I do have a minor issue. When my robot reaches max speed, suddenly the control loop seems to stop the motors and the robot falls over. This happens bot forward and backward. If I increase the max speed, it happens at a faster speed. Any idea what might be causing this?

  • @manishamalshanrajapaksha2841
    @manishamalshanrajapaksha2841 10 місяців тому

    in my robot the moving forward and backward works fine...but when turning its shaking....why is that?

  • @benzmer6337
    @benzmer6337 7 місяців тому

    Dear can I use arduino nano?

  • @darrendas5645
    @darrendas5645 4 роки тому

    Can anyone tell me how he got the equation for linear compensation of the stepper motor?....im using a 5.18 : 1 planetary geared nema 17...is it the same equation?

  • @pintokitkat
    @pintokitkat 7 років тому +1

    I built the robot and it balances beautifully, but I'm struggling hopelessly with the remote. I've now bought eight of the transceivers from three different suppliers in two countries and I cannot get any of them to talk to each other. The nunchuck is sending 1, 2, 4 and 8, but I might as well have a piece of damp string between the remote and the robot as the transceivers, for all the good they do. Did you have to make sure your transceivers had the same IDs or change any other settings to get them to talk to each other? Do you have any suggestions for how I might test them? Sadly, these transceivers do not feature much on the internet - everything seems to be more centred on the NRF24L01. I've downloaded the manual for the Open Smart ones, but that hasn't been any real help at all.

    • @Joop_Brokking
      @Joop_Brokking  7 років тому

      There is a blue led on the transceivers that will lit when they receive or transmit data. So you can send data via the serial output of the Adruino and check if the led on the other tranceiver starts to flash.
      I bought 4 of them and they all worked fine without any settings. Make sure you use 9600bps.

    • @pintokitkat
      @pintokitkat 7 років тому

      Sorry it's been so long in following your suggestion (but I've been building a copy of Ben Eater's 8 bit computer - brilliant!). However, I'm back struggling with the remote again. Yes, both the transmitter and the receiver blue LEDs flash when I operate the nunchuck, but the robot does nothing other than balance itself. The LEDs aren't very bright, but they do light up

    • @paulgregory8846
      @paulgregory8846 5 років тому

      Joop Brokking
      Hi Joop I have the same problem the robot stands still the remote is making connection flashes blue on robot and Nunchuck but there is no movement at all can you please advise

  • @steve8939123
    @steve8939123 7 років тому

    Hello, your explanation of your code was very good, thanks for your hard work and sharing it with us. I do have a question if the robot travels on a surface that is not level say the right wheel is elevated above the left ( not front to back level, but right to left unlevel) will the software compensate to this and keep the robot balanced? Again thanks.

    • @Joop_Brokking
      @Joop_Brokking  7 років тому

      No, the robot is made for flat surfaces only.

  • @rave5636
    @rave5636 7 років тому

    Hey Joop, your work is realy the best ever. I build this bod and now it is running. But i used finlay a Bluetooth module and a handy app to control. One question i would have. Your code use the motors with 1/4 steps. If i change the motor controller to 1/16 steps, the bod is not able to be at zero. I assume it have to do with the 20ms IRQ routine?
    My reason to try 1/16 steps is the noise of 1/4 steps configuration.
    Could you give an hint on what would be necessary to change on the code, to can use the motor controller with 1/16 step configuration?
    Many thanks
    Rainer

    • @Joop_Brokking
      @Joop_Brokking  7 років тому

      You cannot run this robot on 1/16. The motors will simply not produce enough speed to balance the robot.

  • @shivaprasad3378
    @shivaprasad3378 6 років тому

    Thanks for the great tutorial. I did build the robot and am facing some challenges. MPU is working fine. The pid_output increases and clamps at 400 all the time it never comes down even if i change the robot orientation manually. Any pointers to see what could be wrong. angle_gyro responds well. The other problem that i have is my stepper motor stops responding when the throttle variable is beyond 325 i just hear the PWM sound. Thanks in advance for any directions.

    • @Joop_Brokking
      @Joop_Brokking  6 років тому

      It's normal the the PID output is maximum all the time. This is because the robot is never in a 100% horizontal position and the I-gain is really high.
      Best way to test the PID controller is to set the I- and D-gain to 0. This way you only see the error. This might help you.
      If you only hear the PWM sound it means that the stepper motor cannot keep up with the signal and comes to a standstill. Make sure to set the correct stepper modes.

  • @thaibinhtangoc4495
    @thaibinhtangoc4495 6 років тому

    Great project! I love this! I'm making the balance robot using DC servo motor. I'm using data reading from DMP of MPU6050. It currently can balance itself but I feel it's not perfect and there is many thing to do with it. In of them is that when I pushed it in a direction with plenty of force it was easily fallen or it moved with max speed til falling. Could you please help me to implement the brake function for my robot. I didn't use remote control as I will be next goal after the balancing work without problem. Thanks in advance!

  • @ulf8468
    @ulf8468 6 років тому

    Wow. Really impressive implementation. Where did you get the informations about the formulars for the motor pulse calculation? I would like to comprehend why you choosed numbers like the 400.

    • @Joop_Brokking
      @Joop_Brokking  6 років тому

      It's all done by:
      while (fail == 1){
      think again;
      try again;
      if(succes)fail = 0;
      }

    • @ulf8468
      @ulf8468 6 років тому

      Are you refering your answer just to the numbers or also to the formular self?

  • @Kadeshy
    @Kadeshy 5 років тому

    Hi Joop!
    Great video and very educative!
    I have made an auto-balancing robot inspired in yours for a project for a class.
    The only differences are:
    -> I am using arduino Nano instead of mini pro
    ->My motor is not a Nema (your motor doesn't have specs, but looks like a NEMA). My stepper motors are Mitsumi M42sp-6tg from old printers wreckage.
    -> I have built the rest of the project just like yours, using the same pinouts in the board.
    My project is simpler than yours, I don't have the remote control stuff and my objective is to only get the robot balancing to stand still alone. Apparently, running your code makes my robot to keep the wheels stuck, but with no movement at all. Could you help me, please?
    Thank you!

  • @joaosantos-61
    @joaosantos-61 5 років тому

    Hi
    Is possible to use arduino Nano in this project?

  • @panamera970
    @panamera970 4 роки тому

    Thanks for very detailed video.

  • @MrAbeni
    @MrAbeni 7 років тому +1

    Hello. Thank you for your great video. I have build my balancing robot based on your documentation. Everything works fine exept the transmission causes problems. I have used you original code in the nunchuk and in the robot. But there must be something wrong with the code. The robot only turns in one direction. Moving forward and backward command will not be received by the robot. Unfortunatly it is a litte difficult for me to debug the problem. Any Idea how I can find out where the problem comes from. BR Andreas

    • @Joop_Brokking
      @Joop_Brokking  7 років тому

      If you move the Nunchuck, can you see the blue LED's flash on the transceivers?

    • @rave5636
      @rave5636 7 років тому

      Hi, i changed the code in line 225 from
      if(!(received_byte & B00001100))
      to
      if(received_byte & B00001100)
      but i replaced the also the Nunchuck version with an handy app input

  • @makersgeneration3739
    @makersgeneration3739 5 років тому

    Good project! 😉
    What software did you used to design the the frame for the plywood? If not open source, what open source software do you advise for that type of job?

    • @Joop_Brokking
      @Joop_Brokking  5 років тому

      I use LibreCad for the drawings. It's free :-)

  • @minhvu8893
    @minhvu8893 6 років тому

    I don't get this line:
    *if(pid_output > 10 || pid_output < -10)pid_error_temp += pid_output * 0.015 ;*

  • @pisitnakjai1219
    @pisitnakjai1219 6 років тому

    Thank you for your video.
    I have some question. Can I put the difference MPU-6050 alignment on my robot?
    I mean, your video put in a vertical line but I have to put mpu-6050 in a horizontal line.

    • @Joop_Brokking
      @Joop_Brokking  6 років тому

      Change/swap the axis in the code via the trail and error method.

    • @saragomez2829
      @saragomez2829 5 років тому

      Joop, how can i chage the axis in the code?

  • @igort5418
    @igort5418 6 років тому

    How to get PWM values for motors speed from your PID, to use a dc motors

  • @문병훈-j6r
    @문병훈-j6r 3 роки тому

    Hi Joop. This is great tutorial. Appreciate so much! I used Arduino Mega for my robot. Can you help me what should I change in code if I still use Mega board instead of Nano?

  • @alivelinaveenchawdary6657
    @alivelinaveenchawdary6657 6 років тому

    can we take any Chassis measurements as our wish or we is there any ratio of mesasurements..

    • @Joop_Brokking
      @Joop_Brokking  6 років тому

      It's best to start with the ratios that I used so you got a working model. After that you can change anything you like and try to make it work.

  • @nickldominator
    @nickldominator 6 років тому

    Hey, Awesome video! I plan to make a system similar to this, but I want to mount my board Horizontally rather than vertically. All the components will be in the same orientation as your board though. Looking at the code, all I would have to change are the I2C Registers we pull data from 3F -> 3B (To pull Accel Data from X axis rather than Z) and then the Gyro Registers (which I'm not entirely sure about what I need to change from, as it makes my head spin a bit at the moment, haha). Does this sound correct to you? Thanks for the awesome videos!

    • @saragomez2829
      @saragomez2829 5 років тому

      What have you do to solve this problem??

  • @franscornel6734
    @franscornel6734 4 роки тому

    You are the best.....

  • @ElectroIoT
    @ElectroIoT 6 років тому

    If I use A4988 is there any problem

  • @wolfgangklenner6996
    @wolfgangklenner6996 6 років тому

    Great project! I build your robot from steppermotors I had from other project and printed the frame with 3D. All other parts are as your robot.
    I have a problem regarding the stepper motor frequency. My stepper motor work with a max. stepper frequency of about 2kHz. If I measure the stepper motor frequency of your software it is in a max. about 5.6kHz. So motor does not rotate and robot is not working. I measured ISR tick, which is the 20microsec and also the main loop is 4millisec.
    I tried to find a parameter to limit the max. stepper frequency to 2kHz but couldn't solve the search . Any help from the experts, which parameter I can align.
    Thank's Wolfgang

    • @Joop_Brokking
      @Joop_Brokking  6 років тому

      The robot won't work at 2kHz. You really need the maximum speed to make it balance correctly. If you use the same motors as I did it should work fine.

  • @kj4051
    @kj4051 2 роки тому

    sir.... why the angle is always increase (I copied your code and follow all your step.)

  • @matiashubert4256
    @matiashubert4256 7 років тому

    Hello, i have a question. In your case, the main loop frequency its 250Hz, but in my case, im datalogging in SD Card the MPU and GPS, what means the main loop frequency isnt 250Hz, so, i can calculate the angles with my own frequency loop, right? the only thing that means, ill have a bit more error if the frequency be higher than 250Hz?

    • @Joop_Brokking
      @Joop_Brokking  7 років тому +1

      If you are using a higher refresh rate the calculations need to be optimized for this refresh rate. Make sure that you have a constant refresh rate/loop time.

    • @matiashubert4256
      @matiashubert4256 7 років тому

      Joop Brokking lowest loop frequency, increase the error

  • @carronhi
    @carronhi 7 років тому

    Hello Joop, I'm your big fan and I'm about to buy all the components necessary to build my balancing robot and also a drone.
    Just as a doubt, If I want to build an overboard, do you think that this code could works?
    Of course, adjusting the diameter of the wheels and big battery.
    Also, which drone do you prefer, the octocopter or the quadcopter?
    Which one provides you a better performance?
    I really appreciate your help, thank you
    regards!

    • @Joop_Brokking
      @Joop_Brokking  7 років тому +1

      The code can be used to measure the angle but not for controlling a hoverboard. You have to modify the code yourself.
      Quad or octo depends on what you are going to do with it. If you are starting I would suggest a quadcopter. This is cheaper to fix when you crash.

    • @carronhi
      @carronhi 7 років тому

      Joop Brokking awesome, thank you for all you have shared. regards

  • @oleksandrgrytsenko
    @oleksandrgrytsenko 7 років тому

    Is it able to work with horizontally changed center of mass? I mean some weight moved out of axis/lipo line.

    • @Joop_Brokking
      @Joop_Brokking  7 років тому

      As long as you set the correct balance calibration value.

    • @oleksandrgrytsenko
      @oleksandrgrytsenko 7 років тому

      And how about dynamic calibration?
      The goal is to grab some object from the floor and counterweight it with own mass by doing some tilt.

  • @yuchoy1
    @yuchoy1 7 років тому

    Hi Joop! I love your videos, and I love the YABR especially. What an amazing design! Mine is completely built and working now (happily balancing!) but I have not yet connected the radios for remote control, because I would prefer to use a bluetooth radio or NRF24L01 radios. Have you tried these or is there a reason not to? Thanks!!!

    • @Joop_Brokking
      @Joop_Brokking  7 років тому +1

      The modules that I used are plug and play and don't consume any microcontroller calculation power. The is why I did not use the NRF modules.

    • @yuchoy1
      @yuchoy1 7 років тому

      Joop Brokking thanks Joop 😊

    • @yuchoy1
      @yuchoy1 7 років тому

      Joop Brokking I can't believe how well the robot can balance even on loose bed covers on a mattress!

  • @JAMBILOO66
    @JAMBILOO66 7 років тому

    This is amazing! As somebody who knows little about this kind of programming, do you think it could be scaled up to a robot approx. 30cm tall? I want to create a working model of the robot from my comic strip. Thanks!

    • @Joop_Brokking
      @Joop_Brokking  7 років тому +2

      Yes, it will work if it is larger. You might need to tune the PID values but it should work fine.

    • @JAMBILOO66
      @JAMBILOO66 7 років тому

      Thanks!

  • @BrandonByrne
    @BrandonByrne 7 років тому

    Hi Joop, can you expand on the part about "logarithmic behavior of stepper motor speed vs pulse train"?
    I'm trying to figure out what this line means:
    if(pid_output_left > 0)pid_output_left = 405 - (1/(pid_output_left + 9)) * 5500;
    Where do the 405, the 9, and the *5500 come from? What is this equation derived from? Thanks

    • @Joop_Brokking
      @Joop_Brokking  7 років тому

      You can find it in the Excel sheet. The equation is the result of trying to compensate the behavior of the stepper motor.

    • @BrandonByrne
      @BrandonByrne 7 років тому

      Ah I see, it is non-linear because you are changing the period between pulses correct? ie, your output is 1/x. If I am varying the frequency of pulses, that should already be linear right? Since varying the frequency is directly varying how many steps per second the motor is receiving?

  • @JyskMaker
    @JyskMaker 6 років тому

    Hi i Like all you videos. :-)
    But i have a quistin.
    I like to use BL but my BT app can only send karakter, like a "a" "b" "c" and so one, how do i convert them to bit.??
    And also what do the line.
    if(!(received_byte & B00001100)){ //Slowly reduce the setpoint to zero if no foreward or backward command is given
    if(pid_setpoint > 0.5)pid_setpoint -=0.05; //If the PID setpoint is larger then 0.5 reduce the setpoint with 0.05 every loop
    else if(pid_setpoint < -0.5)pid_setpoint +=0.05; //If the PID setpoint is smaller then -0.5 increase the setpoint with 0.05 every loop
    else pid_setpoint = 0; //If the PID setpoint is smaller then 0.5 or larger then -0.5 set the setpoint to 0
    }
    You skip this part :-)

  • @plymouthrovadventures.646
    @plymouthrovadventures.646 3 роки тому

    Hi. this was not exclaimed in the description. if(!(received_byte & B00001100)){ as the nunchuck is not sending this. Anybody...

  • @sebek531
    @sebek531 7 років тому

    Hello. Thank you for your great video. I have build my balancing robot based on your documentation. I use NEMA17 SX17-1005LQCEF engines - 1.8 ° (200 Steps on full rotation). Will they be good for this project?. If not, could you tell me how to make the correct code for these motors?

    • @Joop_Brokking
      @Joop_Brokking  7 років тому

      If you use the same stepper controllers it should work fine.

  • @CorruptName1
    @CorruptName1 5 років тому

    thanks for the great video! how can i change the code for a4988 driver? i already changed circuit. thanks again!

  • @ahmetpehlivan5494
    @ahmetpehlivan5494 8 місяців тому

    whats this guys profession, how can i be like him like knowing all this stuff about microprocessors and electronics; should i apply for embedded systems jobs or i dont know who does that white good companies, aerospace companies. Can anyone help?

  • @1969mrd
    @1969mrd 5 років тому

    Does anyone have an issue with the stepper motors? They don’t seem to have enough torque and stop and make a whirring noise!

    • @SaurabhRastogiRC
      @SaurabhRastogiRC 4 роки тому

      yes same happening with my motors ( took from dot matrix printers) ... did you find the solution?

  • @osamamahmoud8508
    @osamamahmoud8508 3 роки тому

    bro please help me i am facing some problems with my project can i contact you, please

  • @hamidhamouchi4437
    @hamidhamouchi4437 6 років тому

    Nice Woork Mr. Joop You're awsome !
    How I can control this project with an Android application instead of the joystick :)
    Plz help me !
    Go On !!

  • @TheSpyderRoque
    @TheSpyderRoque 6 років тому

    Your Videotutorial is probably the best and most thorough I have ever seen. Keep up the great work!
    What I do not understand is, however, why it is important for you to keep the frequence of loop() constant. Is there any specific reason?

    • @Joop_Brokking
      @Joop_Brokking  6 років тому

      Otherwise the PID controller is getting really confused. It's fixed on 4ms and will react different on a different loop time.

  • @bobyla13
    @bobyla13 4 роки тому

    battery_voltage = (analogRead(0) * 1.222) + 85
    if analogRead(0) = 1023 then
    battery_voltage = (1023 * 1.222) + 85 = 1335.106
    does that mean battery voltage equals 13.35 V?

    • @muhammed_genco
      @muhammed_genco 4 роки тому

      Here we added (+85) for the diode voltage drop, where the highest voltage that will come to the analogRead will be (5V - 0.85V) = 4.15V...

  • @makarthur4618
    @makarthur4618 7 років тому

    Hi Joop,
    Thank you very much for your effort in producing the entertaining and educating videos. I learnt a lot.
    After watching all three YABR videos, I realize that so long as the robot is self balancing on the pitch axis, the hardware setup procedure will take care of the normal balance position. so no code change is needed even the MPU6050 is positioned horizontally at setup (instead of vertical). Grateful if you could confirm my understanding.
    Thanks,

    • @Joop_Brokking
      @Joop_Brokking  7 років тому

      The position of the MPU-6050 is very important because the accelerometer is needed for compensating the gyro's drift. As explained in detail in this video: ua-cam.com/video/4BoIE8YQwM8/v-deo.html

    • @makarthur4618
      @makarthur4618 7 років тому

      thanks for your reply. Lucky that I have not soldered my mpu to pcb.

    • @makarthur4618
      @makarthur4618 7 років тому

      ok, I mounted the MPU6050 vertically. Another question - will e the robot's weight distribution along the pitch axis affect the performance. I could imagine the power use is increased, pls share your thoughts.

    • @makarthur4618
      @makarthur4618 7 років тому

      Hi Joop,
      Completed the built, hardware test program run ok, and generated a balancing value -1319 (negative). My MPU5060 is setup vertically by attaching it to an angled stand, the pcb and other components are mounted horizontally. Wondering why a negative value?!
      Followed the procedure to limit DVR8825 current.
      After changing the balance value in the Balancing robot program and upload. Powered the robot by 12V lipo, the robot cannot balance. Try to reload the hardware test program, but this time, encountered upload error: "Verification error content not match".
      Research the web indicates an upload reset issue, what is your view on this?

    • @makarthur4618
      @makarthur4618 7 років тому

      one more question, the diode becomes burning hot when 12V power is connected for a brief while. Is it normal?

  • @karthickpaneerselvam2108
    @karthickpaneerselvam2108 5 років тому

    great video nice

  • @markgreco1962
    @markgreco1962 7 років тому

    Deal extreme is out of the stepper motors. Maybe someone could list the nema14 motors they used from Banggood or a different source like Amazon.
    I have everything made I'm just waiting on the motors.

    • @Joop_Brokking
      @Joop_Brokking  7 років тому +1

      You could also use these:
      www.dx.com/p/geeetech-3d-printer-reprap-1-8-degree-anti-slip-42yb-stepper-motor-black-370044
      But please note that these are 42mm in stead of 35. So you have to modify the frame.

    • @gyoosuhnjee8698
      @gyoosuhnjee8698 7 років тому

      I've done with Nema17 which is 42mm. And the size of frame is not important just like Joop's saying!

    • @markgreco1962
      @markgreco1962 7 років тому

      Back in stock !!! Ordering today

  • @kayisimuhendisi1573
    @kayisimuhendisi1573 6 років тому

    if you are making robots then my projects are just toys..Take me as a padawan

  • @drumbum7999
    @drumbum7999 7 років тому

    fantastic

  • @aparnaprabhune6951
    @aparnaprabhune6951 7 років тому

    where did you learn such complex coding?

    • @Joop_Brokking
      @Joop_Brokking  7 років тому +4

      From the datasheet of the ATmega328P.

  • @derarty4290
    @derarty4290 3 роки тому

    What i learned: You should not change values if you don't know what you are doing

  • @fahimshahriar6572
    @fahimshahriar6572 7 років тому

    Thank u Joop Brokking :D

  • @MrFaresProduction
    @MrFaresProduction 6 років тому

    God bless you!

  • @poweredbysergey
    @poweredbysergey 7 років тому

    Cool

  • @praveenrock7410
    @praveenrock7410 6 років тому

    bro send me link for downloading code

  • @qigao5458
    @qigao5458 7 років тому

    nice!

  • @cy8berpunk831
    @cy8berpunk831 7 років тому

    Love you ;)

  • @stevenlee1726
    @stevenlee1726 6 років тому

    Try to listen the video at 0.25 speed. LMAO!

  • @framespersecondfps5256
    @framespersecondfps5256 7 років тому

    joop please help me out