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

Project 3:  Linear Quadratic Gaussian

MAE6246: Electromechanical Control Systems

1    Optimal Control with LQR

In class, we discussed how to use LQR to do a controller based on an optimization process.  In python, use the solve_continuous_are function in the scipy linalg module to find the LQR gain for a set of Q = I and R = I matrices. Show that the eigenvalues of the resulting linearized system are stable. Now adjust the weights of Q and R to generate controllers that:

• Minimize response time

Minimize control effort

• Minimize velocity at the tip of the pendulum

Not that each of these points is a separate problem, and you some up with a separate set of gains for each. Discuss why each choice of Q and R for each of the goals should be effective in acheiving those goals.

2    Optimal Estimation with a Kalman Filter

In class, we discussed a Kalman filter, and how it is an optimized filter assuming gaussian noise.   Note in the provided simulator, there is a new function called sensor_update that will generate a noisy sensor value based the C matrix and the covariance M specified at the top of the file (lines 43 and 44). This matrix will be the M matrix for the Kalman filter. In our case, the model noise will come mostly from the non-linear nature of the simulation. We can calulate it by using a monte-carlo estimation. To do this, follow the following procedure:

1.  Generate 1000 random states near the origin with angles within ±   radians and angular velocities within ±1.5 rad/sec.

2.  Apply a single step using the non-linear dynamics, save the results in an array

3.  Apply a single step using the linearized dynamics, save these results in another array

4.  calculate the covariance of the difference linearized and non-linear results

Now that you have an estimate of the N matrix, calculate the Kalman gain using the solve_continuous_are function again.

Now experiment with this process, what happens if you increase the number of samples in your monte-carlo ap- proximation? What if you increase the size of the region you are sampling? How does this effect the resulting gains, and what does this mean in a practical sense?  How does adding additional sensors (additional rows of C) effect performance?

3    Optimal Combined Estimation and Control with LQG

Finally, combined the controller and estimator by using the estimated state for control.  How does this effect the performance?  Adjust the controller as needed to get good performance, discuss what you had to adjust, and why you think that is. Make sure that your Kalman filter is optimized to work on the envelop that the LQR controller is designed to operate in, discuss how you define this envelope.