Open design_demo.m in the Editor
Run in the Command Window

First-Cut Robust Design

In this demo we use Robust Control Toolbox™ commands usample, ltiarray2uss and dksyn to design robust controller with traditional performance objectives. It can serve as a template and jumping off point for other and more complex design situations.

Contents

Introduction

The original plant model consists of a first-order system with uncertain gain and time constant, in series with a mildly underdamped resonance and significant unmodeled dynamics. This is created easily with the uncertain model construction commands. A collection of step responses illustrate the potential variability.

gamma = ureal('gamma',2,'Perc',30);  % uncertain gain
tau = ureal('tau',1,'Perc',30);   % uncertain time-constant
delta = ultidyn('delta',[1 1],'SampleStateDim',5,'Bound',1);
W = makeweight(0.1,20,10);
wn = 50; xi = 0.25;
P = tf(gamma,[tau 1])*(1+W*delta)*tf(wn*wn,[1 2*xi*wn wn*wn]);
step(P,1.5)

Covering the Uncertain Model

The model for P contains a complex (3 uncertain elements) uncertainty description. For feedback design purposes, it is often desirable to simplify the uncertainty model, while approximately retaining the overall variability. This is one use of the command ltiarray2uss. This command takes a nominal model, along with an array of models, and derives an uncertain system, Usys. The uncertain system Usys employs simple multiplicative, unmodeled dynamics to cover the system behavior in displayed in the array of systems with an uncertain model centered at given nominal.

In order to use ltiarray2uss, we first need an array of models, whereas currently we have a single uncertain model. The command usample samples an uncertain object, across its modeled uncertainty, to create an array of not-uncertain models. Sample the uncertain model P at 60 points. The random number generators are seeded for repeatability.

rand('seed',99);
randn('seed',99);
Parray = usample(P,60);

The next task is to "cover" the behavior in this array using a simple, multiplicative, unmodeled dynamics description. This is done with ltiarray2uss. We choose as the center of the cover the nominal value of P. The dynamic order of the weighting function used in the unmodeled dynamics modeling is specified by the user. Here we use a 2nd order weight. A Bode magnitude plot illustrates that the magnitude of the weighting function "covers" the relative variability in the plant model behavior.

orderWt = 2;
[Usys,Wmult,d] = ltiarray2uss(P.NominalValue,Parray,orderWt,'in');
bodemag(Wmult,(P.NominalValue-Parray)/P.NominalValue,'r--');

Usys is a 1-input, 1-output system with a simple uncertainty description. It is centered at P.NominalValue, and its variability approximately covers the variability in P.

Creating the Open-loop Design Model

How can we pose a "traditional" design for this uncertain plant? Suppose we choose a desired closed-loop bandwidth, and perform a robust sensitivity-minimization design, using the bandwidth to parametrize the performance weighting function on the closed-loop sensitivity function. The performance weighting function is chosen 1st order, with DC gain of 100, high frequency gain of 0.5, and a magnitude of 1 at the desired closed-loop bandwidth. This type of transfer function is easily constructed with makeweight. We also add a sensor noise model, to complement this objective, and limit controller bandwidth. This noise weight is also 1st order, with DC gain of 0.005, high frequency gain of 10, and a magnitude of 1 at 20*(desired closed-loop bandwidth).

desBW = 0.4;
Wperf = makeweight(100,desBW,0.5);
Wnoise = makeweight(0.5/100,20*desBW,10);

With the weighting functions, we next build the open-loop interconnection. It is a system with two types of inputs: exogenous distrubances, and controls; and two types of outputs: errors and measurements. The disturbances and errors are chosen so that the transfer function from disturbance-to-error is what is "to be kept small" through feedback. In our case, this consists a Performance-weighted Sensitivity and Noise-weighted Complementary

Here we use the iconnect objects. Alternatively, the sysic command, as well as simple model construction (series, etc.,) can be used.

[ny,nu] = size(Usys);
M = iconnect;
d = icsignal(ny);
n = icsignal(ny);
u = icsignal(nu);
e = icsignal(ny);
M.Input = [d;n;u];
M.Output = [e;-(e+Wnoise*n)];
M.Equation{1} = equate(e,Usys*u+Wperf*d);

1st Design: Low Bandwidth Objectives

M.System is the 3-input, 2-output uncertain system, suitable for robust design. The design is carried out with the automated robust design command dksyn.

