Robot Balances Ball On A Plate

Imagine trying to balance a heavy metal ball bearing on a cafeteria tray. It’s not the easiest thing in the world! In fact, it’s perhaps a task better automated, as [skulkami3000] demonstrates with this robotic build.

The heart of the build is a flat platform fitted with a resistive touchscreen panel on top. The panel is hooked up to a Teensy 4.0 microcontroller. When a heavy ball bearing is placed on the touch panel, the Teensy is thus able to accurately read its position. It then controls a pair of NEMA 17 stepper motors via TCM2208 drivers in order to tilt the panel in two axes in order to keep the ball in the centre of the panel. Thanks to its quick reactions and accurate sensing, it does a fine job of keeping the ball centred, even when the system is perturbed.

Projects like these are a great way to learn the basics of PID control. Understanding these concepts will serve you well in all sorts of engineering contexts, from controlling industrial processes to building capable quadcopter aircraft.

26 thoughts on “Robot Balances Ball On A Plate

    1. It’s a physical system, the motors have limited power and take time to move, and last but not least the calculation isn’t instantaneous so there will always be some small amount of overshoot. Not saying it cant be much better than what is demo’d here but at the same time you’ll never get a completely “dead stop” (that is unless you happen to have a much higher budget and access to much better hardware).

        1. Professional engineer with a masters in power control systems, nope these are real limitations. Expecting a physical system to stop instantaneously on a dime isn’t realistic, unless like I said you release some constraints like time and/or money.

          1. PhD Computational physics
            M.S. nuclear engineering
            B.S. electronics engineering

            You’re dead on with that statement sir 👍…No physical system is truly “instantaneous” — every actuator, motor, valve, or mechanical assembly has inertia, latency, damping, and control loop limitations.

            Expecting a system to stop on a dime is like expecting a freight train to halt at a stop sign — not happening unless you either:
            oversize everything so masively that cost and practicality go out the window,

            allow destructive braking or wear-and-tear that ruins the system, or
            relax the constraints (give it more time, more distance, or more budget for exotic solutions).

            Even with high-end power control systems, you run into the same physical truths: signal delays, actuator saturation, thermal limits, and structural stresses. “Infinite control authority” only exists on paper. Engineers live in the world where materials flex, electrons have finite mobility, and regulators fight to keep stability margins from collapsing.

          2. Even the JATO bottles won’t be instantaneous.

            And, anyway, you can not actuate faster than the speed of sound in the mechanical structure, generally, or it will break in an equivalent of high explosive assisted fragmentation (which is essentially forcing a supersonic shockwave into the material).

            So the movement cannot be instantaneous.
            But can it be sufficiently fast?
            Now the engineering questions begin…

    2. you dont need that, just put big magnet in the middle, the ball steel will dead stop. and no need electric power. or just design a cone shapes tray. sometimes simple solutions works better

  1. My uncle flew a cropduster and got into RC airplanes. Had something similar for training. Board+glass+painted circles connected to servos and the radio. Object was to get the ball bearing in the circles.

    It was tough. He never let me fly lol.

    1. That would surely slow down the ball and give a “weak” processor a better chance. On the other hand, shifting sand would likely add whole other set of variables to tune for.

      It would be interesting to see how this would be handled with analog circuitry.

  2. A stereotypical masters thesis project for 2010s mechatronics/robotics/automation student.

    Not that there’s anything wrong with that. I’d rather see projects like this than yet another totally genuine, totally working DIY hydro power plant built in a rice field drainage ditch by a clickbait video farm operating from some 3rd world country.

    1. wait… you made me realize: this whole thing clearly looks conspiratorial to start with. The setup is actually spherical with the ball inside. The electronic feedback loop is just adding some extra dimensions to topologically realize this in a lab setting with an apparent flat surface. At least locally, this might be an accurate description of control theory?

Leave a Reply to Not Walking to the Fridge Like a ChumpCancel 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.