Modified adaptive controllers for improving the transients in adaptive control M de la Sen
This paper presents a program for the CA D of modified adaptive controllers for improving the transients in adaptive systems. Two techniques are analysed, based respectively on optimization tools and adaptive sampling. The software package has a modular structure. Each module has a specific task corresponding to the hardware design. In structuring the modules both expected hardware implementation facilities and ease o f programming are taken into
which applies optimization tools to improve the adaptation transients in adaptive control systems. These control systems are known to have poor performances in terms of both tracking errors, and to inputs supplied to the controlled plant. The adaptive scheme used is summarized in Appendix A.
account.
This section describes the programming packages. Generally speaking, each subroutine corresponds to a specific mechanism, or group of mechanisms with clearly assigned specific tasks in the corresponding hardware implementation. Sometimes a piece of hardware for this problem may be partially substituted by an algorithmic software design (implemented on a set of mini or microcomputers). This considerably reduces the hardware required and improves the accuracy of performance. This is particularly interesting since a complete hardware design would be very complex.
adaptive controllers, transients, optimization An efficient programming must meet some specific requirements: •
The software subroutines must be related to the hardware components as closely as possible. This allows easier programming for simulation purposes. It also allows a clear modular interpretation closely related to classical control schemes (consisting of specific blocks) and the possibility of substituting hardware blocks for algorithms. • The main program must be as small as possible. It must be limited to calling the subroutines for the specific tasks, and to reading the data and writing the results. Calling the subroutines corresponds to a 'hardware coordination mechanism'. Input and output corresponds to the generation of signals and results. • Dividing the task like this allows, in some cases, the division of the controller design to use a set of microcomputers (each implementing one or more routines). The microcomputers are coordinated by a 'headmaster' executing the main program. Such a structuration is particularly interesting for problems in which several tasks can be implemented in parallel. This leads to faster algorithms. For simple control problems, such a structure is perhaps unnecessary. However, for complex problems, it aids the development of a solution and the testing of the programs. In fact, a first attempt to solve the problem presented in the next section, without meeting these requirements led to unsuccessful software which was very difficult to correct.
THE OPTIMIZATION APPROACH The theory for this problem has been developed elsewhere I-2. It is similar to the approach used in a more general project 3, Departamento de Autom~.tica e Inform~tica, Facultad de Cienclas, Universidad de] ParsVasco, Leloa (Vizcaya), Spain
volume 17 number I jan/feb 1985
GOALS
Technical details The programs have been implemented in FORTRAN VII. The study is related to discrete systems but may be extended to the continuous case by the appropriate discretization. Only software simulations (and no hardware implementations) have been made. A 3220 PERKIN-ELMER computer with the following characteristics has been used: • • •
16 or 32 (optionally) bytes for integer variables 32 or 64 (double precision) bytes for real variables 128 bytes for complex variables
The results obtained were, in general, good. The algorithm was convergent4 . The memory used (including the common area) was about 14 kbytes. Apart from the simulation development, which considered as many samples as necessary to achieve convergence, software development for optimization on the current optimization interval 4-s was studied for a thirdorder system. This study led to the conclusion that time delays under 0.01 seconds can suffice to determine the whole computation cycle (ie, the a prior/and a posterior/ modes of the adaptive controller), if a FORTRAN optimizer and floating-point processor are used. By using programming languages closer to machine language, the computation time could be further reduced.
General software organization corresponding to a hardware implementation The complete program consists of:
0010-4485/85/010009-06 $03.00 © 1985 Butterworth & Co (Publishers) Ltd
9
•
a main program corresponding to hardware coordination mechanism - this performs the usual input-output functions • a set of subroutines corresponding to hardware (or 'software algorithmic') mechanisms with specific tasks these correspond to the essential parts of the problem, such as obtaining the outputs of a controlled plant or explicit reference model. • a common memory zone to the main program and subroutines, corresponding to a common memory zone accessible, by hardware circuitry to all the modular components of the adaptive controller
Each addition of a new sampling point in the optimization horizon, together with the loss of information about the previous point, corresponds to a sliding of the horizon, treated algorithmically before generation of a new input to the plant. In more sophisticated designs, the coordination mechanism can also decide to increase or decrease the size of the optimization horizon. The physical foundations of such an organization were consciously considered during the design. These are that: An optimization problem always has, by its nature, a correcting strategy on the future. Analytically this fact is registered in the system state evolution, according to the structure and numerical values of the parameters, which appropriately depend on the input sequence to be determined. In adaptive problems, such a dependence is not on known parameters, so the adaptive controller must use estimates of future output in order that the sense of the optimization design does not become lost. This translates into taking approximations versus an exact design, to manipulate the problem as if the parameters were known. Analytical, optimization schemes (such as quadratic optimal regulators) are applicable in realtime leading to explicit solutions as results. In practice they are applied to standard continuous or discrete state-space realizations. The adaptive control scheme must be put approximately into this form using a finite tracking error sequence as the variable to be regulated. The parameterizations of such a time-varying 'near linear' model are obtained from the adaptive controller. The model is 'near linear' since parameter-state couplings are ignored, in the results for updated parameters and adaptation gain matrices. In this way, the a priori mode makes the basic controller act as a parameterizer and predicting mechanism for constructing the equivalent system. The aposteriori mode acts in its classical sense, ie, it generates input to the plant. For this purpose, it repeats its updating (using past and predicted values) on the same horizon, by using corrected values of the free parameters obtained from appropriately translating the optimization results on the equivalent system.
This structure was chosen after the earlier unsuccessful experimentation. The task is divided as follows: •
(a) implementing a basic adaptive controller, which computes its own parameters adaptively, and generates real-time input to the plant. • (b) solving the optimization problem with respect to a quadratic criterion for an equivalent, near-linear system to the complete adaptive scheme, by appropriate weighting of the tracking errors on a sliding optimization horizon • (c) translating the equivalent inputs for such an equivalent system into modifications of the free parameters (within the stability domain) of the basic adaptive controller The basic adaptive controller plays the same role as in classical model reference adaptive designs, but uses a finite set of sampling points in order to characterize the equivalent system. These basic tasks imply the existence of a coordination mechanism which distinguishes between a prior/and a posterior/modes. The a priori mode is used to parameterize the equivalent system by using results supplied by the basic adaptive controller (which in this mode generates no input to the plant and only updates its own parameters). The basic controller also uses predicted output and filtered outputs, associated with the nearer samples by using either heuristical or analytical approaches4 . The a posterior/mode is used to solve the optimization problem by means of a Riccati matrix equation, on a sliding horizon for optimization with respect to the used quadratic criterion. In this mode, the adaptive controller again updates its parameters before generating input to the plant. It uses updated free parameters in the adaptation algorithm, evaluated at the corrected values obtained by applying the optimization results for the equivalent system to their a priori values. The coordination mechanism (or the designer by means'of an additional input to the algorithm) decides, by evaluating online the scheme's performances, if the aposteriori mode must be applied repetitively or, once only, before generating the input to the controlled plant. The coordination mechanism also tests the global stability of the scheme, using the realtime variations of the free parameter. When the test fails, this parameter must be restarted to a 'sufficiently accurate' nominal value. In a priori mode, a new sampling point is processed for the horizon, relative to the current sampling point for which the input must be generated. The information corresponding to the last sampling point associated with such a horizon is lost. This leads to data lists organized as'first-in, first-out structures 6, which permit a rational use of the computer memory.
I0
This organization permits a considerable economy of both hardware and memory. Common memory zone In general, there are two points of view appearing in constructing the common memory zone: •
To include within the zone all the positions relative to arrays (memory input and output sequences for the system and model, Riccati matrices of the optimization problem, etc) and also all the simple real and integer static or dynamic variables that are inputs or outputs, which are common at least to two subroutines, or to one subroutine and the main program. • To include only the arrays which are common to all (or several) routines and the main program. The common variables are the input and output parameters of the subroutines.
The first approach allows a faster design, but is more expensive in memory. It is easy to separate the variables which influence each subroutine.
computer-aided design
The second approach is closer to a hardware (or algorithmic versus hardware) design , since it allows the clear identification of the minimum number of variables necessary for input/output communication between two subroutines. It is usually slower than the first approach, but uses less memory. In the work described in this paper, the second approach was taken. For subsequent work, needing larger programs, we decided to use the first approach for simulation designs, due to the associated ease of programming. S o f t w a r e
s i m u l a t i o n
d e v e l o p m e n t
Table 1 shows the structure of the modified adaptive controller. The subroutines ALGO, OPT and MODI F correspond to the functions (a)-(c) described earlier. CALCI is used as modelling tool for the equivalent system. It takes results from ALGO and computes intermediate results to be transferred to OPTI. The use of a common memory zone allows the current values of the variables and arrays for all the routines to be accessed at any time.
The distribution of tasks is not the only important feature to be taken into account. The correct treatment of the information in each task merits the same attention. This allows the use of less computing time and memory. The organization of data structures has received much attention 6 . Figure 1 shows the three lists used for solving the problem treated in this section. The three lists have finite length. The list associated with the basic adaptive controller has a circular structure, because of its dynamic nature. After each sliding of the horizon, a new sampling point together with its associated measurement appears. The list must have a finite dimension, related to the optimization horizo/n size, and so must be treated dynamically, using a pointer~o a key element for each current optimization horizon. The choice of such a key element may be freely made by the designer. Two subhorizons (related to past-real/or futurepredicted measurements) must constitute the whole optimization horizon. The list associated with the optimization problem for the equivalent system has a more static nature, in the sense that its entries are sequentially computed from appropriate
Table 1. Structure of the modified adaptive controller
Inputs, outputs and coordination of the genera/scheme for the optimization approach MAIN PROGRAM - Inputs all the data necessary to implement the scheme. In a real hardware design inputting data is in practice the a priori knowledge for initialization of the algorithm. - Calls the different subroutines. Slides the optimization horizon and makes predictions of the next output. Outputs results, in terms of tracking errors/supplied input to the plant. - Checks the following: • Is it necessary to reinitialize the basic algorithm because error trackings are sufficiently important to be taken into account? • Is it necessary to reinitialize the adaptive gain matrix if decreasing? • Does the corrected free parameter violate the global stability condition? -
-
Specific subroutines for simulation (which are not implemented in hardware)
-
subroutine is relative to the previous a posteriori mode of the adaptive controller. Initializes the adaptive controller parameters and adaptation gain matrix, by using the contents of the second corresponding memory cells from the common memory zone.
OPT Optimizes the equivalent system if the main program establishesa posteriori mode over a prescribed (or variable) optimization horizon.
-
CALCI An auxiliary routine for OPT. Solves both the Riccati matrix equation and the 'parasitic' vector associated with the deterministic disturbance inherent in the model itself, before the optimization problem solution.
-
MODIF Transfers the optimal equivalent input sequence for the equivalent system into corrections of the free parameters of the algorithm, before the next a posteriori mode action in which ALGO acts.
-
CALC Computes the discrete transfer function for a given continuous plant
CALFI - Constructs the measurement vector needed by ALGO to implement the adaptation algorithm from the input/ output sequence. This measurement vector is also used by CALCI after some intermediate computations, in order to implement the equivalent system model needed by OPT.
In a practical design, these functions are implemented in hardware.
Common memory zone
MOREF Computes the output of the reference model or the adaptive plant
-
-
Subroutines for specific tasks {substituted by hardware components in hardware designs) ALGO Computes (online) the adaptive controller parameters and decreasing gain matrix from the recursivity inherent in the adaptive control algorithms. Generates the input to the controlled plant if the main program establishes that the current application of this
-
-
volume 17 number 1 january/february 1985
ALGO and CALFI do not distinguish between the apriori and a posteriori modes. It is possible to introduce, through CALC, dynamic changes in the plant reference model parameters, at certain prescribed time instants. This allows a detailed experimental study of the response rate characteristics of the controlled plant. This is closely related to parallel programming processes. This philosophy is very useful for operatormachine communication.
11
Equivalent system parameterizationand state estimation
[
Current pointer
I
Estimation problem
u(t) $ I
I .........................
. . .
;rll' +
New information
~F lit-N1+1)
r--~
~(t+N2)
~(t+N2) ....... (I IN2+1)
F(t+l)l - ~
I
I "~(t+N2+1) I •~ ~(t+N2+l)II
I o'~-F(t+N~+I) ~= L .-wI
I
Lost information
=jol°°°e°°l• Translation problem
1
[ e(t-~2+l)
~'(t+ 1 )
"if(t) $
I
pIt-IN1)/ Optimization problem
I
p(t)
~(t-N 1) ~ -
~(t)
r(t-N2+l) I
r(t- 1)
.......
A priori mode
- -
A posteriori mode
I I
I P(t+N 2) •
I
~ .....
I n
I I
Q(t+N2)
l I
l•
0
I
" ~ ' - ~ ( t + N 2 ) "i{'l . . . . . . .
-
_ _
Oa,a,oure
I r(t+W2+l) I ,
l l
q
_2
I
Figure 1. Genera/external structure o f the adaptation mechanism
initial conditions for each optimization horizon. This corresponds in practice to computing a Riccati matrix sequence together with an additional vector, arising from the modelling characteristic of the disturbance vector, and a normalizing weighting term for the equivalent system input arising from the bang-bang nature of the equivalent system controller 4-s. There is no direct relation between the elements of the list associated with the translation of the optimization results into local corrections of the free parameters of the adaptation algorithm. The corrections to be made are computed from the optimization data in the common memory zone.
THE ADAPTIVE SAMPLING APPROACH Elsewhere I, a formulation was developed which allowed the use of a time-varying difference equation, valid for a description of non-periodic sampling systems. In this way, the problem of non-periodic sampling formally results in a similar representation to that of the z-transform for the periodic sampling case, although state-space tools are used to obtain the difference equation. Such a formulation can also be applied to adaptive sampling problems, in which the sampling rate is adapted to the variations of certain signals in a control loop. Such a strategy permits the improvement of the transient behaviour of the adapted signals. This formulation has been applied to the adaptation of the transient tracking (or regulation) errors in model reference adaptive control systems 2.
12
General software organization corresponding to a hardware implementation The spirit of the general organization remains the same. FORTRAN was used on a 3220 PERKIN-ELMER minicomputer. The general adaptive scheme is omitted for space reasons. The modified adaptive controller consists of: •
the usual basic adaptive controller which updates the adaptive controller parameters and generates the input to the plant • the sampling controller which computes the sampling periods in an adaptive way (ie by measuring derivatives or their difference finite approximations) to the tracking errors by using adaptive laws • the induced sampling controller which computes the induced sampling instants from the real ones supplied by the sampling controller* using standard computations. These basic tasks imply the necessity of a coordination mechanism which establishes the appropriate sequence of operations and error checking. The common memory zone may be organized following the same strategies as above. *It is shownI that in order to implement the time-varying difference equation, the so-called induced sampling instants (related to the current mean sampling period for the last n sampling intervals, where n is the plant order) must be manipulated for the output sequence. The real sampllng periods must be manipulated for the input sequence.
computer-aided design
CONCLUSIONS This paper has described the rational programming tools used to solve the problem of improving the adaptation transients in model reference adaptive control systems. These tools were used to simulate the theoretical aspects studied in previous papers. The program has a modular structure. This permits the simulated example to be closer to the real problem, associating the software simulation with the hardware implementation. This modular structuration allows: easier programming; a (partial) design of algorithmic modules, instead of the traditional hardware modules; and a problem interpretation from an algorithmic point of view, which is very close to the classical method involving the use of block diagrams. It also allows the introduction of changes in experimental conditions before executing the programs, or even the implementation of such changes dynamically at prescribed sampling points by appropriate structuring of the programs.
of Control Systems, Zurich, Switzerland (I 979) pp 253-258 Frederick, D K Computer packages for the simulation and design of control systems Lecture notes, Arab School on Science and Technology (1982) Garbow, B Set al Matrix eigensystemroutines EISPACK Guide Extension Lecture Notes in Computer Science, Vol 51, Springer-Verlag (1977) Goldberg, A J, Robson, D and Ingalls, D H H
SMA L L TA L K-80 : The language and its implementation Addison-Wesley, Reading, MA, USA (1983)
APPENDIX A. S T R U C T U R E OF THE A D A P T I V E C O N T R O L L E R IN THE O P T I M I Z A T I O N APPROACH (t) (the updated adaptive controller parameters) "- (ha (t),
ACKNOWLEDGEMENTS The work reported in this paper has been supported in part by the Comisi6n Asesora de Investigaci6n Cientffica y T6cnica (Project 1260-6). This support is gratefully acknowledged. The author is also grateful to Mr AlvarezL6pez, Mr Herrero-Herrero and Mr P6rez-Morosov for their help in the use of the PERKIN-ELMER computer of the Computer Center of the Universidad del Pars Vasco, and also for their suggestions about the convenient distribution of tasks for a rational programming of this kind. He is also very grateful to Dr Garitagoitia for his useful discussions about focusing these problems from an informatic point of view.
= 0 (t-l) + where
T (t)) T
F(t) ~(t-d)[Cr(q-') y(t) - ~T (t-l) ~(t--d)] . c(t) + ~T (t-d) F(t) ¢(t--d) '
d > 0 (plant delay)
(o) = Oo F -~ (t+l) (the inverse of the adaptation gain matrix) --" X(t) F-' (t) + ~X(t) - ) ¢ (t-d) cT (t-d) ; F(0) = FT (0) > 0 ¢(t) (measurement vector) g (u(t), cT(t))T; where ~o (t) is sequence of inputs/outputs;
REFERENCES 1 De la Sen, M 'A new modelling for aperiodic sampling systems' Int. J. 5ystemsSci. Vol 15 No 3 (1984) pp 315-328 2 De la Sen, M 'A method for improving the adaptation transient using adaptive sampling' Int. J. Control Vol 40 No 4 (1984) pp 639-665 3 De la Sen, M 'T6cnicas de Optimizaci6n y de muestreo aperi6dico para mejorar el r6gimen transitorio de los sistemas adaptativos' Proyecto 1260-6, Comisi6n Asesora de I nvestigacibn Cientffica y T6cnica (First annual Report)(1982) 4 De la Sen, M 'On-line optimization of the free parameters in discrete adaptive control systems' Proc. IEE-D Vol 131 No 4 (1984) pp 146-157 5 De la Sen, M 'A simple method to improve the transients in adaptive systems' Proc. IEEE Vol 72 No 1 (1984) pp 131-134
6 Wegner, P Programming languages, information structures, and machine organization McGraw-Hill, New York, USA (1968)
B IBLIOG R A P H Y Dongarra, J J, Moler, C B, Bunch, J R and Stewart, G W LINPACK Users Guide SIAM, Philadelphia, PA, USA (1979) Edmuns, J M 'Cambridge linear analysis and design programs' I FAC Symposium on Computer Aided Design
volume 17 number 1 january/february 1985
u(t) (the input to the controlled plant) "__~)~1(t) [Cr(q-')y M (t+d)_OT (t)~o (t)] Cr (q-1) is an asymptotically stable filter {y(.)}, {yM (.)} are the outputs of the plant and the reference model, respectively
c(t) is a free parameter chosen for the optimization design (The algorithm converges if c(.)e (0, =)). aT(t) is the equivalent input obtained from the optimization problem on the so-called equivalent system (defined by using the equation x(t+l ) ~-A x(t) + b(t) E(t) + w(t))
x(t) is the sequence of (real or predicted) tracking errors constituting the state of the equivalent system
A,b(.), w(.) are parameters and the disturbance inherent in the modelling of the equivalent system = related to 0 (.), F(.), ~(.), and Cr(q-')
APPENDIX B. S T R U C T U R E OF THE A D A P T I V E C O N T R O L L E R IN THE A D A P T I V E SAMPLING APPROACH Tk ~(hth sampling period) = Tk = Tk (6k, ek) using adaptive sampling laws, for instance Tk = (positive constant)/16k I. If necessary, b(.) is approximated by its first-order difference approach.
13
t'(/) (k) is the jth induced sampling instant on the modelling interval
14
-Tk = (Z;= n+k k Ti)ln
and
[ tk, tn+k ] {tk, tk + Tk, tk + 27k . . . .
where
, tk + nTk, tn+k }
(.), F(.), Cr(.), u(.), ~(.), etc. are defined as in the optimization approach.
computer-aided design