YOU CAN 3D PRINT A PLATE THAT MAKES A BALL DANCE BY ITSELF

A touchscreen plate feels where a ball is and three stepper motors tilt it so the ball never falls off, even when you push it.

by aaedmusa

FULL CAD BOM FIRMWARE DOCS

RoboticsDisplays

Built withArduinoTeensy3D printing

difficulty
●●●●○
time
a weekend-plus
license
(empty — no licence declared)
repo
repo INACTIVE65 stars
1
Jump to section

COMPAREE VERDICT

This is a classic control-systems demo: a steel ball rolls on a resistive touch panel, the panel reports where it is, and three NEMA 17 steppers driving a three-legged parallel platform (3RRS) tilt the plate to keep it balanced or make it trace patterns. It is mesmerising to watch and genuinely useful if you are learning PID control or parallel-robot kinematics. The repo has the CAD, STLs, Arduino-IDE code for a Teensy 4.1, a bill of materials and an inverse-kinematics derivation, and the creator's step-by-step guide on Instructables covers printing, the circuit, assembly and uploading the code. The hard part is not the build, it is the tuning. PID constants that work for one ball and one touch panel may not work for another, and the guide only tells you which values to change. If you want to understand closed-loop control and are comfortable iterating on parameters, this is one of the best ways to learn. If you want a plug-and-play demo, you will be frustrated.

GOOD TO KNOW

  • —STL files for the base, motor mounts, linkages and touch-panel frame are in the repo (STL Files.zip), plus full CAD.
  • —Arduino code (Teensy 4.1) is provided for the PID loop and the three-stepper motion, plus a separate sketch with patterns (line, triangle, square, circle, sine wave, figure eight) and a stepper test sketch.
  • —Bill of materials lists three NEMA 17 steppers, TMC2208 drivers, a Teensy 4.1, an 8.4-inch resistive touch panel and the mechanical hardware.
  • —The repository has no README or assembly guide, but the creator's written step-by-step guide with a circuit schematic is on Instructables.
  • —The GitHub repository has no licence, and the Instructables guide is CC BY-NC-SA 4.0, so personal builds are fine but commercial use is not permitted without asking the creator.
  • —The PID constants are hard-coded with no explanation of how to tune them for your build.

Parts to buy

11 items

From our check of the build. Exact quantities and part numbers are in the creator’s BOM.

  • Teensy 4.1Find
  • Three NEMA 17 steppers (59 Ncm)Find
  • Three TMC2208 driversFind
  • 8.4-inch 4-wire resistive touch panelFind
  • 24 V supply (the creator uses a bench supply)Find
  • 5 V regulatorFind
  • Two small protoboards with screw terminalsFind
  • M3/M4 hardwareFind
  • Heat-set insertsFind
  • RC tie rodsFind
  • 1-inch steel bearing ballFind

BUILDS OF THE WEEK

Five open-source builds worth your weekend, every week.

Checked like this one: what’s really in the repo, what it costs, how hard it is. One email, unsubscribe anytime.

Can I build this?

PrintBase, motor mounts, linkage arms and touch-panel frame (STL Files.zip in the repo).
BuyTeensy 4.1, three NEMA 17 steppers (59 Ncm), three TMC2208 drivers, 8.4-inch 4-wire resistive touch panel, a 24 V supply (the creator uses a bench supply), a 5 V regulator, two small protoboards with screw terminals, M3/M4 hardware, heat-set inserts, RC tie rods, 1-inch steel bearing ball.
ToolsSoldering iron (also used to press in the heat-set inserts), small screwdrivers, a multimeter to set the 5 V regulator output, and a computer with the Arduino IDE (Teensyduino) and a USB cable.
SkillsIntermediate electronics and basic 3D printing. You need to be comfortable flashing a Teensy from the Arduino IDE, wiring stepper drivers, and iterating on PID constants until the system stabilises.
TimeA weekend to assemble and wire, then another few evenings to tune the control loop and get smooth motion.
CostThe creator's BOM spreadsheet works out to roughly 150 dollars of parts (the Teensy 4.1, the three NEMA 17 steppers and the 8.4-inch touch panel are the big items), plus a bench power supply (listed at about 70 dollars) if you do not already own one.
SafetySteppers draw several amps under load, so use a dedicated power supply, not USB. No other hazards beyond ordinary electronics care.

Build at your own risk. Projects involve tools, electronics and sometimes mains voltage — follow the creator’s safety notes.

