main content

analyzing control systems with delays -凯发k8网页登录

this example shows how to use control system toolbox™ to analyze and design control systems with delays.

control of processes with delays

many processes involve dead times, also referred to as transport delays or time lags. controlling such processes is challenging because delays cause linear phase shifts that limit the control bandwidth and affect closed-loop stability.

using the state-space representation, you can create accurate open- or closed-loop models of control systems with delays and analyze their stability and performance without approximation. the state-space (ss) object automatically keeps track of "internal" delays when combining models, see the "specifying time delays" tutorial for more details.

example: pi control loop with dead time

consider the standard setpoint tracking loop:

where the process model p has a 2.6 second dead time and the compensator c is a pi controller:

$$ p(s) = {e^{-2.6 s} (s 3) \over s^2 0.3 s 1} , \;\; c(s) = 0.06 (1  
{1 \over s}) $$

you can specify these two transfer functions as

s = tf('s');
p = exp(-2.6*s)*(s 3)/(s^2 0.3*s 1);
c = 0.06 * (1   1/s);

to analyze the closed-loop response, construct a model t of the closed-loop transfer from ysp to y. because there is a delay in this feedback loop, you must convert p and c to state space and use the state-space representation for analysis:

t = feedback(p*c,1)
t =
 
  a = 
          x1     x2     x3
   x1  -0.36  -1.24  -0.18
   x2      1      0      0
   x3      0      1      0
 
  b = 
        u1
   x1  0.5
   x2    0
   x3    0
 
  c = 
         x1    x2    x3
   y1  0.12  0.48  0.36
 
  d = 
       u1
   y1   0
 
  (values computed with all internal delays set to zero)
  internal delays (seconds): 2.6 
 
continuous-time state-space model.

the result is a third-order model with an internal delay of 2.6 seconds. internally, the state-space object t tracks how the delay is coupled with the remaining dynamics. this structural information is not visible to users, and the display above only gives the a,b,c,d values when the delay is set to zero.

use the step command to plot the closed-loop step response from ysp to y:

step(t)

the closed-loop oscillations are due to a weak gain margin as seen from the open-loop response p*c:

margin(p*c)

there is also a resonance in the closed-loop frequency response:

bode(t)
grid, title('closed-loop frequency response')

to improve the design, you can try to notch out the resonance near 1 rad/s:

notch = tf([1 0.2 1],[1 .8 1]);
c = 0.05 * (1   1/s);
tnotch = feedback(p*c*notch,1);
step(tnotch), grid

pade approximation of time delays

many control design algorithms cannot handle time delays directly. a common workaround consists of replacing delays by their pade approximations (all-pass filters). because this approximation is only valid at low frequencies, it is important to compare the true and approximate responses to choose the right approximation order and check the approximation validity.

use the pade command to compute pade approximations of lti models with delays. for the pi control example above, you can compare the exact closed-loop response t with the response obtained for a first-order pade approximation of the delay:

t1 = pade(t,1);
step(t,'b',t1,'r',100)
grid, legend('exact','first-order pade')

the approximation error is fairly large. to get a better approximation, try a second-order pade approximation of the delay:

t2 = pade(t,2);
step(t,'b',t2,'r',100)
grid, legend('exact','second-order pade')

the responses now match closely except for the non-minimum phase artifact introduced by the pade approximation.

sensitivity analysis

delays are rarely known accurately, so it is often important to understand how sensitive a control system is to the delay value. such sensitivity analysis is easily performed using lti arrays and the internaldelay property.

for example, to analyze the sensitivity of the notched pi control above, create 5 models with delay values ranging from 2.0 to 3.0:

tau = linspace(2,3,5);                    % 5 delay values
tsens = repsys(tnotch,[1 1 5]);           % 5 copies of tnotch
for j=1:5
  tsens(:,:,j).internaldelay = tau(j);    % jth delay value -> jth model
end

then use step to create an envelope plot:

step(tsens)
grid, title('closed-loop response for 5 delay values between 2.0 and 3.0')

this plot shows that uncertainty on the delay value has little effect on closed-loop characteristics. note that while you can change the values of internal delays, you cannot change how many there are because this is part of the model structure. to eliminate some internal delays, set their value to zero or use pade with order zero:

tnotch0 = tnotch;
tnotch0.internaldelay = 0;
bode(tnotch,'b',tnotch0,'r',{1e-2,3})
grid, legend('delay = 2.6','no delay','location','southwest')

discretization

you can use c2d to discretize continuous-time delay systems. available methods include zero-order hold (zoh), first-order hold (foh), and tustin. for models with internal delays, the zoh discretization is not always "exact," i.e., the continuous and discretized step responses may not match:

td = c2d(t,1);
step(t,'b',td,'r')
grid, legend('continuous','zoh discretization')
warning: discretization is only approximate due to internal delays. use faster
sampling rate if discretization error is large. 

to correct such discretization gaps, reduce the sampling period until the continuous and discrete responses match closely:

td = c2d(t,0.05);
step(t,'b',td,'r')
grid, legend('continuous','zoh discretization')
warning: discretization is only approximate due to internal delays. use faster
sampling rate if discretization error is large. 

note that internal delays remain internal in the discretized model and do not inflate the model order:

order(td)
td.internaldelay
ans =
     3
ans =
    52

some unique features of delay systems

the time and frequency responses of delay systems can look bizarre and suspicious to those only familiar with delay-free lti analysis. time responses can behave chaotically, bode plots can exhibit gain oscillations, etc. these are not software quirks but real features of such systems. below are a few illustrations of these phenomena

gain ripples:

g = exp(-5*s)/(s 1);
t = feedback(g,.5);
bodemag(t)

gain oscillations:

g = 1   0.5 * exp(-3*s);
bodemag(g)

jagged step response (note the "echoes" of the initial step):

g = exp(-s) * (0.8*s^2 s 2)/(s^2 s);
t = feedback(g,1);
step(t)

chaotic response:

g = 1/(s 1)   exp(-4*s);
t = feedback(1,g);
step(t)

see also

|

related examples

    more about

      网站地图