A kind of Temperature and Humidity Control algorithm of bulk curing barn controller
Technical field
The present invention relates to the Temperature and Humidity Control algorithm in the environment controlling technique field in industrialized agriculture, particularly a kind of bulk curing barn controller.
Background technology
Tobacco flue-curing is last important step determining tobacco production and value amount, the baking quality of tobacco leaf, mainly by the restriction of fresh cigarette quality, roasting plant and baking technology, provides the suitable environmental baseline such as temperature, humidity to be guarantee the key of baking quality of tobacco according to the requirement of method for flue-curing tobacco leaves.Before bulk curing barn is applied, be use dry wet differential thermometer to measure humiture in barn substantially, people is for controlling, and this mode is difficult to accurately implement baking process, and baking quality of tobacco is difficult to be guaranteed; In recent years, along with applying of bulk curing barn, adopt bulk curing barn humiture automatic control equipment, improve the automaticity of Temperature and Humidity Control and the arrival rate of baking process in barn, but the single proportional control algorithm of general employing controls humiture in tobacco flue-curing, more extensive, control accuracy is lower, still needs the artificial firepower that adjusts by rule of thumb to assist to control humiture.
Chinese patent (number of patent application is 200710036583.3) disclosed " calculation method for multiple factor coordination control of greenhouse environment ", its basic thought is: for so non-linear, the distribution parameter in greenhouse, time change, long time delay, Multivariable Coupling complex object, and also there is very strong coupling between each control device, this invention is in conjunction with some empirical methods of facilities horticulture, Greenhouse System is converted and equivalent process, by problem reduction; Simplification measure reduces the difficulty of system modelling and the complexity of control algolithm, but can meet the requirement of greenhouse flower; This algorithm can either realize greenhouse multiple-factor, multiobject control, also can solve the problem that greenhouse multiple-factor is seriously coupled.
Summary of the invention
Technical matters to be solved by this invention is to provide a kind of control algolithm that can calculate each environmental conditions parameter and variable quantity and then realization accurate control barn humiture in barn.
For solving the problems of the technologies described above, the technical solution used in the present invention invents a kind of Temperature and Humidity Control algorithm of bulk curing barn controller: adopt the pid algorithm optimized, and realized the accurate control of humiture by controller; Described controller comprises PID controller, relay link and corrects the fuzzy controller of pid parameter, and PID controller completes control algolithm, calculates output controlled quentity controlled variable; Relay link realizes the initial parameter of PID controller; Fuzzy controller is according to deviation e and deviation variation rate e
c, the parameter K of the online PID of adjustment in real time
p, K
iand K
d, make PID controller have adaptive ability, thus make system time be in optimum state of a control; Its specific algorithm is:
First, system initial p ID parameter k is obtained by the relay rectification method of relay link
p1, k
i1, k
d1, relay rectification is by fire-control door is fixed on certain aperture, and heating tobacco flue-curing house, after certain hour, system temperature is in a metastable state, then tries to achieve oscillation amplitude A and oscillation frequency w according to the operation curve of system
c, and then set up the algorithm of the initial controling parameters of PID, its calculating formula is as follows:
K
p1=0.6K
c,K
i1=0.5T
c,K
D1=0.125T
c。
K
cfor system-gain, A is sinusoidal magnitude value, and d is return rings amplitude, w
cfor system oscillation frequency, T
cfor system oscillation amplitude, π value is 3.14;
Then, fuzzy controller is by deviation e (that is: the difference of humiture sampled value and humiture setting value) and deviation variation rate e
cobfuscation and quantification, by e and e after obfuscation and quantification
cambiguity solution also combines the parameter tuning table adopting expanding critical proportion degree method to obtain, and draws corresponding location parameter variation delta K by fuzzy controller
p, Δ K
i, Δ K
d, then, the parameter K of the online PID of adjustment in real time
p, K
iand K
d, and by e and e after obfuscation
cbe stored in fuzzy rule base, for next reference, make PID controller have adaptive ability;
Thereafter, the initial controling parameters K of PID is drawn by relay rectification
p1, K
i1, K
d1, and combination draws corresponding location parameter variation delta K by fuzzy controller
p, Δ K
i, Δ K
d, and then set up the algorithm of actual parameter of basic PID controller, its calculating formula is as follows:
K
p=K
p1+ΔK
p,K
i=K
i1+ΔK
i,K
D=K
D1+ΔK
D
K
pfor PID control ratio coefficient, K
icontrol integral coefficient K
dfor controlling differential coefficient, K
p1, K
i1, K
d1be respectively P ratio, integration and differentiation initiation parameter, Δ Kp, Δ Ki, Δ K
dbe respectively drawn by fuzzy controller control ratio, integration and differentiation location parameter variable quantity;
Obtain fuzzy control table by test and vast tobacco flue-curing technician experience accumulation again, meanwhile, adopt integral separation algorithm to avoid saturation integral;
Ratio (P) controls to be make corresponding control adjustment according to current humiture to the deviation of setting humiture:
Dry-bulb temperature P value calculating formula is:
P
1the dry-bulb temperature of the dry-bulb temperature/setting of=reality,
Wet-bulb temperature P value calculating formula is:
P
2the wet-bulb temperature of the wet-bulb temperature/setting of=reality,
Temperature and Humidity Control mode is: work as P
1(P
2) >1 time, illustrate temperature in barn or humidity higher, system is in unbalanced state, need carry out lowering the temperature or the operation of hydrofuge; Work as P
1(P
2during)=1, illustrate that the temperature and humidity in barn is suitable, system is in the state of balance, need carry out keeping current state; Work as P
1(P
2) <1 time, illustrate temperature in barn or humidity on the low side, system is in unbalanced state, need carry out heating up or moisturizing operation;
Integration (I) controls to be carry out control adjustment according to the uniformity coefficient changed in the humiture unit interval in barn:
Dry-bulb temperature I value calculating formula is:
pid.Integral1=[r1(k)-y1(k)]/t,
Wherein y1 (k) is the warm and humid angle value of next target, and r1 (k) is the warm and humid angle value of previous target, and t is the time, and pid.Integral1 represents the theoretical rate of change of wet and dry bulb within the t time;
Wet-bulb temperature I value calculating formula is:
pid.Integral2=[r2(k)-y2(k)]/t
Wherein y2 (k) is the warm and humid angle value of target, and r2 (k) is current warm and humid angle value, and t is the time, and pid.Integral2 represents wet and dry bulb actual rate of change within the t time;
Temperature and Humidity Control mode is: as pid.Integral1=pid.Integral2, illustrates that the change of wet and dry bulb is uniform, does not need through any operation of row;
As pid.Integral1>pid.Integral2, illustrate that the change of wet and dry bulb is excessively slow, if dry bulb, then will open fan blower, accelerate to heat up, if wet bulb, then will close air door, allow humidity rise; As pid.Integral1<pid.Integral2, illustrate that the change of wet and dry bulb is too fast, if dry bulb, then will close fan blower, intensification is slowed down, if wet bulb, then will open air door, allow humidity reduce;
Differential (D) controls to be carry out control adjustment according to the difference of current humiture and target humiture and wet and dry bulb temperature rate of change, and during current humiture arrival target humiture, the rate of change of wet and dry bulb temperature should be 0; In conjunction with the actual conditions of tobacco flue-curing, the algorithm arrangement of employing is: during target humiture-current humiture≤0.5 degree, starts the rate of temperature change calculating wet and dry bulb, and operate accordingly every 6 minutes;
The rate of change calculating formula of previous 6 minutes wet and dry bulbs is:
pid.Differential1=[T1(k)-S1(k)]/t1,
Wherein T1 (k) is the previous 6 minutes warm and humid angle value of target, and S1 (k) is previous 6 minutes current warm and humid angle value, and t is the time, and t=0.1 hour, pid.Differential1 represent the rate of change of previous 6 minutes wet and dry bulbs;
The rate of change calculating formula of next 6 minutes wet and dry bulbs is:
pid.Differential2=[T2(k)-S2(k)]/t2,
Wherein T2 (k) is next 6 minutes warm and humid angle value of target, and S2 (k) is next 6 minutes current warm and humid angle value, and t is the time, and t=0.1 hour, pid.Differential2 represent the rate of change of next 6 minutes wet and dry bulbs;
Temperature and Humidity Control mode is: as pid.Differential1<pid.Differential2, illustrates that the rate of change of wet and dry bulb is in minimizing, does not now need through any operation of row;
As pid.Differential1 >=pid.Differential2: illustrate that the rate of change of wet and dry bulb does not decline, now will do corresponding operation, the rate of change of wet and dry bulb is declined, when arriving target dry humidity, its rate of change is 0.
Further, described control algolithm also combines with the combustion-supporting aided algorithm of PID, combustion fan is precisely controlled, and in conjunction with actual conditions, when the dry-bulb temperature of reality is less than the target dry bulb temperature of setting, combustion fan is opened, and when the dry-bulb temperature of reality is greater than the target dry bulb temperature of setting, combustion fan is closed.
Further, described control algolithm also combines with the hydrofuge aided algorithm of PID, precisely controls hydrofuge air door, setting W
1for the wet-bulb temperature of reality, W
2for the target wet-bulb temperature of setting, work as W
1<W
2time:
At W
2-W
1>0.7 scope, air door is closed; At 0<W
2-W
1≤ 0.7 scope, air door opens 15 °;
Work as W
1>=W
2time:
At 0.5>W
1-W
2>=0 scope, air door opens 30 °; At 1>W
1-W
2>=0.5 scope, air door opens 45 °; At 1.5>W
1-W
2>=1 scope, air door opens 60 °; At 2>W
1-W
2>=1.5 scopes, air door opens 75 °; At W
1-W
2>=2 scopes, air door opens 90 °.
The Temperature and Humidity Control algorithm of bulk curing barn controller of the present invention, adopts the controller of the fuzzy controller comprising PID controller, relay link and correct pid parameter, utilizes PID controller to complete control algolithm, calculate output controlled quentity controlled variable; Relay link is utilized to realize the initial parameter of PID controller; Utilize fuzzy controller, according to deviation e and deviation variation rate e
c, the parameter K of the online PID of adjustment in real time
p, K
iand K
d, thus, accurately can calculate each environmental conditions parameter and variable quantity thereof in barn, make PID controller have adaptive ability, and then realize precisely controlling barn humiture, thus make barn system time be in optimum state of a control.
In barn Temperature and Humidity Control, bulk curing barn controller can automatically according to the insulation of the barn of working control and performance of keeping humidity and coal-fired adjusting performance controling parameters, as poor thermal insulation property or coal-fired combustion value low, then automatically calculate the opening time of proper extension combustion fan, and calculating is suitable for controlling from the temperature spot close to target temperature automatically; If the performance of keeping humidity of barn is poor, then automatically calculate the angle suitably reducing door opening and time, and automatic calculating is suitable for controlling from the humidity point away from target humidity; Otherwise still.By experimental results demonstrate, apply the bulk curing barn controller of Temperature and Humidity Control algorithm of the present invention, can accurately control temperature and humidity, improve flue cured tobacco quality, and ensure the cured effect that coal-fired abundance can reach desirable, greatly reduce labor cost.
Accompanying drawing explanation
Fig. 1 is fuzzy controller basic scheme of the present invention;
Fig. 2 is pid algorithm basic scheme of the present invention;
Fig. 3 is each variable membership degree function of the present invention.
Embodiment
Below in conjunction with drawings and Examples, the present invention is further illustrated.Explanation below adopts the mode exemplified, but protection scope of the present invention should not be limited to this.
The Temperature and Humidity Control algorithm of the bulk curing barn controller of the present embodiment, is adopt the pid algorithm optimized, and is realized the accurate control of humiture by controller; Its controller comprises PID controller, relay link and corrects fuzzy controller three part of pid parameter, wherein: PID controller completes control algolithm, calculates output controlled quentity controlled variable; Relay link realizes the initial parameter of PID controller; Fuzzy controller is according to deviation e and deviation variation rate e
c, the parameter K of the online PID of adjustment in real time
p, K
iand K
d, make PID controller have adaptive ability, thus make system time be in optimum state of a control.
Its specific algorithm is:
First, by relay link, fire-control door is fixed on certain aperture, heating tobacco flue-curing house, after certain hour, system temperature is in a metastable state, then tries to achieve oscillation amplitude A and oscillation frequency w according to the operation curve of system
c, and then set up the algorithm of the initial controling parameters of PID, its calculating formula is as follows:
K
p1=0.6K
c,K
i1=0.5T
c,K
D1=0.125T
c。
K
cfor system-gain, A is sinusoidal magnitude value, and d is return rings amplitude, w
cfor system oscillation frequency, T
cfor system oscillation amplitude, π value is 3.14;
Thus, obtain system initial p ID parameter k
p1, k
i1, k
d1.
Secondly, first by fuzzy controller by deviation e (that is: the difference of humiture sampled value and humiture setting value) and deviation variation rate e
cobfuscation and quantification, then by e and e after obfuscation and quantification
cambiguity solution, and combine the parameter tuning table (see table 1 below) adopting expanding critical proportion degree method to obtain:
Table 1 parameter tuning table and fuzzy control table
Corresponding location parameter variation delta K is drawn by fuzzy controller
p, Δ K
i, Δ K
d, then, the parameter K of the online PID of adjustment in real time
p, K
iand K
d, and by e and e after obfuscation
cbe stored in fuzzy rule base, for next reference, make PID controller have adaptive ability, as shown in Figure 1;
Thereafter, the initial controling parameters K of PID is drawn by relay rectification
p1, K
i1, K
d1, and combination draws corresponding location parameter variation delta K by fuzzy controller
p, Δ K
i, Δ K
d, and then set up the algorithm of actual parameter of basic PID controller, its calculating formula is as follows:
K
p=K
p1+ΔK
p,K
i=K
i1+ΔK
i,K
D=K
D1+ΔK
D
K
pfor PID control ratio coefficient, K
icontrol integral coefficient K
dfor controlling differential coefficient, K
p1, K
i1, K
d1be respectively P ratio, integration and differentiation initiation parameter, Δ Kp, Δ Ki, Δ K
dbe respectively drawn by fuzzy controller control ratio, integration and differentiation location parameter variable quantity;
Obtain fuzzy control table (see table 1 above) by test and vast tobacco flue-curing technician experience accumulation again, meanwhile, adopt integral separation algorithm to avoid saturation integral;
The input quantity of fuzzy parameter is deviation e (k) and the deviation variation rate e of humiture
c(k), the trim amount Δ Kp of output quantity pid parameter, Δ Ki, the linguistic variable of Δ KD, basic domain, fuzzy subset, fuzzy domain.
The subordinate function of each variable is chosen as even trigonometric function, makes each variable membership degree function according to parameter tuning table and fuzzy control table, as shown in Figure 3.
Try to achieve the assignment of each linguistic variable according to the membership function of input/output variable, in the assignment according to linguistic variable, obtain domination set through fuzzy reasoning, the numerical value of each controling parameters is obtained by the defuzzification to this fuzzy control collection.
Ratio controls to be make corresponding control adjustment according to current humiture to the deviation of setting humiture:
Dry-bulb temperature P value calculating formula is:
P
1the dry-bulb temperature of the dry-bulb temperature/setting of=reality,
Wet-bulb temperature P value calculating formula is:
P
2the wet-bulb temperature of the wet-bulb temperature/setting of=reality,
Temperature and Humidity Control mode is: work as P
1(P
2) >1 time, illustrate temperature in barn or humidity higher, system is in unbalanced state, need carry out lowering the temperature or the operation of hydrofuge; Work as P
1(P
2during)=1, illustrate that the temperature and humidity in barn is suitable, system is in the state of balance, need carry out keeping current state; Work as P
1(P
2) <1 time, illustrate temperature in barn or humidity on the low side, system is in unbalanced state, need carry out heating up or moisturizing operation;
Integration control carries out control adjustment according to the uniformity coefficient changed in the humiture unit interval in barn:
Dry-bulb temperature I value calculating formula is:
pid.Integral1=[r1(k)-y1(k)]/t,
Wherein y1 (k) is the warm and humid angle value of next target, and r1 (k) is the warm and humid angle value of previous target, and t is the time, and pid.Integral1 represents the theoretical rate of change of wet and dry bulb within the t time;
Wet-bulb temperature I value calculating formula is:
pid.Integral2=[r2(k)-y2(k)]/t
Wherein y2 (k) is the warm and humid angle value of target, and r2 (k) is current warm and humid angle value, and t is the time, and pid.Integral2 represents wet and dry bulb actual rate of change within the t time;
Temperature and Humidity Control mode is: as pid.Integral1=pid.Integral2, illustrates that the change of wet and dry bulb is uniform, does not need through any operation of row;
As pid.Integral1>pid.Integral2, illustrate that the change of wet and dry bulb is excessively slow, if dry bulb, then will open fan blower, accelerate to heat up, if wet bulb, then will close air door, allow humidity rise; As pid.Integral1<pid.Integral2, illustrate that the change of wet and dry bulb is too fast, if dry bulb, then will close fan blower, intensification is slowed down, if wet bulb, then will open air door, allow humidity reduce;
Differential controls to be carry out control adjustment according to the difference of current humiture and target humiture and wet and dry bulb temperature rate of change, and during current humiture arrival target humiture, the rate of change of wet and dry bulb temperature should be 0; In conjunction with the actual conditions of tobacco flue-curing, the algorithm arrangement of employing is: during target humiture-current humiture≤0.5 degree, starts the rate of temperature change calculating wet and dry bulb, and operate accordingly every 6 minutes;
The rate of change calculating formula of previous 6 minutes wet and dry bulbs is:
pid.Differential1=[T1(k)-S1(k)]/t1,
Wherein T1 (k) is the previous 6 minutes warm and humid angle value of target, and S1 (k) is previous 6 minutes current warm and humid angle value, and t is the time, and t=0.1 hour, pid.Differential1 represent the rate of change of previous 6 minutes wet and dry bulbs;
The rate of change calculating formula of next 6 minutes wet and dry bulbs is:
pid.Differential2=[T2(k)-S2(k)]/t2,
Wherein T2 (k) is next 6 minutes warm and humid angle value of target, and S2 (k) is next 6 minutes current warm and humid angle value, and t is the time, and t=0.1 hour, pid.Differential2 represent the rate of change of next 6 minutes wet and dry bulbs;
Temperature and Humidity Control mode is: as pid.Differential1<pid.Differential2, illustrates that the rate of change of wet and dry bulb is in minimizing, does not now need through any operation of row;
As pid.Differential1 >=pid.Differential2: illustrate that the rate of change of wet and dry bulb does not decline, now will do corresponding operation, the rate of change of wet and dry bulb is declined, when arriving target dry humidity, its rate of change is 0.
As shown in Figure 1, e (k), e
ck () is respectively error current and the error current rate of change of humiture, the e (k), the e that will obtain on the one hand
c(k) obfuscation, then through row fuzzy reasoning, the result obtained by fuzzy reasoning is stored in fuzzy rule base, for next reference, on the other hand by e (k), e
ck () quantizes, obtain parameter tuning table, the data finally obtained by fuzzy reasoning are combined with parameter tuning table, jointly calculate the parameter required for PID controller.
As shown in Figure 2, e (k), e (k-1) be respectively error current and last time sampling error, e (k)=r (k)-y (k), e
ck ()=e (k)-e (k-1), wherein y (k) is Current Temperatures sampled value, and r (k) is Current Temperatures setting value, e
ck () is error current rate of change, u (k) is this PID arithmetic result, and u (k-1) is previous PID arithmetic result, k
p, k
i, k
dbe respectively revised PID control ratio, integration and differentiation coefficient.
This control algolithm also combines with the combustion-supporting aided algorithm of PID, precisely controls combustion fan, combines the pid algorithm optimized, obtain a dry-bulb temperature and control temperature T in advance according to actual conditions that are coal-fired and property of baking chamber
b, temperature T in advance
bvalue may be different because the impact of the factor such as rate of change in the different baking stages, setting T
1for actual dry-bulb temperature, T
2for setting dry-bulb temperature, work as T
1<T
2-T
btime, combustion fan is opened; Work as T
1>=T
2-T
btime, combustion fan is closed.
This control algolithm also combines with the hydrofuge aided algorithm of PID, precisely controls hydrofuge air door, setting W
1for the wet-bulb temperature of reality, W
2for the target wet-bulb temperature of setting.
Work as W
1<W
2time: at W
2-W
1>0.7 scope, air door is closed; At 0<W
2-W
1≤ 0.7 scope, air door opens 15 °;
Work as W
1>=W
2time: at 0.5>W
1-W
2>=0 scope, air door opens 30 °; At 1>W
1-W
2>=0.5 scope, air door opens 45 °; At 1.5>W
1-W
2>=1 scope, air door opens 60 °; At 2>W
1-W
2>=1.5 scopes, air door opens 75 °; At W
1-W
2>=2 scopes, air door opens 90 °.
The Temperature and Humidity Control algorithm of bulk curing barn controller of the present invention, the temperature and humidity controller that can be used for domestic different longitude and latitude area bulk curing barn carries out controlling calculation.