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

Calculate the kinetic energy

Calculate the potential energy of the system

Calculate the Lagrangian of system

Find equation of motion for the bob

Find equation of motion for the bob for small angle

Find equation of motion for the cart

Find equation of motion for the cart for small angle

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

setup the A matrix

setup the B matrix

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

define desired pole locations

Setup the sI - A matrix

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

Find the characteristic equation for the A matrix

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

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

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

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

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

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