PID Controller for a double integrator.
------------------------------------------------------------------------
See also @statespace/statespace.m, FResp, PIDMIMO, Series, TResp,
Plot2D
------------------------------------------------------------------------
Contents
The plant model-a single axis vehicle with an inertia of 1
aP = [0 1;0 0];
bP = [0;1];
cP = [1 0];
dP = 0;
The frequency range for plotting
w = logspace(-4,2,200);
The PID controller. The rate filter is automatically set
inr = 1;
zeta = 2;
wN = 1;
tauI = 20;
[aC,bC,cC,dC] = PIDMIMO(inr,zeta,wN,tauI);
FResp(aC,bC,cC,dC,1,1,w);
Close the loop the plant and controller are in the forward path
[a,b,c,d] = Series(aP,bP,cP,dP,aC,bC,cC,dC);
a = a - b*c;
The output is the angle
c = [1 0 0 0];
e = eig(a);
DispWithTitle(e,'Eigenvalues');
Eigenvalues
-5
-3.7321
-0.26795
-0.05
Double integrator
[magOL,~] = FResp(aP,bP,cP,dP,1,1,w);
magOL = 20*log10(magOL);
Closed loop system
[magCL,~] = FResp(a,b,c,d,1,1,w);
magCL = 20*log10(magCL);
Plot2D(w,[magOL;magCL],'Frequency (rad/sec)','Magnitude (db)',...
'Disturbance transmission','xlog',[],[],[],[],[],...
{{'Open Loop' 'Closed Loop'}})
Step response
g = statespace( a, b, c, d );
TResp( g, [0;0;0;0] );