Observer-Based Feedback with Matlab
This wiki covers the aspects of a typical control problem which is solved using Matlab Suppose we are given the plant,
\(P(s)= \frac{1}{s(s+1)}\)
which we would like to stabilize it and perform tracking using pole placement and observer design techniques in matlab.
a. Place the poles according to the time domain specifications: overshoot is less than 20% and the rise time is less than 0.5 seconds.
We can use the transfer function and pick it in controllable canonical form to obtain the A,B matrices. First we’ll want to convert the system to state space. Recall that A state-space model can be extracted from the system variable G with the following command:
[A,B,C,D] = ssdata(G) % or with [A,B,C,D] = tf2ss(num,den)
Which return the matrices in controllable canonical form. Alternatively, for this simple system we can write the system as a set of differential equations,
\(y''+y'=u\)
which is trivial to put into state space formulation. In either case, the command
* place(A,B,[-1.8+3.177j,-1.8-3.177j]) *
yields K values of 2.6 and 13.333.
Now we close the loop and simulate the time response. Acl=A-B*K; sys=ss(Acl, B, C, D); step(sys); %to simulate response and verify time response
But what’s this? The step response is off by a constant factor! Well this is because the controller we have designed so far meets our transient requirements, but now we must address the steady-state error. This is done with the use of a constant precompensator. Looking at our block diagram we can derive that we must achieve unity DC gain, thus let
\(G=(C(-A+BK)^{-1})^{-1}\)
b.Next, we want to design an observer and incorporate it into the system. Note that the step response is exactly the same. Show we this is the case.
So we add an observer with dynamics, \(\hat{\dot{x}} = (A-LC)\hat{x}+By+Ly\)
Again we can use place to choose the location of the poles, say twice as far (it doesn’t matter in this case.)