Pencil Balancer A Bit Noisy For Desk Use

Who wouldn’t want to install this little bot as your newest pencil holder? Place a pencil tip-down and it will keep it from falling using two motors. There is a Dynamic Vision Sensor for each axis that provides feedback, but it’s not the same as using a camera. These sensors pick up changes in pixel contrast, outputting a positive or negative number based on the direction the pencil is beginning to fall. An NXP2103 running at 64 MHz reads in the values and drives the pair of servo motors accordingly.

If you’re interested in the nitty-gritty the full paper is available from the page linked above. It goes into great detail about the algorithm used, and includes plots and histograms showing the data capture during a balancing session. Or you can skip the eggheaded exercises and watch the video after the break.

[youtube=http://www.youtube.com/watch?v=f9UngTdngY4&w=470]

[via ycombinator]

22 thoughts on “Pencil Balancer A Bit Noisy For Desk Use

  1. I was just thinking of the possibilities if you could scale this thing up! This would be fun if you could scale it all the way up for a person. Then sell it to the Tomato juice company V8 for a witty commercial. :)

  2. Scaling this up is easy, try balancing a pencil on a fingertip, then try balancing a broom on your nose.

    The broom is easier to do.

    Balancing larger objects is somewhat easy by comparison.

  3. I am just wondering if it is possible to get the accuracy tight enough to stabilize the pencils so that the motion is not as erratic.

    I imagine you would need finer control over the servos? Then again I am not exactly an engineer.

    If you could manage to get this thing scaled DOWN and accurate/quiet enough with cheap enough parts this thing would make an amazing desk toy in the future.

  4. RussWill, this is using a PD loop at 500Hz, the I component isn’t necessary for a system like this. Its probably oscillating because of the limited speed of the cameras and servos relative to the rapid movement of the pencil.

  5. This is much more impressive than the inverted pendulum demonstration many of us did in school. You’d have a fighting change at trying to balance those long rods on your finger — with a pencil it’s hopeless (at least for me).

    The PID controller is a great “first cut” controller because there’s easy physical intuition to how it works, and indeed it works well for many, many systems. For some systems it doesn’t work very well, however, especially if you have sensor or process noise you’d like to attenuate.

  6. If it was driven with voice coils like the head in a HDD it would be quiet and quick enough to seem motionless, maybe the lens positioners from a couple old cdrom drives could be hacked?

  7. Not two “ordinary” cameras… The “cameras” described in the linked web page are analog “retinas” that detect and report contrast changes of changed pixels only, at up to hundreds of “frames” per second, giving a small enough quantity of output data to be processed with only a small processing load. That is what allows detection speed fast enough to balance a pencil, which is too small for a human to balance.

  8. I think the erratic movement makes for a neat display of how it works. I dont know if the prosesor is just to slow or if its just bad math or just done on purpose but its much more interesting to watch than something perfectly balanced.
    Nice Work.

  9. @robwentworth

    i know loads of jugglers who can balance itens smaller than a pencil on their nose. teaspoons are quite popular. but i have seen a few people balancing cigarettes and once

    there even one guy who balances a juggling club on the top of his head, where he can’t actualy see it!!

    i read an article in Cascade (the european jugglers journal) a few years back that explained that the movements that a juggler makes are actually faster than the ammount of time it takes for the the brain to comunicate with the muscles. the cited a principle called “dynamic noise” that was apparently also used in the design of aircraft wings. apparently just adding a small random wiggle makes the whole system more stable.

  10. @Ewan
    The reason this works is that the ‘random’ but predictable noise can be compensated for by the control algorithm. A random, even if smaller, unpredictable noise is much harder to compensate for.

  11. 2psuedonymous:
    > A random, even if smaller, unpredictable noise is much harder to compensate for.
    I think we can use it as RNG in cryptography :-)

    i also guess that it’s possible to make it more stable using proper algorithms. but if it was 100% stable it would look like any other pencil holder, so the motion is cool – almost like lava lamp :-)

  12. Very cool project and I do agree with making operate more quietly as well as an algorithm to stabilize the pencil. The issue I have is with the writer/creator making poor comparisons.

    What is most bothersome about the article is the claim about how they are simulating an animal (human) eye to get data, but they use optical sensors at 90* of each other. What animal has eyes at 90* apart?

  13. Scale it up to a person? I can already stand up and don’t need to be madly corrected by external devices to keep standing up.

    Well maybe after a great many hours or drinks I might :)

    So scale it up and put a palace guard on it at the end of his shift you mean, or a brit or irishman when pubs close?

Leave a Reply to RussWillCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.