main content

building and manipulating uncertain models -凯发k8网页登录

this example shows how to use robust control toolbox™ to build uncertain state-space models and analyze the robustness of feedback control systems with uncertain elements.

we will show how to specify uncertain physical parameters and create uncertain state-space models from these parameters. you will see how to evaluate the effects of random and worst-case parameter variations using the functions usample and robstab.

two-cart and spring system

in this example, we use the following system consisting of two frictionless carts connected by a spring k:

figure 1: two-cart and spring system.

the control input is the force u1 applied to the left cart. the output to be controlled is the position y1 of the right cart. the feedback control is of the following form:

u1=c(s)(r-y1)

in addition, we use a triple-lead compensator:

c(s)=100(s 1)3/(0.001s 1)3

we create this compensator using this code:

s = zpk('s'); % the laplace 's' variable
c = 100*ss((s 1)/(.001*s 1))^3;

block diagram model

the two-cart and spring system is modeled by the block diagram shown below.

figure 2: block diagram of two-cart and spring model.

uncertain real parameters

the problem of controlling the carts is complicated by the fact that the values of the spring constant k and cart masses m1,m2 are known with only 20% accuracy: k=1.0±20% , m1=1.0±20% , and m2=1.0±20%. to capture this variability, we will create three uncertain real parameters using the ureal function:

k = ureal('k',1,'percent',20);
m1 = ureal('m1',1,'percent',20);
m2 = ureal('m2',1,'percent',20);

uncertain cart models

we can represent the carts models as follows:

g1(s)=1m1s2,g2(s)=1m2s2

given the uncertain parameters m1 and m2, we will construct uncertain state-space models (uss) for g1 and g2 as follows:

g1 = 1/s^2/m1;
g2 = 1/s^2/m2;

uncertain model of a closed-loop system

first we'll construct a plant model p corresponding to the block diagram shown above (p maps u1 to y1):

% spring-less inner block f(s)
f = [0;g1]*[1 -1] [1;-1]*[0,g2]
uncertain continuous-time state-space model with 2 outputs, 2 inputs, 4 states.
the model uncertainty consists of the following blocks:
  m1: uncertain real, nominal = 1, variability = [-20,20]%, 1 occurrences
  m2: uncertain real, nominal = 1, variability = [-20,20]%, 1 occurrences
type "f.nominalvalue" to see the nominal value and "f.uncertainty" to interact with the uncertain elements.

connect with the spring k

p = lft(f,k)
uncertain continuous-time state-space model with 1 outputs, 1 inputs, 4 states.
the model uncertainty consists of the following blocks:
  k: uncertain real, nominal = 1, variability = [-20,20]%, 1 occurrences
  m1: uncertain real, nominal = 1, variability = [-20,20]%, 1 occurrences
  m2: uncertain real, nominal = 1, variability = [-20,20]%, 1 occurrences
type "p.nominalvalue" to see the nominal value and "p.uncertainty" to interact with the uncertain elements.

the feedback control u1 = c*(r-y1) operates on the plant p as shown below:

figure 3: uncertain model of a closed-loop system.

we'll use the feedback function to compute the closed-loop transfer from r to y1.

% uncertain open-loop model is
l = p*c
uncertain continuous-time state-space model with 1 outputs, 1 inputs, 7 states.
the model uncertainty consists of the following blocks:
  k: uncertain real, nominal = 1, variability = [-20,20]%, 1 occurrences
  m1: uncertain real, nominal = 1, variability = [-20,20]%, 1 occurrences
  m2: uncertain real, nominal = 1, variability = [-20,20]%, 1 occurrences
type "l.nominalvalue" to see the nominal value and "l.uncertainty" to interact with the uncertain elements.

uncertain closed-loop transfer from r to y1 is

t = feedback(l,1)
uncertain continuous-time state-space model with 1 outputs, 1 inputs, 7 states.
the model uncertainty consists of the following blocks:
  k: uncertain real, nominal = 1, variability = [-20,20]%, 1 occurrences
  m1: uncertain real, nominal = 1, variability = [-20,20]%, 1 occurrences
  m2: uncertain real, nominal = 1, variability = [-20,20]%, 1 occurrences
type "t.nominalvalue" to see the nominal value and "t.uncertainty" to interact with the uncertain elements.

note that since g1 and g2 are uncertain, both p and t are uncertain state-space models.

extracting the nominal plant

the nominal transfer function of the plant is

pnom = zpk(p.nominal)
pnom =
 
        1
  -------------
  s^2 (s^2   2)
 
continuous-time zero/pole/gain model.

nominal closed-loop stability

next, we evaluate the nominal closed-loop transfer function tnom, and then check that all the poles of the nominal system have negative real parts:

tnom = zpk(t.nominal);
maxrealpole = max(real(pole(tnom)))
maxrealpole = -0.8232

robust stability margin

will the feedback loop remain stable for all possible values of k,m1,m2 in the specified uncertainty range? we can use the robstab function to answer this question rigorously.

% show report and compute sensitivity
opt = roboptions('display','on','sensitivity','on');
[stabilitymargin,wcu] = robstab(t,opt);
computing peak...  percent completed: 100/100
system is robustly stable for the modeled uncertainty.
 -- it can tolerate up to 288% of the modeled uncertainty.
 -- there is a destabilizing perturbation amounting to 289% of the modeled uncertainty.
 -- this perturbation causes an instability at the frequency 575 rad/seconds.
 -- sensitivity with respect to each uncertain element is:           
      12% for k. increasing k by 25% decreases the margin by 3%.     
      47% for m1. increasing m1 by 25% decreases the margin by 11.8%.
      47% for m2. increasing m2 by 25% decreases the margin by 11.8%.

the report indicates that the closed loop can tolerate up to three times as much variability in k,m1,m2 before going unstable. it also provides useful information about the sensitivity of stability to each parameter. the variable wcu contains the smallest destabilizing parameter variations (relative to the nominal values).

wcu
wcu = struct with fields:
     k: 1.5773
    m1: 0.4227
    m2: 0.4227

worst-case performance analysis

note that the peak gain across frequency of the closed-loop transfer t is indicative of the level of overshoot in the closed-loop step response. the closer this gain is to 1, the smaller the overshoot. we use wcgain to compute the worst-case gain peakgain of t over the specified uncertainty range.

[peakgain,wcu] = wcgain(t);
peakgain
peakgain = struct with fields:
           lowerbound: 1.0424
           upperbound: 1.0731
    criticalfrequency: 4.1606

substitute the worst-case parameter variation wcu into t to compute the worst-case closed-loop transfer twc.

twc = usubs(t,wcu);         % worst-case closed-loop transfer t

finally, pick from random samples of the uncertain parameters and compare the corresponding closed-loop transfers with the worst-case transfer twc.

trand = usample(t,4);         % 4 random samples of uncertain model t
clf
subplot(211), bodemag(trand,'b',twc,'r',{10 1000});  % plot bode response
subplot(212), step(trand,'b',twc,'r',0.2);           % plot step response

figure contains 2 axes objects. axes object 1 with ylabel magnitude (db) contains 5 objects of type line. these objects represent trand, twc. axes object 2 contains 5 objects of type line. these objects represent trand, twc.

figure 4: bode diagram and step response.

in this analysis, we see that the compensator c performs robustly for the specified uncertainty on k,m1,m2.

see also

| | | |

related topics

    网站地图