Videos

The creator's own video "I Built a Ball Balancing Robot" shows the design, the build and the platform balancing and tracing patterns.

More builds like this

All projects

Gallery

Start here

Navigation into the creator’s own docs — we don’t rewrite the guide, we route you to the source.

  1. 1.Print the frame and mounts(Print the parts in PLA at 20% infill with auto-generated supports, as the creator recommends; expect about 310 g of filament and roughly 25 hours of printing.)
  2. 2.Order the electronics (The spreadsheet lists the exact steppers, TMC2208 drivers, Teensy 4.1 and touch panel; match them to avoid re-tuning.)
  3. 3.Wire the steppers and touch panel to the Teensy (Pin assignments are at the top of Ball_Balancing.ino (STEP/DIR pins for the three drivers, A0-A3 for the touch panel).)
  4. 4.Flash the Arduino code(Default PID constants are in the code — you will tune them later.)

KNOWN ISSUES

  • The touch panel matters. Resistive panels from different suppliers report slightly different raw values, so the centre offsets in the code (Xoffset/Yoffset) may need adjusting before the PID loop behaves.
  • PID tuning is barely documented. The constants in the code worked for the creator's build; your ball, touch panel and mechanics may differ. The guide only says you can change kp, ki and kd for sharper or softer reactions, so expect hours of trial and error.
  • The steppers need their own supply: the guide uses a bench supply set to 24 V (or any 24 V supply), with a 5 V regulator feeding the Teensy. You must cut the Teensy's 5 V trace as the guide describes, otherwise USB and the regulator are tied together.
  • Ball choice affects behaviour. The original build uses a 1-inch steel bearing ball, and the PID constants assume that mass.
  • The repository itself has no README, but the creator's step-by-step guide is on Instructables (printing, circuit schematic, assembly, uploading the sketches, operation). Tuning beyond the default values is up to you.

Can I use different motors?

The design uses three NEMA 17 steppers (59 Ncm) with TMC2208 drivers. Other steppers will work if they have similar torque, but you will need to re-check the step settings in the code and re-tune the PID constants.

How do I tune the PID constants?

Start with Kp only, increase it until the ball oscillates, then back off 30%. Add Ki to eliminate steady-state error, then add Kd to damp overshoot. The repo does not document this — it is standard PID tuning, but you will learn it by doing.

Can it follow patterns or just balance?

The firmware includes setpoint tracking, so you can command it to trace circles, figure-eights, or any path. The demo video shows circle-following. The setpoint is hard-coded — there is no joystick or GUI.

Community builds

No community builds yet — be the first, we feature the best ones.

Discussion1

FROM THE COMPAREE TEAM

The whole trick is tuning the PID loop until the steel ball stops oscillating on the touch panel. How long did yours take to stabilise?

CompareeTEAM2mo agoedited

Practical notes from our verification: Ball-Balancer-V2 is a three-legged (3RRS) parallel platform driven by three NEMA 17 steppers with TMC2208 drivers and a Teensy 4.1; the ball position is read by an 8.4-inch resistive touch panel, not a camera, and the ball is a 1-inch steel bearing ball. The repository has the CAD, STL files, Arduino sketches, a BOM spreadsheet, a kinematics PDF and a resources document, but no README and no licence. The written step-by-step guide is on Instructables (under a CC BY-NC-SA licence), and Aaed Musa's video 'I Built a Ball Balancing Robot' shows the build. Expect to spend more time tuning the control loop than printing parts. Correction (4 October 2026): we re-checked this page line by line against the project's own repository, documentation and videos, and fixed errors in earlier versions.

aaedmusa

Aaed Musa built Ball-Balancer-V2 as a three-legged (3RRS) parallel platform that balances a steel ball on a resistive touch panel using PID control. It replaced his first, six-servo, camera-tracked version. He published the CAD, code and parts list on GitHub in April 2023, with a step-by-step guide on Instructables and a build video on YouTube.

GitHub

Star the project on GitHub

DISCLAIMER

  • Comparee is not the author of the projects featured here. All rights to each project belong to its creator — every page links to the original source, and we never host creators’ files.
  • Information is provided without warranty and may become outdated as projects evolve. Prices are indicative bands only — always check the creator’s parts list for current costs.
  • Building and operating any project is at your own responsibility. Protective equipment, safe workshop practice and compliance with local regulations are the builder’s responsibility.