View Full Version : Discussion Gyro Balance
Flipper_118
Jan 10, 2007, 09:36 PM
I dont know if this will fall under this catagory...but,
I am a second year EE student and am wonder the feasability of a project I have in mind.
We need a year end project to graduate (worth 50%) and I am in the thinking stages of a gyro stabailized 2 wheel robot, think segway. What I am wondering is if I have a servo modified to turn 360 degrees (spin either way continuously), that servo connected to a drive wheel and a HH gyro at the top of the robot will it self stabilize assuming the gyro is in HH mode?
I will be using a small PIC to run pulse signals to the gyros (in the same manner the Rx does) and used 2 gyros, 2 servo's, and 2 main wheels. Is this possible? I first considered IR detectors (fore and aft of the bot) then considered ultrasonics...but I think HH gyros will be much more stable.
If anyone whats to comment I would be extreamly happy! I have 15 weeks to complete this project and would like to get the hardware all rigged up before I moved onto the programming endevor!
Thanks for you comments and oppinions,
Curt
mmormota
Jan 10, 2007, 10:33 PM
I like the idea, pure fun building such a thing! :D
If you are lucky, you can avoid programming at all.
Of course it's possible that the gyros built-in feedback loop is not stable in this application, then a more advanced feedback loop is necessary - that mens programming unfortunately. ;)
You can try easily, if it is working without any additional uC programming.
First modify the servo as follows:
The modified servo is not really a servo any more, but more like a two way speed controlled motor. The servo circuit will work this way too. Just replace the potmeter mechanics with a shaft&bearing, but keep it in the circuit. Turn it once and forever to the middle, then the wheel speed will be proportional to the gyro error signal.
Use one gyro for the pitch stability, and another for yaw stability, mix the gyro output signals with a normal delta mix circuit (standard rc gadget for elevon controlled planes).
Using rc radio and a stock rc receiver, you can drive the robot by feeding the gyros with 2 rc channels: the throttle channels is going to the pitch gyro, the wheel channel to the yaw gyro.
The higher the input to the pitch gyro, the more the robot tilts and the faster it's walking. :D
The yaw gyro input controls how fast it is turning left or right - proportional direction control, like a car wheel.
Try to tune pitch stability using the pitch gyro sensitivity trimmer. The yaw is no problem, controllable even without the gyro.
mmormota
Jan 10, 2007, 10:59 PM
There is a problem.
Let's suppose the HH gyro is trying to keep a tilt angle. The robot has to accelerate to keep this angle. (the sum vector of the gravity and acceleration has to be in line with the robot body)
To avoid acceleration, it is necessary to subtract the speed from the servo error signal - then the speed becomes proportional to the tilt angle, and makes the robot more controllable.
Flipper_118
Jan 10, 2007, 11:35 PM
Thanks,
I was thinking of using two gyros both set up like the above pic (one for each wheel...never thought of mixing them and using one for yaw). I can actually get a working proto without using the micro at all! Only reason I need the micro....is because that is part of my course...or else I'd just have a RC controlled robot.
With a heading hold tho if I give it a command (lets say forward). Wont the heading "inside" the gyro be moved (think about the tail on a heli, move the stick left and the tail swings untill it hits the new heading that you deaviated with the stick movement then stops). So wouldn't the bot tilt forward untill it reached the new heading then tilt back, stop its self, and then hold steady?
I would be totally pumped if I could just get it to balance stable but I think gyro drift may eventually cause it to tip....hmmmmm.....I want to go the gyro route as there is less programming....but infared would definatly work.....but more programming.
mmormota
Jan 11, 2007, 12:05 AM
With a heading hold tho if I give it a command (lets say forward). Wont the heading "inside" the gyro be moved (think about the tail on a heli, move the stick left and the tail swings untill it hits the new heading that you deaviated with the stick movement then stops). So wouldn't the bot tilt forward untill it reached the new heading then tilt back, stop its self, and then hold steady?
No. If the stick is not perpendicular, gravity forces it to tilt more and more. The gyro feels itself turning, and forces the wheel to run. To prevent turning, the stick has to accelerate.
Pure physics: to keep the stick in balance, both the sum of forces and the sum of momentums must be zero.
Forces:
1. gravity, perpendicular, attacks in the center of gravity
2. earth pushes the rod, perpendicular, attacks the bottom of the rod
If the rod is not perpendicular, the above forces build a momentum. If there is a momentum, the rod is turning.
To prevent this turning, the gyro drives the motor, the level force attacks the bottom of the stick and builds a counter-momentum. So the stick is not turning, and the gyro is happy. :D But this force accelerates the stick.
When the motor reaches it's maximum rpm, acceleration ends, and the poor robot falls to mother Earth.
Mark J
Jan 11, 2007, 05:38 AM
Have you had a look on the net for other peoples projects, as I remember seeing an exact same type of balancing robot (even had a video of it working) and it gave a list of things they used to make it balance (sorry not got a link, but it was probably almost a year ago I saw it)
What about using something like these? Minature tilt switches (http://www.maplin.co.uk/Module.aspx?ModuleNo=2680&criteria=tilt&doy=11m1)
As I would think they will be fine, as once the robot is tilted over, the switch will be triggered which in then would make your robot move to counter the effect, so one either side of the robot I presume would work ok.
Mark.
Acetronics
Jan 11, 2007, 05:51 AM
Hi, Flipper
I saw in Microchip AN's an application of the "inverted pendulum" ...
If i've understood what you wanna build ( age make things more difficult ...) that should help.
Alain
Flipper_118
Jan 11, 2007, 09:09 AM
mmormota,
I realized I was wrong at about 1am!lol I understand that it would accelerate constantly now. I am also thinking about shifting the center of mass... wonder it that would cause a tilt and acceleration... :rolleyes:.
Mark,
There is one very similar robot called nbot. I have done alot of reading on that site. Tilt switches are alright...I just don't think they have the resolution I need for both stand still balance and movement.
Acetronics,
Inverted pendulum is pretty much the same principle... balancing an object that shouldn't balance. :p Lots of reading there too.
The only way I can avoid constant acceleration from the gyro's is to use en accelerometer with the gyro's. A wee bit of programming involved there!
Thanks guys... really getting my mind churning...
Acetronics
Jan 11, 2007, 09:56 AM
Hi, Flipper
I had a further look ... Bingo !!! No "High technology" constant acceleration detector needed !!!
http://ww1.microchip.com/downloads/en/AppNotes/00964A.pdf
Soft also available ...
Alain
Flipper_118
Jan 11, 2007, 10:10 PM
Thanks for the link Alain,
I talked with my micro teacher today to figure out the minor details of this project. Apparently he did the inverted pendulum project for a graduate project back in University....so I cant screw this up!
After some talking we figured that I need a exact position sensor. Using a gyro is only going to approximate what is level. They are pretty good at doing that but they drift...and even a 1 bit error in the feedback is going to cause this little bot to accelerate outta control and tip. :o
I am really thinking about using a pot or a IR ping to dectect the ground. Pot would have to be attached to a weight below the axels to avoid the double pendulum effect ( :eek: )...or have a feeler on the ground to detect tilt..booo! I only want 2 things touching the ground....wheels! I will definatly have to think this thru!
I remember making a line follower with a dual chip comparator back in the day. I figure I could run something like that for the pot setup. Have a reference voltage connected to the wiper of the pot and either side of the pot running to the comp. Tilt one way and the servos run to correct it. I think this system should work....only I will use the micro instead of the comparator to get a more proportional output (not bang bang like the comparator). My goal is to get it balancing...motion forward and back is definatly going to take some extra work. Baby steps.
Stephen Weller
Jan 26, 2007, 06:31 PM
Only offered as potential reference material:
http://www.tlb.org/scooter.html and
http://www.tedlarson.com/robots/balancingbot.htm and
http://www.geology.smu.edu/~dpa-www/robo/nbot/ and
http://www.neko.com/~rgrant/tip_balancing_robot.htm and
http://www.parallax.com/html_pages/resources/custapps/app_bway.asp and
http://www.wulabs.org/bbot.html and
http://www.barello.net/Robots/gyrobot/index.htm and
http://www.teamhassenplug.org/robots/legway/
My old hobby was robotics. Then I got married. Wives have no appreciation for the art of robotics. Especially when it wrecks the house and causes personal injury. ;)
Best of luck to you! It'll be a blast.
Flipper_118
Jan 27, 2007, 03:42 PM
Stephen,
Thanks for all the links. I have been reasearching this for the last few weeks and I finally think I found a way it which I can do it on the cheap, and somewhat easily.
I am going to use IR distance sensors to "see" the ground from both sides of the robot and determine the tilt angle by the sensor difference. The only problem I had with that if the robot is not prefectly centered (mass wise) it always going to drift forward or backwards and not remain in a stable balance. I am going to solve this by using wheel encoders. If the robot is balancing but the wheel encoders report that it is still moving forward, I will have a feed back loop telling the IR sensors that it isn't quite level yet, the angle of neutral balance point will be updated and then it will look to the wheel encoders again......
The only draw back to this is that this robot will only be able to balance on a level surface, and I am going to simplify the process by using only 1 drive motor (common axle)...that will keep another degree of motion out of problems.....if I can nail the balance in my 15 weeks....I may try the dual motors....but as of now the only thing I have to do is balance, in order to consider my project a success.
Wish me luck!
Curt
Zlatko
Jan 27, 2007, 04:36 PM
Curt,
This may give you some more ideas,
http://www.tlb.org/scooter.html
Cheers
Stephen Weller
Jan 28, 2007, 10:31 AM
I'll be interested to hear how well the IR technique works for you. I found the resolution to be so poor - depending on the surface it was "looking" at - that I wound up using it as only one subsystem in an array of detection. Ultimately, ultrasonics provided the best overall resolution. But again, it was still dependent on the type of surface it was "looking" at. It was some time ago, but I recall *ANDing* multiple returns from both detectors and achieving greater accuracy.
Shop around for things like these as they should help you reduce your development time:
http://www.superdroidrobots.com/shop/item.asp?itemid=81
And don't overlook Parallax. They've got a lot of neat, inexpensive stuff:
http://www.parallax.com/index.asp
AndyKunz
Jan 30, 2007, 12:01 PM
My old hobby was robotics. Then I got married. Wives have no appreciation for the art of robotics. Especially when it wrecks the house and causes personal injury. ;)
Just think, if you combined those two items - wife & robotics...
Just call me "Stepford."
Andy
Brandano
Jan 30, 2007, 12:48 PM
I know this fits here only marginally, but I tought I'd point out that sometimes it's better to keep electronics out of the feedback loop if you want a faster response. http://en.wikipedia.org/wiki/Gyro_Monorail
Flipper_118
Feb 01, 2007, 09:41 PM
Stephen Weller,
The Sharp GP2D12 IR sensor is actually the one I am using right now on some other robots for my classes....and is the one I will use for the balancing. I was worried about the resolution of the sensor and thought that I would have a very difficult time determining distance till I found this little gem:
http://www.balbots.com/product_info.php?products_id=28
Check the bottom of the page to see what they are using for tilt detection ;) .
I've be thinking ultrasonics.....but they seem to be quite sensitve to angles (almost needs head on to get a detection).....still and option tho.
Brandano,
THANK YOU! I actually experimented with mechanical gyro for stability but hit a snag when it came to the math involved and the physics behind 2 gyros. I will definatly be giving that link a good read thru....very useful (and amazing) information there.
I have the motors for this project already and will hopefully have the hardware done within a week or two here (send off a digikey order :p ). That will give me 10 or so weeks to work on the software and most likely tweek the hardware. I am using a couple of 200rpm geared motors...have like 150-200 oz/inch of torque so I think that should be plenty once I slap some tires on that puppy. Onward we go.......
Curt
vBulletin® Copyright ©2000-2009, Jelsoft Enterprises Ltd.