Balance Wheel

Balance a 40mm steel ball on a lasercut wood wheel

Similar projects worth following
Rev. 1: Built from ground up. Drew parts in Inkscape, lasercut at Used old CPU (ATMega 644P), motor driver (VNH2SP30) and bluetooth boards I had lying around. Glued, soldered, programmed.

Goals for Rev. 2: Get rid of wire chaos inside (new single PCB, Arduino Leonardo compatible), rework drawings (include solar cell and lamp holder, barriers to stop ball from falling off), publish everything (PCB layout, code, drawings for lasercutting, build instructions).

I saw a similar project about 6 years ago at Chaos Communication Congress in Berlin - so I can't take credit for the solar-cell-as-sensor idea. (Unfortunately, I don't remember who made that - some university I think. It was a bit strange architechture as well - realtime patched Windows PC with Matlab/Simulink etc.)

The algorithm is not that sophisticated - no modeling involved. 2 cascaded control loops - the outer one has wheel speed as input and ball position (solar cell target voltage) as output, the inner one has solar cell voltage as input and motor pwm as output (plus a feedback from motor speed to pwm - so the output from the inner controller is closer to acceleration than speed). Whole controller structure:

The spinning motion in the video comes from the fact that the feedback from motor speed was tuned at higher speeds and less load (table tennis ball). So for the steel ball I have quite a big control deviation (distance of the red an green line) on the inner controller. The i part of the outer controller "learns" this away, and after the spinning direction changes, the deviation is in the opposite direction:

View project log

Enjoy this project?



electroboogieman wrote 02/19/2015 at 12:36 point

Clever use of solar cell as sensor.

Maybe you could use short circuit current of solar cell as input, as current is linear function of illumination as opposed to voltage which is logarithmic function. I think you would gain a lot on sensitivity.

If you want more information about subject, you can go on: for voltage info for current info.

  Are you sure? yes | no

Manuel Kasten wrote 02/19/2015 at 13:31 point

The solar cell is currently loaded by a 1K resistor. The behaviour may not be perfectly linear but it's good enough (tm). If I reduce the resistor too much, the resulting voltage will be very small. Then I'd loose resolution on the ADC conversion. 

  Are you sure? yes | no

Stryker295 wrote 02/19/2015 at 10:37 point

Quite clever, and simple

  Are you sure? yes | no

unigamer wrote 02/19/2015 at 09:35 point

Great project! It has been added to my list of stuff to make.

Edit: I like the spinning motion. In this project it looks quite graceful, of course in most control projects such as balancing robots it's undesirable, in this case I think there is an exception.

  Are you sure? yes | no

Manuel Kasten wrote 02/19/2015 at 13:26 point

I like it as well. But I'd rather have it deliberately (as input on the target speed controller), than as byproduct (the way it is right now) - I'm going to tune this further to see whats possible.

  Are you sure? yes | no

unigamer wrote 02/19/2015 at 13:44 point

Oh I see. Yes that would look good. Having both modes available is a plus. It's a great piece, deceptively subtle. Looks like you've lots more fun to get out of it.

  Are you sure? yes | no

Manuel Kasten wrote 02/09/2015 at 14:43 point

Thank you (all of you).

I have added a section to the details regarding the questions so far :)

  Are you sure? yes | no

esot.eric wrote 02/08/2015 at 23:27 point

Yeah, I keep coming back to this. Well done. Agreed with Alan and Dave... The solar-sensor is a great idea. I take it you're trying to keep the cell roughly half-covered...?

Also, see you work on ABS, so I imagine your algorithm is pretty sophisticated. Does it include a model of the ball's mass, etc? That stuff is beyond me, but I find it fascinating.

What controls the spinning-motion? It looks like that's intentional rather than just attempting to keep the ball balanced...?

  Are you sure? yes | no

esot.eric wrote 02/10/2015 at 01:34 point

Nice details-update. I dig that the control loop is so simple, I'da thought some complicated physics-modelling would've been necessary. I'm glad to know it's not, maybe I'll try this some day :)

  Are you sure? yes | no

Alan Kilian wrote 02/08/2015 at 20:44 point

Great! I wouldn't have thought you could get direction out of a single sensor, but of course you can!

  Are you sure? yes | no

davedarko wrote 02/08/2015 at 14:07 point

Hey, nice project! Clever way of using the solar cell as a position tracker.

BTW: You can embed the video in the description by simply adding the link and click enter :)

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates