Shop OBEX P1 Docs P2 Docs Learn Events
2 Wheels Balancing Robot — Parallax Forums

2 Wheels Balancing Robot

Tronic (Greece)Tronic (Greece) Posts: 130
edited 2010-11-14 09:18 in Robotics
rc2robotsm4bh.jpg

This is a project still in development but its some sort of complete as it is now as I think I reached the BS2 and servo speed limitations.
As you can see, its actual a boe-bot reformed into a inverted pendulum so it can balance on its two wheels.
And it does so!! It consists of the OEM BS2 board of education (special order by Deagostini), continuous rotation servo (by parallax), and an infrared sensor circuit (QRD1114) that resembles the QTIsensor.
With combination of RCTIME command, it can return the "angle" distance from 0.5cm to 5cm with enough precision to maintain its balance.
My intentions was to use 2 such IR sensors (one front, the other back) to be able to make it more stable but the speed limitation prevented that so in the working model shown below it uses only one sensor.
To add more weight on top and to free the BS2·from the servo jitter, I used a second set of batteries.
Now for the navigation part I choose to add a digital RF remote control module that outputs 0 or 1 on each channel to simplify and speed up the BS2 program.



Many thanks to·Makis·[url=mailto:makis_stergiou@yahoo.com?subject=La Cicala]Stergiou [/url]for his original idea for the formation of the robot. Take a look on his progress on a balancing robot:

http://www.freewebs.com/bouloni/robot.htm




rcsensorcircuitsm8km.gif

qrd1114schematic3aj.jpg

qrd1114unfocusedinfraredphotod.jpg


qrd1114rctimechart4pu.gif



Early 2robot pics:
http://img83.imageshack.us/img83/5297/01qrd1114rcsensortest2gf.jpg
http://img80.imageshack.us/img80/2008/022robotwheels2ma.jpg
http://img80.imageshack.us/img80/2863/032robotsensorswiring2qo.jpg
http://img83.imageshack.us/img83/1222/042robotsensorswiring25wh.jpg
http://img83.imageshack.us/img83/3076/052robotfront2az.jpg
http://img80.imageshack.us/img80/221/062robotside8yv.jpg
http://img80.imageshack.us/img80/1386/072robotback3mk.jpg
http://img83.imageshack.us/img83/3653/082robotqrd1114sensors3iy.jpg
http://img80.imageshack.us/img80/7307/092robotwirings1my.jpg

The code I wrote to make it ballance is based on a PID control article posted here Stamps In Class Mini Projects and its very efficient. It implements the feedback mechanism of a standard servo in software mode so I can read the feedback factor from QRD1114.
The link of the great article is: http://forums.parallax.com/showthread.php?p=529609

In order for the feedback system to work properly it needs to calibrate it self during power-on. The procedure to do this is to hold it vertically while you switch on the power and after 2 seconds it is ready to balance by its own!!

proportionalwithoutputoffset7q.jpg

Watch the first steps of my balancing robot:
http://rapidshare.de/files/12792224/2robot_first_steps.zip.html
http://rapidshare.de/files/12792297/2robot_fisrt_steps_small.zip.html



With the digital RF remote control I was able to make it turn left and right while· its balancing in place. The tough part was the forward-backward motion as the only thing I could do it to make it lean a little forward so it unbalances and release the front button to let it run forward trying to balance... and help it brake by pressing the back button...· :-)


bs2torcreceiverinterface0vz.gif

http://img130.imageshack.us/img130/4332/rc2robot14ru.jpg
http://img301.imageshack.us/img301/990/rc2robot22ur.jpg
http://img131.imageshack.us/img131/2872/rc2robot34xc.jpg



Watch it here to make some turns and small steps forward:

http://rapidshare.de/files/13159228/2robot_Navigation.zip.html
http://rapidshare.de/files/13159314/2robot_Navigation_small.zip.html





Post Edited (Tronic (Greece)) : 2/14/2006 2:25:09 PM GMT