[K,ClosedLoop,muBound] = dksyn(M.System,ny,nu);
muBound
muBound =

    0.7236

The muBound is a positive scalar. If it near 1, then the design was successful, and the desired closed-loop bandwidth fairly consistent with what can be achieved. As a rules of thumb, if muBound is less than 0.85, then the achievable performance can be improved upon; if muBound is greater than 1.2, then the desired closed-loop bandwidth is not achievable, in light of the plant uncertainty.

So, here, with muBound approximately 0.72, the objectives are met, but could ultimately be improved upon. Create open-loop Bode plots, noting the typical crossover frequency, and phase margin.

bode(Parray*K); grid

Finally, compute and plot output-disturbance step responses of the closed-loop system. These are consistent with the desired closed-loop bandwidth of 0.4, with settling times approximately 7 seconds.

step(feedback(1,Parray*K),8);

In this naive design strategy, we have correlated the noise bandwidth with the desired closed-loop bandwidth. This simply helps limit the controller bandwidth. A fair perspective is that this approach focuses on output disturbance attenuation in the face on plant model uncertainty. Sensor noise is not truly addressed. Problems with considerable amounts of sensor noise would be dealt with in a different manner.

2nd Design: Higher Bandwidth Objectives

Let's redo the design, adjusting the desired bandwidth higher.

desBW = 2;
Wperf = makeweight(100,desBW,0.5);
Wnoise = makeweight(0.5/100,20*desBW,10);
M.Output = [e;-(e+Wnoise*n)];
M.Equation{1} = equate(e,Usys*u+Wperf*d);
[K2,ClosedLoop2,muBound2] = dksyn(M.System,ny,nu);
muBound2
muBound2 =

    0.9176

With muBound2 close to 1, this design achieves a good tradeoff between performance goals and plant uncertainty. Open-loop Bode plots confirm a fairly robust closed-loop bandwidth of approximately 2 rad/sec along with decent phase margins.

bode(Parray*K2); grid

Closed-loop step disturbance responses further illustrate the higher bandwidth response, with reasonable robustness across the plant model variability.

step(feedback(1,Parray*K2),8);

3rd Design: Very Aggressive Objectives

Redo the design once more, with an extremely optimistic closed-loop bandwidth goal.

desBW = 20;
Wperf = makeweight(100,desBW,0.5);
Wnoise = makeweight(0.5/100,20*desBW,10);
M.Output = [e;-(e+Wnoise*n)];
M.Equation{1} = equate(e,Usys*u+Wperf*d);
[K20,ClosedLoop20,muBound20] = dksyn(M.System,ny,nu);
muBound20
muBound20 =

    1.7662

With muBound significantly greater than 1.5, the closed-loop performance goals in the presence of the plant uncertainty are not achievable. The Bode plots clearly indicate the poor performance of this controller.

bode(Parray*K20); grid

Disturbance step response plots (for 1 time-unit) also highlight the poor closed-loop performance.

step(feedback(1,Parray*K20),1);

Robust Stability Calculations

The Bode and Step response plots shown above are generated from samples of the uncertain plant model P. We can use the uncertain model directly, and assess the robust stability of the 3 closed-loop systems.

ropt = robopt('Sensitivity','off','Mussv','sm5');
[stabmarg,destabunc,report] = robuststab(feedback(P,K),ropt);
[stabmarg2,destabunc2,report2] = robuststab(feedback(P,K2),ropt);
[stabmarg20,destabunc20,report20] = robuststab(feedback(P,K20),ropt);

The RobustStability reports confirm exactly what we have observed.

report

report2

report20
report =

Uncertain System is robustly stable to modeled uncertainty.               
 -- It can tolerate up to 188% of the modeled uncertainty.                
 -- A destabilizing combination of 252% of the modeled uncertainty exists,
    causing an instability at 17 rad/s.                                   


report2 =

Uncertain System is robustly stable to modeled uncertainty.               
 -- It can tolerate up to 164% of the modeled uncertainty.                
 -- A destabilizing combination of 166% of the modeled uncertainty exists,
    causing an instability at 25.9 rad/s.                                 


report20 =

Uncertain System is NOT robustly stable to modeled uncertainty.            
 -- It can tolerate up to 80.2% of the modeled uncertainty.                
 -- A destabilizing combination of 80.5% of the modeled uncertainty exists,
    causing an instability at 100 rad/s.