Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Project 1:  Double Pendulum

MAE6246: Electromechanical Control Systems

Consider the Double Pendulum system that was the subject of the previous few assignments. In this lab, you will be controlling this system suing full state feedback as discussed in class. During this project, let the mass of both arms be 0.5kg with a length of 1m. Use 9.81m/s2  as the acceleration of gravity.

1    Controllability Analysis

Consider the linearization about the stable equilibrium. Find the controllability matrix and show that this system is controllable.   Do you expect the controllability to change when considering the linearization of the unstable equilibria? Fine the relevant controlabillity matrices and test your guess.

2    Control Design

For the fully inverted and fully not inverted (θ1  = 0,π , θ2  = 0), use the methods discussed in class (Using the Companion form matrix or the Lyapunov method) to calculate a feedback matrix.  Choose poles such that the system has poles at λ = −1 ± 1.8i,  −2 ± 2i.  (note the dominant pole here will have a settling time of roughly 3s, and approximately 20% overshoot.

3    Simulation

Calculate the analytical solution to the closed loop system. Use the provided simulation code to generate the non- linear response for the system. Explore several different initial conditions, and plot 1 or 2 interesting ones together with the linear response. Remember that the linear dynamics operate on the difference between the state and the equilibrium!

3.1    Setup Anaconda

Anaconda can be downloaded from https://www.anaconda.com/products/distribution. Once installed, create and activate a new environment with the following commands

$  conda  create  -n  ctrl  numpy  h5py  bokeh

$  conda  activate  ctrl

Now that you are in the conda environment with the proper packages installed, navigate to where you downloaded the simulation script. You can run this script with the following command:

$  bokeh  serve  --show  doublependulum .py

This should open up your browser  and you should be  able to see the simulator interface.   After running the simulation, if you saved the trajectory, you can plot it by running

$  python  doublependulum_plotter .py

Implement the controller and plot the analytical solution to the linear equation, and the numerical solution to the non-linear equations of motion. Do this for both the fully inverted and fully not inverted equilibria.

Vary the initial conditions to get a feel for how far away from the equilibrium the state can start before the controller is unable to bring the system back to equilibrium. Particularly consider how this effects the unstable vs the stable equilibria. How would errors in the position effect things vs errors in the velocity?

4    Report

Write up a report, discuss your approach and results for each part.  Include a discussion of what it means for the system to be controllable, and the limits of approximating a non-linear system with linearization. Discuss how far from the equilibrium you can get before the linearized controller is unable to stabilize the unstable systems.  How does adjusting the poles effect this boundary?

5    Extra Credit

Consider the linearized closed loop systems. Use the euler method from the midterm where xk+1  = xk +hx˙ (hk) to discretize these solutions. Determine how large the time step can get before the discretization becomes unstable. Use this value to determine a range of test timesteps to plot along with the analytical solution. Discuss this boundary and what timestep you would ultimately use and why.  Discuss how adjusting the pols by choosing different gains would effect these boundaries.  This will result in up to 15 points of extra credit towards the midterm (depending on quality of report and insights)

If you do the same analysis for the other equilibria of the double pendulum system for this assignment  (where θ2  = π), it will be worth up to 10 points extra credit on this project.