Вы находитесь на странице: 1из 18

# Variable structure and compound adaptive control of the process with model of order one

CHAPTER 2

## Variable structure and compound adaptive control

of the process with model of order one
This chapter presents an introduction in to VS-MRAC systems. It is considered the most
simple plant model, plant model of order one. More explicitly, are considered plants to which
can be associated models of order one. Therefore, the reference model can be chosen SPR
transfer function. The SPR condition establishes the way in VS-MRAC and compound MRAC
control input synthesis. Anyway, VS-MRAC control input synthesis for plant model of order
one does a separate topic by this chapter, in order to make easier the understanding and the
introduction of the new elements in VS-MRAC and compound control.

The case, when the plant model may be chosen of order one, leads to an easier manipulation of
the systemic tools to the performances (transitory and asymptotic) and properties (stability and
parameter convergence) analysis of adaptive closed loops.

## 2. 1. Adaptive control input synthesis and

27
Variable structure and compound adaptive control of the process with model of order one

Let Hp(s) be, the plant model transfer function. In time domain, the plant model is described by
differential equation

.
y p  t    a p y p  t   k p u t  , (2. 1. 1)

where the parameters a p , k p are unknown. It knows at most the sign of the parameter k p .
The transfer function of the plant model could be unstable, that corresponds to an unstable
process.

The reference model has the stable transfer function, H m  s  . In time domain, it can be
described by the differential equation

.
y m  t    a m ym  t   k m r  t  , (2. 1. 2)

where the parameters a m , k m are known and am>0 . The last inequality comes from the
stability property of the reference model.

## If it considers the control input

u  t    y  t  y p  t   r  t  r  t  , (2. 1. 3)

## where the parameters have the true values

 op  a p  a m / k p 
, (2. 1. 4)

 or  k m / k p

then the transfer from the reference signal to the process output is identical with the transfer
from the reference signal to the reference model output (it can say that the transfer by
reference model way is identical with the transfer by the process way)

 
.
y p  t    a p y p  t   k p p  t  y p  t   r  t  r  t  
, (2. 1. 5)
 
  a p  k p p  t  y p  t   k p r  t  r  t    a m y p  t   k m r  t 

0 0
when p(t)=p and r(t)=r (when the control input parameters have the true values).

## Define the parameter estimation errors of the control input

28
Variable structure and compound adaptive control of the process with model of order one

 p  t    p  t    op
(2. 1. 6)
 r  t    r  t    or

## and the tracking error

eo  t   y p  t   y m  t  . (2. 1. 7)

## After some manipulations, the tracking error becomes

1

e o  t   o H m  s  p  t  y p  t    r  t  r t   . (2. 1. 8)
r

## In the previous relationship the expression

H m  s p  t  y p  t   r  t  r t   (2. 1. 9)

means the Laplace operator transfer function, Hm(s)[.], applied to the time function.

In the equation (2. 1. 8), H m  s  is SRP (any stable transfer function of order one is a SRP
function) and if assume the parameter update laws
.
 
 p  t     g sign k p e o  t  y p  t 
, (2. 1. 10)
.
 
 r  t     g sign k p e o  t  r  t 

asymptotic zero tracking error is guaranteed, in conformity with lemma 1. 2. 2, from the
previous chapter.

## Simulation 2. 1. 1. In the figure 2. 1. 1 is represented the response of the process,

1 1
H p  s  , and the reference model, H m  s   , to a variable step input signal (r(t)=1,
s 1 s 1
for 0t5r(t)=-2, for 5t10r(t)=2, for 10t). It was considered the control input law (2. 1.
3) with the parameter updating (2. 1. 10) and the process dynamics H p  s  . It has been
chosen the constant  g  1 . The value of that constant is an indicator of the searching step
size to parameter update law. A smaller value for the step size, like as in the this simulation,
produces a quiet parameter updating with negative effects of transitory response of the
adaptive loop. A greater value can produce oscillations on the control input and/or plant
output, that may not accepted even if the transitory response is good. Because the reference
signal is not 2n-sufficiently rich, that did not assure PE condition for the signals vector of the
closed loop. It can observe in subplot 2. 1. 1 b the parameter values do not converge to the
true values (the true values are:  op  2 and  or  1 ).

