Control of the Cart Pendulum System

PID controller of Pendulum Cart System

PID controllers are typically used to regulate some system to get a desired output. This process is much like how cars uses cruise control, or how an oven may heat up to a certain temperature.

These controllers accept a setpoint as an input and it will increase or decrease the output based on the error between your desired value and the actual value. In the cart and pendulum model, the PID is told to make the pendulum angle equal to zero so it then uses a sensor to find the current pendulum angle. With thesetwo values, we can find the error between the desired angle and the actual angle of the system, and the controller will calculate the required output to reach the desired angle. A PID controller was used in the Matlab/Simulink cart pendulum model in order to help select accurate requirements for our part selection, and it will also be used in the physical construction.

In order to tune a PID controller, Kp, Ki, and Kd constants must be determined since theyt will determine the performance characteristics of the controller. Those performance characteristics are overshoot, settling time, and rise time and are defined below.

 

Overshoot: How far the controller's output will go past the desired setpoint.

Settling Time:The amount of time it takes to reach the desired setpoint.

Rise Time: The amount of time it takes for the system to begin to react in order to start reaching the desired setpoint.

 

A PID controller was chosen instead of a PI or PD controller because it is commonly used to track "type 2 inputs" with only minor error. Since the pendulum is swining based on the acceleration of the cart influencing the angular acceleration of the pendulum, there is angular velocity and angular position involved. because we would have to transform angular acceleration into angular velocity, and transform angular velocity into angular position with two integrators, the pendulum movement is an type 2 input. For type 0 or type 1 inputs there are simpler controllers that can track them just as well.

The PID used for the simularion shown below was automatically tuned using the controls toolbox of MATlab, and it successfully cancels the swing of the pendulum in half the time it took for friction to cancel the swing.