{user_name}
Ball balance training model on workbench with laptop, measuring device, and parts boxes for control engineering and prototype construction

Ball balance
Experimental setup for control engineering lab

PIDT1 controller icon on the ball balance project page – control engineering functional model and demonstrator

Teaching model for control engineering

The ball balance is a fascinating teaching model that clearly demonstrates the principles of control engineering. With a function block editor developed specifically for this purpose, students can independently design and optimize control loops. The aim is to control the tilt of the seesaw via a propeller drive so precisely that a metal ball is stably balanced in the center.

Show video info

Ball balance as a teaching model for control engineering - THWS Schweinfurt - Engineer Glaser

🎱 The ball balance is a fascinating teaching model that clearly demonstrates the principles of control engineering. With a function block editor developed specifically for this purpose, students can independently design and optimize control loops. The aim is to control the tilt of the seesaw via a propeller drive so precisely that a metal ball is stably balanced in the center.
https://ingenieur-glaser.de/kugelwaage/ – Behind the scenes

#ControlEngineering #THWS #ElectricalEngineering #Prototyping #HardwareDevelopment #Microelectronics #Engineer #Matlab #Simulink #ATMEGA32 #Cplusplus #Cnc

💡️ Development & Manufacturing – Engineering firm Glaser
https://ingenieur-glaser.de/ – Electronics・Software・Hardware

🔔 Subscribe now! – Don't miss any development!
https://ingenieur-glaser.de/Instagram/ – Instagram
https://ingenieur-glaser.de/Facebook/ – Facebook
https://ingenieur-glaser.de/YouTube/ – YouTube
https://ingenieur-glaser.de/LinkedIn/ – LinkedIn
https://ingenieur-glaser.de/Twitter/ – Twitter
https://ingenieur-glaser.de/TikTok/ – TikTok
https://ingenieur-glaser.de/Xing/ – Xing

🥇 References – How visions became successes.
https://ingenieur-glaser.de/Projekte/ – References

📞 Contact – Has the spark been lit?
https://ingenieur-glaser.de/Kontakt/ – Contact

#ControlEngineering #THWS #ElectricalEngineering #Prototyping #HardwareDevelopment #Microelectronics #Engineer #Matlab #Simulink #ATMEGA32 #Cplusplus #Cnc #TeachingModel

To the YouTube channel

A challenging control process

At the center of the control process is a propeller drive connected to a pivot-mounted V-profile. A ball can roll freely on this. A servo motor changes the blade pitch to generate targeted thrust to the left or right and thus change the tilt of the seesaw.

Ball balance experimental setup with propeller drive, rolling metal ball and laptop function block editor for control engineering

The challenge is to develop a control loop that controls the highly dynamic and unstable system so that the rolling ball comes to rest in the middle of the V-profile. Even the smallest changes in tilt set the ball in motion. The ball's own weight acts as a disturbance as do varying propeller speeds and airflow turbulence. These factors significantly increase the complexity of stable control.

Ball balance teaching model with propeller drive, microcontroller control and ball position sensing for control engineering

For control, the ball position and the tilt angle of the seesaw are available as measured variables. As the only actuator, a pitch-adjustable propeller must suffice to keep the ball in balance.

Unobtrusive sensor with impressive precision

The ball position is measured using two carbon fiber rods in the transparent acrylic. One of the rods is connected to GND and 5V, creating a linearly falling voltage. The metal ball acts quasi as a sliding contact by transferring this position-dependent voltage to the second rod. This allows the ball position to be determined with millimeter accuracy.

Ball balance V-profile: metal ball in acrylic guide with carbon fiber rods as a position-dependent voltage dividerAcrylic ball balance with carbon fiber rods and voltage divider for precise position measurement of the metal ball

Angle determination via an accelerometer

The tilt angle of the seesaw is measured with an accelerometer mounted on the pivot-mounted axis. The sensor uses the constant gravity vector as a reference to precisely determine the tilt angle of the seesaw.
BMA280 LGA‑14 accelerometer finely soldered onto ball balance prototype as a demonstration model for control engineeringClose-up of the BMA280 LGA‑14 accelerometer with fine red wire connections on the PCB of the ball balance project

Thrust reversal thanks to pitch-adjustable rotor blades

A model hobby servo changes the pitch angle of the rotor blades, so the propeller produces thrust in both directions without having to reverse rotation. This rapid thrust reversal is crucial to stabilize the complex system.
Ball balance with pitch-adjustable propeller, servo and shaft coupling as a measurement and teaching model for control engineeringPitch-adjustable propeller drive in red with mounting and center hub on the ball balance teaching model for control engineering

Signal and control interface with ATMEGA32 microcontroller

