Shop OBEX P1 Docs P2 Docs Learn Events
Balancing Bot - Page 2 — Parallax Forums

Balancing Bot

24

Comments

  • ratronicratronic Posts: 1,451
    edited 2010-10-29 13:02
    That ball balancer is Cool. Can"t wait to see the video of your first prototype you come up with!
  • agfaagfa Posts: 295
    edited 2010-10-30 05:37
    Take a look at my picture. Do you know what it is? No, it's not a dragster, it's my balancing bot. Do you know why it's lying down? Because it's not balancing. Do you know why it's not balancing? I don't know either. Do you know what I do know? I know how to burn up gyros and motor drivers. So as soon as the smoke clears I'll be placing an order.

    I hope that everyone else is having better luck than I am.
    768 x 512 - 72K
  • LeonLeon Posts: 7,620
    edited 2010-10-30 07:55
    Erco:

    I've just ordered two of those Sharp units from Junun. They are over twice the price from Farnell here in the UK, and they don't supply made-up cables. Thanks for the link.
  • ercoerco Posts: 20,256
    edited 2010-10-30 11:52
    @Leon: Junun has the best sensor prices I've found.

    @agfa: You've gotta be a better politician than that. NEVER admit failure or defeat. If it doesn't balance, then you MEANT to make a dragster. Then later on when it does balance, you're DOUBLY a hero, because dragsters don't balance (well only briefly during a wheelie).

    I'm sure these IR units will work to some degree in many applications, but a gyro/accelerometer combo is best for use on all surfaces, and certainly for going up a ramp and crossing from one floor type to another. That's the ultimate goal, but I think the IR units will be a good place to start.
  • LeonLeon Posts: 7,620
    edited 2010-10-30 11:56
    erco wrote: »
    @Leon: Junun has the best sensor prices I've found.

    @agfa: You've gotta be a better politician than that. NEVER admit failure or defeat. If it doesn't balance, then you MEANT to make a dragster. Then later on when it does balance, you're DOUBLY a hero, because dragsters don't balance (well only briefly during a wheelie).

    I'm sure these IR units will work to some degree in many applications, but a gyro/accelerometer combo is best for use on all surfaces, and certainly for going up a ramp and crossing from one floor type to another. That's the ultimate goal, but I think the IR units will be a good place to start.

    It's probably best to have a floor with fairly high reflectance, or put something like a large sheet of white paper under it.
  • agfaagfa Posts: 295
    edited 2010-10-30 12:35
    Leon wrote: »
    It's probably best to have a floor with fairly high reflectance, or put something like a large sheet of white paper under it.

    I don't think you'll have to Leon. I read that it can detect a black wall in full sunlight.
  • LeonLeon Posts: 7,620
    edited 2010-10-30 13:04
    I'll do some experimentation when I get my units.
  • ercoerco Posts: 20,256
    edited 2010-10-30 16:42
    BTW, I've read on several BB websites that they work best with pneumatic tires (tyres for you, UK Leon!) and on carpeting. Well, both of those mush out to make a bigger footprint, so they are both a bit of a cheat. At least a bandaid.

    http://code.google.com/p/b3r1/
    http://nutsvolts.texterity.com/nutsvolts/200612/?pg=79#pg79

    A REAL MAN'S balancing robot must use solid rubber tires on a hard floor. :)

    Tons of good info & links on BBs:
    http://www.wa4dsy.net/robot/balancing-robot/analog-balancing-bot
  • agfaagfa Posts: 295
    edited 2010-10-30 20:05
    It's pretty rough, but it balanced.

    http://www.youtube.com/watch?v=rGtIJhqaEg8
  • ercoerco Posts: 20,256
    edited 2010-10-30 22:14
    That's a great start! Be proud! Care to share your methods?
  • agfaagfa Posts: 295
    edited 2010-10-31 06:25
    erco wrote: »
    Care to share your methods?

    I'm using a gyro to calculate a rotational position that's plugged into a proportional feedback loop to control the motors. At best it will only stay balanced for a few seconds.

    I've modified the sample software to read the gyro, I'm still playing around with methods to get rotational position. To drive the motors I have a 754410 quad half hbridge with a propeller generating the PWM.

    I'm kind of bumping around in the dark on the hardware so I have everything on a breadboard for now.

    Of course, against all advice here, I had to try balancing with just an accelerometer. I guess I had to see it for myself.

    I'm really lost when it comes to filtering techniques to combine the gyro with an accelerometer. I found a document describing a complimentary filtering method that is supposed to be a lot simpler than a kalman filter. That's what I will try next.

    agfa
  • ercoerco Posts: 20,256
    edited 2010-10-31 08:45
    XLNT. And you are using a Propeller?
  • agfaagfa Posts: 295
    edited 2010-10-31 09:02
    erco wrote: »
    XLNT. And you are using a Propeller?

    Yes. I'm using a propeller proto board.
  • ercoerco Posts: 20,256
    edited 2010-10-31 12:31
    I have all the parts I need to make a simple balancer, just no time! Arrgghh!!!
  • ercoerco Posts: 20,256
    edited 2010-11-06 20:52
    Here's a guy whose robot achieved balancing using a single Sharp IR sensor: http://homepage.mac.com/sigfpe/Robotics/equibot.html There's a video link on that page, and a link to his C code that uses PI control (not PID). Looks like a long program for the fairly rough control achieved. I'm sure we can do as good with a BS2 and much shorter code.

    Edit: Here's a guy who abandoned his accelerometer in favor of two Sharp GP2D12 IR units, which worked for him. His PIC Basic code also attached: http://home.comcast.net/~botronics/balibot.html

    And here's a robot built for TCHFFRC that uses an accelerometer, gyro, AND 5 Sharp sensors, plus extra sensors for candle flame detection. Site has videos and brief descriptions of the PID system and Kalman filtering technique, plus some interesting links: http://www.joustinghill.org/matt/robots/firemarshalbill/
  • ercoerco Posts: 20,256
    edited 2010-11-09 10:45
    More PID/Kaufman filter info for a balance bot from this Prop forum post: http://forums.parallax.com/showthread.php?t=123932

    Just trying to consolidate BB info in this thread.
  • ercoerco Posts: 20,256
    edited 2010-12-16 14:30
    Looking forward to continuing on this project and also digging into my S2 over Christmas break. I just saw this Forum thread about a VERY nice balance bot using BoeBot servos & wheels from 2006-07 from Greece: http://forums.parallax.com/showthread.php?83412-2-Wheels-Balancing-Robot. Youtube video links there.

    I have done some testing with my Sharp IR distance measuring sensor and I am VERY impressed with the results. It outputs an analog signal that my Stamp 2 HW board reads using the world's quickest & dirtiest A/D converter: a voltage divider ladder feeding into 8 input pins, right at their 1.4V high/low transition voltage. 8 resistor simplicity, works like a champ! Just have to finish the mechanical construction and rough out some code to drive the servos. I'm pretty confident I can get something balancing using just one sensor. That Sharp sensor really doesn't care if the reflecting surface is white or dark. Genius!
  • ercoerco Posts: 20,256
    edited 2011-01-01 19:58
    Well my S2 is defective, so I got some time to work on my balancer. As promised, I went down the KISS path. Nothing is ever as simple as it seems, but I'm actually starting to get results with ONE Sharp sensor and a BS2 Homework board! So far my simple P software (just the P, not PID) is stable for a while, then the undamped oscillations build up, but I'm hand-tweaking the code and I'm closing in! It won't be the slickest balancing implementation, but it may be the simplest hardware configuration: one IR sensor and 8 resistors. More to come.
    490 x 653 - 40K
    653 x 490 - 37K
    653 x 490 - 43K
    2.jpg 37.4K
    3.jpg 43.4K
  • ercoerco Posts: 20,256
    edited 2011-01-02 11:24
    First success always tastes the sweetest! It doesn't get any better, simpler or cheaper than this.

    http://www.youtube.com/watch?v=C2v-clzykS8
  • ratronicratronic Posts: 1,451
    edited 2011-01-02 15:05
    That's totally cool erco! Do you mind sharing your program?
  • agfaagfa Posts: 295
    edited 2011-01-02 15:19
    Nice Job erco!
  • WhitWhit Posts: 4,191
    edited 2011-01-02 16:38
    Nice work erco!

    As usual - a marvel of simplicity. You da man!
  • Martin_HMartin_H Posts: 4,051
    edited 2011-01-02 18:03
    Really slick!
  • ercoerco Posts: 20,256
    edited 2011-01-02 18:56
    Thanks guys, it's nice to hear some positive feedback!

    @ratronic: Minimalist first program attached, just to balance in place. Methodical experimentation to get those particular servo pulsout numbers. I said simple, not easy!
  • ratronicratronic Posts: 1,451
    edited 2011-01-02 21:38
    erco - you amaze me at what you can do with so little!
  • ercoerco Posts: 20,256
    edited 2011-01-02 21:50
    Thanks, dat's what I do!
  • ercoerco Posts: 20,256
    edited 2011-01-02 22:05
    This guy on Youtube uses a BEAM approach and purely analog circuit ( 555 timer or 2 transistors reading 2 photocells) to get a one-wheel balancing robot working. He uses a capacitor for his derivative control input! Fascinating how many ways there are to get something like this going.

    http://www.youtube.com/watch?v=Y-afnY32RrY
  • Martin_HMartin_H Posts: 4,051
    edited 2011-01-03 04:57
    That BEAM balancer is really cool too. I could almost build that from scrap material I had sitting around.
  • ercoerco Posts: 20,256
    edited 2011-01-03 11:47
    There are lots of cheatin' videos like http://www.youtube.com/watch?v=JDVHkAKlN7U that have tethers attached. Big Cheat! That fairly stiff wire is adding most or all of the stability. It's not moving at all!

    Heck, I can even get my twins to stand perfectly still if I use big enough wire...
Sign In or Register to comment.