29
Variable structure and compound adaptive control of the process with model of order one

raspuns comanda
4 6

4
2
2
0
0
-2
-2

-4 -4
0 10 20 30 0 10 20 30
a) t[s] c) t[s]
parametrii comenzii eroarea de urmarire
2 1.5

1 1

0 0.5

-1 0

-2 -0.5

-3 -1
0 10 20 30 0 10 20 30
b) t[s] d) t[s]

Figure 2. 1. 1. Loop response to adaptive control input, gradient parameter update law,
(g=1), variable step reference input signal.

raspuns comanda
3 4

2 2

1 0

0 -2

-1 -4

-2 -6
0 10 20 30 0 10 20 30
a) t[s] c) t[s]
parametrii comenzii eroarea de urmarire
4 2

2
1
0
0
-2

-4 -1
0 10 20 30 0 10 20 30
b) t[s] d) t[s]

Figure 2. 1. 2. Loop response to adaptive control input, gradient parameter update law,
(g=1), cosine reference input signal (pulsation radians/sec, amplitude a=2).

Simulation 2. 1. 2. Figure 2. 1. 2 represents the response of the same loop, but to a cosine
wave reference signal with the frequency (in radians/seconds) 1rad/sec. In can see the
control input parameters go to their true values, asymptotically. The reference signal r(t) is 2-
sufficiently rich, because a single frequency  yields two points, {-, on the spectral
density power axe, so that is assured PE condition of the adaptive loop signals vector, where
the control input has only a single component with parameter updating by a gradient law. On
the subplot a) have been drown the reference signal, plant output and reference model output.

30
Variable structure and compound adaptive control of the process with model of order one

It can see the convergence of the control input parameters to their true values, asymptotically,
for any frequency value in the reference input signal.

The closed loop dynamics are completely described by the following differential equations for
tracking error and parameter estimation errors

.

e o  t    a m eo  t   k p  r  t  r  t    y  t  eo  t    y  t  y m  t   (2. 1. 11)

.
 
 y  t     g sign k p e o  t  y p  t 
. (2. 1. 12)
.
 
 r  t     g sign k p e o  t  r  t 

## It can choose the Lyapunov function

  
V eo , y ,  r  eo2 / 2  k p 2y  2r / 2 g   (2. 1. 13)

as a square form of tracking error and parameter estimation errors. Making its time derivate,
along of a trajectory of the differential equations (2. 1. 11), (2. 1. 12), easily results a negative-
definite form
 
.
V e o  t ,  y  t ,  r  t    a m eo
2  t  0 (2. 1. 14)

Therefore, the loop is stable and, for any initial conditions, the error signals: e o(t), (t), 2(t)
are bounded. Moreover, it obtains zero tracking error, asymptotically.

The adaptive loop, with gradient parameter update law, has good robustness properties to
bounded external disturbances and multiplicative unmodeled dynamics. The disturbances could
affect the control input and/or the plant output. The unmodeled dynamics is excitable in a high
frequency band and it assuming that the number of unstable poles of the plant model remains
unchanged. The high frequency unmodeled dynamics can change the values of unstable poles.
In the following loop simulations, it considers as an multiplicative unmodeled dynamics
(multiplicative unstructured uncertainty) a proper transfer function with one pole and one
zero, the last one being more closed to the origin axis than the pole. The magnitude bode plot
of the uncertainty, in high frequency band, is an upper boundary of a uncertainty set. In low
and medium frequency the plant model is not affected by any kind of uncertainty.

## Simulation 2. 1. 3. The plant dynamics is affected by an uncertainty represented by the

0.08s  0.8
transfer function H nm  s   with magnitude and phase bode plots like as in figure
0.05s  1
2. 1. 3. It can observe its magnitude bode plot with a high frequency band beginning on the
frequency   10 rad / sec . The uncertainty affects the plant by the transfer function factor
1  H nm  s  . In the adaptive loop configuration, a variable step disturbance (p(t)=-0.5 for
0t3p(t)=0.5 for 3tp(t)=-1 for 6t) is additive to the plant output. The loop response
to the reference input, disturbance output and unmodeled dynamics, is shown in figure 2.1.5.
The loop is stable and zero tracking error is obtained asymptotically, even if the control input

