Circus Bot

After finishing my sumobot I was really excited to build another robot so I started brainstorming. I finally decided I wanted to try and make a balancing robot sort of like a segway only a lot simpler. Now the problem is I didn't have any super fancy sensors like accelerometers or gyroscopes so I had to find a way to know if it was balanced with what I had lying around. What I ended up using was 2 super bright LEDs and a LDR (light dependent resistor) to "see" how far the floor was and know if its falling one way or the other.

 

Once I got the LDR running through an analog input I had to find a way to tell it when it was balanced so I hooked up a potentiometer to another analog input and made that so I could manually set the balance point. Unfortunately the only potentiometers I had lying around was a one turn style which make tuning it a little hard but all in all a fun way of interacting with it.

Now since Im only using a LDR as a crude distance sensor a whole bunch of variables affect its performance such how much light is in the room or what color the surface its balancing on is, although I kind of enjoy this as I have to continually interact with it. The program is really simple in that if the sensor is farther away from the floor than the balance point then the motors move backwards, if it's closer than they move forward. This gives the robot an oscillation around Its balance point which makes it not the most stable as it does fall over some times.

I'm pretty happy with the way it all turned out. I set out to build a robot that balanced on two wheels and finished it in one weekend with parts i had lying around for pretty cheap. I do plan on trying to improve the program to be smoother and better balanced. I want to learn and incorporate a PID controller and if anyone knows some good learning resources or tutorials for it I would appreciate that. More power to the wheels would be better too so I'm thinking of trying a 9 volt battery instead of 4AAs. As far as improvements are concerned any suggestions would be appreciated.

Balances upright

  • Actuators / output devices: 2 GM12as
  • CPU: PIC18f252
  • Power source: 4 AA batteries
  • Programming language: Picbasic Pro
  • Sensors / input devices: one LDR

This is a companion discussion topic for the original entry at https://community.robotshop.com/robots/show/circus-bot

Private video
Can you set your YouTube videos so they are not private?

cool robot. i think my mini
cool robot. i think my mini sumo is gonna be a failure D: the design is too cramped!!! anyway, that just my prototype, gonna make a better one.i may make a balancing robot too. haha

Wow!
This project sounds awesome, your sensors remind me of a line following robot I read in a book. It shines a bright LED on the ground and compares the amount of light reflecting in the LDR, but a balancing robot is so much better! I can’t wait to see the video.

a balancing robot with a ldr

a balancing robot with a ldr as sensor is very critical…

please provide free videos or i will think that it is a fake :smiley:

Oops
Ya I wil fix that, I thought they were

RobotRoom
Are you talking about the books from David Cook because thats were I got the inspiration to try it from. I actually have both his books and his website is a great resource. His stuff really got me into trying to build my own robots.

Videos!!!
The videos should be up now. I made them all public so if it still isn’t working please let me know.

Interesting, any idea of
Interesting, any idea of this could be done with a IR sensor too?

good results !!!i tryed the

good results !!!

i tryed the same balancing robot some times ago using (slow) picaxe and IR photodiode / IR led

it did not works very well :frowning:

2873492992_7bf37e9101.jpg

anyway the design was col :)

table!
I have the exact same table with exact same chairs! Good bot, I’m going to have to try it

What kind of algorithm are

What kind of algorithm are you using to calculate the response of the bot? are you using any averaging/integrating/filtering?

I think that LDRs have a relatively slow response time, something like 4 or 5 times that of phototransistors - maybe it’s not important but it would speed up the cycling of the program?

Really simple

Basically the program is really simple, it bascically goes like this:

IF LDR is less than tuning pot then move fowards

IF LDR is more than tuning pot then move backwards

Loop

Really simple although I would like to try and play with some better algorithms like a PID controller or something like it but I still need to learn more about it and how to use it. But then again everything can always be improved so we’ll see what I actually end up doing.

a good choice is to place 2

a good choice is to place 2 light sensors on opposite side of the bot

so the setpoint became to keep equals readings between the two sensors

this neutralize calibrations issues

Yep
Yeah, that’s what I was trying to remember. Great material, I agree.

Nice use of the LDRs. I
Nice use of the LDRs. I agree with noise0 that using a sensor on each side of the bot might improve the shakyness

bigger wheels

if it is posible for you try to put some bigger wheels (3 inch.or so)on your robot,maybe it will stabilise it. leave the sensor at the same hight as you have it now

http://www.embedded.com/2000/0010/0010feat3.htm some PID learning