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.
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.
@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.
@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.
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.
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.
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/
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!
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.
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!
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.
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...
Comments
http://www.designboom.com/weblog/cat/16/view/10069/balancing-robot-on-ball.html
I hope that everyone else is having better luck than I am.
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.
@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.
I don't think you'll have to Leon. I read that it can detect a black wall in full sunlight.
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
http://www.youtube.com/watch?v=rGtIJhqaEg8
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
Yes. I'm using a propeller proto board.
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/
Just trying to consolidate BB info in this thread.
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!
http://www.youtube.com/watch?v=C2v-clzykS8
As usual - a marvel of simplicity. You da man!
@ratronic: Minimalist first program attached, just to balance in place. Methodical experimentation to get those particular servo pulsout numbers. I said simple, not easy!
http://www.youtube.com/watch?v=Y-afnY32RrY
Heck, I can even get my twins to stand perfectly still if I use big enough wire...