Embodiment
Contrast accompanying drawing 1, the structure of Fuzzy control system comprises fuzzy controller, IO interface, pick-up unit, topworks and controlling object, wherein the signal input part of the signal output part of pick-up unit and input interface joins, the signal output part of input interface and the signal input part of fuzzy controller join, the signal output part of fuzzy controller and the signal input part of output interface join, the signal output part of output interface and the signal input part of topworks join, the signal output part of topworks and the signal input part of controlling object join, and the signal output part of controlling object and the signal input part of pick-up unit join.
Described controlling object, the controlling object of native system is a vision sensor.This vision sensor be multivariable, nonlinear, the time become, controlling object high-order, at random.For such non-linear of vision sensor and the time object that becomes be difficult to set up precise math model, so fuzzy control strategy is comparatively suitable solution.
Described pick-up unit, pick-up unit comprise that sensor and change send device (having now), are used to detect various non electrical quantities, and as brightness, colour temperature, aberration etc., and conversion is enlarged into the electric signal of standard.
Described topworks, topworks are fuzzy controller applies devices from control action to controlled device.Topworks in the native system is made up of main circuit in the vision sensor and drive part.
Described IO interface, IO interface are the bridges that the central processing unit of realization FUZZY ALGORITHMS FOR CONTROL is connected with controlled system.Input interface is connected with pick-up unit, and detection signal is converted to the digital signal that central controller can be discerned and handle.Output interface is converted to the desired signal of topworks to the digital signal of central controller output, and this outputs signal to topworks controlled device is applied control action.In native system, IO interface is all by the I of standard
2C circuit and its driving circuit are formed.
Described fuzzy controller, fuzzy controller are the cores of Fuzzy control system, are realized by the fuzzy control software of ARM central processing unit and operation in the above.
Contrast accompanying drawing 2, fuzzy controller is become by defuzzification interface, knowledge base, inference machine and ambiguity solution interface group.Corresponding joining of signal input part of first signal output part of knowledge base, secondary signal output terminal, the 3rd signal output part and gelatinization interface, inference machine, ambiguity solution interface wherein, the signal output part of gelatinization interface and the signal input part of inference machine join, and the signal input part of the signal output part of inference machine and ambiguity solution interface joins.
Described defuzzification interface is that the accurate semaphore that fuzzy controller is obtained by input channel is converted into the fuzzy quantity that the reasoning function receives.
Described knowledge base comprises database and rule base.Deposit all fuzzy subsets' that use definition in the database.In the controller reasoning process, database provides data necessary to inference machine.When defuzzification interface and ambiguity solution interface, database also provides the necessary data of relevant domain to them.Rule base is deposited fuzzy control rule.Fuzzy control rule is the knowledge model that controlled device is controlled based on the control experience of manual operator long-term accumulation and this domain expert's relevant knowledge.
Contrast accompanying drawing 3
Fuzzy controller is with the output valve of controlled device and the error between setting value is designated as input variable X and error rate is designated as input variable Y, and the fuzzy controller output variable is designated as Z.The set of the language value of X, Y, Z also claims the diction collection, is made as respectively:
X:{Aii=1,2,...m}
Fuzzy control rule can be expressed as so:
If X be A1 and B1 then Z be C11 otherwise
If X be A1 and B2 then Z be C12 otherwise
?...
If X be A1 and Bn then Z be C1n otherwise
If X be A2 and B1 then Z be C21 otherwise
?...
If X be A2 and Bn then Z be C2n otherwise
?...
If X be Am and B1 then Z be Cm1 otherwise
?...
If X be Am and Bn then Z be Cmn otherwise (.1)
The represented rule of formula (.1) is a usefulness otherwise the multistage fuzzy condition statement that connects, total m * n section, and each section be with and connect the two-dimentional fuzzy reasoning statement of front condition.
(X * Y * Z) can regard a converter as, when being input as A and B, conversion is output as C to fuzzy relation R ∈ F.For the multistage fuzzy condition statement of this group fuzzy condition statement composition of formula (.1), the wherein represented fuzzy relation R of each section
IjFor:
R
Ij=R
Ij((A
i) and (B
j) ∧ (C
Ij))=R
Ij(A
I, B
j, C
Ij) (.2)
Total fuzzy relation is:
If a certain moment be input as A ' and B ', then export C ' and be:
C’=(A’×B’)·R (.3)
Formula (.3) is exactly the composition rule of the fuzzy reasoning of fuzzy controller employing.Various reasoning algorithms all can be obtained fuzzy relation R earlier by formula (.2) according to rule base, carry out reasoning by formula (.3) then and try to achieve control output.But as field X, when Y, Z contained than multielement, it is huge that R becomes, and make troubles for storage, calculating, so the FUZZY ALGORITHMS FOR CONTROL of native system adopts simple and direct method to carry out compose operation.
The ambiguity solution interface is opposite with defuzzification interface, and ambiguity solution is to the transfer process of accurately measuring by fuzzy quantity.
Central controller must be converted to the receptible accurate amount of topworks to the control action that obtains from fuzzy reasoning.
Contrast accompanying drawing 4, question blank are the corresponding relations that the point on the input domain arrives the output domain, are the processes of having passed through obfuscation, fuzzy reasoning and ambiguity solution, and calculated off-line obtains.When fuzzy controller carried out at off-line, it was just passable only need to table look-up, thereby has accelerated on-line operation speed greatly.Input quantity is error e and error change amount ec.In each sampling instant, input quantity e and ec are carried out the range conversion, promptly error e multiply by scale factor k1, and error change amount ec multiply by scale factor k2, quantizes then.The physical signalling value of input is converted to the point of input on the domain, obtains exporting point on the domain by question blank then, multiply by scale factor k3 again and carry out the range conversion, just obtain exporting the desired physical quantity of hardware interface.
Contrast accompanying drawing 5, the framework of vision sensor Fuzzy control system comprises vision sensor and ARM central processing unit, fuzzy controller, empirical model database, control algolithm, communications protocol.Wherein, corresponding the joining of signal I/O end of the signal output/input end of vision sensor and ARM central processing unit.What the ARM central processing unit adopted is to be the SoC chip of core with ARM9, and its dominant frequency can run to 500MHz.Fuzzy controller, empirical model database, control algolithm, communications protocol all realize on the ARM central processing unit.
Contrast accompanying drawing 6. determines that the structure of fuzzy controller is to set up the prerequisite of fuzzy control rule, and different structures has multi-form rule.Select the version of fuzzy controller (FLC), also should adapt with the manual control experience.In native system, controlled device is that the vision sensor setting conforms to the expert knowledge library definite value to the requirement of system, promptly requires system to realize that with many close-loop feedback control system's visual pattern output is best.The fuzzy controller of system is to be input with integration EI of the error E of controlled volume (brightness, contrast, color, saturation degree, sharpness, gamma, white balance, backlight compensation, supply frequency, exposure, focusing), error rate EC and error etc., and the controlling object vision sensor is set at output.
Contrast accompanying drawing 7, the fuzzy controller in the system be one and be changed to the input of controller with the sum of errors error of controlled variable, and with the single argument fuzzy controller of the output that is changed to controller of controlled quentity controlled variable.K1 among the figure, K2, K3 is three parameters of fuzzy controller, be respectively the quantizing factor (coefficient of proportional action) of error, the scale factor (total enlargement factor) that quantizing factor of error change (coefficient of the differential action) and controlled quentity controlled variable change, K1, K2 increases, the proportional action, the differential action that are equivalent to controller strengthen, and K3 increases, and then is equivalent to the total enlargement factor of controller and strengthens.
if{E=A
i?and?EC=B
i}then?Δu=Ci,i=1,2,...n (2.1)
E wherein, EC and Δ u are respectively the error of controlled variable, the linguistic variable that error change and controlled quentity controlled variable change; And Ai, Bi and Ci for the language value on its corresponding domain are: NB, NM, NS, NO, PS, PM, PB.Fuzzy control rules as the table * shown in.
Wherein: P-just, N-is negative, B-is big, among the M-, S-is little, O-zero.
By control law (2.1) formula, according to approximate principle, can calculate corresponding to E, the Δ u of EC uses function f ' be expressed as:
Form 1. Fuzzy Controller parameter online self-tunings
Δu=f’(E,EC) (2.2)
If the actual error of n sampling instant controlled variable is e (n), when error change is ec (n), it is quantized and obfuscation, can obtain two independent fuzzy sets in its corresponding domain:
E(n)=INT(K
1e(n)+0.5) (2.3)
EC(n)=INT(K
2ec(n)+0.5) (2.4)
Substitution (2.2) formula has
Δu(n)=f’[INT(K
1e(n)+0.5),INT(K
2ec(n)+0.5)]
=f[K
1e(n),K
2ec(n)] (2.5)
It is adjudicated and takes advantage of scale factor K
3, obtain actual controlled quentity controlled variable and change:
Δu(n)=K
3D{f[K
1e(n),K
2ec(n)]}(2.6)
D[in the formula] the expression judgement.Thereby have
If the input-output characteristic of controlled process is described by following formula:
y=g(u) (2.8)
Then have:
As seen three of Fuzzy Controller parameters are all influential to the output characteristics of system.K wherein
1, K
2Be the output that changes controller by the value of adjusting linguistic variable, and K
3Then be equivalent to proportional gain effect in the classical control system.
Further describe the relation of Fuzzy Controller parameter and system performance below:
← K
1And K
2Influence to dynamic performance
By formula (2.3) and (2.4) as can be known, if K
1, K
2Change, then the language value that changes on the pairing domain of Shi Ji error or error also will change.In general, K
1And K
2Be worth big more, the language value that pairing sum of errors error changes also more greatly, vice versa.Can find out by fuzzy controller state table 1, error change get under the constant condition of language value, it is big more that error is got the language value, the language value that the output of corresponding controllers (controlled quentity controlled variable variation) is got also more greatly; And get under the constant condition of language value in error, error changes the language value got more greatly, and the language value that the output of corresponding controllers is got is more little.Therefore, K
1Influence to system dynamic characteristic is: K
1Big more, the adjusting dead band of system is more little, and system's climbing speed is big more.But K
1Got senior general and made system produce bigger overshoot, the adjusting time is increased, also can produce vibration when serious, made the system can not steady operation.And K
2To the influence of system dynamic characteristic just in time with K
1On the contrary, K
2Big more, the reaction of system is just blunt more; K
2More little, the reaction of system is sensitive more, and climbing speed is big.And too small K
2Also will cause the overshoot that system is bigger, and make the adjusting time of system long, also will producing when serious vibrates makes the system can not stable operation.
↑ K
1, K
2To the systematic steady state Effect on Performance
For Fuzzy control system, its steady state (SS) can be described as:
E?is?zero?and?EC?is?zero (2.10)
Language value zero correspondence certain scope, when the sum of errors error change all enters its language value
During the pairing scope of zero, system just enters steady state (SS).The stable state span that can be obtained e and ec by formula (2.3) and (2.4) is
|K
1?e(∞)|<0.5,|K
2?ec(∞)|<0.5 (2.11)
By formula (2.12) as seen, in Fuzzy control system, generally can not eliminate steady-state error and error change amount, but can be by increasing K
1, K
2Value they are reduced.But, also to take into account K for guaranteeing the performance of entire system optimum
1, K
2Dynamic property influence to system.
→ K
3The influence of system performance
K
3Be equivalent to the proportional gain in the classical control system, general K
3Big more, the climbing speed of system is fast more.But K
3Cross senior general and produce bigger overshoot, can produce vibration when serious and making the system can not steady operation.But K
3The general steady-state error that can not influence system, it is smaller that promptly the stable state of system is subjected to the influence of output gain of system.
Fuzzy Controller parameter self-tuning algorithm, as the above analysis, in system's operational process, adopt the fuzzy controller of preset parameter can not obtain excellent system dynamics and steady-state behaviour, therefore must carry out on-line automatic adjustment to each parameter of regulator according to the input and output signal of system.For coherent system dynamically and the different requirements of stable state to parameter adjustment, and reduce the complicacy of adjustment, we come setting parameter K according to the requirement of systematic steady state performance index
1And K
2, and, come setting parameter K online by identification to system's output state
3, make system obtain excellent dynamic performance.
← parameter K
1, K
2Adjust
By formula (2.12) as can be known, if the steady-state error that requires system then must make less than δ (a little positive number)
Any requirement is not done in the variation of steady-state error in the performance index of General System.At K
1Under certain condition, K
2Influence the sensitivity of system dynamics response, a desirable dynamic response, K are arranged for making system
2Must and K
1Coordination is got up, and we adopt the fuzzy control rule of table 1, and is generally desirable
K
2=(1.5~2.5)K
1 (3.2)
↑ parameter K
3Adjust
In control system, because given the changing of input, perhaps object parameters changes, and external disturbance perhaps takes place, system output (controlled variable) all will depart from its stationary value, the curve description of deviation e (t)=Y (t)-common available Fig. 8 of R (t) of it and new steady-state value.
At a point, e depart from steady-state value (| e|=0) bigger, and
Trend towards near steady-state value,, wish that control action is big in order to improve closing rate.At the b point, e is near steady-state value, and
For making the unlikely steady-state value of breaking through of e (t) cause new fluctuation, and be stable at rapidly | the e|=0 place, wish K
3Reach smallerly.C point, deviation e be for just, and
Wish control action big (control action is by table 1 decision).At the d point, although e still for just,
The trend steady-state value is stabilized in rapidly for making e (t) | and the e|=0 place, wish K
3Smaller slightly.Other each point K
3But the value similar analysis of parameter.
The design of similar FUZZY ALGORITHMS FOR CONTROL, regulator parameter also is one group of fuzzy condition statement from adjusting,
Can be expressed as
if{E=A
j?and?EC=B
j}then?K=C
j,j=1,2,...n (3.3)
E wherein, EC represent the linguistic variable that the sum of errors error of controlled volume changes, A respectively
j, B
jLanguage value on its corresponding domain, as NB, NM, NS, NO, PS, PM, PB etc., K represent the linguistic variable of scale-up factor, C
jFor the language value on its corresponding domain, as B, M, S, VB (Very Big) etc.
Formula (3.1)~(3.3) are exactly Fuzzy Controller parameter self-tuning algorithm.In native system, Fuzzy Controller is actually a secondary Fuzzy control system, and low one-level is carried out control action, and higher one-level is carried out the parameter adjustment effect.In native system, the Fuzzy control system block diagram that has a parameter self-tuning algorithm as shown in Figure 9.
As regulator parameter K
1, K
2, K
3When changing with image parameter, the output characteristics that has from the Fuzzy control system of setting algorithm has all reached perfect condition.Governing speed that it should be noted that the voltage Fuzzy Controller must be faster than the speed of current regulator.Because the output of system requires the voltage constant of DC side, so when the output of voltage, current regulator departed from stable state or default and changes, the output of voltage regulator should reach stable state prior to the output of current regulator.The method that solves is the K that guarantees in adjustment process in the voltage regulator
1Control action be greater than K in the current regulator
1Control action.