A kind of flush type learning memory control method and controller thereof
Technical field:
The present invention relates to the automatic control technology field, specifically refer to a kind of embedded controller that uses the learning and memory control algolithm.
Background technology:
In the continuous production control process of present many industry, various controllers still adopt traditional pid control algorithm, less application intelligent control technology.Along with more and more higher to product quality and control effect of requirement, traditional controller is difficult to meet the demands.The control technology of many utilization intelligent control algorithms has appearred since phase early 1990s, as ANN (Artificial Neural Network) Control, fuzzy control, Genetic Control etc.These algorithms can improve the control effect to a certain extent, but in the practical application, it exists, and pace of learning is slow, memory capability is not enough, control weak effect and be difficult to realize shortcoming such as Long-distance Control.
Summary of the invention:
Along with the development of BIOLOGICAL CONTROL theory, Intelligent Control Theory and biological information disposal system are more and more tightr in conjunction with getting.Just as, the fourth immortality (" computational intelligence-theory, technology and application " [M]. Beijing: science tech publishing house, 2004) point out: the biological information disposal system comprises nervous system, genetic system, immune system and internal system, wherein Immune System is the system of a high complexity, it demonstrate accurate regulating power to detecting and eliminate infection problems, it can discern and eliminate pathogen, has study, memory and mode identificating ability.
The object of the present invention is to provide a kind of based on the Immune System principle, promptly learn, storage, memory principle design possess study, memory and adaptive ability, has the novel embedded intelligent controller (EIC) of supporting characteristics such as remote access, it comprises input interface, output interface, control algolithm module and control memory body storehouse, and part such as communication interface, wherein, the control algolithm module comprises auxiliary pid algorithm and memory control algolithm, and control memory body storehouse is made up of all control memory bodys.
About the Immune System principle summary that the present invention is based on
In Immune System, when external antigen (Ag, i.e. pathogen) was for the first time in the invasion body, vivo immuning system did not have corresponding antibody (Ab) to eliminate antigen.At this moment original antibody will heredity, evolve under the stimulation of antigen, finally produces the antibody that can eliminate antigen, and Here it is immune primary response also is the process of immune system study.After antigen was eliminated, the quantity of the antibody that matches reduced along with the aging death of self, but always kept the antibody cell of some in vivo, immunity storage that Here it is.
When external antigen was invaded once more, the antibody in the body can mate according to the unique point of antigen.If the unique point of the unique point of a certain antibody and this antigen matches, then this antibody is exactly the antibody that matches.This subsequently antibody will be bred in a large number, and rapidly antigen is eliminated.This is the performance of immune system second set response process and adaptivity, just immunological memory.Its principle as shown in Figure 1.
Principle of work about the learning and memory controller that the present invention is based on the Immune System principle
At this, the control deviation of control system likened to be immune antigen, the final control output changing value of eliminating a certain control deviation likens to and is immune antibody, is called the control memory body in the present invention.All control memory bodys that form in the control system are formed control memory body storehouses, in view of the above, we can design a kind of based on immune control system as shown in Figure 2.
Simultaneously, the present invention is based on following understanding:
When control deviation occurred for the first time, EIC must learn and train, and produced control corresponding memory body and storage.When control deviation occurred once more, EIC at first according to the feature of control deviation, mated with existing control memory body, then the control memory body of coupling is revised, then utilize revised control memory body to eliminate control deviation, after control deviation is eliminated, form new control memory body.
A kind of flush type learning memory control method of the present invention comprises the following steps:
A. note control memory body is C
Ab(i), i=1 wherein, 2 ..., n (n is the control memory body total number in the control memory body storehouse)
To control memory body C
AbAnd be defined as follows (i):
(1) unique point: control memory body C
AbSetting value sp when (i) producing
i(t
0) and control deviation e
i(t
0);
(2) memory control output changing value: at control memory body C
Ab(i) changing value is finally exported in the control of (being the process that controller is eliminated deviation) in the generative process, i.e. the final output valve u of controller
i(t) and the controller output valve u of control memory body when beginning to produce
i(t
0) difference:
Δu
i=u
i(t)-u
i(t
0) (1)
B. when control deviation (antigen) occurred for the first time, the learning and memory controller did not have the control corresponding memory body, and it must be learnt and train, thereby produced the control corresponding memory body.The generation first and the storing process of control memory body are as follows:
1) when the absolute value of control deviation e (t) greater than setting threshold ε
1The time, record technique initialization value sp at this moment
j(t
0), control deviation e
j(t
0), controller output valve u
1(t
0);
2) utilize the traditional PID control algorithm to eliminate control deviation;
3) when control deviation is eliminated, record controller output valve u at this moment
1(t);
4) according to the output changing value Δ u of formula (1) computing controller
1, control memory body C
Ab(1) forms;
5) control memory body C
Ab(1) with document form data or the storage of other form.
Control memory body C
Ab(1) generation and storing process are as shown in Figure 3.
C. control the memory control procedure of memory body: when control deviation occurred once more, the control memory body began to have an effect.The learning and memory controller is at first according to the feature of control deviation, mate with control memory bodys all in the control memory body storehouse, find out the control memory body that mates most with it, then the control memory body of coupling is revised, then the learning and memory controller utilizes revised control memory body to eliminate control deviation, after control deviation is eliminated, form new control memory body.This process is exactly the memory control procedure of control memory body, detailed process following (establishing the control memory body total quantity of controlling in the memory body storehouse this moment is n):
1) (absolute value of control deviation e (t) is greater than setting threshold (ε when control deviation occurs
1), write down current eigenwert: setting value sp (t), deviation e (t) and controller output state value u (t);
2) with the eigenwert of current control deviation and the eigenwert sp of all control memory bodys
i(t
0) and e
i(t
0) compare, calculate the corresponding matching degree ω of all control memory bodys according to formula (2)
i(i=1,2 ..., n).
(0<α<1.0) (2)
If get α=0.5, matching degree ω then
iMaximum control memory body is exactly the control memory body that mates most with current control deviation, and the control memory body of final coupling is designated as C
Ab(k) (k≤n).This process is exactly the memory process of control memory body.
3) because current e (t) and coupling control memory body C
Ab(k) eigenwert e
k(t
0) might not mate fully, inconsistent etc. such as the size of control deviation or direction, can utilize formula (3) to control memory body C this moment according to linearized theory
Ab(k) output changing value is revised, and forms new intermediate controlled memory body C
Ab' (n+1) memory control output changing value Δ u (t).This process is exactly the genetic evolution process of control memory body.
4) controller utilization control memory body memory control algolithm is eliminated control deviation, the controller output valve u (t when its output valve u (t) equals control deviation and occurs
0) add and revise back control memory body C
Ab' (n+1) memory control output changing value Δ u (t):
u(t)=u(t
0)+Δu(t) (4)
Iff the control memory body memory control algolithm of use formula (4), because
1) the relative response speed of output signal is slow, can make the stabilization time of control system elongated;
May there be certain error in actual final output changing value when 2) the memory control output changing value of the revised intermediate controlled memory body of coupling and control system are finally eliminated deviation, thereby influences control accuracy.
At first kind of situation, take to control the mode (as the formula (5)) of memory body memory control algolithm and traditional ratio P effect combination.Both actings in conjunction are risen output rapidly, and eliminate control deviation.When deviation was eliminated, the stable state output valve of controller was exactly the memory control final output changing value and the output valve sum (formula (4)) of controller when the elimination control deviation begins of control memory body.
u(t)=u(t
0)+Δu(t)+K
p0e(t) (5)
K wherein
P0Be proportional gain factor.
At second kind of situation, take the mode that combines with the traditional PID control algorithm.When the absolute value of deviation e (t) more than or equal to setting threshold ε
2When (being made as 2%), the mode of utilizing control memory body memory control algolithm and P effect to combine; When absolute value of the bias less than setting threshold ε
2The time, be converted to the traditional PID control mode, further eliminate control deviation, its control flow is as shown in Figure 4.
5) when control deviation is eliminated fully, according to final controller output valve u
N+1(t), calculate intermediate controlled memory body C by formula (1)
Ab' (n+1) actual Δ u
N+1(t), thus form a new control memory body C
Ab(n+1), and with document form data or other form store.This process is exactly the reproductive process of control control memory body.Detailed process as shown in Figure 5.
Comprehensive above-mentioned steps overall flow figure as shown in Figure 6.
Description of drawings:
Fig. 1 is immune system storage memory principle figure;
Fig. 2 is a learning and memory control system block diagram of the present invention;
Memory body is first to be produced and the storing process subroutine flow chart Fig. 3 for the present invention controls;
Fig. 4 eliminates deviation procedure subprogram process flow diagram for the present invention controls memory body memory control algolithm;
Fig. 5 controls the memory control procedure subroutine flow chart of memory body for the present invention;
Fig. 6 is the whole software program flow chart of the present invention;
Fig. 7 is a system principle diagram of the present invention;
Fig. 8 is a hardware principle block diagram of the present invention;
Fig. 9 is simulated effect figure of the present invention.
Label declaration in the accompanying drawing:
1: input signal; 2: input interface; 3: auxiliary pid algorithm; 4: the memory control algolithm; 5: the control algolithm module; 6: control memory body storehouse; 7: communication interface; 8: output interface; 9: output signal; 10:CPU; The 11:SDRAM storer; The 12:FLASH flash memory.
Embodiment:
The invention will be further described below in conjunction with accompanying drawing:
A kind of flush type learning memory control method of the present invention comprises the following steps:
A. note control memory body is C
Ab(i), i=1 wherein, 2 ..., n, wherein n is the control memory body total number in the control memory body storehouse;
To control memory body C
Ab(i), be defined as follows:
1) control memory body C
AbSetting value sp when (i) producing
i(t
0) and control deviation e
i(t
0) be its unique point;
2) at control memory body C
Ab(i) in the generative process, the final output valve u of controller
i(t) and the controller output valve u of control memory body when beginning to produce
i(t
0) difference: Δ u
i=u
i(t)-u
i(t
0) for controlling the memory control output changing value of memory body;
B. control the generation first and the storing process of memory body:
1) when the absolute value of control deviation e (t) greater than setting threshold ε
1The time, record technique initialization value sp at this moment
j(t
0), control deviation e
j(t
0), controller output valve u
1(t
0);
2) utilize the traditional PID control algorithm to eliminate control deviation;
3) when control deviation is eliminated, record controller output valve u at this moment
1(t);
4) according to formula: Δ u
i=u
i(t)-u
i(t
0) the output changing value Δ u of computing controller
1, control memory body C
Ab(1) forms;
5) control memory body C
Ab(1) with document form data or the storage of other form;
C. control the memory control procedure of memory body:
1) absolute value of control deviation e (t) is greater than setting threshold ε
1, write down current eigenwert: setting value sp (t), deviation e (t) and controller output state value u (t);
2) eigenwerts with current eigenwert and all control memory bodys compare, according to formula:
Wherein 0<α<1.0 are established and are got α=0.5, calculate the corresponding matching degree ω of all control memory bodys
iI=1 wherein, 2 ..., n.Matching degree ω then
iMaximum control memory body is exactly the control memory body with current control deviation optimum matching, and the control memory body of final coupling is designated as C
Ab(k) wherein, k≤n;
3) current e (t) controls memory body C with coupling
Ab(k) eigenwert e
k(t
0) occur as with the size of control deviation or direction when inconsistent etc., according to formula:
To control memory body C
Ab(k) output changing value is revised, and forms new intermediate controlled memory body C
Ab' (n+1) memory control output changing value Δ u (t);
4) utilize control memory body memory control algolithm to eliminate control deviation, the controller output valve u (t when its output valve u (t) equals control deviation and occurs
0) add and revise back control memory body C
Ab' (n+1) memory control output changing value Δ u (t) is as formula: u (t)=u (t
0)+Δ u (t)
When the absolute value of deviation e (t) more than or equal to setting threshold ε
2When (being made as 2%), utilize the memory control algolithm of control memory body and the mode that traditional ratio P effect combines, both actings in conjunction are risen output rapidly, and eliminate control deviation, as formula: u (t)=u (t
0)+Δ u (t)+K
P0E (t), wherein K
P0Be proportional gain factor;
When the absolute value of deviation e (t) less than setting threshold ε
2The time, be converted to the traditional PID control mode, further eliminate control deviation.
5) when control deviation is eliminated fully, according to final controller output valve u
N+1(t), according to formula: Δ u
i=u
i(t)-u
i(t
0) calculate intermediate controlled memory body C
Ab' (n+1) actual Δ u
N+1(t), thus form a new control memory body C
Ab(n+1), and with document form data or other form store;
A kind of controller that adopts flush type learning memory control method of the present invention, form by input interface 2, output interface 8, control algolithm module 5 and control memory body storehouse 6 and communication interface 7 parts, wherein, control algolithm module 5 comprises auxiliary pid algorithm 3 and memory control algolithm 4, and control memory body storehouse 6 is made up of all control memory bodys.Its,
A. hardware components comprises main frame and peripheral interface two large divisions:
1) main frame
CPU adopts 32, dominant frequency 70MHZ, ARM7 family chip;
Adopt SDRAM and FLASH flash memory to be used separately as calculator memory storer and storage operating system, application software and control memory body library file;
Adopt the external world that power mode is provided.
2) peripheral interface
Data communication interface: USB, VGA, RJ45, RS232, RS485 and power interface that standard is provided;
Analog signal interface: the I/O of 4~20mA electric current, the I/O of 1~5VDC voltage etc. are provided.
B. software section comprises operating system, bitcom, WEB remote access software and input/output interface software, wherein,
1) operating system
Employing has the embedded OS with the window application compatibility, Win CE.
2) bitcom
Employing provides the support software of ICP/IP protocol, RS232 or 485 agreements.
3) WEB remote access software
Be used to finish remote access, communication, operating function.
4) input/output interface software
Be used to finish the I/O of simulating signal or digital signal.
The control performance of controller of the present invention carries out emulation experiment through choosing the second order object, and compares with the control effect of traditional PI D.By continuous change set-point, make controller produce the more control memory body.In emulation experiment, the auxiliary pid control parameter of controller is identical with the controlled variable setting of traditional PI D.
The transport function of the tank level control system of certain production run equipment is:
The controlled variable of controller of the present invention is provided with as shown in table 1, K in the table
P1, T
I1And T
D1Being its auxiliary pid control algorithm controlled variable, also is the controlled variable of conventional PID controllers; ε
1And ε
2It is respectively its deviation setting threshold value and pid algorithm conversion setting threshold.The control memory body of its formation is as shown in table 2.With the contrast effect of conventional PID controllers as shown in Figure 9.As can be seen from Figure 9, compare with conventional PID controllers, controller of the present invention can be interrogated speed, non-overshoot, stably be eliminated control deviation.
Table 1 control parameter list
Title | K
p0 | K
p1 | T
i1 | T
d1 | ε
1 | ε
2 |
Numerical value | 1.3 | 1.3 | 5.0 | 0.0 | 0.005 | 0.01 |
The control memory body that table 2 generates
Sequence number | Set-point | The deviation changing value | The output changing value |
1 | 1.0000 | 0.5000 | 0.2815 |
2 | 0.5000 | -0.2500 | -0.1407 |
3 | 1.5000 | 0.5000 | 0.2815 |
4 | 1.8000 | 0.1500 | 0.0844 |
5 | 1.5000 | -0.1500 | -0.0844 |