loading

In this Instructable I wanted to show to you how to make a self balancing robot. What makes it unique is that its exterior is made to look like the Instructables Robot. Internally it works in the principle of PID, it is a very popular control system for maintaining a variable from fluctuating. In this instructable I have used the MPU6050 which is a gyroscope and an accelerometer in a single package. The gyroscope is used to find the angular orientation and the acceleration. For our application we just need the gyroscope data. To start off I will discuss the various applications and knowledge obtained from this project. Please vote for my entry in the "Instructable Robot Contest" if you find this instructable good.

Project-Based Learnings:

  • Knowledge of how to use the MPU6050 module.

  • How to implement the data to balance the robot.

  • How to implement control systems to your projects.

____________________________________________

Applications:

____________________________________________

Proportional-Integral-Derivative System Advantages:

  • This Control System should be used when the controlled element needs precise control.

  • This balancing robot can be easily made by a Novice Arduino Programmer using this Control System.

  • The tuned PID system is very flexible over a range of environments (i.e. balancing even when weight is added).

____________________________________________

This control system's efficiency depends on the tuning of three variables namely the Proportional constant, Integral constant and Derivative constant, So once you tune the variables accurate control of the robot is achieved. I have provided most of the instructions for making the robot. This robot is in the intermediate level of robotics so beginners shouldn't get frustrated because it for very challenging for Me!!!

Step 1: Parts & Materials

The material needed to make this balancing robot can be grouped into two categories as shown below:

Electronic Components:

____________________________________________

Other Parts:

____________________________________________

Please note that I have not used Acrylic Sheet as mentioned but Hylam Sheet(Bakelite Sheet). It is very much similar to acrylic but more rigid and easier to cut. It is commonly used in India for Switchboard Boxes. It may or may not be available in your Country so I mentioned it as an Acrylic Sheet.

