LQR and Integral Feedback
Please Log In for full access to the web site.
Note that this link will take you to an external site (https://shimmer.mit.edu) to authenticate, and then you will be redirected back to this page.
Adding An Integral Term to State-Space Control
Recall that in classical control, adding an integral in the compensator eliminates steady-state errors, usually at the cost of worsening the stability. To minimize the distabilizing effects of adding the integral term, we often adjust the other terms (such as the proportional and derivative terms in the PID controller). We can also add an integral to the state-space controller to eliminate steady-state errors, and in the case of state-space control, we have more feedback gains to modify, so we can usually avoid a stability penalty.
State-space control without an integral term
The generic state-space equations are
where x is the state, u is the "plant" input, y_d is the primary input and is usually the desired output of the system, and y is the actual output of the system. Once one has determined \textbf{E}, \textbf{A}, \textbf{B}, and \textbf{C}, and has determined a good set of LQR weights for the state and the input, we can use the lqr
to determine values for \textbf{K} that result in good closed-loop performance.
A key point to note is that the state-feedback gains do not depend on the scaling of the primary input, that is, the K's do not depend on K_r. One can determine K to optimize dynamic performance, and then scale the primary input by K_r so as to achieve a desired steady-state
Once K and the K_r have been determined, the closed-loop system is given by
We can compute K_r from the formula
Adding the tracking-error-integral state
Consider adding an extra state to the system, denoted by w, and defined by the differential equation,
We can add this extra state to a state-space model by appending w to \textbf{x}, as in
The extra state means that there is a row added to \textbf{B}, a column added to \textbf{C}, and a row and column added to both \textbf{E} and \textbf{A}. The expanded matrices, denoted with a subscript + are:
To include the integral term, we alter the representation of the state-space control problem to include the reference input in a different way. That is,
Note that for the extra row in B_+, we used the value of zero, which means that the extra state has the equation
Substituting for u gives us a closed-loop state-space system,
For the case of the three-state model of the propeller, adding the tracking-error-integral state generates a four-state model. The new state vector is then
Determining the gains with the extra state
When we add the extra state w, we also need an extra state-feedback gain, K_w, so that
We can determine \textbf{K}_+ using either the place
or lqr
function with the expanded matrices, \textbf{E}_+, \textbf{A}_+ and \textbf{B}_+. For example, in matlab we could use
Kp = place(Ep\Ap,Ep\Bp,[-1,-2,-3,-4]).where we can used the subscript p because matlab will not let us use + in a variable label.
To prepare for the lab, please re-derive the \textbf{A}_+, \textbf{B}_+, \textbf{C}_+, and \textbf{E}_+ matrices for the open-loop propellor state space model including the integrator state. You will modify the MATLAB script for lab to include the integrator state. You'll need to:
- Create the \textbf{A}_+, \textbf{B}_+, \textbf{C}_+, and \textbf{E}_+ matrices.
- Update the Q and R weights in the LQR optimization.
- Edit the formula that computes the closed-loop matrices for the augmented system.
Notice that in the lab Matlab script, we have done some of the modifications for adding the integral term, but not all of them.
When you get in to lab, you'll see that we have set up a Matlab script and Teensy sketch so that you can modify the matlab script and run it, an intermediate file will be generated. That file will be read when you compile and download the Teensy sketch onto the Teensy.