Thank you for your comment. I checked the link and you are right, it's the wrong link. I corrected the link on my website and it has the correct link now. Thanks again!
Osman, did you even watched the video? You need some inertia on the higher part of the robot to get it to work. Check this video on how to balance a stick on you finger: ua-cam.com/video/lk_Pwu7nf1U/v-deo.html
Joop i still didn't see in the net anybody with such complete and accurate informations/instructions as you. I deeply appreciate your effort and above all your passion. Many should learn from you.
I also want to say the thorough information you provide is great! The bringup steps, checking for overcurrent, etc, are particularly good. These steps are important for any project but almost never discussed. Many folks that view this tutorial, even if they don't build the robot, will learn important concepts they can use on future projects.
Thank you Joop, never seen such a perfect tutorial. The language clear to understand, no music, and all details to download. I just ordered the material and will try to reproduce this Robot. I'm shure, I will learn a lot. I can't understand those who gave a thumb dawn. Kind regards Otto
Bit late to the party. Just made this Robot and must say what a well laid out and explained tutorial. I used 3D printed versions of the wooden bits. Had a bit of a problem with electromagnetic interference but tidying up the wiring and a couple of ferrite cores on the motor wires solved it.
i havent seen the next ep2 and ep3 videos, but i must say that your code and how you express your intruction in this ep1 is very very clear to understand, thank you for that
Any time I see a video from you I know its going to be interesting as well as educational. I enjoy the simple, complete and interesting way you present your video info. (for anyone who does not understand the concepts/idea of a balance bot and how it works using an accel/gyro look back in Joop Brokking's videos for compete simple to understand videos, using his DIY arduino quadcopter as the platform)
Since you made all this code,it should be super easy to transform this project to a xy joystick controlled project. I think many will like this. Just remove the wireless, the accelerometer and the extra code. It will allow anyone to make a xy controlled project!
Nice video, but I miss the most important information... How did you achieve self balancing program ? You have such a great style of teaching, it shouldn't be left out :)
My name's not Joop but I can give you some helpful info on what the code is doing. The accelerometer will calculate various accelerations on 3 axis. (up/down, left/right, forward/back). We know the robot is standing upright when the forward/back axis (aka x) has no acceleration or the up/down axis would be perfectly aligned with gravity meaning roughly 9.81m/s^2 . He is getting the motors to respond to this information, trying to correct the imbalance and rechecking the sensor. By using the nun-chuck he can tell the robot to tip slightly forward or back and remain at that tilt for movement. The speed can be found using force vectors i.e. physics. The likely algorithm controlling the motor speeds is PID control. It is a very flexible algorithm for controlling motors automatically and achieving a desired result (i.e. tilt angle for balance in this case)
What a great news ! Thanks. I know, video creation and editing is very time consuming... I just subtitled some videos and it took me hours for a few minutes of footage.
George Newbold It's not "likely" PID, in some of the code excerpts he shows onscreen you can see clearly named tuning constants in the global variables. It's definately PID.
Excellent @joop Im going to design this balancing robot too in my lab.. In previous YMFC is working fine.. Keep on rocking.. Now im doing ARDUINO CNC.. Share that one soon..
After I spend more than a month to gather all the stuff and to combine, finally I could build this robot. Thanks for you very detail information. But there are some issue that I cannot upload when this arduino is in place... so I have to take out to upload every time.. Anyway I will figure out. And you are right "limit current for step motor" is very important, I saw heated and smoke from diode before I limited current. Thanks a lot!!!
im very late to the party. im trying together all the parts to build the robot. but i have still some questions: he mentions the Arduino Uno on his hardware list, but i did not see it where he place it on his final project?
Awesome! I'm working on exactly the same project! I'm using 12V steppers and an adafruit motorshield V2.3 to control them and an mpu6050. When I started the project I just chose stepper motors because I thought they looked cooler haha
A4988 Driver. Just for information, you can use the A4988 Driver as a direct replacement for the DRV8825 in this robot. BUT you have to add a 5v VDD connection to it - that is next to the GND pin in the 'bottom left corner' (as per schematic PDF layout). Just jumper an extra wire from the 5v connections already going to it.
Congratulation, a really perfect Tutorial. If every teacher would have your qualtity, the world would be much further. Also verry good, no stupid music in the background as often. So your words are verry clear to understand, also by non english mother tonge people. Thank you Otto
Hi Joop, before to start with building, I'm studing your code and video. I read the comment here. Why it is so important the exat position of the MPU-6050? Why it shouldn't work if I put MPU-6050 a little bit top or bottom, right, left? Thank you in advance. BR
Thank you very much for this video and the instructions. I've just finished building my self balancing robot based on your instructions. A great project to learn more about these components, fun to build, and even better it works perfectly and is fun to use :-).
Hi Skyreacher. Congratulations on getting your robot project working. I've been working on this project for about 4 months. I'm at the point where I've soldered the boards and I know that my DRV8825s work and are set to appropriate current for the motors. I'm able to drive the steppers via the 8825s on a separate arduino circuit, no problems. However I'm finding some strange things on the main circuit. On Joop's diagram, resistors R2 and R3 are connected. Does this not effectively short out the purple and black and gray wires on the diagram? I get about a short between the gray and purple connections for the 8825s(lower right two pins) even when the 8825s are not on the board.The low voltage (5V) side of the circuits seem fine, but the high voltage side just goes to full power and the motors are frozen when the power is on. Can you confirm that the -ve side of the battery feeds BOTH the ground pins on the 8825s AND the GND pin on the step-down transformer that gives me the 5V supply for the components and around the low voltage sides of the circuit boards?. I'm at the point where I'm thinking of starting again with the circuit soldering. Any insights you can offer are greatly appreciated. I'm really looking forward to completing this project as I'm on a robotics study group in my board of education in Ontario Canada, working to build our capacity in Arduino and robotics.
Hi Gordon! Search for "voltage divider" to understand what R2 and R3 are doing. This part of the circuit is completely OK, it does not create a short. The wire between R2 and R3 is connected to A0 on the Arduino - this is used for monitoring the battery. When the battery becomes weak, the robot will stop working without damaging the battery. Yes, ground is the same on the whole circuit. All the black and light grey lines on Joop's diagram are connected. It sounds like there's a problem with your lower right two pins of the stepper driver (where high power is feed to them). If you test your circuit, there should be no connection between them. Having a short there can be dangerous for your battery! I'd not connect the battery at all, as long as the problem is there. Check your board very carefully, there must be a soldering problem somewhere (a connection between the purple and the light grey/black lines).
Interesting and Fully explained project. THanx for your efforts Joop Brokking. I can see that the post is old, so now: How about now using a Nano instead of Pro Mini together with 2x A4988, 2x JDY 40 2.4G (NRF24L01) and Stepper Motors +MPU6050. This would reduce the costs to less than 50% of what was in those years. Also the JDY-40 2.4G will not require a second Arduino (Uno in your case) for the remote (use simple 4 buttons sw for FF, RV, TL, TR all wired straight to the board ). this will make a tiny hand held RC operating with a small lipo. Loved your patience in Explaining in all the 3 video clips....I listened to them all.
Thanks for the video. I built a dual axis solar tracker, going to build this robot to learn the MPU9265 to aid in my tracking instead of LDRs (doesn't do very well in cloudy conditions)
Great Video ..very well explained.....as always......Thanks !!! BTW....Stepper Motor`s are an excellent choose for this project because of ...no backlash....in ballancing mode...
There are more benefits to the steppers - accurate (matching) speeds, direct speed command. The DC motors are normally controlled by just duty cycle. This is not speed but rather power control. There is a dead zone at low duty cycle (no motion due to friction). As a result more stable ballancing position (I built first one with DC motors)
Thank you for the great project! One question.. Can I use this platform to make autonomous robot with ultrasonic censor? Or it's impossible because of 4 milliseconds main loop limit? Thank you.
Hello Joop, This project is awesome. Very much descriptive. I would like to suggest you to make a video series on developing a micro quadcopter with serial transceiver(eg. HC-05) or nrf24l01+ with self made remote(transmitter) just like you made YMFC video series. There is no such proper tutorial in youtube. I hope you would appreciate my suggestion and help enthusiasts just like you and me.
Hello, the schematics of the wiring in the downloads page is missing the connection from the second pin, botton position (left to right) in both the drv8825, we can see that they are connected to the 5V in 4:41 and 4:24 but in the pdf they are not connected. Thanks!
When I click on the 《1 x Mini DC 7~28V to DC 5V step-down converter》 to view the item, it takes me to a 《Mini DC 7~28V to DC 5V Step-Down Converter Power Supply Module》. But the Power Supply Module is different with your "yabr-schematic_robot.pdf". Is this wrong on your site??
Very cool project. I just bought an Arduino 101 which has a built-in 6-axis accelerometer, gyro and Bluetooth and may build one of these robots using it. I would like to try controlling it with my cell phone via a Bluetooth connection.
Hello! First, I would like to say that I'm not an english speaker, so, excuse me for the ortography and the explanations. I'm an electronic student and I am making your balancing robot project (thank you for it, it's a good and nice project). I have all devices fixed and running, but the problem is the robot doesn't keep the balancing. If I put the robot in the air (keeping it with my hands) and I turn it (the vertical position), the wheels goes in one or in other sense (this show that the code is ok), but the control is not very good and this does that the robot fall down when I let it in the floor (he turns the wheels but doesn't change the sense in time). Other problem is the motors don't go with 1/4 stepping, If I put this setting, they run only if the robot is in the air, If I let it in the floor they stop because they need more tork (I think). All pieces are the same that yours, and I have the same configuration in drivers (0,145 A), the only think different is my drivers are setting in 1/8 stepping. Can you help me? Thank you very much
Joop Brokking Thanks for answer. I got solve the problem, I changed a little the PID values, and now it works good (I think that is because my stepping is not the same and the distance per pulse is different) The only problem that I have now is when the robot starts, he goes straight about 3 or 4 meters before stop and keep the balancing state. Do you know why happen this? Thank you. (If you want, when I finished, I can share my project. I've changed some parts, like the structure, that it was print in a 3D printer, and the Nunchuk is in a 3D print structure too and runs with an arduino mini , one DC-DC conversor and a 9V power supply.
When you need to change the PID values the self balancing calculations will also need to be changed. I explained the working in the video. It should be these lines: //The self balancing point is adjusted when there is not forward or backwards movement from the transmitter. This way the robot will always find it's balancing point if(pid_setpoint == 0){ //If the setpoint is zero degrees if(pid_output < 0)self_balance_pid_setpoint += 0.0015; //Increase the self_balance_pid_setpoint if the robot is still moving forewards if(pid_output > 0)self_balance_pid_setpoint -= 0.0015; //Decrease the self_balance_pid_setpoint if the robot is still moving backwards }
I built it, but I have a problem. I NEED YOUR HELP!! When I start it, i wait for the end of the blinking, but moving the robot, the motors do not move, they only take a small step when I move the robot from side to side, nothing more! I adjusted the drivers well, I tried with other engines, ...
HI Joop...Thank's for all this information and this great videos.... Didn't you need the capacitors in paralell with the 12V supply of the A4988 ? And.. Do this project work usin Arduino Mega 2560 ? Thank's very much...
Hello Joop, Congratulations on your vids you upload on the web. There are very interesting, clear, with a good quality. Furthermore, your english is quite understandable. Taking in account one of your vids, I built a inclinometer for a friend of mine who wanted to get a device to park his camping car as flat as possible. The device worked fine straightforward. As far I am concerned, I build a segway clone. At first, I got all information on an american website. The system uses an Arduino Uno + MPU6050 + Sabertooth 2X25 + 2 motors DC 24 V + 2 batteries 24V + and, of course aduino code. I face many dysfunctions, especially the I2C bus which breaks, and motors go mad. When I read all posts on the website, it appears that too many people are in the same situation. I wondering myself whether the description is 100% reliable. So here is my question : I have seen your description of your balancing robot. In the same way, do you expect to publish a description of a segway clone. According to your experience, I am sure that it would be quite reliable. In fact, I suppose that minor modifications have to be made on the existing balancing robot code. Best regards, Jean-Claude from France.
If the I2C bus gives you problems you need to make sure that you have no interference on the bus. Wires need to be soldered reliable and the power supply must be clean (filtered form the motors). Check my videos about EMI that I made earlier: ua-cam.com/video/aebO91Xa3Pw/v-deo.html Also watch part 2 and 3!
THANK YOU SIR YOU HAVE ENRICHED MY LIFE ! I have just completed this project and it works perfectly ! I have next to no hope of understanding your code but I am not afraid to tinker. Is it possible to play with the travel speed? I am already experimenting with weight carrying capacity and then height. But a speed change would require a code adjustment that I am not sure is a simple thing to accomplish.Again thank you you made an old'ish man young again.
Great project! First the robot didn't work, but now it works. I had to wire the left motor with the right motor driver and the right motor with the left driver, then the balance worked. But why I must do this?
Thank you very much for an interesting project. The build is finished apart from the Arduino UNO, WiFi and controller. So my question is; should the robot be able to balance without the WiFi units?? Mine will not balance and seems to have a very large angle between the steppers actuating. It seems that maybe the gyro are correcting the wrong way. I have checked and double checked the wiring and it is OK
Great tutorial, I have a wiring question concerning the Mini DC 7~28V to DC 5V step-down converter. It appears the device shares the Out GND with the +Vin (12V) and +5V out. Why didn't you wire a GND for both IN and OUT? Thanks in advance for your response.
The ground in and ground out on the step down converter PCB are connected together. 99.9% of the step down converters will have this connection. That is why I used only one wire.
The part linked to in your BOM does not, however, have a shared ground. www.dx.com/p/mini-dc-7-28v-to-dc-5v-step-down-converter-power-supply-module-green-black-398251?Utm_rid=78761898&Utm_source=affiliate#.WXsC0a1Dw0Q
Thanks for documenting and sharing this project! I had an old, original nunchuk lying around which is was not recognized by the test program. Adding delay(1) after 3 of the Wire.endTransmission() statements fixed it. I guess these old ones are slow ;) If you want, I can send you the fix.
Thanks again Joep! Your delay fix for line 39 was all that was needed to get my very old original nunchuk working in the remote. The other important fix in my setup was to delete the 4K7 resistor in the robot that Joop has on the TX line of the transceiver...the signal could not make it through (BTW I am using a Nano in my robot, not a ProMini)
Nice :) And indeed, the trick with the resistor probably doesn't work on a Nano. Make sure you disconnect the tranceiver before reprogramming the Nano...
Nice project & documentation Joop, congratulations! However, the 12v/5v DC/DC step down converter is not necessary. You can plug directly the battery to the Arduino's RAW pin, then the DRV8825's and the MPU6050 can be fed from Arduino's 5V pin. Also, adding a capacitor for the stepper drivers would not be a bad idea.
The regulator on the Pro Mini can only deliver approx. 100 - 150mA. With the transceiver on the voltage regulator of the Pro Mini can overheat and shut down. That is why I used the external voltage regulator.
Pro Mini's KBAA regulator draws up to 150mA, and your transceiver draws only 21mA(MAX), so there's plenty of available current and so regulator won't overheat. DRV8825's logic side are even less current hungry.
Read the stepper driver datasheet! It requires at least 8V and being inductively loaded generates spikes ot its power rail. The embedded 5V regulator is linear i.e. with limited load handling capability and cannot suppress thye spikes coming from a motor driver.
Hi, Joop: It's very interesting and you explained very well. I don't know if I missed while watching but the only thing I didn't clear after I saw you video is how the remote controller is connected. I know one of the transceivers is connected to the Arduino Uno. However, how is the one working with the remote controller is connected. I assume the Anduino's microcode will take care of their operations. If there's anything else, maybe I will ask next time.
Hi Joop, any idea why the stepper motors work when not touching the ground, but halt and make a whirring noise when they do touch the ground? Everything else works well.
Nice projects. I want to ask you if I can use the accelerometer to read vibration in a ball bearing as I am working on a project mixed between mechanics and electronics...Thank you.
Can I use an Arduino Pro Mini instead of the Arduino UNO in the remote control ?. There should be no modifications in the code for the remote except for the type of board used . The remote is using only I2C to talk to the nunchuck and serial to talk to the RF module
Why the separate tuning for balance point? The addition of a single button (press when the robot is upright and the current value is used as the cal value) and a couple lines of code make it easier. Better yet is fully self calibrating, but that is a bit more work-- I am too lazy to code it for an application like this.
When I look at the photo of the prototyping PCB it looks like the FAULT pin is connected to the + 5V. Is this correct? I don't see in the schematic that pins 9 to 16 are all connected as it appears on the PCB. My fuses blow every time I plug in a DRV8825. With or without a stepper motor connected. @Joop, for information, the schematic in pdf on the website, the FAULT pin is not connected. I started from this schematic purely and alone. After watching the video again, it appears that the schematic in this video used has been drawn correctly.
Hello, i read the code. Timer intterupt occur every 20 micro second. So 40 micro second period pulse is generated and that can control maximum 45 degree. Am i right? And if the pidoutput is less than 45degree. What action is operated during remaining time of 4ms? No action?
When you click on the motor to view the item it takes you to a 42mm stepper motor. Should it be a 35mm
Is this wrong on your site??
Thank you for your comment. I checked the link and you are right, it's the wrong link. I corrected the link on my website and it has the correct link now. Thanks again!
Mark Greco do not place lipo on top, noob . lipo is heavier part in this project. it should be in bottom
osman özütemiz I will build it exactly as Joop has done the project
It is important for the battery to be on top for inertia
Osman, did you even watched the video? You need some inertia on the higher part of the robot to get it to work. Check this video on how to balance a stick on you finger: ua-cam.com/video/lk_Pwu7nf1U/v-deo.html
Joop Brokking no, i dont know english im using translste
Joop i still didn't see in the net anybody with such complete and accurate informations/instructions as you. I deeply appreciate your effort and above all your passion. Many should learn from you.
I also want to say the thorough information you provide is great!
The bringup steps, checking for overcurrent, etc, are particularly good. These steps are important for any project but almost never discussed. Many folks that view this tutorial, even if they don't build the robot, will learn important concepts they can use on future projects.
Hà Nội của em
Thank you Joop, never seen such a perfect tutorial.
The language clear to understand, no music, and all details to download.
I just ordered the material and will try to reproduce this Robot.
I'm shure, I will learn a lot.
I can't understand those who gave a thumb dawn.
Kind regards
Otto
Thank you for writing me this comment. I really appreciate it!
this is one of the first videos I actually see good wire management on the project
I had nothing to do with the project but the description and commentary is so nicely done, it's just perfect!!!
Bit late to the party. Just made this Robot and must say what a well laid out and explained tutorial. I used 3D printed versions of the wooden bits. Had a bit of a problem with electromagnetic interference but tidying up the wiring and a couple of ferrite cores on the motor wires solved it.
i havent seen the next ep2 and ep3 videos, but i must say that your code and how you express your intruction in this ep1 is very very clear to understand, thank you for that
Excellent design and a great video!
Any time I see a video from you I know its going to be interesting as well as educational. I enjoy the simple, complete and interesting way you present your video info. (for anyone who does not understand the concepts/idea of a balance bot and how it works using an accel/gyro look back in Joop Brokking's videos for compete simple to understand videos, using his DIY arduino quadcopter as the platform)
Your work is inspiring, accompanied by your descriptions!
there is nothing better than knowledge explained such that anyone can enjoy it
Found this video from adafruit. You've got my subscription. Cant wait to check out the rest of your videos!
Great stuff I enjoyed your projects. Appreciate your effort. Its world class engineering.
A nice little project to play with,.. clearly explained ( unlike many ),.. with the potential pitfalls of what to look for,.. a definite thumbs up
i have to say thank you for your amazing work i built this robot and worked perfectly thanks
Since you made all this code,it should be super easy to transform this project to a xy joystick controlled project. I think many will like this. Just remove the wireless, the accelerometer and the extra code. It will allow anyone to make a xy controlled project!
Very comprehensive , Thanks for teaching this subject , Nice presentation
AMIGO VOCÊ ALÉM DE GÊNIO, É UM SHOW. VALEU POR COMPARTILHAR UM PROJETO COMO ESSE...PARABÉNS.
Nice video, but I miss the most important information...
How did you achieve self balancing program ?
You have such a great style of teaching, it shouldn't be left out :)
My name's not Joop but I can give you some helpful info on what the code is doing.
The accelerometer will calculate various accelerations on 3 axis. (up/down, left/right, forward/back). We know the robot is standing upright when the forward/back axis (aka x) has no acceleration or the up/down axis would be perfectly aligned with gravity meaning roughly 9.81m/s^2 .
He is getting the motors to respond to this information, trying to correct the imbalance and rechecking the sensor.
By using the nun-chuck he can tell the robot to tip slightly forward or back and remain at that tilt for movement.
The speed can be found using force vectors i.e. physics.
The likely algorithm controlling the motor speeds is PID control. It is a very flexible algorithm for controlling motors automatically and achieving a desired result (i.e. tilt angle for balance in this case)
He does use the accelerometer to stop forwards/backwards motion, but its the gyro data he uses to keep it upright.
Thank you for your comment. I'm currently working on a complete code overview video. But it take so much time to get it finished :-(
What a great news ! Thanks.
I know, video creation and editing is very time consuming... I just subtitled some videos and it took me hours for a few minutes of footage.
George Newbold It's not "likely" PID, in some of the code excerpts he shows onscreen you can see clearly named tuning constants in the global variables. It's definately PID.
Excellent @joop
Im going to design this balancing robot too in my lab..
In previous YMFC is working fine..
Keep on rocking..
Now im doing ARDUINO CNC.. Share that one soon..
After I spend more than a month to gather all the stuff and to combine, finally I could build this robot.
Thanks for you very detail information. But there are some issue that I cannot upload when this arduino is in place... so I have to take out to upload every time.. Anyway I will figure out.
And you are right "limit current for step motor" is very important, I saw heated and smoke from diode before I limited current.
Thanks a lot!!!
im very late to the party. im trying together all the parts to build the robot. but i have still some questions: he mentions the Arduino Uno on his hardware list, but i did not see it where he place it on his final project?
This is great! Greetings from Germany!
Thanks so much! I've been looking for such a tutorial for such a long time!
All the hobbyists should take inspiration from your website. Quality bar set quite high
Thanks for the great tutorial! So concise, like a Swiss watch!
Thanks for such nice and comprehensive tutorial Joop :)
Awesome! I'm working on exactly the same project! I'm using 12V steppers and an adafruit motorshield V2.3 to control them and an mpu6050. When I started the project I just chose stepper motors because I thought they looked cooler haha
awesome project and thanks for the explanations and detailed info , data etc.
Nice little project. This has lots of scope to be able to learn and replay movements..
Very Pleasent Tutorial & Video. Thanks for making my day.
Excellent video yet again, thank you so much! ☺
Really thanks for this project, I made this and works perfectly, really thanks for sharing, all of your projects are amazing, regards from Ecuador
Can you tell me which type of stepper motor (bipolar or unipolar) Joop have used?
hi sir may i ask about the rpoject?
Very cool project. Thanks for sharing your work!
Dude, can you tell me how you got to these levels of pid control?
A4988 Driver. Just for information, you can use the A4988 Driver as a direct replacement for the DRV8825 in this robot. BUT you have to add a 5v VDD connection to it - that is next to the GND pin in the 'bottom left corner' (as per schematic PDF layout). Just jumper an extra wire from the 5v connections already going to it.
Yes you can
Very well done. Excellent craftsmanship . I love your videos. Keep making more!!!!
I subscribed :)
2 seconds in, I already know this is going to be awesome! 👍 :)
Very nice project you have here.
Everything is explained very good .
Good job ! Keep it up .
Congratulation, a really perfect Tutorial.
If every teacher would have your qualtity, the world would be much further.
Also verry good, no stupid music in the background as often.
So your words are verry clear to understand, also by non english mother tonge people.
Thank you
Otto
Excellent !!! Thank You for sharing your Knowledge !!!
Hi Joop, before to start with building, I'm studing your code and video. I read the comment here. Why it is so important the exat position of the MPU-6050? Why it shouldn't work if I put MPU-6050 a little bit top or bottom, right, left? Thank you in advance. BR
Respect man, very nice project!
You are an awesomely inspirational person thank you for your videos
Thank you for the inspiration, think I will build something like this for my April project!
Cool build! Sharing on The Awesomer.
Thank you very much for this video and the instructions. I've just finished building my self balancing robot based on your instructions. A great project to learn more about these components, fun to build, and even better it works perfectly and is fun to use :-).
Thank you for sharing and great to hear that you learned something!
Hi Skyreacher. Congratulations on getting your robot project working.
I've been working on this project for about 4 months. I'm at the point where I've soldered the boards and I know that my DRV8825s work and are set to appropriate current for the motors. I'm able to drive the steppers via the 8825s on a separate arduino circuit, no problems.
However I'm finding some strange things on the main circuit. On Joop's diagram, resistors R2 and R3 are connected. Does this not effectively short out the purple and black and gray wires on the diagram? I get about a short between the gray and purple connections for the 8825s(lower right two pins) even when the 8825s are not on the board.The low voltage (5V) side of the circuits seem fine, but the high voltage side just goes to full power and the motors are frozen when the power is on. Can you confirm that the -ve side of the battery feeds BOTH the ground pins on the 8825s AND the GND pin on the step-down transformer that gives me the 5V supply for the components and around the low voltage sides of the circuit boards?.
I'm at the point where I'm thinking of starting again with the circuit soldering. Any insights you can offer are greatly appreciated. I'm really looking forward to completing this project as I'm on a robotics study group in my board of education in Ontario Canada, working to build our capacity in Arduino and robotics.
Hi Gordon! Search for "voltage divider" to understand what R2 and R3 are doing. This part of the circuit is completely OK, it does not create a short. The wire between R2 and R3 is connected to A0 on the Arduino - this is used for monitoring the battery. When the battery becomes weak, the robot will stop working without damaging the battery.
Yes, ground is the same on the whole circuit. All the black and light grey lines on Joop's diagram are connected. It sounds like there's a problem with your lower right two pins of the stepper driver (where high power is feed to them). If you test your circuit, there should be no connection between them. Having a short there can be dangerous for your battery! I'd not connect the battery at all, as long as the problem is there. Check your board very carefully, there must be a soldering problem somewhere (a connection between the purple and the light grey/black lines).
Great Work, i am building this one, really nice. Thanks a lot
Interesting and Fully explained project. THanx for your efforts Joop Brokking. I can see that the post is old, so now: How about now using a Nano instead of Pro Mini together with 2x A4988, 2x JDY 40 2.4G (NRF24L01) and Stepper Motors +MPU6050. This would reduce the costs to less than 50% of what was in those years. Also the JDY-40 2.4G will not require a second Arduino (Uno in your case) for the remote (use simple 4 buttons sw for FF, RV, TL, TR all wired straight to the board ). this will make a tiny hand held RC operating with a small lipo. Loved your patience in Explaining in all the 3 video clips....I listened to them all.
Genius! Just simple, Genius!
Thanks for the video. I built a dual axis solar tracker, going to build this robot to learn the MPU9265 to aid in my tracking instead of LDRs (doesn't do very well in cloudy conditions)
Great Man! Thanks for posting video and plans.
THANK YOU MY BROTHER!
God bless you every time
I ADMIRE YOU.
Matthew 25:40
Great Video ..very well explained.....as always......Thanks !!!
BTW....Stepper Motor`s are an excellent choose for this project
because of ...no backlash....in ballancing mode...
There are more benefits to the steppers - accurate (matching) speeds, direct speed command.
The DC motors are normally controlled by just duty cycle. This is not speed but rather power control. There is a dead zone at low duty cycle (no motion due to friction). As a result more stable ballancing position (I built first one with DC motors)
Thank you for the great project! One question.. Can I use this platform to make autonomous robot with ultrasonic censor? Or it's impossible because of 4 milliseconds main loop limit? Thank you.
Absolutely awesome video, so if I wanted to make one twenty times the size, would the code have to be altered or not?
this is excellent work , how small can this be feasible do you think , based on currently available components ?
Thank u so much Mr Joob for this perfect and accurate explanation, best regards
You are awesome! thanks for posting this!
Hello Joop,
This project is awesome. Very much descriptive.
I would like to suggest you to make a video series on developing a micro quadcopter with serial transceiver(eg. HC-05) or nrf24l01+ with self made remote(transmitter) just like you made YMFC video series.
There is no such proper tutorial in youtube. I hope you would appreciate my suggestion and help enthusiasts just like you and me.
i love the sound it makes
Cool thing ;-)
I like the sound of the stepper motors :-)
Great work! Thanks for sharing.
Hello, the schematics of the wiring in the downloads page is missing the connection from the second pin, botton position
(left to right) in both the drv8825, we can see that they are connected to the 5V in 4:41 and 4:24 but in the pdf they are not connected. Thanks!
You don't have to connect them. I changed the schematic after the video was uploaded.
Joop Brokking thanks, I build and works , soon will post a video, thank you!
When I click on the 《1 x Mini DC 7~28V to DC 5V step-down converter》 to view the item, it takes me to a 《Mini DC 7~28V to DC 5V Step-Down Converter Power Supply Module》.
But the Power Supply Module is different with your "yabr-schematic_robot.pdf".
Is this wrong on your site??
I FOUND THE SAME, DID U FIGURE IT OUT. thanx
Nice and clear demonstrationen and the same for to the documentation as to what one need and how til assemble, much better than most others.
Very cool project. I just bought an Arduino 101 which has a built-in 6-axis accelerometer, gyro and Bluetooth and may build one of these robots using it. I would like to try controlling it with my cell phone via a Bluetooth connection.
Great. Why put the Gyro in stand position instead of flat ? For giving plus and minus values from y pitch accelerometer ?
Cool project! Thanks for sharing!
I'm so happy I subscribed to you 🙂
Hello!
First, I would like to say that I'm not an english speaker, so, excuse me for the ortography and the explanations.
I'm an electronic student and I am making your balancing robot project (thank you for it, it's a good and nice project). I have all devices fixed and running, but the problem is the robot doesn't keep the balancing. If I put the robot in the air (keeping it with my hands) and I turn it (the vertical position), the wheels goes in one or in other sense (this show that the code is ok), but the control is not very good and this does that the robot fall down when I let it in the floor (he turns the wheels but doesn't change the sense in time).
Other problem is the motors don't go with 1/4 stepping, If I put this setting, they run only if the robot is in the air, If I let it in the floor they stop because they need more tork (I think).
All pieces are the same that yours, and I have the same configuration in drivers (0,145 A), the only think different is my drivers are setting in 1/8 stepping.
Can you help me?
Thank you very much
Make sure to set them to the same setting as described in the video. And also set the correct current for the controllers.
Joop Brokking
Thanks for answer. I got solve the problem, I changed a little the PID values, and now it works good (I think that is because my stepping is not the same and the distance per pulse is different) The only problem that I have now is when the robot starts, he goes straight about 3 or 4 meters before stop and keep the balancing state. Do you know why happen this?
Thank you.
(If you want, when I finished, I can share my project. I've changed some parts, like the structure, that it was print in a 3D printer, and the Nunchuk is in a 3D print structure too and runs with an arduino mini , one DC-DC conversor and a 9V power supply.
When you need to change the PID values the self balancing calculations will also need to be changed. I explained the working in the video.
It should be these lines:
//The self balancing point is adjusted when there is not forward or backwards movement from the transmitter. This way the robot will always find it's balancing point
if(pid_setpoint == 0){ //If the setpoint is zero degrees
if(pid_output < 0)self_balance_pid_setpoint += 0.0015; //Increase the self_balance_pid_setpoint if the robot is still moving forewards
if(pid_output > 0)self_balance_pid_setpoint -= 0.0015; //Decrease the self_balance_pid_setpoint if the robot is still moving backwards
}
Hi Joop! Thank you for your video. Why did you use 1/4 step mode instead of 1/16? Was it because of torque or to increase the time step?
I built it, but I have a problem. I NEED YOUR HELP!!
When I start it, i wait for the end of the blinking, but moving the robot, the motors do not move, they only take a small step when I move the robot from side to side, nothing more!
I adjusted the drivers well, I tried with other engines, ...
I've the same issue. No answer
HI Joop...Thank's for all this information and this great videos....
Didn't you need the capacitors in paralell with the 12V supply of the A4988 ?
And.. Do this project work usin Arduino Mega 2560 ? Thank's very much...
Hello Joop,
Congratulations on your vids you upload on the web.
There are very interesting, clear, with a good quality. Furthermore, your english is quite understandable.
Taking in account one of your vids, I built a inclinometer for a friend of mine who wanted to get a device to park his camping car as flat as possible. The device worked fine straightforward.
As far I am concerned, I build a segway clone. At first, I got all information on an american website.
The system uses an Arduino Uno + MPU6050 + Sabertooth 2X25 + 2 motors DC 24 V + 2 batteries 24V + and, of course aduino code.
I face many dysfunctions, especially the I2C bus which breaks, and motors go mad. When I read all posts on the website, it appears that too many people are in the same situation.
I wondering myself whether the description is 100% reliable.
So here is my question :
I have seen your description of your balancing robot.
In the same way, do you expect to publish a description of a segway clone. According to your experience, I am sure that it would be quite reliable.
In fact, I suppose that minor modifications have to be made on the existing balancing robot code.
Best regards,
Jean-Claude from France.
If the I2C bus gives you problems you need to make sure that you have no interference on the bus. Wires need to be soldered reliable and the power supply must be clean (filtered form the motors).
Check my videos about EMI that I made earlier:
ua-cam.com/video/aebO91Xa3Pw/v-deo.html
Also watch part 2 and 3!
THANK YOU SIR YOU HAVE ENRICHED MY LIFE ! I have just completed this project and it works perfectly ! I have next to no hope of understanding your code but I am not afraid to tinker. Is it possible to play with the travel speed? I am already experimenting with weight carrying capacity and then height. But a speed change would require a code adjustment that I am not sure is a simple thing to accomplish.Again thank you you made an old'ish man young again.
The maximum speed can be changed with this line that you can find in the code:
float max_target_speed = 150; //Max target speed (100)
Hi Joop
Many thanks for your video, just a quick question, can I use this software with the geared DC motor instead do step motor?
Thanks
I made the code for the stepper motors only. If you want to use normal dc motors you have to modify the code yourself.
Excellent design!!
can i use Li-ion battery?
Great project! First the robot didn't work, but now it works. I had to wire the left motor with the right motor driver and the right motor with the left driver, then the balance worked. But why I must do this?
Cool bro. Responce is response but very cool robot!
Thank you very much for an interesting project. The build is finished apart from the Arduino UNO, WiFi and controller. So my question is; should the robot be able to balance without the WiFi units?? Mine will not balance and seems to have a very large angle between the steppers actuating. It seems that maybe the gyro are correcting the wrong way. I have checked and double checked the wiring and it is OK
Great tutorial, I have a wiring question concerning the Mini DC 7~28V to DC 5V step-down converter. It appears the device shares the Out GND with the +Vin (12V) and +5V out. Why didn't you wire a GND for both IN and OUT? Thanks in advance for your response.
The ground in and ground out on the step down converter PCB are connected together. 99.9% of the step down converters will have this connection. That is why I used only one wire.
The part linked to in your BOM does not, however, have a shared ground. www.dx.com/p/mini-dc-7-28v-to-dc-5v-step-down-converter-power-supply-module-green-black-398251?Utm_rid=78761898&Utm_source=affiliate#.WXsC0a1Dw0Q
@@akauppi2 Yes, they are connected, I just checked with my ohmmeter
Great video. I am going to build one.
Hello, very educational video. But one question: What has to be changed if I want to power the robot with cable?
Thanks for documenting and sharing this project!
I had an old, original nunchuk lying around which is was not recognized by the test program. Adding delay(1) after 3 of the Wire.endTransmission() statements fixed it. I guess these old ones are slow ;) If you want, I can send you the fix.
Thanks again Joep! Your delay fix for line 39 was all that was needed to get my very old original nunchuk working in the remote. The other important fix in my setup was to delete the 4K7 resistor in the robot that Joop has on the TX line of the transceiver...the signal could not make it through (BTW I am using a Nano in my robot, not a ProMini)
Nice :)
And indeed, the trick with the resistor probably doesn't work on a Nano. Make sure you disconnect the tranceiver before reprogramming the Nano...
Thanks again Joep! Is the remote supposed to be proportional (faster if you push it farther)?
The remote isn't proportional. It is digital by design.
Joep Suijs: I guess my remote works properly then, it only produces a 1 or 2 or 4 or 8 depending on the position of the joystick 😊
Nice project & documentation Joop, congratulations! However, the 12v/5v DC/DC step down converter is not necessary. You can plug directly the battery to the Arduino's RAW pin, then the DRV8825's and the MPU6050 can be fed from Arduino's 5V pin. Also, adding a capacitor for the stepper drivers would not be a bad idea.
The regulator on the Pro Mini can only deliver approx. 100 - 150mA. With the transceiver on the voltage regulator of the Pro Mini can overheat and shut down. That is why I used the external voltage regulator.
Pro Mini's KBAA regulator draws up to 150mA, and your transceiver draws only 21mA(MAX), so there's plenty of available current and so regulator won't overheat. DRV8825's logic side are even less current hungry.
Read the stepper driver datasheet! It requires at least 8V and being inductively loaded generates spikes ot its power rail. The embedded 5V regulator is linear i.e. with limited load handling capability and cannot suppress thye spikes coming from a motor driver.
Oooh! I've been meaning to build something like this!
Hi, Joop: It's very interesting and you explained very well. I don't know if I missed while watching but the only thing I didn't clear after I saw you video is how the remote controller is connected. I know one of the transceivers is connected to the Arduino Uno. However, how is the one working with the remote controller is connected. I assume the Anduino's microcode will take care of their operations. If there's anything else, maybe I will ask next time.
Additional question. Does the wheel size affect the calculations? If so, could the spreadsheet help to derive the new factors? Thanks
Hi Joop, any idea why the stepper motors work when not touching the ground, but halt and make a whirring noise when they do touch the ground? Everything else works well.
Beautiful project, thansks for share !!!!
nice project.👍👌 :)
Nice projects. I want to ask you if I can use the accelerometer to read vibration in a ball bearing as I am working on a project mixed between mechanics and electronics...Thank you.
very nice complete tut! Thank you.
yeah! this is awesome! I wanna build it
Yessss
Can I use an Arduino Pro Mini instead of the Arduino UNO in the remote control ?. There should be no modifications in the code for the remote except for the type of board used . The remote is using only I2C to talk to the nunchuck and serial to talk to the RF module
Amazing work Joop.
Why the separate tuning for balance point? The addition of a single button (press when the robot is upright and the current value is used as the cal value) and a couple lines of code make it easier. Better yet is fully self calibrating, but that is a bit more work-- I am too lazy to code it for an application like this.
When I look at the photo of the prototyping PCB it looks like the FAULT pin is connected to the + 5V. Is this correct? I don't see in the schematic that pins 9 to 16 are all connected as it appears on the PCB. My fuses blow every time I plug in a DRV8825. With or without a stepper motor connected.
@Joop, for information, the schematic in pdf on the website, the FAULT pin is not connected. I started from this schematic purely and alone. After watching the video again, it appears that the schematic in this video used has been drawn correctly.
Hello, i read the code. Timer intterupt occur every 20 micro second. So 40 micro second period pulse is generated and that can control maximum 45 degree. Am i right? And if the pidoutput is less than 45degree. What action is operated during remaining time of 4ms? No action?
Very beautiful and good job