31
Variable structure and compound adaptive control of the process with model of order one

is more oscillate. The SIMULINK block schema, used for simulations, is shown in the figure
2. 1. 4.

Bode Diagrams

2
Phase (deg); Magnitude (dB)

-2

15

10

0 1 2
10 10 10

Figure 2. 1. 3. The magnitude and phase bode plots of the uncertainty, high frequency band
beginning to   10 rad / sec .

update law, external disturbance additive on the plant output, multiplicative unmodeled
dynamics.

32
Variable structure and compound adaptive control of the process with model of order one

raspuns comanda
4 4

2
2

0
-2

-4 -2
0 10 20 30 0 10 20 30
a) t[s] c) t[s]
parametrii comenzii eroarea de urmarire
1 1.5

1
0.5
0.5
0
0
-0.5
-0.5

-1 -1
0 10 20 30 0 10 20 30
b) t[s] d) t[s]

Figure 2. 1. 5. The loop response to adaptive control input, gradient parameter update law,
(g=1), variable step reference input, variable step disturbance, additive to plant output,
high frequency unmodeled dynamics.

## 2. 2. Variable structure adaptive control

with sigmoid switching function to the parameter update law

For briefly presentation of variable structure adaptive control, without lost the generality, it
supposes the high frequency gains, k m , k p , are positive values. Let a p , k p be, the
unknown plant model parameters. The sign of k p is known . There are the known positive
values a p , k p such that

a p  ap , kp  kp . (2. 2. 1)

With these assumptions, the true values of control input parameters from relationship (2. 1. 3)
verify the inequalities

o o
r  r ,  p  p , (2. 2. 2)

where r , p are a priori known. In variable structure adaptive control, the control input
parameters support the following update law

p  t     p signeo  t  y p  t  
_

. (2. 2. 3)
_
r  t     r sign eo  t  r  t  
33
Variable structure and compound adaptive control of the process with model of order one

In this introduction section, it can conclude that the control input has the same synthesis with
the parameter update law that contains a switching function. Introducing (2. 2. 3) in (2. 1. 3),
the variable structure control input becomes

_ _
u  t     p sign  eo  t   yp  t    r sign eo  t   r  t  . (2. 2. 4)

## Choosing the Lyapunov function as a square form of tracking error

V eo  t    e2o  t  / 2 (2. 2. 5)

and, making its time derivate along the solutions of the differential equation

.  _ _ 
e o  t    a m eo  k p  o
p y p  r   p y p sign e o    r sign eo   ,
o
(2. 2.
 
6)

## it obtains the following negative definite expression

.  _  _  
V  eo    a m e2
o  k p   p  o 
p  e o y p    r  o
 r 
 eo r   0 (2. 2. 7)

    

Due to the some reasons as in previous sub-chapter, asymptotic zero tracking error is obtained
or, more, tracking error tends to zero in finite time. Although, in real conditions there are
delays in switching relays (due to the real switching function) and in the presence of
uncertainties, the loop can exhibit a high frequency oscillation on the control input and/or in
the plant output, around the equilibrium point e o  0 . This phenomena is named chattering.
For alleviating or eliminating chattering, is used, in (2. 2. 3), a parameterized sigmoid as a
switching function (parameterized by a constant, k, and for that the switching function is
named k-sigmoid) instead of a pure relay switching function

_ k eo  t  y p  t   1
e
p  t    p k  t  y  t 
e eo p  1
, (2. 2. 8)
_ k eo  t  r  t   1
e
r  t    r k  t  r t 
e eo 1
where k is a positive constant. For a smaller value of the constant, k, the sigmoid switching
function is closer to a pure relay function. It shows bellow, in this case, the Lyapunov stability
condition is satisfied only on certain intervals, but, globally, the tracking error remains
bounded. With k-sigmoid switching function, the differential equation (2. 2. 4) becomes

34
Variable structure and compound adaptive control of the process with model of order one

.  _ k e o  t  y p  t  1 _ k eo
e e
e o  t    a m e o  t   k p  p y p  t    r   p e o  t 
o o  r eo t 
k e o  t  y p  t  1
 e ek eo
