Chapter 1 Introduction
Xmath Control Design Module 1-22 ni.com
Because this system is open-loop unstable and has fairly fast poles in both
halves of the s-plane, you want to make sure it can bring the effect of an
external disturbance (such as a sharp push to the cart) to zero as quickly as
possible.
[Kr,EVr,Pr] = regulator(wsys,diag([1e8,1,1,1]),1);
You then can verify that the regulator gain Kr can be used with full-state
feedback to control this system by using an identity matrix for C to feed
back the states:
[no, ni, ns] = size(wsys);
augwsys = system(A,B,eye(ns, ns),[]);
creating the compensator (which is a system object, though it has no states
and thus has NULL A, B, and C matrices) with the gains Kr:
comp = system([],[],[],Kr);
and feeding back the states:
wsysreg = feedback(augwsys, comp);
You then can observe the system response to a sustained disturbance by
simulating a five-second step response:
stepreg = step(wsysreg, 0:0.01:5);
plot (stepreg, {legend=states,
xlab="Time",ylab="Magnitude",
title="System Step Response with "+...
"Full State Availability",!grid})
The resulting plot is shown in Figure1-13.