Greenhouse environment is a complex and changeable controlled object, and it is impossible to establish an accurate mathematical model.The climate change in Jiangsu and Zhejiang is obvious in four seasons, but the control mode of the existing control system is fixed, which makes it difficult to achieve the desired control effect.Based on the research of leaf vegetable growing environment, a measurement and control system of leaf vegetable greenhouse based on fuzzy PID controller is designed to realize the automatic regulation of leaf vegetable greenhouse environment.Fuzzy reasoning is used to adjust three parameters of the PID controller, which improves the adaptive performance of the system.The experimental results show that the system has stable performance, short response time and small overshoot, and achieves the desired control effect.With the rapid development of computer and network technology, greenhouse environment control is moving towards intelligent and automated direction. Effective regulation and control of greenhouse environment by Internet of Things technology can improve agricultural ecology, improve crop quality and yield.However, the greenhouse environment is a multi-variable, strong coupling, large lag and time-varying controlled object [1], and the climate change in Jiangsu and Zhejiang region is obvious in four seasons, hot and humid in summer, cold and dry in winter, and the temperature and humidity difference between day and night is large. The conventional control methods are difficult to achieve ideal results, while the existing control system has a fixed control mode and can not adapt to environmental changes. Therefore, it is an urgent need for modern precision agriculture to establish an intelligent greenhouse measurement and control system with strong adaptability, fast response and good stability.
At present, the traditional PID control is used in the existing control schemes, but the PID parameters are constant, which can not meet the control requirements of the non-linear system.Therefore, this paper combines the fuzzy theory with the PID control, adjusts the three parameters of the PID controller by using the fuzzy reasoning, improves the adaptability and flexibility of the system, and improves the dynamic performance of the system.In the traditional control field, thermostatic element the more precise the description of the dynamic information of the system, the better the control effect. However, for complex systems, because of too many variables, it is often unable to accurately express the dynamic information of the system. Fuzzy control can be considered to solve this problem.Fuzzy control is a kind of non-linear control method, which does not depend on the precise mathematical model of the controlled object, but sums up the control rules through a large number of practical operation data and expert experience, describes the control strategy with natural language, simulates the decision-making of people to achieve the control of the system.Because the greenhouse environment is complex and changeable, and there are many interference factors, it is difficult for conventional methods to achieve ideal control effect, so it is more appropriate to use fuzzy control to control the greenhouse environment.In the fuzzy control system, the design of the fuzzy controller is the core part. The structure of the controller is shown in Fig. 1. It consists of four parts: fuzzification processing, rule base, fuzzy reasoning and de-fuzzification.In engineering practice, PID control is widely used in industrial and facility agriculture process control because of its simplicity, high reliability and good robustness, and achieves better control effect.In formula (1), Kp, Ki and Kd are proportional, integral and differential coefficients, e (t) = R (t) – C (t), R (t) is the set value, C (t) is the actual measured value, e (t) is the input of the controller, it is the deviation between the set value and the actual measured value, and u (t) is the output of the controller.The regulation of Kp, Ki and Kd in the PID controller will have great influence on the dynamic and static performance of the system. The functions of the three parameters are as follows: (1) proportional control Kp: make the system response sensitive, and can quickly adjust the system error; (2) integral control Ki: the system has steady-state error after entering the steady-state, and Ki is used to eliminate the steady-state error; (3) differential control Kd: lift. Kd is a kind of advanced adjustment, which predicts the trend of system error change and makes the error advance to zero.Leaf vegetable greenhouse environment contains many factors, including environmental temperature, light intensity, air humidity, CO2 concentration, soil moisture and fertility. These environmental factors are interrelated and coupled in the greenhouse environment, acting together on the microclimate environment of greenhouse [4].Environmental temperature is the most important environmental factor affecting leaf vegetable dry matter distribution and leaf growth.If the ambient temperature is low, the growth of leafy vegetable will be slow or even stagnate. Long-term low temperature is more likely to cause low temperature hazards.If the temperature is too high, the respiratory consumption will increase, the dry matter accumulated by leafy vegetable plants will decrease, and the energy content will decrease.Temperature control in greenhouse mainly includes temperature control and cooling control.Temperature control.
When controlling the greenhouse temperature, first close the skylight and side window, then open the internal insulation film and internal circulation to promote the circulation of air in the greenhouse, and then open the heating, air conditioning and other equipment for heating.Wet curtain cooling fan, etc.Relative humidity of air has a great influence on transpiration of leaf vegetables.If the air humidity is too high, the root of leafy vegetable is difficult to breathe, which not only affects the normal growth and development, but also easily induces diseases. If the air humidity is too low, the soil humidity will also decrease, which may lead to crop water shortage and wilting.For leafy vegetables, long-term growth in low air humidity environment tends to lead to small and thick leaves of leafy vegetables, which hinders the growth of leafy vegetables.Humidity control includes humidification and dehumidification.The common humidification methods in the greenhouse include spray humidification and wet curtain humidification. Natural ventilation or forced ventilation can be used in the control of dehumidification in the greenhouse. Under the condition of certain air content in the greenhouse, heating and dehumidification can also be used to reduce the indoor air humidity.Illumination is the energy source of photosynthesis of crops, which affects the quality of seedlings, plant growth and yield.Too much light will burn crops, and the effect of light cooperation will be weakened when the light is insufficient. The control of light in greenhouse includes shading and supplementing light.Among them, shading control can reduce the light intensity inside the greenhouse by opening the inside and outside shading net; supplementary light control can increase the light intensity in the greenhouse by opening supplementary light in order to promote crop growth in the case of continuous rain or insufficient light.CO2 concentration is an indispensable condition for crop photosynthesis, which directly affects the synthesis of organic compounds.CO2 concentration can be controlled by ventilation or CO2 generator.In addition, ambient temperature and humidity are coupled under certain conditions. When the temperature rises, the humidity tends to decrease, and when the temperature drops, the humidity tends to rise.
At the same time, the change of air humidity will affect the ambient temperature, and the change of illumination will also affect the temperature and humidity. For example, when the illumination increases, the temperature will rise, so the greenhouse measurement and control is designed. The output of the system needs to consider the coupling between environmental factors.PID controller is widely used in process control, but its parameter setting is the core content of controller design.Conventional PID controllers use engineering tuning method, and the parameters are usually fixed and unchanged after setting. The adaptability and anti-interference ability of the system are insufficient. Therefore, the parameters Kp, Ki and Kd of the PID controllers are tuned online by using fuzzy control, so that the controllers can respond to the real-time changes of the system environment in a timely manner and make the system have the ability to adapt to the changes of the system operation. More flexibility.Greenhouse measurement and control system is a complex system with multi-variable coupling and time-varying. In theory, if a fuzzy control system can make all the factors affecting the greenhouse environment as the input of the controller, then the output of the controller must be very accurate, but in fact, it is unrealistic to do so, because the more it will be. With more environmental variables as input, the more coupling relationships among environmental factors, the more complex the control system is, and the rules base of the controller can not be defined.From the above analysis of greenhouse environment, we can see that among many environmental factors, temperature and humidity have the most obvious impact on greenhouse environment, followed by light, other factors such as CO2 control is relatively single, and the coupling effect is relatively small.Therefore, the measurement and control of light, temperature and humidity in greenhouse are considered comprehensively in the design of this system, while other factors are not considered for the time being.The structure diagram of the fuzzy PID controller is shown in Figure 3.
When designing the output of the system, the coupling effect of humidity and light is fully considered for comprehensive control.When the regulation of environmental factors send conflict, temperature regulation is the first, humidity is the second.Among them, R (t) is the temperature setting value, C (t) is the actual temperature measurement value, u (t) is the output of the PID controller, is the variable of controlling the temperature and humidity related actuator [7], the input of the controller is the temperature deviation E and the deviation change rate ec, and the increment Kp, Ki and Kd of Kp, Ki and Kd can be inferred by the controller according to the actual operation of the system.According to the actual situation of greenhouse measurement and control system, the fuzzy universe of e, ec, Kp, Ki and Kd is divided into five levels: {NB, NS, ZO, PS, PB}, which means {negative big, negative small, zero, positive small, positive big} respectively, and the scope of discourse is [-4, 4].The membership functions of two input variables e, EC and three output variables Kp, Ki and Kd are triangular membership functions.The control rules adopt the conditional sentence pattern of “if A and B then C”.
According to the principle of fuzzy reasoning, the table of fuzzy control rules is summarized as shown in Table 1.The controller obtains the fuzziness of E and EC by fuzzing the temperature deviation and the rate of variation of the deviation when the system is running. The fuzziness of Kp, Ki and Kd is obtained by querying the fuzzy rule table. Then the fuzziness of the three parameters is fuzzed into specific values by comparing the fuzzy universe, and the new Kp, Ki and Kd are calculated. Finally, the calculation results are replaced by the results. When the output of the system is calculated by the PID control formula, the output is the variable of the actuator related to temperature and humidity control, and the current control combination is deduced from the variable.According to the system requirements, the overall structure of the measurement and control system for leaf vegetable greenhouse is shown in Figure 4.From left to right, the system hierarchy can be divided into three parts: sensor, fan and other hardware devices; embedded gateway; upper application (cloud service and greenhouse management platform).Among them, the embedded gateway is the core part of greenhouse measurement and control system, and is the center connecting the upper software and the lower hardware.The gateway collects real-time data of field sensors and meteorological stations through RS485 serial communication, controls field execution equipment such as fans and pumps. After analyzing and filtering the environmental data, the gateway first stores the data in sqlite, a local embedded database, and then uploads the data to the cloud server for storage in SQL server.Users can also log on to greenhouse management platform through PC or mobile phone for real-time environmental data query, equipment control, live real-time video viewing and automatic operation settings.Leaf vegetable greenhouse environment is complex and changeable, and there are many interference factors. Especially in summer, it is likely to be in a high temperature and humidity environment for a long time.
As the core part of greenhouse measurement and control system, embedded gateway must choose industrial products to ensure its stability and reliability.This system chooses GT6502 embedded industrial computer based on Linux kernel as the embedded core control module.The CPU of this module adopts the mature and high performance industrial processor ARM926EJ. In order to ensure the stability of industrial equipment, the whole board design adopts the whole industry wiring, and the high quality PCB board is selected in material. The stable hardware design can ensure the normal operation of the system for a long time.In addition, the module has multiple power supply protection, anti-static, over-current, anti-backconnection and other protections can effectively ensure reliable operation in harsh environments such as the field.In the measurement and control system of leaf vegetable greenhouse, the main functions of embedded module software are: collecting real-time environmental data, analyzing and storing filtered data; responding to users’data query and equipment control requirements in real time; automatically regulating greenhouse environment according to user settings and current environmental data.According to the function design of embedded module software, its program implementation process is shown in Figure 5.The main thread is responsible for the creation of sub-threads and the recovery of thread resources. The three sub-threads created are listening threads, disconnection detection threads and automatic control threads.Automatic control: Collect real-time environmental data, analyze and store them after filtering, and input the current environmental data into the fuzzy PID controller to control the greenhouse environment according to the output of the control.Based on the idea of high cohesion and low coupling software design [9], the system divides the server module into communication server and data server according to its function.Communication server is responsible for communication with embedded gateway and greenhouse management platform.At present, the server is applied in the agricultural demonstration base. Considering that the application scenario may be expanded, the number of users and devices may increase, the communication realization needs to be able to respond to the flexible number of users and concurrent needs, and realize the automatic resource allocation, so the communication server is based on the C development under Linux, and the multi-channel I/O multiplexing model epoll is chosen to realize the communication. Concurrent, through the creation of thread pools to achieve load balancing connection.The data server is responsible for the storage of environmental information and the query of historical data, and the HTTP protocol is used to realize the query and response of data.The two modules are designed separately and developed independently to ensure that communication services and data services do not affect each other. Inter-process communication is used to realize the communication between modules.In order to verify the actual operation effect of the system, the subject tested the Liuhe Agricultural Demonstration Base of Jiangsu Academy of Agricultural Sciences, and selected a multi-span lettuce greenhouse in the demonstration base as the implementation site.The lettuce greenhouse consists of four regions, each region contains two light, temperature and humidity triad sensors. There are eight triad sensors in the whole greenhouse. The greenhouse has side windows, internal and external shading, circulating fans, water pumps and other executing equipment. Four high-definition network cameras are also connected to the greenhouse for viewing real-time video.A weather station with six sensors including light, temperature, humidity, wind speed, wind direction and rainfall is installed outside the greenhouse to sense outdoor environmental information.
The test time is December 12, 2016. The temperature and humidity of the greenhouse environment are selected as the test object, and the temperature and humidity regulation status from 9:00 to 16:00 is tested.Because lettuce is in the lotus stage at present, the optimum temperature range for growth is 18-22 C and humidity is 70%-80%. Therefore, the set temperature value is 20 C and humidity value is 75%.As shown in Fig. 6, the range of temperature change in greenhouse is 17.5-22.3 C and humidity is 73.2%-83.1%. The data show that the system works normally and responds in time according to the set value, keeping the temperature and humidity in a reasonable range, achieving the desired control effect.The measurement and control system of leaf vegetable greenhouse based on fuzzy PID controller is constructed.Through the study of leaf vegetable growth environment, the parameters of PID controller are adjusted by using fuzzy reasoning, which improves the dynamic performance of the system and realizes the automatic control of leaf vegetable greenhouse environment.Experiments show that the system runs stably, responds quickly and has strong robustness.