Computation of the Control law using pole placement to stabilize an inverted pendulum on a moving cart

by Nasser Abbasi, computation section project report for 511

set up some notations to use

"control_pendulum_1.gif"

Calculate the kinetic energy

"control_pendulum_2.gif"

"control_pendulum_3.gif"

Calculate the potential energy of the system

"control_pendulum_4.gif"

"control_pendulum_5.gif"

Calculate the Lagrangian of system

"control_pendulum_6.gif"

"control_pendulum_7.gif"

Find equation of motion for the bob

"control_pendulum_8.gif"

"control_pendulum_9.gif"

"control_pendulum_10.gif"

Find equation of motion for the bob for small angle

"control_pendulum_11.gif"

"control_pendulum_12.gif"

Find equation of motion for the cart

"control_pendulum_13.gif"

"control_pendulum_14.gif"

"control_pendulum_15.gif"

Find equation of motion for the cart for small angle

"control_pendulum_16.gif"

"control_pendulum_17.gif"

"control_pendulum_18.gif"

"control_pendulum_19.gif"

"control_pendulum_20.gif"

"control_pendulum_21.gif"

"control_pendulum_22.gif"

"control_pendulum_23.gif"

Set up the state space equations X' = A X + B u

"control_pendulum_24.gif"

setup the A matrix

"control_pendulum_25.gif"

"control_pendulum_26.gif"

setup the B matrix

"control_pendulum_27.gif"

"control_pendulum_28.gif"

Analysis for Uncontrolled inverted pendulum

In this section, we find the solutions (x (t), x' (t), θ (t), and θ' (t)) when no control is applied. i.e. u = 0

define initial conditions, and initial X(0) vector, and define system values

"control_pendulum_29.gif"

"control_pendulum_30.gif"

define desired pole locations

"control_pendulum_31.gif"

"control_pendulum_32.gif"

Setup the sI - A matrix

"control_pendulum_33.gif"

"control_pendulum_34.gif"

"control_pendulum_35.gif"

"control_pendulum_36.gif"

"control_pendulum_37.gif"

"control_pendulum_38.gif"

"control_pendulum_39.gif"

"control_pendulum_40.gif"
"control_pendulum_41.gif"
"control_pendulum_42.gif"
"control_pendulum_43.gif"

"control_pendulum_44.gif"

"control_pendulum_45.gif"

"control_pendulum_46.gif"

Analysis for Controlled inverted pendulum

In this section, we find the solutions (x (t), x' (t), θ (t), and θ' (t)) when control force is applied which is first determined based on desired pole locations

Setup the A matrix with the control law. See analytical report for how this is derived

"control_pendulum_47.gif"

"control_pendulum_48.gif"

Find the characteristic equation for the A matrix

"control_pendulum_49.gif"

"control_pendulum_50.gif"

Determine the desired characteristic equation from the desired closed loop pole locations

"control_pendulum_51.gif"

"control_pendulum_52.gif"

Compare coefficients of the above 2 characteristic equations to solve for f1,f2,f3,f4

"control_pendulum_53.gif"

"control_pendulum_54.gif"

"control_pendulum_55.gif"

"control_pendulum_56.gif"

"control_pendulum_57.gif"

"control_pendulum_58.gif"

"control_pendulum_59.gif"

"control_pendulum_60.gif"

Now that we have solved for the f' s, we plug in the numerical values to obtain numerical value for the f' s

"control_pendulum_61.gif"

f3→21.4
f4→6.
f1→0.4
f2→1.

Now we can update the A matrix with the values found for the control law

"control_pendulum_62.gif"

"control_pendulum_63.gif"

"control_pendulum_64.gif"

"control_pendulum_65.gif"

Now we can solve the system by method of inverse Laplace transform

"control_pendulum_66.gif"

"control_pendulum_67.gif"

"control_pendulum_68.gif"

"control_pendulum_69.gif"

"control_pendulum_70.gif"

"control_pendulum_71.gif"
"control_pendulum_72.gif"
"control_pendulum_73.gif"
"control_pendulum_74.gif"

Now that we have found the solutions, we plot them and compare the result for the uncontrolled case

"control_pendulum_75.gif"

"control_pendulum_76.gif"

Spikey Created with Wolfram Mathematica 7.0