Inverted Pendulum
The rotary inverted pendulum has 2 degrees of freedom: α of the under-actuated vertical link and θ of the actuated horizontal link (Figure 1). In lab 4 of MECHENG552, we measure α and θ in real-time, and developed a control system to swing up the vertical link and then stabilize it (Video 1).
Video 1 Demo filmed on April 11, 2021
The overall development process is as follows:
1. Formulation (?)
Formulate dynamics equation of inverted pendulum through Lagrangian mechanics (Prof. S. Awtar taught us).
2. Parameter Identification
Mass and momentum parameters were identified through CAD models provided by Mr. Wirkner. Damping coefficients and motor constants were experimentally evaluated in lab 3, instructed by D. Schulman and N. Jalgaonkar.
Now we have the numerical expression for the nonlinear equation in Step 1.
3. State-Space Model
Linearize the previous nonlinear equations around the vertical equilibrium position, and get a state-space model about α, θ and their 1st order derivatives.
4. LQR for Stabilizer Controller
Guess a pair of cost matrix, and apply linear–quadratic regulator algorithm to generate a full-state feedback controller matrix C. Use SIMULINK to model dynamics equation in Step 2, and test whether controller matrix C can stabilize the inverted pendulum in SIMULINK world. If not, improve the guess for cost matrix. If yes, insert more realistic effects such as quantization and saturation into SIMULINK world, and then test controller matrix C again (Figure 2).
5. Swing-Up Controller
Initially, the vertical link is at rest and pointing downward. To have it pointing upwards, we need to inject mechanical energy into the system. So, the controller input (u, torque of motor) has its magnitude proportional to the energy difference. The sign of u is set such that the motor is always injecting energy into the system.
6. LabView
Setup the encoder, add a switching algorithm between two controllers, and have the whole system refreshing at 1kHz. Experiment suggests that a refreshing rate lower than 250Hz will give a bad enough estimation of velocity such that the switching algorithm malfunctions.
7. User Interface
Plotting some useful real-time data makes debugging easier (Figure 4).
Acknowledgment:
This is MECHENG552 Lab 4. Again, this great course is instructed by Prof. Shorya Awtar.
The mechanical setup was made by UM Mechanical Engineering Machine Shop. I did modeling and control as described above.
Oltean, Stelian-Emilian. “Swing-up and Stabilization of the Rotational Inverted Pendulum Using PD and Fuzzy-PD Controllers.” Procedia Technology, vol. 12, Elsevier Ltd, 2014, pp. 57–64, doi:10.1016/j.protcy.2013.12.456.