Camera based control of a ball balancing plate

OData support
Dr. Stumpf Péter Pál
Department of Automation and Applied Informatics

In my thesis, I set the goal to design, build, program and test a ball-on-top balancing machine. The thesis describes the design and building process, a dynamical model of the system, the ball sensing method, and the steps of the design and implementation of the controller.

The machine consists of a plate tilted by two servos, a webcamera, an ARDUINO Uno board, a DC power source and a PC running the image processing algorithm.

The position of the ball is detected by a webcamera, which is connected to a PC via USB connection. On the PC, a program implemented in MATLAB runs a colour based image processing algorithm, which identifies the position of the ball and the position of the plate. The distinction is achieved by using a red ball and green markers on the corners of the plate. After the image processing and numerous additional calculations, knowing the real position of the ball on the plate, a discrete time PD controller is implemented as the control method. A desired angle for both servos is calculated at the end and is sent to the ARDUINO board via serial communication. The ARDUINO board controls the servos via PWM. Servos are powered by a DC power supply connected to a basic breadboard circuit.

At the end of the thesis, I present two simulations for the system, a SIMULINK representation and a representation with transfer functions. These simulations are compared to the real system using step response functions. Measurements for positioning to a given point and for following a circle are also presented. A video showing the different operating modes of the machine is linked to the Appendix.

At the end of the work, conclusions are drawn, considering the work successful, and future work options are proposed, including improvement of the machine by improving some physical parts or possible educational uses.


Please sign in to download the files of this thesis.