.
(2. 2. 9)
Introducing (2. 2. 9) in (2. 2. 5), and considering for exponential function from the k-sigmoid
function, a Taylor series development with retaining only two first terms, it obtains the
following inequality for the Lyapunov time derivate function

.
V e o    a m e o
22
k p o o 
p  r / k
.  (2. 2. 10)

For
 
e o  2 k p  op   or /  k a m  , (2. 2. 11)

results V  e   0 . It can conclude there is a finite interval on real axe where the tracking
o
error is bounded even if the stability Lyapunov condition is not satisfied.

To the update law (2. 2. 8,) it will introduce a supplementary dynamics of the upper limits
 p ,  r . More precisely,  p ,  r become time function and will be commanded by the tracking
error and loop signals as follow

_
  t      t   
v eo  t  y p  t 
 p p , (2. 2. 12)

_
 r    r  t    v eo  t  r  t  , (2. 2. 13)

where and v are positive constants. In (2. 2. 12) and (2. 2. 13), it can observe an evolution
to negative values of p , r . The first term from the right side of (2. 2. 12) and (2. 2. 13) is
equivalent to a forgotten term and that is the reason for the denoting modification the
update laws (2. 2. 3) and (2. 2. 4), with p , r time depending. For increasing the robustness
to external disturbances and unmodeled dynamics, the modification can be considered a
time function, depending of the control input parameters vector norm. In the next two
chapters is taken in to account the time depending modification, too. To the current
chapter, it remains only to constant modification.

Looking with greater attention in (2. 2. 12) and (2. 2. 13) it can observe that p , r have
nonzero values during the tracking error is nonzero. Implicitly, y(t) and r (t) have nonzero
values. The utilization of (2. 2. 8) to the control input as the parameter update law together
with the supplementary dynamics (2. 2. 12), (2. 2. 13), lead to a nonzero asymptotic tracking
error, but bounded. That can easy proofed by choosing the following Lyapunov function as a
quadratic form of tracking error and parameter estimation errors

 _ _ 
V eo ,  y ,  r   e2 2 2
o   y  r (2. 2. 14)
 
 

35
Variable structure and compound adaptive control of the process with model of order one

and making its time derivate along the solutions of (2. 2. 9), (2. 2. 12), (2. 2. 13). It can show
that the time derivate of the function from (2. 2. 14) is upper bounded by a negative-definite
expression.

Simulation 2. 2. 1. The same plant and reference models as in 2. 1. 1 are considered in to the
adaptive loop with variable step reference input. The parameters of the control input have a
variable structure update law.  p  t  and  r  t  are on-line updated following (2. 2. 8) with a
k-sigmoid as a switching function. Also, the amplitude of switching function is time depending
following the dynamics (2. 2. 12) and (2. 2. 13), with constant modification. Looking to the
figure 2. 2. 1, can observe a nonzero asymptotic value of tracking error and negative
asymptotic values for the parameters of the control input,  p  t  and  r  t  . It can remark the
quality of transitory response, that is smooth and without oscillations. For the constants, from
above relationships, have been chosen the following values: v=100, k=5.

raspuns comanda
4 10

2
5

0
-2

-4 -5
0 10 20 30 0 10 20 30
a) t[s] c) t[s]
parametrii comenzii eroarea de urmarire
2 0.2

1 0.1

0 0

-1 -0.1

-2 -0.2
0 10 20 30 0 10 20 30
b) t[s] d) t[s]

Figure 2. 2. 1. The loop response to variable structure adaptive control input, constant -
modification, (v=100), k-sigmoid switching function, (k=5), variable step reference
input signal.
In accordance with the inequality from (2. 2. 11) and above stability analysis, the tracking
error remains bounded all the time with a nonzero asymptotic value. The asymptotic tracking
error value depends of the parameter k from sigmoid switching function.

Simulation 2. 2. 2. The figure 2. 2. 2 presents the response of the same variable structure
adaptive loop, but for a greater value of the parameter k (k=50) than to the simulation 2. 2. 1.
Can be remarked a smaller asymptotic tracking error and an evolution to the negative values
of the control input parameters.

36
Variable structure and compound adaptive control of the process with model of order one

