Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: mackmelby on February 28, 2008, 10:09:28 PM

Title: Balance-bot takes off uncontrollably!
Post by: mackmelby on February 28, 2008, 10:09:28 PM
Ok, my balance bot balances perfectly, except when after a few seconds of balancing, it randomly decides to take off (either forwards or backwards)...I need to find some way to bring it under control... I have two inputs that can readjust the direction the robot moves while balancing. One controls forwards & backwards and one is mixed turning, each controlled by a 5K potentiometer. Any ideas on bringing robot under control would be helpful.
Title: Re: Balance-bot takes off uncontrollably!
Post by: airman00 on February 28, 2008, 10:28:54 PM
please provide much more details on how the robot balances, and on the robot itself. Im still not sure how it balances based on the info you gave!
Title: Re: Balance-bot takes off uncontrollably!
Post by: bukowski on February 29, 2008, 11:06:00 AM
so you are using pots only, no accelerometer or gyro, and adjusting motor speed from there?
when you say it is balancing perfectly, is it standing perfectly still (or close to it) or is it oscillating quite a bit? Good design btw. It still seems counter intuitive to me that you want the main mass of teh bot so far away from the wheel base, but after reading up on the n-bot it makes sense.
Title: Re: Balance-bot takes off uncontrollably!
Post by: mackmelby on March 01, 2008, 10:17:11 PM
Airman00: Alright...well, I can't explain everything about the robot but its a very simple design...Sensor is a simple "on-neutral-off" switch that touches the floor...ON instantly drives motors one direction...OFF instantly drives motors in another direction....NEUTRAL Is when bot is perfectly perpendicular to the floor

Bukowski: The robot oscillates about a centimeter at most...It balances for about 5 seconds still, and slowly increases speed either forwards or backwards and eventually falls. My goal is to make the robot stay in one position until further commanded to move.
Title: Re: Balance-bot takes off uncontrollably!
Post by: mackmelby on March 01, 2008, 10:30:26 PM
Sensor schematic
Title: Re: Balance-bot takes off uncontrollably!
Post by: airman00 on March 01, 2008, 10:34:00 PM
I think that because it is digital (either falling or not) you do not have enough time to balance, where if it was analog you could adjust the balancing according to tilt. But I may be wrong......
Title: Re: Balance-bot takes off uncontrollably!
Post by: mackmelby on March 01, 2008, 10:42:58 PM
Well...Im thinking that while in neutral, I can give the robot a tendency to tilt one way or another to keep it in one spot.
Title: Re: Balance-bot takes off uncontrollably!
Post by: airman00 on March 01, 2008, 10:44:03 PM
Well...Im thinking that while in neutral, I can give the robot a tendency to tilt one way or another to keep it in one spot.


maybe

try it out, you have nothing to lose
Title: Re: Balance-bot takes off uncontrollably!
Post by: mackmelby on March 01, 2008, 10:49:14 PM
But IDK...Im not sure how get the robot to sense its position accordingly to the ground...Ill do some research.
Title: Re: Balance-bot takes off uncontrollably!
Post by: mackmelby on March 02, 2008, 09:34:41 PM
Heres a video of my balance bot
[youtube]http://www.youtube.com/watch?v=YTmq38tJvLs[/youtube]
Title: Re: Balance-bot takes off uncontrollably!
Post by: airman00 on March 02, 2008, 09:36:34 PM
looks good

make it have a tendency to go backwards
Title: Re: Balance-bot takes off uncontrollably!
Post by: Ro-Bot-X on March 02, 2008, 11:53:23 PM
Nice job!

Instead of using a digital sensor, why not use an arm attached to a pot wiper? The analog response is much finer and you may be able to controll the ballancing smoothly. Use a pot from a servo, they are of a better quality and low friction.
Title: Re: Balance-bot takes off uncontrollably!
Post by: mackmelby on March 04, 2008, 01:10:20 PM
Using a potentiometer as the main sensor was my original plan but they take too much rotation to get the bot moving on time...I would need a potentiometer that has a total of 5 degrees turning to get the robot to respond fast enough. The potentiometer I have takes almost one complete rotation to get the motors spinning at full power, so that obviously did not work. I'm still researching different sensors that will work better but I might just stick with the digital sensor.
Title: Re: Balance-bot takes off uncontrollably!
Post by: mackmelby on March 04, 2008, 08:13:22 PM
By the way, What is a pot wiper Ro-Bot-X?
Title: Re: Balance-bot takes off uncontrollably!
Post by: Admin on March 15, 2008, 06:21:28 PM
Quote
I think that because it is digital (either falling or not) you do not have enough time to balance, where if it was analog you could adjust the balancing according to tilt. But I may be wrong......
yeap, airman00 is correct


Try putting a capacitor across the switch leads, and have it output to an ADC instead. This will give you much better analog control over it. The capacitor value will need some tweaking, so try a few values - .1uF, 1uF, 10uF, etc.
Title: Re: Balance-bot takes off uncontrollably!
Post by: mackmelby on March 17, 2008, 08:04:50 PM
hmmm...so when I put capacitors on the leads, It will smooth out the balancing?? I will consider that...But right now, I need to focus on controlling the robot by means of where it's moving, because if I let the robot just drive wherever it wants to, It eventually builds up speed and falls from not keeping up with the tilt.

So, I've come up with some solutions but I'm not really sure what would work best.