Comments

  • bobledouxbobledoux Posts: 187
    edited 2006-02-14 13:45
    This is a very nice piece of work.
  • SN96SN96 Posts: 318
    edited 2006-02-15 14:10
    Very well documented! Nice job!

    If you want to provide video of it in action, you can go to www.youtube.com and host your video there. It's free and it's like imageshack but for videos. It take some time for it to show up after uploading, so you will need to be patient.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike

    ·
  • Tronic (Greece)Tronic (Greece) Posts: 130
    edited 2006-02-16 09:21
    Thanks, roll.gif

    For those wondering what’s the trick behind it, here is a small clue:
    On first experiments I discovered that hard surfaces cause summing oscillations on the code because of the poor precision of the servos that sometimes do bigger movements from the calculated. By placing it on a carpet which has about 2mm thickness it absorbs the oscillations thus making it more stable on navigation.


    I took a few more video of the robot doing some navigation around...

    · nice360turn (5MB)
    · movingforward (1.2MB)
    ··irsensorcloseup (1MB)
    · ouch (1.8MB)· (lost balance after craching on obstable)


    PS. I already posted some videos thru rapidshare on the article above...

    Thanos
    ·
  • SN96SN96 Posts: 318
    edited 2006-02-16 21:20
    Oops, Sorry I mised that. I did not see those links. I guess I was blind that day.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike

    ·
  • Tricky NekroTricky Nekro Posts: 218
    edited 2006-02-27 08:32
    Coolio...

    I want to see the faces of the other at our Forum...

    I'm just out of word... (I can say that is also fair competition!!!)


    Post Edited By Moderator (Chris Savage (Parallax)) : 9/27/2006 8:19:47 PM GMT
  • Tronic (Greece)Tronic (Greece) Posts: 130
    edited 2006-03-03 12:26
    Thanks, Provas

    This is the best I can do with the standard Boe-bot parts. Any further improvements require the replacement of the CR servo by DC motors combined with a DC controller, not to mention the use of an ADXL202 sensor for accurate inclination measurement.

    Thanos


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Greekbotics: Greek Robotics Forum
  • magimagi Posts: 35
    edited 2006-03-03 20:42
    Hello.

    I am planning a one ball balancing robot.

    Does anybody know if someone have done anything like that.
    I have some questions.

    I am to have a ball on the bottom controlled by step motors, as in a mousewheel.

    And to be able to stop and paus I have three arms that is flipped out and down, with micro switches, so it can lean on them and even be able to use them to keep balance in corners.

    This is then ment to be used in a two leged robot so the robot will have one balancing ball in each feet, so it will go from two wheeled to one balled balancing robot as it is walking with its legs.

    Whell if it can be done.....

    This will give a nice movement for my wireless web camera FPS robot player that is planned. [noparse]:)[/noparse]

    www.gamereality.se

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Please start United Religions , UR , for gods sake.. [noparse]:)[/noparse]

    Post Edited (magi) : 3/4/2006 12:24:36 PM GMT
  • boulonibouloni Posts: 1
    edited 2006-03-04 12:52
    Hi all,

    magi, check this pdf:

    robots.stanford.edu/isrr-papers/hollis.pdf
  • Tronic (Greece)Tronic (Greece) Posts: 130
    edited 2006-03-04 13:31
    Ηι Makis (bouloni), you are right! Those guys use real computer to compute the movement required for a one ball system to balance!! shocked.gif

    Magi, are you sure you will go thru it using only a basic stamp? freaked.gif




    Thanos

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Greekbotics: Greek Robotics Forum
  • magimagi Posts: 35
    edited 2006-03-28 18:46
    Tronic (Greece) said...
    Ηι Makis (bouloni), you are right! Those guys use real computer to compute the movement required for a one ball system to balance!! shocked.gif


    Magi, are you sure you will go thru it using only a basic stamp? freaked.gif


    Thanos

    Well a prototype can be done in basic stamp but for industrial use i will use a FOX BOARD or AXIS 241SA.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Please start United Religions , UR , for gods sake.. [noparse]:)[/noparse]

    Post Edited (magi) : 3/28/2006 7:39:22 PM GMT
  • Tronic (Greece)Tronic (Greece) Posts: 130
    edited 2006-03-29 14:48
    I would love to see a prototype of it (using BS2) that actually balances... yeah.gif

    Thanos


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Greekbotics: Greek Robotics Forum
  • SterlingSterling Posts: 51
    edited 2006-04-20 06:56
    I just started a robot similar to yours. I have a very hard time finding the initial balance. Do you have any pointers? Is it normal to try several times before it balances?
  • Tronic (Greece)Tronic (Greece) Posts: 130
    edited 2006-04-20 09:11
    In order for the feedback system to work properly it needs to calibrate it self during power-on. The procedure to do this is to hold it vertically while you switch on the power and after 2 seconds it is ready to balance by its own!! The feedback system starts with this value and then it tries to maintain it when you let it go... Just make sure you power it up in the proper balancing range (-1 to +1 degrees).

    You can always predefine the initial balancing value but it would work only on one type of surface while with my calibration procedure during power-on·you can get it to·balance·on almost every surface type!

    Thanos


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Greekbotics: Greek Robotics Forum

    Post Edited (Tronic (Greece)) : 4/20/2006 9:14:45 AM GMT
  • SterlingSterling Posts: 51
    edited 2006-04-20 17:03
    I think I figured out what the problem is. I tried several different surfaces and finally found one that worked. Apparently, to the sensor, not all surfaces are created equal. [noparse]:)[/noparse]
  • RinksCustomsRinksCustoms Posts: 531
    edited 2006-06-29 04:45
    magi...

    I believe the propeller would give enough computing power for this project www.parallax.com/propeller

    coupled with two stepper motors and the addition of the two axis accelerometer and some fancy coding that balancing ball thinamabobber could actually work.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Definetly a E3 (Electronics Engineer Extrodinare!)
    "I laugh in the face of imposible,... not because i know it all, ... but because I don't know well enough!"


    Post Edited (RinksCustoms) : 6/29/2006 4:59:17 AM GMT
  • AImanAIman Posts: 531
    edited 2006-07-26 15:56
    I wonder if linking 2 stamps would allow control of a unicycle type robot.
  • Tronic (Greece)Tronic (Greece) Posts: 130
    edited 2006-07-27 11:04
    Well, not exaclty linking, but if each stamp checked (only) its own axis direction, it might balance.

    But then how are you going to add control to it, to make it move?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Greekbotics: Greek Robotics Forum

    (Translate it using Babelfish)
    ·
  • AImanAIman Posts: 531
    edited 2006-11-16 13:07
    It would move based on a slightly less correction to upright.

    In other words when it gets balanced by your method and then released, it would deliberatly NOT correct position or over correct the opposite postion to move and steer.
  • bubbleheadbubblehead Posts: 36
    edited 2006-11-16 18:23
    There was a story on the 'Ballbot' in a recent issue of Scientific American (maybe the August issue).· Check your library.·

    The ballbot uses gyroscopes and accelerometers for balancing and moving.· And has legs that come out when it is stationary, so as to conserve battery power.

    Here is some info, with photos,·from CMU: http://www.msl.ri.cmu.edu/projects/ballbot/


    ·
  • Bryan K.Bryan K. Posts: 47
    edited 2007-07-18 03:02
    The Propeller is very useful with a balancing bot. I am currently working on one, along with scaling it up to make a balancing scooter (Segway) So far, the Prop seems to have more processing power than I am currently using (only 4 of the 8 processors) it seems to be doing a great job so far....
  • AImanAIman Posts: 531
    edited 2007-07-19 17:57
    The more I think about it the more I like the idea of a combination of items. There is the standard accelarometor (sp?), IR and Sonar combination but if a couple Gyro's·are thrown in things would be better.
  • bulkheadbulkhead Posts: 405
    edited 2007-07-24 00:22
    That's a very interesting project! I didn't think a simple boe bot could be converted into a working, balancing robot with just a line sensor. I have a question though, why must it be calibrated each time? It seems to me that, given the reading from the sensor, theres enough information to have it balance itself. The conditions for balance would be 1) the boe bot's servos are pretty much not moving and 2) the readings from the sensor are relatively stable.

    Also, for speeding up your bs2's readings and calculations, it helps to run the line sensors as close to the ground as possible so that the readings are faster. In the same way, a more reflective/lighter colored surface would allow for less time for distance readings.
  • Tronic (Greece)Tronic (Greece) Posts: 130
    edited 2007-07-25 11:31
    It just needs calibration for each surface during power-up.

    If I were going to revisit this project I would definetly changed the cheap RC ADC with a more accurate and faster ADC converter like a ADC0831...

    But I moved on on bigger projects like the one below:

    http://youtube.com/watch?v=QWzkWVQ1SMQ

    **update**: http://www.youtube.com/watch?v=Quuqhjnxwq4·


    Yes, it its moved by a basic stamp2 with HB-25 controllers for the motors... with a proportional servo code simular to the one I used in the balancing robot!hop.gif


    Regards, Thanos


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Greekbotics: Greek Robotics Forum

    (Translate it using Babelfish)


    Post Edited (Tronic (Greece)) : 8/17/2007 10:20:27 AM GMT
  • stamptrolstamptrol Posts: 1,731
    edited 2007-07-25 14:31
    · Nice project!

    · Great to see some life-size projects!

    ·· Maybe start a new thread to keep us informed.

    · Cheers,






    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • bulkheadbulkhead Posts: 405
    edited 2007-07-26 00:04
    Wow! I would like to see a new thread on that project, it looks really cool.
  • HenrymouHenrymou Posts: 128
    edited 2007-08-17 05:48
    HIGH TECH SORCERY I SAY!
    SORCERY!
    very nice, it's so shinny and futuristic
    what kind of magic bean does it run on?
  • Tronic (Greece)Tronic (Greece) Posts: 130
    edited 2007-08-17 10:20
    It runs on the best magic bean ever: a Basic Stamp2 chip!!! jumpin.gif

    Thanos


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Greekbotics: Greek Robotics Forum

    (Translate it using Babelfish)
    ·
  • nelsonlombardonelsonlombardo Posts: 2
    edited 2010-11-14 09:18
    Nice work!
Sign In or Register to comment.