raspuns comanda
4 10

2
5
0
0
-2

-4 -5
0 10 20 30 0 10 20 30
a) t[s] c) t[s]
parametrii comenzii eroarea de urmarire
3 0.2

2
0.1
1
0
0
-0.1
-1

-2 -0.2
0 10 20 30 0 10 20 30
b) t[s] d) t[s]

Figure 2. 2. 2. The loop response to variable structure adaptive control input, constant -
modification, (v=100), k-sigmoid switching function (k=50), variable step
reference input signal.

The robustness to the external disturbances and high frequency unmodeled dynamics of the
variable structure adaptive loop is greater than the adaptive loop with the control input
having parameter update by a gradient law. It remembers that the loop robustness
means loop stability and the bounded tracking error when external disturbances and/or
high frequency unmodeled dynamics affect the plant.

Simulation 2. 2. 3. The quality and the robustness of the loop response to variable structure
adaptive control input is shown in the figure 2. 2. 3. The same external disturbance and
unmodeled dynamics as in the simulation 2. 1. 3 affect the plant. Although the amplitude of the
control input is bigger, the loop tracking performances (smooth transitory response and small
asymptotic tracking error) are better than to the loop response from figure 2. 1. 4.

37
Variable structure and compound adaptive control of the process with model of order one

raspuns comanda
4 20

2
10

0
-2

-4 -10
0 10 20 30 0 10 20 30
a) t[s] c) t[s]
parametrii comenzii eroarea de urmarire
4 2

2
1
0
0
-2
-1
-4

-6 -2
0 10 20 30 0 10 20 30
b) t[s] d) t[s]

Figure 2. 2. 3. The loop response to variable structure adaptive control input, constant -
modification, (v=100), k-sigmoid switching function (k=50), variable step
reference input signal, variable step external disturbance additive to the plant output, high
frequency unmodeled dynamics.

Below, are given the MATLAB m-files used to the simulation of the variable structure
adaptive closed loop for the plant, reference model, external disturbance and multiplicative
unmodeled dynamics, above considered.

***************************************************************************
global u e0 gams lam k1;
t0=0; e0=0; k1=50; lam=10; tf=30; u=0; gams=100;
y0=[0 0 0 0 0];
[t,y]=ode23('vsord1',[t0 tf],y0);
clf; for k=1:length(t),
if t(k)<3,
pv(k)=-0.5;
elseif t(k)<6,
pv(k)=.5;
else pv(k)=-1;
end;
if t(k)<5,
rv(k)=1;
elseif t(k)<10,
rv(k)=-2;
else rv(k)=2;
end;
e0v(k)=y(k,1)+pv(k)-y(k,2);

38
Variable structure and compound adaptive control of the process with model of order one

