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

Project 2: State Estimation

MAE6246: Electromechanical Control Systems

Consider the double pendulum system from project 1.  Previously, we relied on full state knowledge to control the system, however, this is not always the case.  In this project, we will consider the system with limited sensor capability.  Provided with this is an updated simulator and plotter script with the correct constants (including damping).  This updated simulator also tracks a variable state_est which is the estimated state of the system. This estimate is not updated automatically, and you must be sure to update it during the control phase of the problem.  This simulator also has a flag LINSIM on line 41 which will let you toggle the simulator to be a linear or non-linear simulation; this should be useful during debugging, and for parts of this project.  The estimated state history is tracked along with the actual state, and it is plotted as a dashed line in the plotter script.  The initial estimate of the state can be modified on lines 32-35. There is also a variable TIMESCALE that can be used to slow down the simulation (a value of 1 is real time, 2 would be half speed, etc.). The estimated state will also be visualized during the sim as a ghost” pendulum alongside the real pendulum.  In this project, only consider the inverted configuration of the system.

1 State Estimation

1.1 Sensor Modeling

The first step to state estimation setting up what you are able to get from your sensors. To start, assume that we are only able to track the angle of the elbow joint in the arm with a potentiometer or some other sensor. We can fit this into our general model as

y = [0   1   0   0   0] x                                                                       (1)

Create this C matrix in python, and calculate the observability matrix and show that the system is fully observable from sensing only this angle.

1.2 Feedback Gain Calculation

Use the Lyapunov method to calculate a feedback gain L. Choose a gain so that the eigenvalues of A − LC are 10 times faster than those of your closed loop system (i.e. multiply the real part of your controlled eigen values by 10).

Create your F and matrices and verify that (F, ) is controllable. You can now solve the Sylvester equation

AT T TF = CT T                                                                                                           (2)

and calculate the final feedback gain L = T T . Verify that your gain sets the eigenvalues as desired.

1.3 Simulation

Implement the state estimation law = A +Bu+L(y − C ) in the function control_law on line 112 along with your control law from project 1.  Note that u = −Kx and is thus based on the true state for now.  Run both the linear and non-linear simulations using this state estimator and comment on the results. Do you think these results are adequate for control purposes? How is the non-linearity in the non-linear system effecting the estimation?

1.4 Additional Sensor Configurations

Now assume we can also add a gyroscope to the second link. This gyroscope will measure the global rotation of the second link (e.g. ω 1 + ω2 ). We can represent this sensor along with the potentiometer with the following model:

y = ] x                                                                         (3)

Build a state estimator with this model (you should be able to do everything as before with the solve_sylvester function in scipy.   Comment on how this helped with the state estimation, and what more you would need to comfortably control the system with the estimated state.

Come up with at least two more potential sensor configurations.  Think about what kind of physical sensors you might use (potentiometers, gyroscopes, accelerometers, lasers, etc.), and how to model them linearly.  Implement state estimation based on these configurations and comment on their performance.

2 Estimated State Feedback

Now that we have some state estimators setup, use the estimated state in the feedback controller instead of the true state.  Start with the linear system, this should work fairly easily.  Can you get the estimated state feedback to work on the non-linear system? you can adjust the controller, or the estimator as needed to try to achieve this. Good Luck!