A C++ programmed microcontroller collects the sensor data and controls the propeller's motor controller as well as the servo for blade pitch adjustment. Communication with the notebook running the control loop is done via the serial RS232 interface.

Control board with ATMEGA32, connectors and multicolored cables in the ball balance teaching model for control engineering

Control design with function block editor in VB.NET

For creating a controller, a function block editor specifically developed for this setup is available. The editor, written in VB.NET, includes all common control elements such as PIDT1 controllers and can be flexibly extended with user-defined function blocks. A special feature is the ability to edit the entire signal flow during runtime. Changes take effect immediately without requiring recompilation as is the case with e.g. MATLAB Simulink.

Function block editor for ball balance: controller diagram with PID blocks, visualization, joystick input and recorder functions

Controller design for a nonlinear, highly dynamic system

The ball and beam represents a complex, nonlinear control system. The developed control loop comprises a total of four cascades with five PIDT1 controllers, which act on the state variables of velocity and position of both the ball and the beam. Each cascade stage is finely tuned to reliably keep the ball centered despite the unstable conditions.

Ball balance project control loop signal diagram with PIDT1 controllers and plant for the teaching model of control engineering

The inertia dynamics of the propeller drive were reproduced using a model simulation and integrated into the control loop as feedforward. To create the motor characteristic, the thrust or the torque acting on the beam was measured with a kitchen scale.

Charts of the speed and torque–pitch characteristic of a ball balance propeller at 32% power for demonstrator construction

The dynamics of the propeller's rpm collapse under load were determined by recording the motor noise with a notebook microphone and analyzing the pitch or frequency.

Audio signal recording of the ball balance motor noise in the frequency spectrum as a waveform for analysis in the control engineering project

Manual control to illustrate the complexity

For a better understanding of the complexity, the experimental setup can optionally be controlled manually via a joystick. This quickly makes clear how demanding or nearly impossible it is to keep the ball balanced without an elaborate controller.

Joystick control box for ball balance teaching model with LEDs, red pushbuttons and laptop for manual control in the labBall balance project: wooden box with mains connection, on/off switch and red emergency stop as a measurement stand functional model component

Manufacture of the wood, acrylic, and aluminum parts by CNC milling

All mechanical components were designed in AutoCAD and manufactured on a CNC milling machine. This enabled high precision fit and reliability in implementation.

Ball balance AutoCAD view with laser-capable CNC part plates, tilt rings and assembly plans for demonstrator modelCNC mill machining acrylic and wood panels for ball balance teaching model with shavings – prototype construction and trade show exhibit production
CNC mill produces precise wooden parts for the ball balance project as a trade show model and prototype in the model-making labCNC mill machining aluminum plate for the ball balance project – precise trade show prototype and exhibit manufacturing in model making
CNC-milled wooden panels and components for ball balance teaching model on a workbench with screwdrivers, shavings and storage boxesCNC-milled aluminum machined parts for ball balance teaching model as trade show exhibit and functional model for prototyping
CNC-milled wooden construction of the ball balance teaching model as trade show exhibit and functional model for control engineeringBall balance detail: aluminum construction with acrylic and carbon fiber rods as a functional model for trade show and laboratory
CNC-milled wooden construction of the ball balance teaching model as trade show exhibit and functional model for control engineeringBall Balance Detail: Aluminum construction with acrylic glass and carbon fiber rods as a functional model for trade shows and labsBall Balance Detail: Aluminum construction with acrylic glass and carbon fiber rods as a functional model for trade shows and labs

Development Environments for Software Development

For programming the function block editor in VB.NET, Visual Studio was used, while for the microcontroller programming in C++ the ATMEL AVR Studio was used. Additionally, HTerm was used to monitor the serial communication between the microcontroller and the PC during development.

Atmel AVR Studio and Visual Studio logos next to microcontroller image and ball balance control software for teaching modelScreenshot of the HTerm RS232 interface with received and sent data for the ball balance control engineering teaching model

Fine motor soldering work on the BMA280 accelerometer

Soldering the BMA280 accelerometer was a particular challenge. The LGA-14 package with a pin pitch of 0.5 mm appears tiny even on a 1-cent coin. Despite having a soldering tip that was far too large, patience to wait for the delivery of a suitable one was practically non-existent. ;)
Close-up of a tiny BMA280 accelerometer on a 1-cent coin, suitable for prototyping and microelectronicsSoldering iron tip soldering fine wire connections to BMA280 LGA-14 accelerometer on the ball balance circuit board

Handover of the experimental setup to THWS

The THWS (University of Applied Sciences Würzburg-Schweinfurt) has taken over the “Ball Scale” experimental setup for its control engineering laboratory. Prof. Dr. Abid Ali, who leads the lab, expressed his heartfelt thanks for the extraordinary commitment.

