Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that is obtained under the creative work prerequisite.
The embodiment of the invention discloses a kind of chlorination control method,, and do not need to use a large amount of detecting instruments, save investment with the chlorination control effect that realizes to reach higher.
Referring to Fig. 1, be the process flow diagram of a kind of chlorination control method that the embodiment of the invention provided, specifically comprise:
S11, obtain the real-time working condition data;
Described operating mode is the variables that chlorination is had material impact, in the present embodiment, operating mode comprises: filter back discharge, temperature, pH value, clear water reserviors water level, the chlorine residue of last stage, temperature and illumination, the acute variation of these factors has decisive influence to the dosage of chlorine.Those skilled in the art can define the variables of operating mode according to actual conditions, and to this, the present invention does not do qualification.
S12, inquiry set up in advance with reference to the environmentalist storehouse, describedly be used to indicate the various information of controlling the corresponding relation of value with reference to floor data and its chlorination with reference to comprising in the environmentalist storehouse;
Described foundation with reference to the environmentalist storehouse specifically comprises following substep:
A1, by analyze adjusting, obtain stable chlorination state;
In chlorination system, the quality of judging the chlorination effect mainly is the value according to chlorine residue, and the chlorine residue error illustrates that then chlorination is suitable in critical field.When at the appointed time, when described error can maintain control aperture in the specialized range, we thought that this moment, chlorination system had stable chlorination state.
This step can adopt fuzzy control strategy to obtain chlorination control value under the floor data of each sampling instant, and adjust by constantly analyzing, and obtains stable chlorination state.
B1, under described stable chlorination state, obtain pairing chlorination control value under the various operating modes by fuzzy control strategy, and will described various operating modes and corresponding chlorination control value and deposit primary database in;
Described fuzzy control strategy is a kind of computer numerical control (CNC) technology based on fuzzy set theory, fuzzy language variable and fuzzy logic inference.Adopt after the fuzzy logic, the more approaching mankind's of its control ability the mode of thinking promptly, becomes the language control law with expert's control experience, the representation of knowledge, carries out with these rules then and controls.
In this step, adopt fuzzy control strategy to obtain chlorination control value and specifically comprise following substep:
A2, determine input quantity and output quantity;
B2, input quantity is carried out Fuzzy processing;
C2, infer fuzzy output quantity by the fuzzy control strategy rule;
D2, fuzzy output quantity is carried out defuzzification obtain chlorination control value.
C1, primary database is added up optimization, and choose typical condition and store, thereby set up with reference to the environmentalist storehouse as the reference operating mode.
S13, according to Query Result determine with described real-time working condition Data Matching with reference to operating mode, with described chlorination controlled quentity controlled variable with reference to the operating mode correspondence as the first control value;
S14, utilize fuzzy control strategy to described first control value handle, obtain second control value;
S15, the weighted sum by the described first control value and the second control value obtain current control value, and carry out chlorination control according to described current control value.
The embodiment of the invention set up in advance comprise various with reference to floor data, and with the corresponding relation of its chlorination control value with reference to the environmentalist storehouse, when getting access to the real-time working condition data, described by inquiring about with reference to the environmentalist storehouse, determine with described real-time working condition Data Matching with reference to operating mode, and with described chlorination controlled quentity controlled variable with reference to the operating mode correspondence as the first control value, utilize fuzzy control strategy that the described first control value is handled again, obtain the second control value, weighted sum by the described first control value and the second control value obtains current control value at last, and carries out chlorination control according to described current control value.By this mode, can improve chlorination control effect greatly, and not need a large amount of detecting instruments, save investment.
For the easier quilt of technical solution of the present invention is understood, with a specific embodiment technical scheme provided by the present invention is described in detail below.
Process flow diagram referring to shown in Figure 2 specifically comprises:
S21, by fuzzy control strategy, obtain pairing chlorination control value under the multiple sampling instant operating mode, and adjust by analyzing, obtain stable chlorination state.
In chlorination system, the quality of judging the chlorination effect mainly is the value according to chlorine residue, and the chlorine residue error illustrates that then chlorination is suitable in critical field.When at the appointed time, when described error can maintain control aperture in the specialized range, we thought that this moment, chlorination system had stable chlorination state.
Described fuzzy control strategy is a kind of computer numerical control (CNC) technology based on fuzzy set theory, fuzzy language variable and fuzzy logic inference.Adopt after the fuzzy logic, the more approaching mankind's of its control ability the mode of thinking promptly, becomes the language control law with expert's control experience, the representation of knowledge, carries out with these rules then and controls.
Described operating mode is the variables that chlorination is had material impact, in the present embodiment, operating mode comprises: filter back discharge, temperature, pH value, clear water reserviors water level, the chlorine residue of last stage, temperature and illumination, the acute variation of these factors has decisive influence to the dosage of chlorine.Those skilled in the art can define the variables of operating mode according to actual conditions, and to this, the present invention does not do qualification.
S22, under described stable chlorination state, obtain pairing chlorination control value under the various operating modes by fuzzy control strategy, and will described various operating modes and corresponding chlorination control value and deposit primary database in.
Schematic diagram referring to fuzzy control strategy shown in Figure 3, the process that realizes fuzzy control strategy is briefly described as follows: microcomputer interrupts the exact value that controlled variable is obtained in sampling, then this amount is relatively obtained error signal E with set-point, generally select the input quantity of error signal E as fuzzy control.The accurate amount of error signal E is carried out obfuscation become fuzzy quantity.The fuzzy quantity of error E can be represented with corresponding fuzzy language, obtains a subclass e of the fuzzy language set of error E, carries out fuzzy decision by e and fuzzy control rule R composition rule by inference again, obtains fuzzy control quantity u.
Describe in detail below.
Fuzzy control strategy specifically comprises following substep:
A3, determine input quantity and output quantity;
The control law of general fuzzy control strategy is that the experience of summing up expert or operating personnel gets, so when definite input quantity, output quantity, mainly observed which amount when fully taking into account their control of expert or on-the-spot experienced operating personnel, promptly, as the control foundation, which amount to output to the Be Controlled object by with the variation of which amount again.
In water factory's chlorination system, judge that the leading indicator of chlorination controlled quentity controlled variable is exactly the value of chlorine residue.Chlorine residue conformance with standard (error is in allowed band) illustrates that then chlorination is suitable, otherwise, be exactly control fails.So judge that the chlorination controlled quentity controlled variable is exactly to carry out according to the size of error, therefore, error is an input variable of fuzzy control strategy strategy, another input variable is exactly an error rate, and it also affects chlorine dosage.Because it has determined error change trend.Thus, it is error and error rate that present embodiment has designed an input variable, and output variable is the two-dimentional fuzzy control strategy strategy of chlorination controlled quentity controlled variable.
By Fig. 3, error obtains by sensor measurement, and described error is the poor of chlorine content and setting value, obtains error rate through error of calculation inverse again.
B3, input quantity is carried out Fuzzy processing;
Input quantity in the fuzzy control strategy and output quantity all are accurate amounts, and fuzzy reasoning all carries out at fuzzy quantity, therefore must carry out Fuzzy processing to input quantity.
Carry out the variable obfuscation and will know the basic domain and the fuzzy language value of variable before.As Fig. 4, described is the domain (representing the actual change scope of variable for this reason) and the fuzzy language value of input variable (error e, error rate EC) and output variable (controlled quentity controlled variable u).Because of requiring the chlorination control accuracy, the owner must in ± 0.1, be [0.1,0.1] so locate the domain of chlorine residue error; The valve opening increment of controlled quentity controlled variable is 2 to the maximum, and the domain of controlled quentity controlled variable is [2,2].The mapping of input and output conversion is as follows so: input: [0.1,0.1] → e; Output: it is 3 that quantification gradation is chosen at this in u → [2,2], and then the fuzzy subset of input/output variable is that { NB, NS, ZO, PS, PB} represent { PB (honest), PS (just little), ZO (zero), NS (negative little), NB (negative big) } respectively.If the domain of chlorine residue error, chlorine residue error rate and controlled quentity controlled variable linguistic variable is respectively X, Y, Z, X=Y=Z={-3 then ,-2 ,-1,0,1,2,3}.
Then, obtaining quantizing factor, is example with the error, the domain maximal value of error is 0.1, seven grades of the branches of fuzzy language, and the quantizing factor of error is exactly ke=7/0.1 so, the value of obfuscation is exactly that actual value multiply by this quantizing factor, if be not integer then round.
Referring to Fig. 5, be fuzzy membership function.The subordinate function of traditional fuzzy control strategy generally all is equally distributed, and the subordinate function curve resolution rate height of shape point in fact, control sensitivity is also higher, on the contrary, the subordinate function curve shape is more slow, control characteristic is also more steady, system stability is better, relative merits are respectively arranged therefore, present embodiment has proposed to choose the subordinate function of non-uniform Distribution, promptly adopt the fuzzy set of low resolution, adopt the fuzzy set of high-resolution in the less zone of error, when error approaches zero, select high-resolution fuzzy set for use in the bigger zone of error.In order to improve chlorination control accuracy, response speed, make chlorine residue control within the limits prescribed like this, membership function adopts following non-uniform Distribution subordinate function.Degree of membership is exactly that the value of fuzzy quantity is assigned among the fuzzy subset by degree of membership, is used for control law with this and infers.
C3, infer fuzzy output quantity by the fuzzy control strategy rule;
Referring to Fig. 6, be the fuzzy control strategy rule base of being set up, described fuzzy rule base is write as a rule fuzzy relation by expertise, at last such fuzzy rule base of Xing Chenging.
1) deviation e>0, deviation changes e '<0, in phase place 1.Deviation is for just, and deviation is changed to negative, the super assigned direction variation of the output c of system.If e is that PM and e ' are NM, although illustrate that deviation is bigger, in rapid minimizing, the super assigned direction of system output changes fast, if controlled quentity controlled variable is P, then system will overshoot, is output as ZO so control, and its rule is as follows:
If?e?is?PM?and?e′isNM?then?u?is?ZO
When the deviation minimizing, as be PS, and deviation variation e ' is NM, illustrates under little overgauge, the direction of the super set-point of the output c of system changes fast, and for the possible overshoot trend of inhibition system, not only controlled quentity controlled variable u is not P but also should be N, and its rule can be
If?e?is?PS?and?e′is?NM?then?u?is?NS
2) deviation e<0, deviation changes e '<0, and e * e '>0 is in phase place 2.System overshoot, and continue to change to deviating from the set-point direction, drawing close set-point as early as possible in order to make the output c of system, the output u of fuzzy control strategy device is that N and absolute value are bigger.For example, when e is NS, e ' is NM, and its control law can be
If?e?is?NS?and?e′isNM?then?u?is?NM
This rule declaration is though deviation is little.But the deviation pace of change is fast, thereby controlled device applies a bigger controlled quentity controlled variable.
3) deviation e<0, deviation changes e '>0, and e * e '<0 is in phase place 3.The output c of system changes to the set-point direction, and very fast if deviation changes when deviation is big in order to prevent unbalance of system, the output c of system changes fast to set-point, and control law can be:
If?e?is?NM?and?e′isPM?then?u?is?ZO
If?e?is?NS?and?e′isPM?then?u?is?PS
4) deviation e>0, deviation changes e '>0, and e * e '>0 is in phase place 4.This situation is the same with 2, and just system's output changes in the opposite direction, and the fuzzy control strategy device provides bigger controlled quentity controlled variable u, and control law can be:
If?e?is?PS?and?e′isPM?then?u?is?PM
If?e?is?PS?and?e′isPS?then?u?is?PM
D2, fuzzy output quantity is carried out defuzzification obtain the chlorination controlled quentity controlled variable.
The fuzzy output quantity that obtains by fuzzy input quantity and control law can not directly apply to real process, also will carry out defuzzification to it.Defuzzification is exactly the Converse solved of obfuscation, and the defuzzification of controlled quentity controlled variable is exactly that fuzzy value multiply by one than the row factor, and the domain maximal value of scale factor controlled quentity controlled variable is removed with fuzzy grade, i.e. ku=2/7.
S23, primary database is added up optimization, and choose typical condition and store, to set up with reference to the environmentalist storehouse as the reference operating mode;
Described statistics optimization comprises the data in the described primary database is gone heavily, gone wrong operation, and data are handled, so that data adapting is in the memory module of database.Referring to Fig. 7 and Fig. 8, be respectively in the present embodiment elementary environment data base and with reference to the data type of a variable of being stored in the environmentalist storehouse.
S24, obtain the real-time working condition data;
S25, inquiry set up in advance with reference to the environmentalist storehouse, describedly be used to indicate the various information of controlling the corresponding relation of value with reference to floor data and its chlorination with reference to comprising in the environmentalist storehouse.
S26, according to Query Result determine with described real-time working condition Data Matching with reference to operating mode, with described chlorination controlled quentity controlled variable with reference to the operating mode correspondence as the first control value;
S27, utilize fuzzy control strategy to described first control value handle, obtain second control value;
S28, the weighted sum by the described first control value and the second control value obtain current control value, and carry out chlorination control according to described current control value;
S29, according to control effect described confidence level with reference to stored relation in the environmentalist storehouse is estimated;
Can estimate its confidence level by setting evaluation of estimate, said confidence level just can be with reference to property, in order to the quality of record controls effect.When system initially is written into raw readings,, increase and decrease one according to practical operation situation later on for the evaluation of estimate of the confidence level of every corresponding relation is set to a fixing value.If a certain corresponding relation can be used for control, and can be in three control cycles, keep departure in specialized range, we think that this corresponding relation has reference significance, confidence level adds one, otherwise subtracts one, when the evaluation of estimate of the confidence level of a certain corresponding relation is 0 or when negative, think that then this corresponding relation does not have reference significance, can be with this corresponding relation deletion.
S210, according to the evaluation of estimate of described confidence level, make amendment and optimize with reference to the environmentalist storehouse described, improve described reference value with reference to the environmentalist storehouse.
This step can be by being provided with online learning functionality in reference to the environment experts database and realizing described.Because chlorination system is can be by the single output system that different operating mode influenced, its output under the normal condition (being the chlorine dosage set-point) should constitute certain mapping relations with floor data, wherein dosage is a variations per hour, relevant with multiple factor, therefore can obtain the approximate value that the ideal corresponding with it adds concentration by on-line study by setting up the form of a chlorinating machine aperture under duty parameters such as difference filter back discharge, different clear water reserviors water levels as the content in the reference environmentalist storehouse.Be responsible for estimating with reference to the study of environment experts database and adaptive mechanism and add effect (chlorinating machine aperture), realize online correction reference data, rolling optimization, and determine that in real time suitable chlorinating machine adds aperture and some other controller parameter.By on-line study, make with reference to the data in the environment experts database to obtain revising and optimizing, improved the control effect greatly.
The embodiment of the invention has also proposed a kind of chlorination control device, referring to apparatus structure synoptic diagram shown in Figure 9, described device comprises: acquiring unit 901, with reference to environmentalist storehouse 902, query unit 903, first acquiring unit 904, second acquisition unit 905 and control module 906.Wherein:
Acquiring unit 901 is used to obtain the real-time working condition data;
Described operating mode is the variables that chlorination is had material impact, in the present embodiment, operating mode comprises: filter back discharge, temperature, pH value, clear water reserviors water level, the chlorine residue of last stage, temperature and illumination, the acute variation of these factors has decisive influence to the dosage of chlorine.Those skilled in the art can define the variables of operating mode according to actual conditions, and to this, the present invention does not do qualification.
With reference to environmentalist storehouse 902, be used to store the various information of controlling the corresponding relation of value with reference to floor data and its chlorination of indication;
Query unit 903 is used to inquire about described with reference to the environmentalist storehouse;
First acquiring unit 904, be used for according to Query Result determine with described real-time working condition Data Matching with reference to operating mode, with described chlorination controlled quentity controlled variable with reference to the operating mode correspondence as the first control value;
Second acquisition unit 905 is used to utilize fuzzy control strategy that the described first control value is handled, and obtains the second control value;
Control module 906 is used for obtaining current control value by the weighted sum of the described first control value and the second control value, and carries out chlorination control according to described current control value.
The embodiment of the invention has also proposed another kind of chlorination control device, referring to Figure 10, this device except comprise with said apparatus in intimate acquiring unit 101, with reference to environmentalist storehouse 102, query unit 103, first acquiring unit 104, second acquisition unit 105 and the control module 106, also comprise: build library unit 107, evaluation unit 108 and on-line study unit 109.Wherein:
Build library unit 107, be used for setting up in advance with reference to the environmentalist storehouse, its step specifically comprises:
Obtain stable chlorination state;
Under described stable chlorination state, obtain pairing chlorination control value under the various operating modes by fuzzy control strategy, and deposit described various operating modes and corresponding chlorination control value in primary database;
Primary database is added up optimization, and choose typical condition and store, to set up with reference to the environmentalist storehouse as the reference operating mode.
Evaluation unit 108 is used for estimating with reference to the environmentalist storehouse described, and described evaluation specifically comprises: write down the described number of times that is referenced with reference to each bar corresponding relation in the environmentalist storehouse;
According to what of described reference count its evaluation of estimate is added 1 or subtract 1;
When the evaluation of estimate of a certain described corresponding relation is 0 or when negative, delete described corresponding relation.
On-line study unit 109 is used for according to described evaluation of estimate, to described with reference to making amendment and optimize in the environmentalist storehouse, thereby can improve described reference value with reference to the environmentalist storehouse.
The embodiment of the invention set up in advance comprise various with reference to floor data, and with the corresponding relation of its chlorination control value with reference to the environmentalist storehouse, when getting access to the real-time working condition data, described by inquiring about with reference to the environmentalist storehouse, determine with described real-time working condition Data Matching with reference to operating mode, and with described chlorination controlled quentity controlled variable with reference to the operating mode correspondence as the first control value, utilize fuzzy control strategy that the described first control value is handled again, obtain the second control value, weighted sum by the described first control value and the second control value obtains current control value at last, and carries out chlorination control according to described current control value.By this mode, can improve chlorination control effect greatly, and not need a large amount of detecting instruments, save investment.
In addition, the invention process, makes with reference to the environmentalist storehouse constantly to obtain revising and optimizing, thereby can improve the reference value in environmentalist storehouse by on-line study also at reference environmentalist lab setting on-line study function, has guaranteed chlorination control effect.
Each embodiment adopts the mode of going forward one by one to describe in this instructions, and what each embodiment stressed all is and the difference of other embodiment that identical similar part is mutually referring to getting final product between each embodiment.For the disclosed device of embodiment, because it is corresponding with the embodiment disclosed method, so description is fairly simple, relevant part partly illustrates referring to method and gets final product.
It will be understood by those skilled in the art that and to use many different technologies and in the technology any one to come expression information, message and signal.For example, the message of mentioning in the above-mentioned explanation, information can be expressed as voltage, electric current, electromagnetic wave, magnetic field or magnetic particle, light field or above combination in any.
The professional can also further recognize, the unit and the algorithm steps of each example of describing in conjunction with embodiment disclosed herein, can realize with electronic hardware, computer software or the combination of the two, for the interchangeability of hardware and software clearly is described, the composition and the step of each example described prevailingly according to function in the above description.These functions still are that software mode is carried out with hardware actually, depend on the application-specific and the design constraint of technical scheme.The professional and technical personnel can use distinct methods to realize described function to each specific should being used for, but this realization should not thought and exceeds scope of the present invention.
The method of describing in conjunction with embodiment disclosed herein or the step of algorithm can directly use the software module of hardware, processor execution, and perhaps the combination of the two is implemented.Software module can place the storage medium of any other form known in random access memory (RAM), internal memory, ROM (read-only memory) (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or the technical field.
To the above-mentioned explanation of the disclosed embodiments, make this area professional and technical personnel can realize or use the present invention.Multiple modification to these embodiment will be conspicuous concerning those skilled in the art, and defined herein General Principle can realize under the situation that does not break away from the spirit or scope of the present invention in other embodiments.Therefore, the present invention will can not be restricted to these embodiment shown in this article, but will meet and principle disclosed herein and features of novelty the wideest corresponding to scope.