th0v(k)=y(k,3)*(exp(k1*e0v(k)*(y(k,1)+pv(k)))-1)/(exp(k1*e0v(k)*(y(k,1)+pv(k)))+1);
thrv(k)=y(k,4)*(exp(k1*e0v(k)*rv(k))-1)/(exp(k1*e0v(k)*rv(k))+1);
uc(k)=th0v(k)*y(k,1)+thrv(k)*rv(k);
end;
subplot(221);
plot(t,y(:,1)+pv','-k',t,y(:,2),'-k',t,rv,'-k',t,pv,'-k');
grid; title('response'); xlabel('a) t[s]');
subplot(223);
plot(t,th0v,'-k',t,thrv,'-k');
grid; title('control parameters'); xlabel('b) t[s]');
subplot(222);
plot(t,uc,'-k');
grid; title('control input'); xlabel('c) t[s]');
subplot(224);
plot(t,e0v,'-k');
grid; title('tracking error'); xlabel('d) t[s]');

***************************************************************************
function yd=vsord1(t,y);
global u e0 gams lam k1;
if t<3,
p=-.5;
elseif t<6,
p=.5;
else p=-1;
end;
if t<5,
r=1;
elseif t<10,
r=-2;
else r=2;
end;
yd(5)=36*u-20*y(5);
y(5)=2.6*u+y(5);
yd(1)=y(5)+y(1);
yd(2)=r-y(2);
e0=y(1)+p-y(2);
yd(3)=-lam*y(3)-gams*abs(e0*(y(1)+p));
yd(4)=-lam*y(4)-gams*abs(e0*r);
th0=y(3)*(exp(k1*e0*(y(1)+p))-1)/(exp(k1*e0*(y(1)+p))+1);
thr=y(4)*(exp(k1*e0*r)-1)/(exp(k1*e0*r)+1);
u=th0*(y(1)+p)+thr*r;
***************************************************************************

## 2. 3. Compound adaptive control input synthesis.

Gradient and variable structure parameter update laws

39
Variable structure and compound adaptive control of the process with model of order one

Assume the control input parameters p , r , obtained by additive composing of two terms:

 p  t    gp  t    vp  t 
, (2. 3. 1)
 r  t    gr  t    vr  t 

where the parameters  gp ,  gr have a gradient updating, following the dynamics (2. 1. 10),
and the parameters  vp ,  vr have a variable structure updating

_ k eo t  y p t   1
e
vp  t    vp k  t  y  t 
e e1 p  1
, (2. 3. 2)
_ ke1 t  r  t   1
e
vr  t    vr k  t  r  t 
e e1 1
where vp , vr are time depending, as in the differential equations (2. 2. 12) and (2. 2. 13),
respectively. The variable structure component,  v , of the control input, has effect during
transitory time, its value tends to zero.

Simulation 2. 3. 1. In the figure 2. 3. 1, is the response of the same plant and reference model
to compound adaptive control input with gradient and variable structure parameter update
laws with k-sigmoid switching function and variable step reference input signal. The constants
have been chosen to the following values: g=10, v=100, k=50. Zero tracking error and
a smaller amplitude of the control input are obtained.

The asymptotic values of the control input parameters, from the above simulation, are not the
true ones and are not the same with those from adaptive loop with gradient parameter update
law. Because, the reference input signal that is not 2-sufficiently rich in frequencies so that the
loop signals vector is not PE. To the compound adaptive control, the parameter convergence
to the true values exits only for the component of the control input that has gradient
parameter update law. The variable structure component has only a local convergence to a
value depending of the asymptotic tracking error. To the variable structure adaptive control,
with a pure relay as a switching function, there isn’t an asymptotic parameter convergence and
the tracking error becomes zero in finite time. The norm of parameters vector of the control
input is a measure of the signals level inside of the adaptive loop.

Simulation 2. 3. 2. The transitory and asymptotic performances, as well as the stability of the
loop to compound adaptive control input are exhibited when an additive external disturbance
acts to the plant output and a high frequency uncertainty affects the main plant dynamics. The
simulated loop response from the figure 2. 3. 2 proofs that. The loop is well behaved during
transitory and asymptotic time.

40
Variable structure and compound adaptive control of the process with model of order one

raspuns comanda
3 10

2
5
1

0
0
-1

-2 -5
0 10 20 30 0 10 20 30
a) t[s] c) t[s]
parametrii comenzii eroarea de urmarire
4 0.2

2 0.1

0 0

-2 -0.1

-4 -0.2
0 10 20 30 0 10 20 30
b) t[s] d) t[s]

Figure 2. 3. 1. The loop response to compound adaptive control input, gradient and variable
structure parameter update laws, (g=1, v=100), k-sigmoid switching function,
(k=50), variable step reference input signal.

raspuns comanda
3 20

2 15

1 10

0 5

-1 0

-2 -5

-3 -10
0 10 20 30 0 10 20 30
a) t[s] c) t[s]
parametrii comenzii eroarea de urmarire
4 1

2 0.5

0 0

-2 -0.5

-4 -1

-6 -1.5
0 10 20 30 0 10 20 30
b) t[s] d) t[s]

Figure 2. 3. 2. The loop response to compound adaptive control input, gradient and variable
structure parameter update laws, (g=1, v=100), k-sigmoid switching function,
(k=50), variable step reference, variable step external disturbance additive to the plant
output, high frequency unmodeled dynamics.
The following algorithm yields steps for compound adaptive control input synthesis, where the
input data are: the sign of the plant high frequency gain and model reference transfer function.

41
Variable structure and compound adaptive control of the process with model of order one

