A METHOD AND AN APPARATUS FOR AUTOMATICALLY TUNING A PROCESS REGULATOR

Abstract: Method and an apparatus for tuning a process regulator (2), in which a process model is obtained from an experiment employing relay feedback, there being obtained self-oscillation of the system, and in which the process model is obtained from the result of samplings of the wave form obtained with relay oscillation. The invention provides a model which is directly adapted for digital adaptive control.

Description: A method and an apparatus for automatically tuning a process regulator. Description The present invention relates to a method of the kind set forth in the preamble of Claim 1, and particularly, although not exclusively, to a method for adjusting the setting of a digital process regulator with the aid of the result obtained from a simple relay feedback experiment. A serious problem encountered with all digital regulators is one of obtaining in a simple fashion those parameters which are to be used for tuning the regulator. The Swedish Patent Specification No. 8104989-2, with the same inventor as the present invention, describes a method which utili¬ zes the fact that many processes experience periodic oscillation with relay feedback. A simple relay feedback experiment is carried out, and the amplitude and period of. the resultant oscillation is used to tune a PID-type regu¬ lator (PID stands for Proportional, Integrated, Derivat- ing) on the basis of the control concept according to Ziegler-Nichols-like design methods. This prior art tuning method is thus based solely on knowledge of the amplitude and period of the oscillation. Although this method is successful in the majority of cases, it is encumbered with the fundamental drawback that the model is based solely on one point in the frequency curve of the open loop system in a Nyquist diagram. A process model can also be determined experimentally by first selecting a sampling period and introducing pertuba- tion signals, whereafter .the process model is obtained with the aid of some suitable parameter assessment method. In those cases in which the regulator is tuned automati¬ cally, the oscillations. are generated by conventional feedback and the parameters determined recursively and progressively, as further measurements become available. The sampling period is a critical parameter, both in respect of conventional parameter estimation and of adap¬ tive control. In order to estimate the sampling period, it is necessary to have prior knowledge of the time scale of the model and of the system engaged. This has long been the stumbling block in achieving automatic model construc- tion and adaptive regulation or tuning. The aforesaid difficulties encountered with known methods of tuning digital regulators have now been overcome with a method having the characteristic features set forth in the following Claims. Further improvements and developments of the method, together with apparatus for carrying out the method, are set forth in the remaining Claims. In accordance with the invention, the result of a simple relay feedback experiment is used to acquire the requisite knowledge of the process. The difference between the above-mentioned earlier method employing a relay feedback experiment and the method according to the invention, is that instead of using solely amplitude and period of the oscillating signal obtained on the output when carrying out the experiment, the method according to the invention also utilizes the knowledge of the shape of the curve obtained in the form of an output signal from a process effected with relay feedback during one stage of the expe- riment. Accordingly, the curve obtained within one period is sampled at a plurality of points thereon and the sampl¬ ing values obtained at these points on the curve are used to make an accurate calculation of a regulator means suit¬ able for adaptive modification of the process concerned. This calculation must be made in. accordance with certain rules, in a manner such that a computer device, such as a microprocessor, is able to calculate an efficient regula¬ tor in a simple and ready manner, directly from the sampl¬ ing values obtained. As a result of the method according to the invention there is obtained a model which is directly adapted for digital regulation. Distinct from the known prior art method, the calculated or computed regula¬ tor does not have the form of a PID-regulator. The method according to the invention also provides the possibility of calculating the dead-time of the process in a simple fashion. Dead-time is a factor which is often found problematic with adaptive regulators and which has in fact led to the limited use of adaptive systems. The sampling points may be uniformly distributed over one period, although the selection of irregular sampling point distribution is also a conceivable procedure. According to a further development of the invention, the number of sampling -points can be varied. The invention will now be described in more detail with reference to the accompanying drawings, in which Fig. 1 is a block schematic of a regulator system accord- ing to the invention; Fig. 2 illustrates an input signal which is applied to the process to be regulated and produced by relay feedback; Fig. 3 illustrates the signal output of the same process, with relay feedback; Fig. 4 illustrates the process output signal obtained with relay feedback, and also illustrates estimation of the time delay, i.e. the dead time; Fig. 1 shows a block schematic of a system which can be regulated or controlled in accordance with the invention. A process 1 with the input signal u_ and the output signal y has feedback loop, which incorporates a regulator 2 connectable to the process through a controllable switch 3. A relay circuit 4 can be coupled alternatively to the regulator 2 in the feedback loop of the process 1 by the switch 3. The regulator and the relay circuit each have two inputs, one of which is supplied with a reference signal or set-point signal y ref , and the other of which is supplied with the process output signal y_. The sam.e input signals are also supplied to a computer and control unit 5, which preferably has the form of a microprocessor and which is capable of adjusting the regulator 2 through a line herefor. The control unit 5 is also effective in changing the setting of the switch 3, through a control means 6. The control unit 5 is also able to control the operational state or mode of the relay circuit 4. A read-only memory 7 and a volatile memory 8 are connected to the computer and control unit 5. The unit 5 may also be activated through external control means. With a system of this kind, all the units or elements 2-8 in Fig. 1 may be incorporated in one and the same microprocessor in a manner known per se, the regulator 2 and the relay circuit 4 being simulated by various program loops in the microprocessor. In order to arrive at those particular laws which are to be followed in each particular case when employing digital control, it is necessary to ascertain, a suitable sampling period and to detect a process model for a discrete time. The invention provides a method with which this can be achieved. As soon as the setting of the regulator 2 is to be alter¬ ed, which can either be done as an indication of an exter- nal control, as an indication of an impermissible wide deviation of the process output signal y_ from the referen¬ ce signal y ref> ov when a given length of time has lap¬ sed from the time of making the latest setting adjustment, such as a time lapse measured in minutes, in hours, or once per calendar day, the switch 3 is switched to its lower position, so as to connect the relay circuit 4 to the process feedback loop instead of the regulator. The manner of operation of the relay circuit 4 is such that when the output signal y_ of the process 1 exceeds the reference value y f , it produces an output signal u_ . which constitutes the process input signal and which lies at a given value beneath the reference value, whereas when the signal y_ is lower than the reference value y ref. it produces an output signal which lies at a given value above the reference value. The relays used can be encumbe¬ red with hysteresis. Consequently, the switch may be switched-over subsequent to the lapse of a short space of time from the time of indicating a reference value through-put. In other respects it has been found that in certain cases some reduction in noise can be achieved by actively introducing delayed switching of the relay, or a circuit having a switching function and functioning as a relay. This has no affect on the principle concept of the invention, however, even though the computation formulae given by way of example hereinafter for tuning the regula¬ tor must be corrected slightly with regard to the occur¬ rence of hysteresis. The signal u is illustrated in Fig. 2, and the signal y_ in Fig. 3. The oscillation obtained as a result of activating or switching in the relay circuit 4 constitutes the fundamen¬ tal period during proportional feedback (compare the PID- regulator). This period is used as a basis for selecting a sampling period. Suitably, there is selected an even num¬ ber of samplings, 2n samplings per period, with the same number of samplings n_ per half-period. The signal y_ often varies uniformly around the reference value y re f In Figs. 2 and 3 there has been chosen by way of example _n sampling points for one half-period, i.e. n = 3. For the first n. sampling points u o = u χ = ... = u n = -1 (1) for which there is obtained the respective output signal values ΪQ » Y I> * •• Y n ^' at respective time points t = 0, l,.._n. (In the case of sampling points selected during the other half-period u n + l + --' +u 2n = l and the respective output signal values are: A conventional steady state model in a time discrete linear system can be written as: y(t)+a 1 y(t-l)+.. ,+a y(t-m)=b 1 u(t-l)+...+b u(t) (3) which can be re-written as A(z)Y(z)=B(z)U(z)+Q(z) (4) where Y(z), U(z),A(z) are the respective z-transforms for the time discrete system of the signals y and u, and where the respective constants a i and b i of the polynomials A and B, and the polynomial Q(z) correspond to an initial state which gives a stable periodic output signal. The z-transforms of the signals _i and y_ are where d is the degree of the polynomial A minus the degree of the polynomial B. The equation (4) can be written as A(z)D(z) + z d B(z)E(z) = z d (z n + l)Q(z) (7) This equation determines the polynomials A, B and Q. When equating coefficients of equal powers of z_, there is obtained n_ + deg. A +1 linear equations with which to determine the coefficients in the model. In the generic case it is therefore necessary to select n > Z x deg.A. It is thus a straightforward matter to determine the coefficients of the process model in the equation expression (7) from the wave-form Y , Y,... of the periodic solution. When the relay circuit 4 is connected to the process 1, through the switch 3, the computer unit 5 detects the signal y_ and determines its period, and effects a sampling process at a given number of sampling points on the first half period of the signal y_. The computer unit 2 has a number of process models stored in the read-only memory 8, suitably of the form y(k + l)=a, y(h)+...+a m y(k-m)+b 1 u(k-i)• .+b Ji u(k-iλ) (8) For example, an advantage is gained when selecting the following combinations of m and I ; m=l, 1 = 2 ; m=2, 1 = 1 ; m=2, I -2. The following exemplifying calculation utilizes m=l, -2 . Fig. 4 illustrates the curve obtained from.- the output signal y_ in the relay experiment. The curve is relatively complete with superposed wave-motion of various frequencies. The time p v oint tmax within the p *eriod where a local signal peak value occurs for the first time is determined by the computer unit 5. The computer unit then makes successive calculations with increasing values of i, starting from the sampling point occurring immediately after tmax, in order to calculate a regulator setting or adjustment for each i in a manner described in more detail hereinafter, tmax <n.d,' where —d is the samp fling o fperiod (for similar sampling periods). In order to ensure that the curve produced by the signal _y is as free as possible from noise components, the computer unit 5 is conveniently designed to calculate a mean-value curve from the curve shape of several periods of the signal y_, subsequent to the signal stabilizing after switching-in the relay feedback design. An advantage may also be gained by incorporating a noise filter prior to the signal output. The following equations or expressions can be written for each value of _i in the assumed process model incorporating the selected, exemplifying values - 1 and A s 2 A(z)=z i+1 (z-a) (9) B(z)=b 1 z+b 2 (10) Q(z)=q Q Z+q 1 (11) where d = i+2-l=i+l. These equations can be inserted in equation (7) and the values of a, b, , , Λ calcu- lated, ^ becomes equal to zero. By way of example, the values of a, b ± , b ≤ , q Q when n=3 can be calculated from the following equations: y - _-→ - y. • - i+? im ( y i+1 " y i+? The equations are stored in the computer and control unit 5. Before calculating the values of these constants, the unit 5 examines the denominator and if finding the denomi- nator equal to zero, continues to the next highest i. Otherwise, the unit 5 calculates the values of all con¬ stants. When the model according- to equation (b) above with the parameters a, b, and ~ chosen by way of example, corresponds to a sampled continuous first order system with a time delay, the parameters a.b, and b~ shall be positive. This corapatability condition can be used to determine whether or not the time delay is cor¬ rect. Consequently, if one of these constants should be found to be negative, the computer and control unit 5 will continue to calculate the constants for the next ^ in sequence, otherwise the unit continues to calculate a regulator model, for example in accordance with the followwing principles: Assume a characteristic polynomial for the feedback according to the equation: Z 2 < i+1) P(z) Z 2(1+1) (.Z2+P-Z+P-,) (16) where p - 2 e co6(ζω 1 - ζ ) p-^ and ς • >2 provide a translation to continual parame- ters and correspond to a second order response with the relative damping ζ, and the angular frequency ω. In order to obtain a pole placement design which provides a regula¬ tor with integral action, it is necessary to solve the Diophantine equation. A(z)(z-l)R 1 (z)+B(z)S(z) = z 2(i+1) P(z) (17) for those cases when n=3, there are given below examples of calculations for obtaining a regulator for i = 0, 1, 2 When i s 0, i.e. when the first local peak value occurs immediately at the beginning of a period, the minimal degree solution is β 1_ ( P(l)- a P(a) 1 - a B(l) B(a ) The regulator 2 is tuned or adjusted in accordance with the following model u(t) (so+sl. β 0 y(t) - β 1 y(t-h)+ + (1 - r 1 )u(t-h) + r u(t-2h) When i = 1, the minimal degree solution is R.(z) - z 2 * r,z + r 2 where (£ϋ> * 2P( a ), 1 - a B(l) B(a) Γ * — —— S, 2 a - I » a b l b 2 r ι " —T " r 2 " 1 " β l " ~7~ β o The regulator 2 is tuned or adjusted to the following model: u(t) i (β Q +β 1 )y rβf - β Q y(t) - s^U-h) + + (1 - r 1 ) u(t-h) + (r 1 -r 2 )u(t-2h) + r u(t-3h) When i = .2 the minimal degree solution is B 1 ( 2 ) * 2 + r χ z 2 + r 2 + r. S(2) 6 Λ 2 S .2 '! ' where β, - a (P(D _a 2 P(a) ) 1 a - 1 B(l) B(a) b 2 C 3 " " IT s ! r - ( 1 ÷ a ) r -1 r b l r i I r 2 a r 3 ' — s O The regulator 2 is tuned or adjusted according to the following model: u(t) - (β 0 +β 1 )y ref - β 0 y(t> - + + (l-r χ ) u(t-h) + (r χ -c _ ) u(t-2h) + + (r 2 - r 3 )u(t-3 ) + r 3 u( - h) The above calculations are given solely as suitable compu¬ tations of the various values of £ and i_ in different com¬ binations. The computer and control unit 5 can be program¬ med to commence the calculations by applying a low value to £ (for example £ can be made as low as 2 initially, although it is sufficient to begin with n = 3) and to cal¬ culate successively suitable models for all of the sampl¬ ing points which follow tma„x within the first half-p r e- riod, and to continue by setting a new value for £, equal to the earlier value of plus 1, should the calculations for all sampling points provide methods which fail to ful¬ fil the set compatability conditions. Models for all samp¬ ling points occurring after tmax within the first half— period are then calculated with this new value of £. The unit 5 continues to operate in this way, until a calcula- tion is reached which provides a model fulfilling all the set compatability conditions. Thus, the program for which the unit 5 is designed may have stored therein equations or expressions which are common to those computations which must be carried out for each combination of and _i and also equations or expres¬ sions which are individual for the different combinations of £ and i_. The most important factor in this regard is that the unit 5 calculates for each condition of n and i the model which will provide optimal control with precise¬ ly the combination concerned. Important signal conditions are highly significant with respect to good control. In the case of digital control, it is particularly important to use a good filter which will counteract the unfavourable effect caused when the control signal is changed stepwise instead of continuous¬ ly. Since such filters will depend on the. sampling period, it is normally difficult to make a good choice a priori. When applying the procedure for constructing a model for control purposes as described here, the sampling period can be determined automatically, i.e a fixed value for £ can be chosen from the very beginning. It is then possible also to match the filter to the particular conditions. When the sampling period is h, the Nyquist-frequency is π /h rad/s. Assuming that there is used a second order Butterworth filter to obtain a decrease in amplification of 16 at the Nyquist frequency, the bandwidth chosen should then be π/(4ω). The following procedure can be applied to obtain a filter of readily adjustable bandwidth. Select a high sampling frequency, i.e. £ is relatively high, and connect an appropriate analogue prefilter 9 in the feedback line between the process output and the other input of the res- pective units 2,4 and 5. Connect a digital filter 10 in series with the prefilter 9, which digital filter effects the additional filtering required, and sample the output of this filter with period _h. This enables the appropriate filtering to be achieved in a simple and efficient manner. It is also possible to use a plurality of digital filters, with each filter matched to a particular sampling period and to incorporate a switch which will connect-up the most suitable of these filters in the circuit (not shown). As illustrated in Fig. 1, the filters 9 and 10 are preferably both connected-up in the process- feedback loop for both the regulator 2 and the relay circuit 4. Alternatively, the filters 9 and 10 may be connected solely to the second input of the regulator (this circuit not being shown). Many modifications are possible within the scope of the invention.

Claims: CLAIMS 1. A method for tuning automatically a process regulator (2), in which a relay feedback (4) can be connected alter¬ natively to the regulator (2) in the control feedback cir¬ cuit of the process, and in which for the purpose of tuning the regulator the relay feedback is connected so as to cause self-oscillation of the system process/relay feedback circuit; and in which this oscillation is utili¬ zed to calculate the setting of the regulator, characteri¬ zed by indicating within one period of self-oscillation the time point t at which a local signal peak value first occurs; by dividing the signal obtained within a half period into a selected number of £ sampling intervals with intervals _. therebetween; by calculating the regu¬ lator control setting successively from various sampling intervals within the first half period of the oscillating period with a starting point from a model of the process beginning from the sampling interval occurring after tma ;' by J comparing° the result of the calculations with given compatability conditions; and by terminating the successive computations, and applying the calculated control setting to the regulator (2) immediately upon reaching a calculation which satisfies the aforesaid compatability conditions. 2. A method according to Claim 1, characterized by select¬ ing the number of samplings £ within a half-period succes¬ sively, commencing with £ equals at least 2; by making successive calculations with increasing values of £ and calculating model parameters for all sampling intervals after t . ^ within the first half-period for each n, un- til reaching a calculation which provides model parameters which fulfil set compatability conditions. 3. A method according to any of the preceding Claims, cha¬ racterized by making the calculations with the aid of z-transforms and a process model of the form y(k+l)=a,y(h)+.. ,+a y(k-m)+b- L u(k-i)+...b u(k-i) where a1,-am,' b,1-bm are constants calculated with the aid of the z-transforms. 4. A method according to Claim 1, characterized in that the process model is a model which incorporates one of the following combinations of m and £: m=l and 1 =2 ; m=2 and £=1; m=2 and 1 =2 . 5. A method according to Claim 4, characterized by using the values of the input and output signals of the process with relay feedback at the sampling points as the basis for constructing a z-transform of the input signal and the output signal; and by calculating the constants a,-a ,b--b from the z-transformed process model 1 rrr 1 m so as to express the resultant sampled values y. on the output signal at different sampling points. 6. A method according to Claim 5, characterized by apply- ing a characteristic polynomial of the kind z 2(i+1) P(z) = z 2 < i+1 > (z +p 1 z+ρ 2 ) where p, and p are constants which both have a given relationship to relative damping, frequency of the system, and sampling frequency; by calculating the second order control model with the aid of the constants p, and p 2 ; and by tuning the regulator (2) in accordance with this model. 7. A method according to any of the preceding Claims, cha¬ racterized in that the curve shape of the period of self— oscillation on which the calculations are made is obtained by producing a mean value curve on several periods of the self-oscillation obtained through relay feedback. 8. A method according to any of the preceding Claims, cha¬ racterized in that with relay feedback a comparison is made in a known manner between a set-point value y F and the process output signal; and in that the input sig¬ nal to the process is switched from a value which is, lower than the set-point value to a value which is higher than the set-point value and vice versa at a pre-selected level subsequent to the value of the process output signal hav- ing passed the set-point value Y re , i.e. has effected its reversal with a pre-selected hysteresis. 9. Apparatus for automatically tuning a process regulator with the aid of a relay feedback (4) which can be alterna- tively connected to the regulator (2) in the feedback cir¬ cuit of the process (1), characterized by a computer and control unit (5) which when coupled to relay feedback is effective to a) detect the self-oscillating period of the system, b) divide said period into half-periods at a selected number £ of the sampling points, c) detect the time point tmax within one of the oscillation half- periods at which a local signal peak value occurs for the first time and effect successively a calculation of a pro¬ cess model for each sampling moment during the first half- period after t , and d) to compare .each calculation with stored compatability conditions, and immediately upon reaching a calculation which satisfies the set compatabi¬ lity conditions inhibit calculation of the model for the next sampling period in line, and with control to the regulator (2) adjust the calculated model for control in the regulator. 10. Apparatus according to Claim 9, characterized in that the computer and control means (5) includes a microproces¬ sor in which there are stored calculating sequencies for computing models which are individual for each theoreti¬ cally possible sampling interval for each theoretically possible sampling interval division of the self-oscillat- ing signal obtained when engaging the relay feedback (4). 11. Apparatus according to Claim 9 or 10, characterized in that an analogue filter (9) and a digital filter (10) which can be tuned individually to each particular calcu- lating process are incorporated in the regulator/process feedback loop, at least when the regulator is in its acti¬ ve mode.

Inventors: AOSTROEM KARL JOHAN, HAEGGLUND TORE, AOSTROEM, KARL, JOHAN, HAEGGLUND, TORE
Applicants: HIGHTECH NETWORK AB
Application year: 1986
Main classification: G05B13
IPC codes: G05B13, G05B21