<p>Wow, amazing and such detailed instructions! Nice work! :)</p>
<p>Thank you!</p>
hey, which library we have to download.?? i got error so pls rply thanks
<p>Hi. The robot does not work for me.</p><p>The motor turns only in one direction</p>
<p>i need help please . when i make the power of the driver l298 the sensor blocked and don't return any value</p>
<p>hi</p><p>i am done with all the connections and code but when by robot lean to forward than its left wheel moves forward and when it lean towards back than its right wheel turns backward can you please tell me the solution of it</p>
<p>Didn't work very well!</p>
<p>Can you please explain why you &quot; targetAngle = 8.5 &quot; rather than &quot; 0 &quot; cause I'm facing the problem I can't stop motors at just Vertical position rather they stop on slightly bent angle.</p>
<p>how to apply complementary filter using this code?</p>
<p>Now this is how you fukin explain a project. !!JObWeldon</p>
<p>sir...beautiful robot...</p><p>is robot ko modify karke....24 volt ki brushlss motor lagakar....nd 20-24 amp ka motor driver use kake segway bana sakte h....????</p><p>and india me sabertooth motor driver jo 24 amp ka hai availble nahi hai.....plzzz mjhe suggest kijiye ki kese ek rideable segway banaya jaye with the help of your robot....</p>
great work .. some useful tips I've observed while making these is that your IMU must be as close to the axis of rotation as possible. Also like an inverted pendulum ..its more stable when the weight is distributed at the top rather than lower towards the base .. moving things around might just work.
<p>Great work. In my version based on yours I found it necessary to put a pot on to trim out the gyro bias. This stops it trying to move forwards or backwards all the time and stand still!</p>
<p>Hello.</p><p>Great Robot! </p><p>I am new to Arduino so I hope you can help.</p><p>When I compile the MPU6050_DMP6.ino I receive the following errors.</p><p>Arduino: 1.5.7 (Windows 7), Board: &quot;Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)&quot;</p><p>In file included from MPU6050_DMP6.ino:48:0:<br>C:\Program Files (x86)\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:89:7: error: 'prog_uchar' does not name a type<br> const prog_uchar dmpMemory[MPU6050_DMP_CODE_SIZE] PROGMEM = {<br> ^<br>C:\Program Files (x86)\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:229:7: error: 'prog_uchar' does not name a type<br> const prog_uchar dmpConfig[MPU6050_DMP_CONFIG_SIZE] PROGMEM = {<br> ^<br>C:\Program Files (x86)\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:271:7: error: 'prog_uchar' does not name a type<br> const prog_uchar dmpUpdates[MPU6050_DMP_UPDATES_SIZE] PROGMEM = {<br> ^<br>C:\Program Files (x86)\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h: In member function 'uint8_t MPU6050::dmpInitialize()':<br>C:\Program Files (x86)\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:342:30: error: 'dmpMemory' was not declared in this scope<br> if (writeProgMemoryBlock(dmpMemory, MPU6050_DMP_CODE_SIZE)) {<br> ^<br>C:\Program Files (x86)\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:349:42: error: 'dmpConfig' was not declared in this scope<br> if (writeProgDMPConfigurationSet(dmpConfig, MPU6050_DMP_CONFIG_SIZE)) {<br> ^<br>In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28:0,<br> from C:\Program Files (x86)\Arduino\libraries\I2Cdev/I2Cdev.h:77,<br> from MPU6050_DMP6.ino:46:<br>C:\Program Files (x86)\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:390:98: error: 'dmpUpdates' was not declared in this scope<br> for (j = 0; j &lt; 4 || j &lt; dmpUpdate[2] + 3; j++, pos++) dmpUpdate[j] = pgm_read_byte(&amp;dmpUpdates[pos]);<br> ^<br>C:\Program Files (x86)\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:394:98: error: 'dmpUpdates' was not declared in this scope<br> for (j = 0; j &lt; 4 || j &lt; dmpUpdate[2] + 3; j++, pos++) dmpUpdate[j] = pgm_read_byte(&amp;dmpUpdates[pos]);<br> ^<br>C:\Program Files (x86)\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:433:98: error: 'dmpUpdates' was not declared in this scope<br> for (j = 0; j &lt; 4 || j &lt; dmpUpdate[2] + 3; j++, pos++) dmpUpdate[j] = pgm_read_byte(&amp;dmpUpdates[pos]);<br> ^<br>C:\Program Files (x86)\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:437:98: error: 'dmpUpdates' was not declared in this scope<br> for (j = 0; j &lt; 4 || j &lt; dmpUpdate[2] + 3; j++, pos++) dmpUpdate[j] = pgm_read_byte(&amp;dmpUpdates[pos]);<br> ^<br>C:\Program Files (x86)\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:441:98: error: 'dmpUpdates' was not declared in this scope<br> for (j = 0; j &lt; 4 || j &lt; dmpUpdate[2] + 3; j++, pos++) dmpUpdate[j] = pgm_read_byte(&amp;dmpUpdates[pos]);<br> ^<br>C:\Program Files (x86)\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:459:98: error: 'dmpUpdates' was not declared in this scope<br> for (j = 0; j &lt; 4 || j &lt; dmpUpdate[2] + 3; j++, pos++) dmpUpdate[j] = pgm_read_byte(&amp;dmpUpdates[pos]);<br> ^<br>C:\Program Files (x86)\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:478:98: error: 'dmpUpdates' was not declared in this scope<br> for (j = 0; j &lt; 4 || j &lt; dmpUpdate[2] + 3; j++, pos++) dmpUpdate[j] = pgm_read_byte(&amp;dmpUpdates[pos]);<br> ^</p><p> This report would have more information with<br> &quot;Show verbose output during compilation&quot;<br> enabled in File &gt; Preferences.</p><p>Thanks</p><p>Ralph</p>
<p>I'm sorry I didn't reply sooner!! this is very complicated to find the problem I just suggest to start over with each individual module tested using the serial monitor to check the output from the accelerometer!!!</p>
<p>Great works! I have made one too!</p><p>The only problem is that my motors just vibrating back and forth irregularly.</p><p>Can you help me to solve this problem?</p><p>I noticed that my motors work on 90 rpm. And maybe it is noisy, as camiano said.</p>
<p>I have sent you a PM with my troubleshooting tips!!! </p>
<p>The easiest Arduino UNO based self-balancing robot, controllable by Smart Phone, RC and more!</p><p>https://www.indiegogo.com/projects/balanbot-best-arduino-self-balancing-robot-ever/x/8897587#home</p>
<p>Frustating afternoon adding motors to my working electronics. Immediately on start up - the motors just went into full throttle in one direction. Tilting the machine back and forth had no effect. I tried separating the arduino/shield power supplies and added smoothing capacitors to each motor - no change. Tried it with just one motor - no change. Finally I swapped the motors for another similar set. SUCCESS! Seems like the new motors I bought for this project are very very noisy. </p>
<p>Great you found the problem I almost went crazy trying to produce results for my robot :) , post the pic of the finished robot!!!!</p>
<p>I've made the electronic side of this and looks to be working well. I used the L298P Arduino Motor Sheild so needed to amend your code to suit the pre-defined pins needed for the plug in shield. </p><p>When I make the mechanics I intend to put the MPU6050 in line with the wheels as I believe this will balance easier. I can see why you've put your 6050 up high - so your robot looks like the instructable robot.</p><p>Next thing to do is get rid of the variable resistors by using a bluetooth interface to send in the PID values from a mobile phone.</p><p>Thanks for the help - I'm standing on the shoulders of giants!</p>
<p>wow. . awesome.. u can do it. .<br>i start make it, but i cant finish it . LOL.<br>can i make one (your project) for practice? i want to learn it <br><br>sorry for my bad english </p>
<p>sure man just use higher rpm motors for more impressive results.....anything over 300 rpm is good....all the best!</p>
<p>बधाई मुरली. बहुत अच्छा बनाया है</p>
Awesome
<p>Thank you!!</p>

About This Instructable

28,865 views

97 favorites

License:

Bio: I am currently doing my BE in mechanical engineering but im more interested in physics and robotics and such stuff.I am new here hope ... More »
More by Naren_Murali: Balancing Instructable Robot Arduino Real Time Clock (DS1307) 3 Arduino Pins to 24+ Output Pins
Add instructable to: