Files for RED, the balancing robot

Nov 7, 2014 Update – I made a public repository in GitHub to hold all of the files for RED. You can find it here: https://github.com/osmaneralp/RED/.

CAD Files

RED was designed in SolidWorks. I know a full license of SolidWorks is expensive, but it is the most widely used tool for designing robots. If you are a student, you can get an educational version of SolidWorks for about $200, which is very reasonable.

This version has some a few problems:
– The belts don’t turn because the pulleys are fully defined.
– The design as a whole is under defined.

Despite these problems, you can still use the drawing to see what parts are needed and how the parts fit together. I’ll fix the problems when I get time.

In case you don’t have aceess to SolidWorks, here are some images of the important parts:

pulley lower 1

pulley lower 2

pulley upper 1

pulley upper 2

A SolidWorks pack and go file is available in my GitHub repository: https://github.com/osmaneralp/RED.

Arduino Files

The code for RED is contained in two sketches: robot.ino and motors.ino. Most of robot.ino is related to initializing the MPU-6050. I should really move it to a separate file. Most of the motors.ino file is for reading the wheel encoders. I am using an interrupt on each edge of both phases of the quadutrature signals for each wheel. That’s a lot of interrupts. The Arduino Due can keep up. I don’t know if a slower Arduino, such as the Uno, can keep up with so many interrupts. This is one reason I chose the Arduino Due.

In addition to the two sketches, I used the following libraries: I2Cdev, MPU6050, PID_v1, and PS2X_lib. The PS2X_lib did not work with the Arduino Due, so I made some modifications to make it work. One thing I discovered is that a lot of libraries are not yet ported to the Due. If you choose a Due, be prepared to make changes to code that works for all the AVR based Arduinos. Thus, I would not recommend the Due for a beginner.

The Arduino files are available in my GitHub repository: https://github.com/osmaneralp/RED.

Parts List

Item Vendor Part Number Qty Unit Extended
Mechanics
1 6″ Heavy Duty Wheels ServoCity 595610 2 9.99 $ 19.98
2 24″ Aluminum Channel ServoCity 585466 1 15.99 $ 15.99
3 12″ Aluminum Channel ServoCity 585454 2 9.99 $ 19.98
4 9″ Aluminum Channel ServoCity 585450 2 7.99 $ 15.98
5 6″ Aluminum Channel ServoCity 585466 2 5.99 $ 11.98
6 Pinion Pulley 16T 0.25″ ServoCity 615378 4 8.99 $ 35.96
7 Shaft Coupler 0.25″ to 6mmServoCity 625106 2 4.99 $ 9.98
8 Bearing 0.25″ ServoCity 635042 6 0.995 $ 5.97
9 Motor 37D 30:1 Pololu 1443 2 39.95 $ 79.90
10 Motor Mount ServoCity 555128 2 4.99 $ 9.98
11 Flat Single Channel BrackeServoCity 585468 2 1.29 $ 2.58
12 Hub Spacer 0.5″ ServoCity 545384 2 1.59 $ 3.18
13 Shaft Clamp Collar 0.25″ ServoCity 625102 4 2.495 $ 9.98
14 D-Shaft 0.25″ x 1.75″ ServoCity 634066 2 1.39 $ 2.78
15 Shaft Spacer ServoCity 633105 4 0.14 $ 0.56
16 Aluminum Clamp Colar 0.25″ServoCity 6157K12 2 4.99 $ 9.98
17 D-Shaft 0.25″ x 2.25″ ServoCity 634070 2 1.59 $ 3.18
18 Hub Adapter 1.5″ x 0.770″ ServoCity 545388 2 4.99 $ 9.98
19 Clamping Hub 0.25″ x 0.770ServoCity 545588 2 7.99 $ 15.98
20 Socket Head Screw #6 x 0.2ServoCity 632106 1 1.69 $ 1.69
21 Socket Head Screw #6 x 0.3ServoCity 632110 1 1.89 $ 1.89
22 Timing Belt XL 17″ ServoCity B375-170XL 2 4.95 $ 9.90
Electronics
23 Arduino Due SparkFun 11589 1 49.95 $ 49.95
24 Dual MC33926 Motor Driver Pololu 1213 1 29.95 $ 29.95
25 MPU-6050 Breakout SparkFun 11028 1 39.95 $ 39.95
——-
$417.23

Other Misc Parts
#6 Nuts
Hookup wire
Battery
PS2 Remote control
Acrylic

References

Balancing robots have been around for many years. The first balancing robot I encountered, nBot, was created by David Anderson. His robot remains one of the best even after many years. He describes his robot on his website: http://www.geology.smu.edu/~dpa-www/robo/nbot/.

Back in 2010, Kas started a thread on the Arduino blog called Balancing robot for dummies. This was around the same time as I was building my first balancing robot, Blinky. I didn’t use an Arduino in Blinky, but I learned a lot from that thread. It is still an excellent source of information for building a balancing robot.

The only way that I was able to create the code for RED in only a few weeks is because of the work of others, particularly those who created open source Arduino libraries, such as Jeff Rowberg’s I2Cdevlib,¬†Brett Beauregard’s PID library, and Bill Porter’s PlayStation 2 controller library.¬†Many thanks!

21 comments to Files for RED, the balancing robot

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>