The design elements are the constants which could influence the tracking performances and
the robustness.

Algorithm 2. 3. 1. (of compound adaptive control input synthesis for the process with
model of order one).

1) Input data

km
sign(kp), H m  s   .
s  am

2) Design elements

## choose the values for the constants: gvk.

3) Control input

   
u  t    gp  t    vp  t  y p  t    gr  t    vr  t  r t  .

## 4) Parameter update laws (on-line identifier)

.
 
 gp    g sign k p e o y p ,

.
 
 gr    g sign k p e o r ,

_ keo  t  yp t   1
e
vp  t     vp k  t  y  t 
e eo p  1
,
_ k e o t  r  t   1
e
vr  t     vr k  t  r  t 
e eo 1
_
vp  t     vp  t    v e o  t  y p  t 

 ,

_
  t      t   
v e o  t  r t 
 .
vr vr

In above algorithm, the tracking error is the identifier error. In the figure 2. 3. 3 is presented a
block schema of the loop with compound adaptive control input which corresponds to the
response from the simulation 2. 3. 1.

42
Variable structure and compound adaptive control of the process with model of order one

Figure 2. 3. 3. Block schema of the loop with compound adaptive control input for the plant
model of order one.

Below, are given the MATLAB m-files used to the simulation of the compound adaptive
closed loop for the plant, reference model, external disturbance and multiplicative unmodeled
dynamics, above considered.

***************************************************************************
global u e0 gamd gams lam k1;
t0=0;e0=0;k1=5;lam=10;tf=30;u=0;gams=100;gamd=10;
y0=[0 0 0 0 0 0 0];
[t,y]=ode23('avsord1',t0,tf,y0);
clf;
for k=1:length(t),
if t(k)<3,
pv(k)=-0.5;
elseif t(k)<6,
pv(k)=.5;
else pv(k)=-1;
end;
if t(k)<5,
rv(k)=1;
elseif t(k)<10,
rv(k)=-2;
else rv(k)=2;
end;
e0v(k)=y(k,1)+pv(k)-y(k,2);
th0v(k)=y(k,5)*(exp(k1*e0v(k)*(y(k,1)+pv(k)))-1)/(exp(k1*e0v(k)*(y(k,1)+pv(k)))+1);
thrv(k)=y(k,6)*(exp(k1*e0v(k)*rv(k))-1)/(exp(k1*e0v(k)*rv(k))+1);
uc(k)=(th0v(k)+y(k,3))*y(k,1)+(thrv(k)+y(k,4))*rv(k);
end;
clf; subplot(221);
plot(t,y(:,1)+pv','-k',t,y(:,2),'-k',t,rv,'-k');
grid; title('response'); xlabel('a) t[s]');
subplot(223);
plot(t,th0v'+y(:,3),'-k',t,thrv'+y(:,4),'-k');
43
Variable structure and compound adaptive control of the process with model of order one

## grid; title('control input parameters'); xlabel('b) t[s]');

subplot(222);
plot(t,uc,'-k');
grid;title('control input'); xlabel('c) t[s]');
subplot(224);
plot(t,e0v,'-k');
grid;title('tracking error'); xlabel('d) t[s]');

function yd=avsord1(t,y);
global u e0 gamd gams lam k1;
if t<3,
p=-.5;
elseif t<6,
p=.5;
else
p=-1;
end;
if t<5,
r=1;
elseif t<10,
r=-2;
else r=2;
end;
yd(7)=36*u-20*y(7);y(7)=2.6*u+y(7);
yd(1)=y(7)+y(1);
yd(2)=r-y(2);
e0=y(1)+p-y(2);
yd(3)=-gamd*e0*(y(1)+p);
yd(4)=-gamd*e0*r;
yd(5)=-lam*y(5)-gams*abs(e0*(y(1)+p));
yd(6)=-lam*y(6)-gams*abs(e0*r);
th0=y(5)*(exp(k1*e0*(y(1)+p))-1)/(exp(k1*e0*(y(1)+p))+1);
thr=y(6)*(exp(k1*e0*r)-1)/(exp(k1*e0*r)+1);
u=(th0+y(3))*(y(1)+p)+(thr+y(4))*r;
***************************************************************************

44