A wheel encoder is probably the best way to solve the problem, but it might be hard to program (I wouldn't know how).

Adding an RC system might solve the problem, but requires the user's input to keep the robot stable.
Title: Re: Balance-bot takes off uncontrollably!
Post by: mackmelby on March 17, 2008, 08:24:01 PM
Oh, by the way...My balance bot got Me 1st place in my regional science fair and I won a big scholarhip...so thanks for all of your input in this forum....I will be going to the state science fair and will be improving my robot by adding another axis of movement so it can move omnidirrectionaly...so, Ill post a video when my holonomic balance bot is finished. :)
Title: Re: Balance-bot takes off uncontrollably!
Post by: airman00 on March 17, 2008, 08:31:08 PM
Oh, by the way...My balance bot got Me 1st place in my regional science fair and I won a big scholarhip...so thanks for all of your input in this forum....I will be going to the state science fair and will be improving my robot by adding another axis of movement so it can move omnidirrectionaly...so, Ill post a video when my holonomic balance bot is finished. :)

congrats!


anyway
here are your options - use encoders ,add IR or sonar sensor to see how far it is tilting ( sensors faced downward) , or add an accelerometer
Title: Re: Balance-bot takes off uncontrollably!
Post by: Admin on March 18, 2008, 11:54:10 AM
Quote
hmmm...so when I put capacitors on the leads, It will smooth out the balancing??
Yeap. This will dramatically reduce your oscillation problem.

One note though, I forgot to mention you should have a resistor in parallel with the capacitor. A higher resistor value will lower the response time. Purely guessing, I'd say try for a 1k resistor. Google around for resistor-capacitor circuit and equation so you can calculate your ideal response time. I'd say like .2 seconds sounds good.
Title: Re: Balance-bot takes off uncontrollably!
Post by: mackmelby on March 18, 2008, 08:59:53 PM
Alright...Thanks...Ill post a video of my robot when I finish building it.  ;D
Title: Re: Balance-bot takes off uncontrollably!
Post by: mackmelby on April 23, 2008, 05:06:12 PM
[youtube]http://www.youtube.com/watch?v=vQRUt89JrIQ[/youtube]

Well, here is some of my progress in the development of my balance bot...
The first prototype is a simple balancing platform that can not balance completely by its self.
The second prototype in the video basically works the same as the first accept that it balances omnidirectionaly on one ball using two balance sensors; One for balancing in x direction and one for Y direction or X and Y mixed.
The last prototype is a simple 2 wheeled balance bot with some RC equipment used for moving the weight of the robot and controlling the steering channel.


Any advice on programing the same robot only with gyros and accelerometers for the balance sensors would be helpfull.  :)
Title: Re: Balance-bot takes off uncontrollably!
Post by: bietz on April 23, 2008, 05:51:31 PM
Wow those three balancing bots look awesome! I love the one with the ball, which look like CMU's ball-bot, except the sensors are digital! Great job for each of them!

Anyway, when you add gyros, I would recommend doing some PID control: you would have to regulate your PID (for the 2D one, it would be 2 PIDs) on the middle value (when the robot is vertical). Then you find the error and adjust the motor speeds with some tweaked gain constants (for p, i and d).

I you don't know about PID, you could have a look here: http://forums.parallax.com/forums/default.aspx?f=6&m=66982 (http://forums.parallax.com/forums/default.aspx?f=6&m=66982) and if you want more advanced, wikipedia should has a pretty good article I think.

I was planning to work on a balancing bot at my robotics club at school, and I wish I had all those parts (or money to buy them...)  :-[
Title: Re: Balance-bot takes off uncontrollably!
Post by: mackmelby on April 25, 2008, 02:32:49 PM
Thanks...Those expensive parts have already payed for themselves...The robot actualy cost under $200 + $80 of parts that I fryed :-[. Anyway, the thing thats holding me back from buying gyros is that I do not know any programing language. If you could help me write the code, I could probably lend or give you parts...Anyway, If I can get help writing the code, the bot would probably be programed similar to botka.
http://video.aol.com/video-detail/botka-the-barely-standing-robot/23416839
Title: Re: Balance-bot takes off uncontrollably!
Post by: Admin on April 27, 2008, 01:24:20 PM
Nice!

Quote
Anyway, the thing thats holding me back from buying gyros is that I do not know any programing language. If you could help me write the code
You can easily adapt the $50 Robot (http://www.societyofrobots.com/step_by_step_robot.shtml) electronics and code to your bot.
Title: Re: Balance-bot takes off uncontrollably!
Post by: mackmelby on April 29, 2008, 12:13:19 PM
Hmmm....Good Idea. I'll think about it.
Title: Re: Balance-bot takes off uncontrollably!
Post by: Trumpkin on April 29, 2008, 01:56:21 PM
why don't you give the bot a lower center of gravity? It would make it a lot easier to balance.
Title: Re: Balance-bot takes off uncontrollably!
Post by: mackmelby on April 30, 2008, 08:34:41 PM
(Not to change the subject here) If you put weight below the axle, It does help the bot stay upright.
And all other weight should go on the top of the robot, which causes the bot to fall slower.

Title: Re: Balance-bot takes off uncontrollably!
Post by: dunk on May 01, 2008, 02:42:44 AM
Quote
why don't you give the bot a lower center of gravity? It would make it a lot easier to balance.
not true.
the further the center of gravity is from the pivot point the more slowly it will fall.
it's like having an old fashioned clock and making the pendulum longer.

as a practical experiment,
try balancing a pen on end in your hand.
next try balancing a broomstick on end in your hand.
although you need to make far larger movements with the broomstick your reaction time does not need to be nearly as fast.


dunk.
Title: Re: Balance-bot takes off uncontrollably!
Post by: Trumpkin on May 01, 2008, 07:48:56 AM
ooh I guess I didn't think enough before I posted something. It makes sense know why he has it so tall.