CN114779864A - Classroom temperature and humidity control method for optimizing PID (proportion integration differentiation) parameters based on wolf algorithm - Google Patents
Classroom temperature and humidity control method for optimizing PID (proportion integration differentiation) parameters based on wolf algorithm Download PDFInfo
- Publication number
- CN114779864A CN114779864A CN202210694100.3A CN202210694100A CN114779864A CN 114779864 A CN114779864 A CN 114779864A CN 202210694100 A CN202210694100 A CN 202210694100A CN 114779864 A CN114779864 A CN 114779864A
- Authority
- CN
- China
- Prior art keywords
- temperature
- wolf
- pid
- classroom
- humidity
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05D—SYSTEMS FOR CONTROLLING OR REGULATING NON-ELECTRIC VARIABLES
- G05D27/00—Simultaneous control of variables covered by two or more of main groups G05D1/00 - G05D25/00
- G05D27/02—Simultaneous control of variables covered by two or more of main groups G05D1/00 - G05D25/00 characterised by the use of electric means
Abstract
The invention belongs to the field of temperature and humidity control, and particularly discloses a classroom temperature and humidity control method for optimizing PID (proportion integration differentiation) parameters based on a wolf algorithm, which comprises the following specific steps of: the temperature and humidity acquisition module is used for detecting the temperature and humidity in a classroom and sending temperature and humidity information of the terminal nodes to the ZigBee coordinator through the ZigBee network in a ZigBee networking mode; the ZigBee coordinator is communicated with the WiFi module through a serial port and is sent to the upper computer and the STM32 controller through a TCP/IP protocol; the temperature controller is controlled through PID regulation to drive the heating module and the cooling module to work; iterative updating by utilizing the gray wolf algorithm、And outputting the final PID parameter value to control the temperature. The invention optimizes PID parameters through the wolf algorithm, controls the temperature controller and is effectiveAnd classroom-oriented environment sensing, management and equipment control are realized.
Description
Technical Field
The invention relates to a classroom temperature and humidity control method, in particular to a classroom temperature and humidity control method for optimizing PID (proportion integration differentiation) parameters based on a wolf algorithm.
Background
Due to the continuous update of technological innovation, people enjoy the convenience brought by intellectualization more and more, and particularly, the appearance of intelligent home, so that the intelligent requirements of the people on the classroom are gradually changed from teaching intellectualization to comprehensive intellectualization of the classroom environment. Because the temperature is controlled by a manual switch through a manager in the traditional classroom, and the situation that the personnel leave the equipment and are not closed is easy to occur, the service life of the equipment is shortened, and energy is wasted. Meanwhile, classroom personnel are centralized, and the temperature and humidity of a classroom cannot be effectively fed back and controlled in time, so that a complete data storage, uploading and accurate control scheme becomes extremely important.
The IEEE802.15.4 standard protocol for the ZigBee technology realizes two-way wireless network communication with the advantages of low energy consumption, low complexity, low cost and capability of mutual communication in a short distance, and is mainly used for data transmission among some electronic equipment with short distance, low energy consumption and low transmission rate. As a wireless network communication technology, the ZigBee technology has the characteristics of low power consumption, self-organizing capability, high reliability and the like.
The PID controller is a typical proportional, integral and differential controller, and the PID control algorithm is simple, good in robustness and high in reliability, is suitable for various different conditions, and is easy to implement. The performance of the PID mainly depends on the parameter setting of the controller, different controlled objects and control parameters have different influences on the system, and the parameter setting of the PID mainly depends on a background empirical value. Meanwhile, in the aspect of applying intelligent control, the problem of parameter setting of the traditional PID is that the randomness is strong, temperature and humidity information feedback and real-time control cannot be obtained in time, the randomness of PID parameter setting timing is high, the requirements for high precision, rapidness and low power consumption of temperature and humidity are difficult to achieve, and a good adjusting effect is difficult to achieve for complex conditions.
Disclosure of Invention
Aiming at the defects of the prior art, the invention aims to provide a classroom temperature and humidity control method for optimizing PID parameters based on a wolf algorithm, which can automatically adjust the PID parameters according to detection data and reduce the randomness, the inefficiency and the instability during manual intervention.
In order to realize the purpose, the invention adopts the following technical scheme:
a classroom temperature and humidity control method based on a gray wolf algorithm optimization PID parameter comprises the following specific steps:
the temperature and humidity acquisition module is used for detecting the temperature and humidity in a classroom and sending temperature and humidity information of the terminal nodes to the ZigBee coordinator through the ZigBee network in a ZigBee networking mode;
the ZigBee coordinator is connected with the WiFi module and is sent to the upper computer and the STM32 controller through a TCP/IP protocol;
according to the preset classroom temperature regulation, the temperature controller is controlled through PID regulation to drive the heating module and the cooling module to work, and the mode of PID control PWM waves is monotonously controlled;
the temperature controller is regulated and controlled through the PID to drive the heating module and the cooling module to work specifically through three parameters of the PID:、the temperature of the liquid crystal display is adjusted and controlled by a temperature controller,is a proportionality coefficient;is an integral coefficient;is a differential time coefficient;
utilizing a gray wolfThe algorithm is updated iteratively、And (4) judging the iteration times by taking the fitness value as a judgment updating optimization mode, and finally outputting a PID parameter value to control the temperature controller when the target times is reached.
Further, the specific method for adjusting and controlling the temperature controller by the PID comprises the following steps:
the deviation proportion (P), integral (I) and differential (D) are combined by certain linearity to form control quantityThe controlled object is controlled, and the control formula is as follows:
wherein the content of the first and second substances,
wherein:is a proportionality coefficient;is an integral coefficient;is a differential time coefficient.
Further, the grey wolf algorithm is used for iterative updating and updating、The specific steps of the parameters are as follows:
s1: setting the initialization conditions of the gray wolf location, i.e.、Initial values of parameters;
s2: calculating the fitness value according to the initialization condition of the grey wolf position and ITAE, calculating the fitness values of optimal, suboptimal and third-best solution and endowing the fitness valuesWolf, the remaining values being givenA wolf;
wherein t represents time;
s3: updating the gray wolf position according to a formula;
in the formula、、Respectively representThe distance between the wolf and the prey,respectively representThe current position of the wolf is determined,、is a random vector and is a vector of a random number,the position of the current wolf individual;
s4: re-screening all the gray wolf positions and re-aligning according to the fitness valueAssigning a wolf;
s5: and judging whether the iteration times meet the preset times or not, and jumping to Step 3 if the iteration times do not meet the preset times.
S6: output ofThe location vector of the wolf as an optimum parameter, i.e.、And (4) parameter values.
Furthermore, the STM32 controller is also connected with an LCD display screen and used for displaying classroom temperature information.
Furthermore, the ZigBee coordinator sends the data to an upper computer after the data are processed and the data are connected with a WiFi module in a serial mode, and meanwhile the data are connected with an STM32 controller in a serial mode.
Furthermore, the temperature raising module is a PTC heater, and the temperature lowering module is a semiconductor refrigerating sheet and a fan.
The invention has the beneficial effects that: the invention takes a classroom as a research object, utilizes the sensor to collect data, processes the collected data through the ZigBee coordinator, and transmits the data to the controller and the upper computer. The temperature and humidity data are fully utilized, the comfort level in a classroom is guaranteed, the design is suitable for the classroom, the family, the office and the like, and the model application singleness is solved.
The design combines the technology of Internet of things, adopts the ZigBee networking technology and WiFi wireless transmission, optimizes PID parameters through the Grey wolf algorithm, controls the temperature controller, and effectively realizes classroom-oriented environmental perception, management and equipment control.
Drawings
FIG. 1 is a block diagram of a classroom temperature and humidity control system according to the present invention;
FIG. 2 is a grey wolf scale chart;
FIG. 3 is a gray wolf location update diagram;
FIG. 4 is a flow chart of the method of the present invention;
reference numerals are as follows: 1. an upper computer; an STM32 controller; 3. a temperature controller; 4, LCD display screen; 5, a WIFI module; 6, a Zigbee coordinator; 7. temperature and humidity acquisition module.
Detailed Description
The invention will be further described with reference to the accompanying drawings and the detailed description below:
as shown in fig. 1, classroom temperature control system includes a plurality of humiture collection modules 7, humiture collection modules 7 are connected with zigBee coordinator 6, zigBee coordinator 6 is connected with WIFI module 5 through the serial ports, WIFI module 5 passes through the serial ports respectively with host computer 1 and STM32 controller 2, STM32 controller 2 is connected with temperature controller 3 and LCD display screen 4, temperature controller 3 control intensification module and cooling module action, the module of rising temperature is the PTC heater, the cooling module is semiconductor refrigeration piece and fan, humiture collection modules is temperature and humidity sensor.
A classroom temperature and humidity control method based on a Grey wolf algorithm optimization PID parameter is applied to a classroom temperature control system, and comprises the following specific steps:
the temperature and humidity acquisition module 7 is used for detecting the temperature and humidity in a classroom and sending temperature and humidity information of the terminal nodes to the ZigBee coordinator 6 through the ZigBee network in a ZigBee networking mode;
the ZigBee coordinator 6 is connected with the WiFi module 5 and is sent to the upper computer 1 and the STM32 controller 2 through a TCP/IP protocol;
according to the preset classroom temperature regulation, the temperature controller 3 is controlled through PID regulation to drive the heating module and the cooling module to work, and the mode of PID control PWM waves is monotonously controlled;
the temperature controller 3 is regulated and controlled by the PID to drive the heating module and the cooling module to work specifically through three parameters of the PID:、the temperature controller 3 is adjusted and controlled to be,is a proportionality coefficient;is an integral coefficient;is a differential time coefficient;
iterative update is carried out by utilizing the grey wolf algorithm、And (4) judging the iteration times by taking the fitness value as a judgment updating optimization mode, and finally outputting a PID parameter value to control the temperature controller 3 when the target times are reached.
The specific method for PID regulation and control of the temperature controller comprises the following steps:
the deviation proportion (P), the integral (I) and the derivative (D) are combined by certain linearity to form a control quantityThe controlled object is controlled, and the control formula is as follows:
wherein, the first and the second end of the pipe are connected with each other,
wherein:is a proportionality coefficient;is an integral coefficient;is a differential time coefficient.
As shown in FIG. 4, the grey wolf algorithm is used for iterative update、The specific steps of the parameters are as follows:
s1: setting the initialization conditions for the grey wolf location, i.e.、Initial values of parameters;
s2: calculating the fitness value according to the grey wolf position initialization condition through ITAE, and assigning the fitness value of the optimal, the suboptimal and the third optimal solutionWolf, the remaining values being givenThe wolf is a Chinese wolf with the functions of,
wherein t represents time;
s3: updating the grey wolf position according to a formula;
in the formula、、Each representsThe distance between the wolf and the prey,respectively representThe current position of the wolf is set,、in the form of a random vector, the vector is,is the current location of the wolf individual; FIG. 3 shows a gray wolf location update diagram;
s4: re-screening all the gray wolf positions and re-aligning according to the fitness valueAssigning a wolf;
s5: and judging whether the iteration times meet the preset times or not, and jumping to Step 3 if the iteration times do not meet the preset times.
As shown in FIG. 2, the Grey wolf rating system is(ii) a Using the first three levelsUpdating the location of the wolfThe calculation method of the wolf comprises the following steps:
wherein the content of the first and second substances,is composed ofThe individual location of the grey wolf is,is composed ofIndividual location of the wolf;is composed ofIndividual location of the wolf;to othersIndividual positions of wolves, a and C are coefficient vectors, where:
in the formulaLinearly decreasing between 2 and 0 as a convergence factor,andis [0,1 ]]A random number in between.
The grey wolf algorithm is a novel group intelligent optimization algorithm which is provided by simulating the social grade system and hunting behaviors of grey wolf groups in the nature. To maintain population development, there are 4 hierarchical systems in the wolf population, as shown in FIG. 2, whereIn order to be the highest level of the hierarchy,subject to,Subject toOther gray wolvesIs the lowest level. In the gray wolf algorithm,with possibility of updating, other high-level wolf guidanceTo update its location. In the grey wolf hunting process, the main three stages are divided: surround, hunt, and attack. In the algorithm space, initial positions are randomly assigned. Let the dimension of the population be N, theThe position of the wolf is,. The grey wolf unified location update formula is as follows:
in the formula:the distance that exists between the gray wolf and the game,is the position of the prey, and is,andis a gray wolfGeneration and combinationThe position of the generation, t, is the current number of iterations.
The social ranking of the wolf algorithm can be divided into wolfsWolf of the lower genusCommon wolfAnd the bottom layer wolfFour layers of whichIs responsible for leading the wolf group,assistance ofThe decision is made as to whether to take a decision,listening slaveAndcan also direct the underlying individual. In the gray wolf optimization algorithm,Andrespectively representing a historical optimal solution, a suboptimal solution and a third optimal solution,the remaining individuals are indicated. In the process of the evolution of the algorithm,,andthe system is responsible for positioning the position of a prey and guiding other individuals to finish actions such as approaching, surrounding, attacking and the like, and finally achieves the aim of preying on the prey.
Various other modifications and changes may occur to those skilled in the art based on the foregoing teachings and concepts, and all such modifications and changes are intended to be included within the scope of the appended claims.
Claims (6)
1. A classroom temperature and humidity control method based on a Grey wolf algorithm optimization PID parameter is characterized by comprising the following specific steps:
the temperature and humidity acquisition module is used for detecting the temperature and humidity in a classroom and sending temperature and humidity information of the terminal nodes to the ZigBee coordinator through the ZigBee network in a ZigBee networking mode;
the ZigBee coordinator is communicated with the WiFi module through a serial port and is sent to the upper computer and the STM32 controller through a TCP/IP protocol;
according to the preset regulation of classroom temperature, a PID regulation and control temperature controller drives a heating module and a cooling module to work, and the mode of PID control of PWM waves is monotonously controlled;
the temperature controller is regulated and controlled through the PID to drive the heating module and the cooling module to work specifically through three parameters of the PID:K p 、K i 、K D the temperature of the liquid crystal display is adjusted and controlled by a temperature controller,K p is a proportionality coefficient;K i is an integral coefficient;K D is a differential time coefficient;
iterative updating by utilizing the gray wolf algorithmK p 、K i 、K D And parameters, namely, judging the iteration times by taking the fitness value as a judgment updating optimization mode, and finally outputting PID parameter values to control the temperature controller when the target times are reached.
2. The classroom temperature and humidity control method based on the sirius algorithm for optimizing the PID parameters as claimed in claim 1, wherein the specific method for PID regulation and control of the temperature controller is as follows:
forming a control error according to the given value r (t) and the actual output value y (t)
The deviation proportion (P), the integral (I) and the differential (D) are combined by certain linearity to form a control quantity u (t) to control the controlled object, and the control formula is
Wherein, the first and the second end of the pipe are connected with each other,K p is a proportionality coefficient;K i is an integral coefficient;K D is a differential time coefficient.
3. The classroom temperature and humidity control method based on graywolf algorithm optimization PID parameters as claimed in claim 2, wherein the iterative update using graywolf algorithm is performed to updateK p 、K i 、K D The specific steps of the parameters are as follows:
s1, setting the initialization conditions of the gray wolf position, namelyK p 、K i 、K D Initial values of parameters;
s2, calculating fitness values through ITAE according to grey wolf position initialization conditions, calculating the fitness values of optimal, suboptimal and third-best solutions and giving alpha, beta and delta wolfs, and giving w wolfs to the rest values;
wherein t represents time;
s3, updating the position of the wolf according to a formula;
in the formula、、Respectively represent the distances between alpha, beta, delta wolf and the prey,X α 、X β 、X δ respectively represent the current positions of alpha, beta and delta wolf,、、is a random vector, and X is the position of the current wolf individual;
s4, re-screening all the gray wolf positions, and re-assigning values to alpha, beta and delta wolfs according to the fitness value;
s5, judging whether the iteration times meet the preset times or not, and jumping to Step 3 if the iteration times do not meet the preset times;
s6, outputting the position vector of the alpha wolf as an optimal parameter, namelyK p 、K i 、K D The parameter values.
4. The classroom temperature and humidity control method based on the graying algorithm optimization PID parameter as claimed in claim 1, wherein the STM32 controller is further connected with LCD display screen to display classroom temperature information.
5. The classroom temperature and humidity control method based on the grayish wolf algorithm optimization PID parameter as claimed in claim 1, characterized in that the ZigBee coordinator sends the processed data to the upper computer after being connected with the WiFi module in serial, and simultaneously, the serial is connected with the STM32 controller.
6. The classroom temperature and humidity control method based on sirius algorithm optimization PID parameters as claimed in claim 1, wherein the temperature raising module is a PTC heater and the temperature lowering module is a semiconductor cooling plate and a fan.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210694100.3A CN114779864A (en) | 2022-06-20 | 2022-06-20 | Classroom temperature and humidity control method for optimizing PID (proportion integration differentiation) parameters based on wolf algorithm |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210694100.3A CN114779864A (en) | 2022-06-20 | 2022-06-20 | Classroom temperature and humidity control method for optimizing PID (proportion integration differentiation) parameters based on wolf algorithm |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114779864A true CN114779864A (en) | 2022-07-22 |
Family
ID=82421463
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210694100.3A Pending CN114779864A (en) | 2022-06-20 | 2022-06-20 | Classroom temperature and humidity control method for optimizing PID (proportion integration differentiation) parameters based on wolf algorithm |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114779864A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117092905A (en) * | 2023-10-19 | 2023-11-21 | 济南大学 | Optimal robust control method based on improved aircraft brake cooling fan |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104748298A (en) * | 2015-02-03 | 2015-07-01 | 山东大学 | Temperature control system and method based on sensor network |
CN106896716A (en) * | 2017-04-17 | 2017-06-27 | 华北电力大学(保定) | Micro-capacitance sensor alternating current-direct current section transverter pid parameter optimization method based on grey wolf algorithm |
CN110647147A (en) * | 2019-09-10 | 2020-01-03 | 青岛理工大学 | Path tracking control method for optimizing PID (proportion integration differentiation) based on wolf algorithm |
KR20200059796A (en) * | 2018-11-22 | 2020-05-29 | 제주대학교 산학협력단 | Control system based on learning of control parameter and method thereof |
-
2022
- 2022-06-20 CN CN202210694100.3A patent/CN114779864A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104748298A (en) * | 2015-02-03 | 2015-07-01 | 山东大学 | Temperature control system and method based on sensor network |
CN106896716A (en) * | 2017-04-17 | 2017-06-27 | 华北电力大学(保定) | Micro-capacitance sensor alternating current-direct current section transverter pid parameter optimization method based on grey wolf algorithm |
KR20200059796A (en) * | 2018-11-22 | 2020-05-29 | 제주대학교 산학협력단 | Control system based on learning of control parameter and method thereof |
CN110647147A (en) * | 2019-09-10 | 2020-01-03 | 青岛理工大学 | Path tracking control method for optimizing PID (proportion integration differentiation) based on wolf algorithm |
Non-Patent Citations (1)
Title |
---|
李星等: "灰狼算法在风电水电协同运行中的应用", 《发电技术》 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117092905A (en) * | 2023-10-19 | 2023-11-21 | 济南大学 | Optimal robust control method based on improved aircraft brake cooling fan |
CN117092905B (en) * | 2023-10-19 | 2024-02-02 | 济南大学 | Optimal robust control method based on improved aircraft brake cooling fan |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109270842B (en) | Bayesian network-based regional heat supply model prediction control system and method | |
CN111795484B (en) | Intelligent air conditioner control method and system | |
CN104019526B (en) | Improve PSO algorithm Fuzzy Adaptive PID temperature and humidity control system and method | |
WO2023093820A1 (en) | Device control optimization method, display platform, cloud server, and storage medium | |
CN110410942B (en) | Energy-saving optimization control method and system for cold and heat source machine room | |
CN109708258A (en) | A kind of temperature of ice house feedforward-Fuzzy control system and control method based on load dynamic change | |
CN112415924A (en) | Energy-saving optimization method and system for air conditioning system | |
CN103226348B (en) | A kind of edible fungi mushroom house set of circumstances medium-long range controls system and method | |
CN104833154B (en) | Chilled water loop control method based on fuzzy PID and neural internal model | |
CN109612055A (en) | A kind of feedforward fuzzy control method of air-conditioner water system | |
CN101655272A (en) | Energy-saving control management system of network central air conditioner and method thereof | |
CN109798646B (en) | Variable air volume air conditioner control system and method based on big data platform | |
CN114779864A (en) | Classroom temperature and humidity control method for optimizing PID (proportion integration differentiation) parameters based on wolf algorithm | |
CN111442478A (en) | Air conditioning system optimization control method, intelligent terminal and storage device | |
CN107247407B (en) | Big data self-learning correction control system and method based on cloud architecture | |
CN109212965A (en) | Floor heating temperature control system and method based on particle swarm optimization algorithm | |
CN111254229A (en) | Carbon dioxide incubator control method and system and carbon dioxide incubator | |
CN111222191A (en) | Building energy consumption optimization control method and system based on BIM and RFID | |
CN116520909A (en) | High-value consumable cabinet temperature control method for optimizing fuzzy PID parameters by Harris eagle algorithm | |
CN117093033A (en) | Resistance heating furnace temperature control system for optimizing PID parameters based on particle swarm optimization | |
CN109857177B (en) | Building electrical energy-saving monitoring method | |
CN111415036B (en) | Load optimization distribution method for parallel connection cold machines of central air-conditioning system | |
CN112378052A (en) | Indoor comfort degree adjusting method, device and system, computer equipment and storage medium | |
CN111219856B (en) | Air treatment equipment intelligent optimization group control device and method based on 5G communication | |
CN112947207A (en) | Geothermal source energy-saving method and system based on Internet of things |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20220722 |