Using a Makeblock control module to balancing a ball in the middle of a beam. The controlling is done with the help of a PID regulator that is run on the control module (Me Orion). The in data to the regulator is the distance to the ball and the ball is moved by the arm is lifted or lowered.
PID regulator
A ultra sound sensor detecting the position of the ball (Input)
"Output" position of the ball compare to the "Setpoint" (The desired position of the ball, in the middle of the arm in this project)
A PID regulator in the Makeblock control module is used to calculate the angle for the servo based on the difference of "Output" position and "Setpoint" (error).