Johannes Glaser hands over the ball balance as a functional model to the THWS control engineering lab with Prof. Dr. Ali

Pioneering spirit from student days strengthens control engineering lab

THWS thanks Johannes Glaser for the “ball scale,” a teaching model that enables students to learn control engineering in a hands-on way. ➔ Learn more now!

View
Orange THWS logo on white background next to text, embedded in an article about the control engineering lab and ball balance

Pioneering spirit from student days strengthens control engineering lab

On behalf of the Technical University of Würzburg-Schweinfurt (THWS), Prof. Dr. Abid Ali warmly thanks Mr. Johannes Glaser for donating the experimental setup “ball scale” to the Control Engineering Lab.

More than ten years ago, then-electrical engineering student of the Faculty of Electrical Engineering showed extraordinary commitment. Instead of limiting himself to controlling an existing setup as required, he independently developed and built an entirely new control system. Together with his fellow student Daniel Neeser, a demanding setup was created - the “ball scale.” This teaching model now enables our students to learn the theoretical fundamentals of control engineering in a practical way. The aim of the experiment is to design a stable control loop that uses a propeller drive to regulate a metal ball into the center of a seesaw.

We are delighted with this valuable addition to our control engineering lab and appreciate Mr. Glaser’s contribution to the practical training of our students. We wish him every success and all the best for the future as an independent engineer. His commitment is a shining example of the connection between theory and practice that we especially promote at our university.

To the Control Engineering Lab - THWS

Ball Scale Challenge: Award for Outstanding Performance

The person who takes on the challenge and succeeds in developing a controller that stabilizes the ball precisely in the specified position will be awarded a certificate and a prize by Engineer Glaser. :)

Ball balance teaching model in the control engineering lab with function block editor on laptop and V‑profile rail for trade show exhibitBall balance teaching model in the control engineering lab at THWS with propeller drive, measurement setup and students at a laptop

THANK YOU!

Many thanks to Prof. Dr. Ali for the solid teaching of valuable control engineering tools during my studies. The practice-oriented and in-depth exercises complementing the lectures provided me with a solid foundation that still plays a central role in my engineering work today and has significantly contributed to my understanding of complex technical systems.

★★★★★

9 Reviews

View more projects

Trade show exhibit for Z-LASER with green laser projection on a CNC-milled wing mold at the booth

Mold making for trade shows - CNC manufacturing of molds

Mold making for trade show models for product presentation at the trade show. CAD design, CNC manufacturing and painting of molds for the exhibition booth.

View project
UV-illuminated Hygienic Seal demonstrator with acrylic cylinder, water screw and shiny stainless steel screws as an eye-catcher

Trade show exhibit for hygienic seal with water - exhibition construction

Noble trade show exhibit made from an acrylic column filled with water that uses granules and UV light to make the benefits of a hygienic seal visible.

View project
Functional model radar safety demonstrator with two SYMEO sensors and 3,000 LEDs in acrylic tubes as a trade show exhibit

Functional model for safety sensor with LED strips - exhibition construction

Interactive demonstration model to showcase the advantages of a dual radar measurement path for safe and reliable distance measurement.

View project
Radar trade show model with sensor, movable reflector, material and dust module as well as display as an interactive exhibit

Trade show model for radar sensor with display - exhibition construction

Modular trade show model of a robust measurement path that precisely measures distances through water, dust, and plastic with a radar sensor and displays them on a screen.

View project
Sensor box IMU product photo with goldcap memory, Qi charging cradle and ESP32 electronics as a robust trade show and prototype model

Sensor box IMU with AHRS

Spaceflight technology in a box. A measurement unit that assists in decontaminating radioactively contaminated plant components.

View project
Perspective blue code image for examples from software development, visualization and control software

Examples from software development

Control software for plant controls in the field of automation technology. Using Visual Studio in C# and VB.NET.

View project
Warehouse robot mule control with open cable duct, colored wires and terminal strips as a trade show exhibit demonstrator

Warehouse robot Mule

The Heavy Mule is a very robust and smart warehouse robot that navigates using an inductive guidance system and RFID tags.

View project
Compact winding drive trade show model: rows of open control cabinet boxes with emergency stop, sockets, and orange-rubberized cables

Compact winding drive

Smart winding motor with speed and torque control, synchronous drive and multifunction footswitch.

Coming soon
Trade show model palletizing robot behind yellow safety fence with monitor and conveyor technology as a functional demonstrator

Palletizing robot

Robot that measures pallet boxes with variable dimensions and loads them precisely. With digital twin and 3D visualization.

Coming soon
3D visualization of a winding machine as a trade show model with linear guide, brake motor, and demonstration functions for expo

Winding machine

Adaptive winding robot that wraps arbitrary rotational bodies with fabric tape while applying a uniform contact pressure.

Coming soon