Practical Assignment 3

Due in class at 10:00 on 22 July.  To be completed by pairs of students.  Pair assignments are the same as for previous practical assignments.

This lab concerns the control of a robot balancing a rod using state feedback.  This is an instance of the well-known inverted pendulum problem shown below:

inverted_pendulum_diagram

The inverted pendulum system is non-linear but can be linearized to yield the following differential equations (valid only for small angles):

inverted_pendulum_equations

Some further algebraic manipulations are required to bring the system into state-space form with the following selection of state variables:

inverted_pendulum_state_space

Tasks

Complete the tasks below by incorporating the appropriate elements into a Matlab script entitled PA3.m.  Prepare a printout of the execution of this script as your final submission (Matlab’s publish command puts both the script and its output together in a nice form). Make sure that the important quantities computed below are displayed in your output.

  1. The B, C, and D matrices are not given.  Determine the B matrix by finding suitable combinations of the differential equations so that the overall system is expressed in state-space form.  The C matrix should be chosen to select the angle of the pendulum as the output.  The D matrix is the zero matrix.  Start PA3.m by defining variables which give the important parameters of our system:
    mass of the pendulum = 10
    mass of the robot = 20.25
    L = 0.5
    g = 9.81Now define the A, B, C, and D matrices and the system object in PA3.m.
  2. Add Matlab commands to compute the eigenvalues of the open-loop system (i.e. the system just defined).  Comment on the value of these eigenvalues from the stability perspective.  Add further commands to test for controllability and display the result.
  3. The system is 4th order, but we will apply state feedback to compensate the system such that its closed-loop eigenvalues will correspond to a dominant 2nd order pole pair, and two other poles positioned further to the left on the real axis.  The 2nd order pair will be placed to achieve 2% overshoot and a settling time of 5 seconds.  Compute and display all four desired eigenvalues in PA3.m.
  4. Apply Matlab’s place command to determine the K vector that will yield the desired closed-loop eigenvalues for this system.  Test the computed K vector by opening the following V-Rep simulation and inserting the corresponding values into the robot’s control script: PA3.ttt.  Execute the simulation and check that the robot can now balance its pole.  The robot should balance the pole for at least a few seconds.  After a few more seconds the robot may turn out of the plane and become unstable—don’t worry about this.  Note that executing the simulation is simply a check on your computed K vector and will not be explicitly marked.

Each group should print a hard copy of PA3.m (using publish as mentioned above).  The file should also be submitted to D2L by the due date.