Example: Linearization of a nonlinear model involving a nonlinear function of two variables.
The dynamic behavior of the liquid level h in the conical storage tank system shown in the figure can be shown to be represented below, where now the cross section area of the tank is given by:
Fi
Hh
r
R
F
Ahc
AF
dtdh i
2/1
22
HhRrA
The tank model becomes
where α and β are parameters defined by:
cRH
,1 2
FFdtdhA i hcF
iFhcdtdhA
2/32
hhF
dtdh i
Dr. Kalyana Veluvolu
2/32
hhF
dtdh i
This process model has two types of nonlinear functions: Fih-2 , a product of two functions, and h-3/2. We shall have to linearize each of these functions seperately around the steady state (hs, Fis).
The linearization of f(h, Fi) = Fih-2 proceeds as follows:
termsorderhigherFFFfhh
hfFhfFhf isi
Fhis
Fhsisi
ississ
),(),(
,,
whereupon carrying out the indicated operations now gives:
isisssissisi FFhhhhFFhfFhf 232,,
If we ignore the higher order terms.
The steps involved in linearizing the second nonlinear term are no different from those illustrated in the previous example; the result is
sss hhhhh 2/52/32/3 )(23)(
Dr. Kalyana Veluvolu
We may now introduce these expressions in place of corresponding nonlinear terms in
2/32
hhF
dtdh i
Recalling that under steady-state conditions αFis=βhs1/2, and introducing the
deviation variables y=(h-hs) and u = (Fi-Fis), the approximate linear model is obtained upon further simplification as:
uKydtdy
where the steady-state gain, and time constant associated with this approximate linear model, are given by:
2/12/1 22ss h
chK
and
2/52sh
Dr. Kalyana Veluvolu
If we desire an approximate transform-domain transfer function model, Laplace transformation again gives
)(1
)( sUsKsY
Note that the approximate linear model for the conical tank has the same process gain, K, as for the cylindirical tank; but the time constant is a much stronger function of the liquid level hs.
Some important points to note about the results of these two illustrative examples are the following:
In each case, the approximate transfer function model is of the first-order process, with the time constants, and steady-state gain values dependent on the specific steady-state around which the system model was linearized.
Using such approximate transfer function models will give approximate results which are good in a small neighborhood around the initial steady-state; farther away from this steady-state the accuracy of the approximate results becomes poorer.
Using such approximate models, we are able to get a general (even if not 100% accurate) idea about the speed and magnitude of response to expect from any arbitrary nonlinear system. Numerical analysis can give more accurate information, but only about the specific input, starting from a specific operating condition for a specific set of parameters.
Dr. Kalyana Veluvolu
Let us conclude with a comparison of the responses of the nonlinear model and an approximate linear model for the conical tank of the Example. Suppose that α=2, β=1, c=0.5 so that the nonlinear model is:
2/32
2 hhF
dtdh i
while the approximate linear model has the transfer function
)(12
4)( 2/5
2/1
sUshhsYs
s
which in the time domain is
isisss
FFhthhhdt
dh 2/1
2/5 4)(2
1
Dr. Kalyana Veluvolu
clc;clear tss=4; [t,h]=ode45('tank1',0,tss,[0.5]); plot(t,h(:,1))
tank.m
function hdot=tank1(t,h) hs=0.5; dfi=0.15; hdot=[1/(2*hs^2.5)*(hs-h+4*hs^0.5*dfi)];
tank1.m
Nonlinear model
2/32
2 hhF
dtdh i
3536.02
5.02
20 2/32
sis
ss
is
hF
hhF
clc;clear tss=4; [t,h]=ode45('tanknl1',0,tss,[0.5]); plot(t,h(:,1))
function hdot=tanknl1(t,h) alfa=2;beta=1;Fs=0.3536;dfi=0.05;Fi=Fs+dfi; hdot=[alfa*Fi/h^2-beta*h^(-1.5)];
0 0.5 1 1.5 2 2.5 3 3.5 40.5
0.55
0.6
0.65
0.7
0.75
0.8
0.85
0.9
0.95
1
Time (sec)
h (m
)
LinearNonlinear
dFi=0.15
dFi=0.05
The step response for these models is shown in the Figure for steps of two different magnitudes.
For small magnitude step inputs, the linear model is a good approximation of the nonlinear model.
For large amplitude inputs the linear model predictions deviate somewhat from the nonlinear model behavior.
However, in some situations this may be inadequate (e.g. for the control of highly nonlinear processes) so the development of nonlinear controllers has featured prominently in process control in the last decade.
Adaptive Control:A controller designed for the systems in the level control example in the previous example using the approximate transfer function model will function acceptably as long as the level, h, is maintaned at, or close to, the steady-state value hs. Under these conditions (h-hs) will be small enough to make the linear approximation adequate. However, if the level is required to change over a wide range, the farther away from hs the level gets, the poorer the linear approximation.
Observe also from the approximate transfer function model that the apparent steady state-state gain and time constant are dependent on the steady-state around which the linearization was carried out. This implies that in going from one steady state to the other, the approximate process parameters will change.
Dr. Kalyana Veluvolu
The main problem with applying the classical approach under these circumstances is that it ignores the fact that the characteristics of the approximate model must change as the process moves away from hs if the approximate model is to remain reasonably accurate. The immediate implication is that any controller designed on the basis of this changing approximate model must also have its parameters adjusted if it is to remain effective.
In the adaptive control scheme, the controller parameters are adjusted (in an automatic fashion) to keep up with the changes in the process characteristics. We know intuitively that, if properly designed, this procedure will be a significant improvement over the classical scheme.
There are various types of adaptive control methods, differing mainly in the way the controller parameters are adjusted. The three most popular methods are: scheduled adaptive control, model reference adaptive control, and self-tuning controllers.
Dr. Kalyana Veluvolu
Scheduled Adaptive Control
A scheduled adaptive control method is one in which, as a result of a priori knowledge and easy quantification of what is responsible for the changes in the process charactersitics, the commensurate changes required in the controller parameters are programmed (or scheduled) ahead of time. This type of adaptive controller, sometimes referred to as gain scheduling, is illustrated by the block diagram in the following figure.
Parameter Adjustment
Figure. Scheduled adaptive controller.
Dr. Kalyana Veluvolu
Continuing with the example of liquid level system, the figure represents control of linearised approximation of the original nonlinear system. The approximation is in the sense that the process transfer function G(s) only holds good for a particular level of the liquid in the tank. If the level h changes drastically, the transfer function G(s) may fail to represent the original system even approximately. Then there is a need to change the transfer function G(s) to account for the change in level h. One way of doing this is through Scheduled adaptive controller shown in previous page. From the system transfer function
)(1
)( sUsKsY
it is seen that both K and τ are affected by the liquid level h. The effect on K is more prominent since it affects the system gain. The effect on the time constant is less apparent and not so prominent. Thus we only compansate for the effect of liquid level h on K. This is done in a way that the overall system gain KKc is constant. Notice that
ch
A s2
ch
K s2
ch
K s2
Dr. Kalyana Veluvolu
So, to keep KKc = K0 (a constant)
sc h
cKKKK
200
This means that the controller gain Kc has to be adjusted inversely as the square root of the liquid level h. This is what will be done by the block represented as “Parameter adjustment” in the figure.
More generally, if K = K(t), that is, the process gain changes with time, then to keep the product KKc constant it is necessary to adjust Kc inversely with respect to K(t), i.e.
)(/1 tKKc
K(t) itself can be determined periodically by inserting a signal u into the process and monitoring the process output y.
Dr. Kalyana Veluvolu
In practice, it is often possible to find measured variables that correlate well with changes in process dynamics. These variables can be used to change the controller parameters, using a precalculated schedule. The controller parameters are computed off-line for several operating conditions and stored in memory.
It is difficult to give general rules. Each case must be treated individually. The key question is to determine the auxiliary variables to be used as scheduling variables. It is necessary to have good insight into the dynamics of the process if gain scheduling is going to be used. The controller can be automatically tuned at a different operating points and the resulting tuning parameters can be saved and a schedule created.
Example: The figure given below shows different valve characteristics, if the scheduling variable in a level control system is the opening of a control valve, then a schedule may look as in the Table:
Position
FlowQuick opening
Linear
Equal percentage
Table: Scheduled control of Valve
Valve opening Kp Ti Td
0.0-0.15 1.7 95 23
0.15-0.22 2.0 89 22
0.22-0.35 2.9 82 21
0.35-1.0 4.4 68 17
Dr. Kalyana Veluvolu
Example: The nonlinearity of the valve is assumed to be:
4)( uufv
PI f-1(c) f(u) G(s)Command signal uc
+
-Nonlinear Valve Process
Output y
Contol signal u
Let f-1 be an approximation of the inverse of the valve characteristics. To compensate for the nonlinearity, the output of the controller fed through this function before it is applied to the valve. This gives the relation:
cffufv 1)(
where c is the output of the PI controller
Dr. Kalyana Veluvolu
Assume that f(u)=u4 is approximated by two lines as shown in the figure. One from (0,0) to (1.3,3) and the other from (1.3,3) to (2,16).
)(ˆ uf)(uf
1 2
1510
0
Figure. A crude approximation of valve characteristics.Time
Then we have:
163139.10538.030433.0
)(ˆ 1
cccc
cf
Dr. Kalyana Veluvolu
Dr. Kalyana Veluvolu
Model Reference Adaptive Controller (MRAC)
The key component of the MRAC scheme is the reference model that consists of a reasonable closed-loop model of how the process should respond to a set-point change. This could be as simple as a reference trajectory, or it could be more detailed closed-loop model. The reference model output is compared with the actual process output and the observed error ᵋm is used to drive some adoptation scheme to cause the controller parameters to be adjusted so as to reduce ᵋm to zero. The adoptaion scheme could be some control parameter optimization algorithm that reduces the integral squared value of ᵋm or some other procedure. This is an adaptive control technique where the performance specifications are given in terms of a model. The model represents the ideal response of the process to a command signal. The controller has two loops:
The inner loop, which is an ordinary feedback loop consisting of the process and the controller.
The outer loop, which adjust the controller parameters in such a way that the error e = y- ym is small (not trivial)
Dr. Kalyana Veluvolu
myye Tracking error:
Introduce the cost function J:
2
21 eJ
Where θ is a vector of controller parameters. Change the parameters in the direction of the negative gradient of e2.
eeJ
dtd
e is called the sensitivity derivative. It indicates how the error is
influenced by the adjustable parameters θ.
Example:
Process: buyadtdy
Model:cmmm
m ubyadtdy
Controller: yuu c 21 Closed loop system:
cc ubybayubaybuyadtdy
1221
MIT Rule
Ideal controller parameters for perfect model-following
baa
bb mm
02
01 ;
Derivation of adaptive law
Error: myye
where
cubasby
2
1
c
c
ubybasubybays
12
12
Sensitivity derivatives
cubasbe
21
y
basbu
basbe
c2
22
12
2
cmmcmm ubyaubbby
baaba
dtdy
ysdtdy
Approximate
masbas 2
where
euasa
seu
asb
t cm
mc
m
1
1
eyasa
sey
asb
t m
m
m
2
2
mab
• System
MRAC of Pendulum
TdmgdcJ c 1sin
cmgdcsJsd
sTs
2
1
)()(d2
d1dc
T
77.100389.089.1
)()(
2
sssTs
Keith SevcikKeith Sevcik
• Controller will take form:
Controller
Model
AdjustmentMechanism
Controller Parameters
ymodel
u yplant
uc
77.100389.089.1
2 ss
Keith SevcikKeith Sevcik
MRAC of Pendulum
• Following process as before, write equation for error, cost function, and update rule:
modelplant yye
)(21)( 2 eJ
eeJ
dtd
sensitivity
derivative
Keith SevcikKeith Sevcik
MRAC of Pendulum
• Assuming controller takes the form:
cplant
plantcpplant
cmpmodelplant
plantc
uss
y
yuss
uGy
uGuGyye
yuu
22
1
212
21
89.177.100389.089.1
77.100389.089.1
MRAC of Pendulum
plant
c
c
cmc
yss
uss
e
uss
e
uGuss
e
22
22
21
2
2
22
1
22
1
89.177.100389.089.1
89.177.100389.089.1
89.177.100389.089.1
89.177.100389.089.1
MRAC of Pendulum
• If reference model is close to plant, can approximate:
plantmm
mm
cmm
mm
mm
yasas
asae
uasas
asaeasasss
012
01
2
012
01
1
012
22 89.177.100389.0
MRAC of Pendulum
• From MIT rule, update rules are then:
eyasas
asaeedtd
euasas
asaeedtd
plantmm
mm
cmm
mm
012
01
2
2
012
01
1
1
MRAC of Pendulum
• Block Diagram
ymodel
e
yplantuc
Π
Π
θ1
Reference Model
Plant
s
77.100389.089.1
2 ss
Π
+
-
mm
mm
asasasa
012
01
mm
mm
asasasa
012
01
mm
m
asasb
012
s
Π
-+
θ2
Keith SevcikKeith Sevcik
MRAC of Pendulum
• Simulation block diagram (NOTE: Modeled to reflect control of DC motor)
am
s+amam
s+am
-gamma
sgamma
s
Step
Saturation
omega^2
s+amReference Model
180/pi
Radiansto Degrees
4.41
s +.039s+10.772
Plant
2/26
Degreesto Vol ts
35
Degrees
y m
Error
Theta2
Theta1
y
Keith SevcikKeith Sevcik
MRAC of Pendulum
0 200 400 600 800 1000 1200-100
-50
0
50
100
150
ymg=.0001
Simulation with small gamma = UNSTABLE!Simulation with small gamma = UNSTABLE!
Keith SevcikKeith Sevcik
• Solution: Add PD feedback
Keith SevcikKeith Sevcik
MRAC of Pendulum
• Simulation results with varying gammas
0 500 1000 1500 2000 25000
5
10
15
20
25
30
35
40
45
ymg=.01g=.001g=.0001
707.sec3
:such that Designed
56.367.256.3
2
s
m
T
ssy
Keith SevcikKeith Sevcik
MRAC of Pendulum