Greenhouse temperature control method and system based on chaotic particle swarm PID controller
By introducing the particle swarm algorithm improved by Logistic chaos sequence into the agricultural greenhouse temperature control system, the parameter tuning of the PID controller is optimized, the problem of nonlinear changes in system parameters and local optimal solutions is solved, and a more efficient and stable greenhouse temperature is achieved. manage.
Patent Information
- Application Number
- CN202410861678.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-09-27
AI Technical Summary
Due to the uncertainty of the external environment and internal planting conditions of the existing agricultural greenhouse temperature control system, it is difficult to achieve ideal control of system parameters. The traditional PID controller cannot effectively cope with nonlinear changes, and the intelligent algorithm is prone to falling into trouble during the parameter tuning process. local optimal solution.
The particle swarm algorithm (CPSO) improved by Logistic chaos sequence is introduced to optimize the parameter setting of the PID controller through adaptive dynamic inertia weight and chaotic disturbance mechanism, and construct a chaotic particle swarm PID controller for greenhouse temperature control.
It improves the response speed, adjustment time and control accuracy of the system, reduces energy consumption, enhances the stability and economy of temperature control, avoids the trap of local optimal solutions, and achieves more efficient greenhouse temperature management.
Smart Images

Figure CN118708007A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of greenhouse temperature intelligent control, and in particular to a greenhouse temperature control method and system based on a chaotic particle swarm PID controller. Background Art
[0002] At present, the temperature control of agricultural greenhouses is still in the development stage. The existing control systems mostly take some equipment elements of the greenhouse as the control target, and some operations still need to be implemented manually, with a low level of intelligence. The main reason is that the greenhouse control system has strong uncertainty due to the influence of external environment and changes in internal crops. The strongly coupled time-varying characteristics of variables such as temperature, humidity, ultraviolet intensity, and CO2 concentration make it difficult to decompose and coordinate the system. For such a large inertia and nonlinear system, conventional technical means are difficult to seek ideal control, especially when the parameters of the controlled object are affected by nonlinear factors and change, the control parameters of the traditional controller PID (proportion integration difference) cannot change accordingly, so it is difficult to achieve the goal of high efficiency and energy saving. If the system parameters of PID are optimized in real time during the temperature adjustment process, the uncertainty effects such as nonlinear changes in system parameters can be effectively eliminated to meet the needs of precise control of agricultural greenhouse temperature.
[0003] Artificial intelligence algorithm is a method inspired by the laws of nature to solve complex optimization problems by simulating the collaboration, learning and adaptability of the biological world. It is widely used in engineering calculations. In recent years, it has also been used in the parameter setting of greenhouse temperature control. Compared with traditional controllers without parameter setting, the control design using intelligent algorithms as parameter setting tools has overcome the difficulty of accurately selecting system parameters in greenhouse environments with nonlinearity, time lag and multiple interferences to a certain extent. However, the optimization process of system parameters still has the problem of high sensitivity to initial values and easy to fall into local optimal solutions, which affects the final results of parameter setting and control system objectives.
[0004] Therefore, the improved particle swarm optimization algorithm (Chao Particle Swarm Optimization, CPSO) based on Logistic chaotic sequence is introduced. The CPSO algorithm has the global optimization and fast convergence capabilities of PSO. At the same time, the quality of the initial population is improved through the Logistic chaotic sequence, and the perturbation mechanism is used to increase the escape ability when the iteration is stagnant. Based on embedded technology, the constructed CPSO-PID model is used for actual greenhouse temperature control, providing theoretical basis and technical support for parameter adjustment and energy consumption management of the temperature control system. Summary of the invention
[0005] In view of the problems that PSO is highly sensitive to initial values and is prone to falling into local optimal solutions during the system parameter optimization process, the purpose of the present invention is to provide a greenhouse temperature control technology that uses an improved particle swarm algorithm to perform PID controller parameter tuning. The improved particle swarm algorithm (Chao Particle Swarm0ptimization, CPSO) based on Logistic chaotic sequence is introduced, and the constructed CPSO-PID model is used for actual greenhouse temperature control based on embedded technology, providing a theoretical basis and technical support for parameter adjustment and energy consumption management of the temperature control system.
[0006] In order to achieve the above technical objectives, the present application provides a greenhouse temperature control method based on a chaotic particle swarm PID controller, comprising the following steps:
[0007] Based on the target greenhouse, a greenhouse temperature control system including a PID controller is constructed to control the temperature of the target greenhouse;
[0008] Based on the particle swarm optimization algorithm PSO, the algorithm is improved by introducing the Logistic chaotic sequence, the parameters of the PID controller are adjusted, and the chaotic particle swarm PID controller is constructed. The temperature of the target greenhouse is controlled by the chaotic particle swarm PID controller.
[0009] Preferably, in the process of constructing a greenhouse temperature control system, the heat exchange between the air and the planting soil is taken into consideration, and the air heat change amount used to describe the energy balance of the air in the greenhouse is constructed = the heat exchange amount of the greenhouse cover layer + the heat exchange amount of the soil surface + the heat exchange amount of the vents + the heat exchange amount of the crop leaves + the absorbed sunlight radiation - the heat absorbed by the plant transpiration + the heat released by the temperature control facility.
[0010] Preferably, in the process of constructing the greenhouse temperature control system, the transfer function of the greenhouse temperature control system is expressed as:
[0011]
[0012] In the formula, τ=t d , K is the static gain; T is the time constant; τ is the lag time, V is the greenhouse space, ρ is the air density, C ρ is the specific heat of gas at constant volume, C h is the electric-to-heat conversion rate, s represents the variable in the inertia link of the control system, t d Indicates a delay in facility heating time.
[0013] Preferably, in the process of designing a PID controller, the control form of the PID controller is:
[0014] Δd(t)=Kp [e(t)-e(t-1)]+K i e(f)+K d [e(t)-2e(t-1)+e(k-2)]
[0015] In the formula, e(t) is the deviation between the input value and the output value, K p , K i , K d They are weighted forms of the system error signal and the integral and differential components respectively.
[0016] Preferably, in the process of tuning the parameters of the PID controller, the K p , K i , K d Perform adjustment.
[0017] Preferably, in the process of improving the particle swarm optimization algorithm PSO, based on the particle swarm optimization algorithm PSO, an adaptive dynamic inertia weight coefficient is used as an adaptive weight of the particle swarm optimization algorithm PSO.
[0018] Preferably, in the process of improving the particle swarm optimization algorithm PSO, a Logistic chaos mapping method is applied to form a uniform state of initial particle distribution, and chaotic variables are used to traverse the entire search space to improve the particle swarm optimization algorithm PSO.
[0019] Preferably, in the process of temperature control by the chaotic particle swarm PID controller, the specific process of the chaotic particle swarm PID controller for temperature control of the target greenhouse is as follows:
[0020] Step 1. Set the PID control parameter K p , K i , K d as the optimization object; according to the current input value r(t) and the calculated output value y(t), the error function e(t) and de / dt are calculated to obtain the input signal of the greenhouse temperature control system;
[0021] Step 2. Use the Logistic chaotic sequence to initialize the particle swarm, randomly assign the positions and velocities of all particles, and assign an initial inertia weight to each particle;
[0022] Step 3. Calculate the fitness ITAE of each particle and sort the particles in the population of size N according to the fitness value;
[0023] Step 4. Determine the population diversity: If the diversity is lower than the threshold, activate the chaotic perturbation mechanism to interfere with the first N / 2 particles in the solution set, and randomly replace the original particles selected in the population with new particles; otherwise, go to Step 5;
[0024] Step 5. Calculate the ITAE of the disturbed particles again. Each particle moves with reference to the optimal position experienced by itself and the entire population, update the position and velocity of the particle, and generate a new generation of particles.
[0025] Step 6. Use the K of the particle in the current iteration p , K i , K d Calculate the PID controller adjustment signal d(t);
[0026] Step 7. Define the error function between the input and output signals in the PID controller as e(t) = r(t) - y(t), and calculate its result;
[0027] Step 8. Determine whether the termination condition is met. If the optimization error is not met or the maximum number of iterations is not reached, go to Step 3; otherwise, go to Step 9;
[0028] Step 9. Stop the process and output parameter K p , K i , K d , get the optimal output d(t) value, calculate the optimal control output value y(t) according to the transfer function relationship of the controlled object, and realize closed-loop control.
[0029] The present invention discloses a greenhouse temperature control system based on a chaotic particle swarm PID controller, comprising:
[0030] A system building module is used to build a greenhouse temperature control system including a PID controller based on a target greenhouse, so as to control the temperature of the target greenhouse;
[0031] The temperature control module is used to adjust the parameters of the PID controller based on the particle swarm optimization algorithm PSO. After improving the algorithm by introducing the Logistic chaotic sequence, the chaotic particle swarm PID controller is constructed to control the temperature of the target greenhouse through the chaotic particle swarm PID controller.
[0032] Preferably, the temperature control module is also used to control the temperature of the target greenhouse through a chaotic particle swarm PID controller. The specific process is as follows:
[0033] Step 1. Set the PID control parameter K p , K i , K das the optimization object; according to the current input value r(t) and the calculated output value y(t), the error function e(t) and de / dt are calculated to obtain the input signal of the greenhouse temperature control system;
[0034] Step 2. Use the Logistic chaotic sequence to initialize the particle swarm, randomly assign the positions and velocities of all particles, and assign an initial inertia weight to each particle;
[0035] Step 3. Calculate the fitness ITAE of each particle and sort the particles in the population of size N according to the fitness value;
[0036] Step 4. Determine the population diversity: If the diversity is lower than the threshold, activate the chaotic perturbation mechanism to interfere with the first N / 2 particles in the solution set, and randomly replace the original particles selected in the population with new particles; otherwise, go to Step 5;
[0037] Step 5. Calculate the ITAE of the disturbed particles again. Each particle moves with reference to the optimal position experienced by itself and the entire population, update the position and velocity of the particle, and generate a new generation of particles.
[0038] Step 6. Use the K of the particle in the current iteration p , K i , K d Calculate the PID controller adjustment signal d(t);
[0039] Step 7. Define the error function between the input and output signals in the PID controller as e(t) = r(t) - y(t), and calculate its result;
[0040] Step 8. Determine whether the termination condition is met. If the optimization error is not met or the maximum number of iterations is not reached, go to Step 3; otherwise, go to Step 9;
[0041] Step 9. Stop the process and output parameter K p , K i , K d , get the optimal output d(t) value, calculate the optimal control output value y(t) according to the transfer function relationship of the controlled object, and realize closed-loop control.
[0042] The present invention discloses the following technical effects:
[0043] The present invention improves the quality of the PSO initial population by introducing the Logistic chaotic sequence, and reinitializes some particles to jump out of the local optimal solution when the iteration stagnates. The CPSO-PID controller prepared by the present invention can capture the overall system knowledge more quickly to get rid of oscillation, and the performance parameters such as the system's response speed, adjustment time, and overshoot are significantly improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0045] Figure 1 It is the chaotic particle swarm PID controller described in the present invention;
[0046] Figure 2 is the Logistic mapping bifurcation diagram of the present invention;
[0047] Figure 3 It is the chaotic particle swarm PID control process described in the present invention;
[0048] Figure 4 is a step response curve of each controller described in the present invention;
[0049] Figure 5 The indoor and outdoor settings and solar radiation of the greenhouse on the first and second days of the present invention;
[0050] Figure 6 The energy consumption comparison of the greenhouse heating system controlled by GA-PID and PID based on the first day and the second day according to the present invention;
[0051] Figure 7 The third and fourth day greenhouse indoor and outdoor setting temperatures and solar radiation of the present invention;
[0052] Figure 8 It is a comparison of energy consumption of the greenhouse heating system controlled by using CPSO-PID and PSO-PID based on the third and fourth days as described in the present invention. DETAILED DESCRIPTION
[0053] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0054] like Figure 1-8 As shown in the figure, due to the complex time-varying characteristics of multiple factors in the agricultural greenhouse temperature control system, the PID control process needs to use an intelligent algorithm to optimize the system parameters in real time to eliminate the uncertainty caused by its nonlinear changes. In view of the fact that PSO is highly sensitive to initial values and easily falls into local optimal solutions during the system parameter optimization process, the present invention proposes a greenhouse temperature control technology that uses an improved particle swarm algorithm to adjust the PID controller parameters. The controller consists of a traditional PID controller and a p , K i , K d The CPSO algorithm is tuned (the CPSO algorithm has the global optimization and fast convergence capabilities of PSO, and at the same time improves the quality of the initial population through the Logistic chaotic sequence, and uses the perturbation mechanism to increase the ability to escape when the iteration is stagnant). The quality of the PSO initial population is improved by introducing the Logistic chaotic sequence, and some particles are reinitialized to jump out of the local optimal solution when the iteration is stagnant. Simulation experiments show that the CPSO-PID controller can capture the overall system knowledge more quickly to get rid of oscillation. The response speed, adjustment time, overshoot and other performance parameters of the improved control system are significantly improved. Through the full-scale physical test of the multi-span greenhouse, it is further verified that the CPSO-PID control can improve the heating control efficiency and reduce the ineffective energy consumption compared with PID, GA-PID, and PSO-PID control in similar temperature control scenarios, showing better adjustment accuracy and adaptability when setting temperature rise and fall, thereby greatly improving the economy and stability of the temperature control process.
[0055] The present invention proposes a greenhouse temperature control technology for PID controller parameter tuning using an improved particle swarm algorithm, which includes the following contents:
[0056] Greenhouse temperature control system model:
[0057] Greenhouses in different regions have different climate conditions, and their temperature control system model structures and parameters vary greatly. In order to reduce the complexity of model calculation, the controlled target is simplified as follows: the air in the greenhouse is evenly distributed and there is no heat exchange with the planting soil. Only the one-dimensional longitudinal transfer of the internal soil temperature is calculated, and the lateral migration vector is ignored. The crop canopy temperature in the system is kept evenly distributed. This gives the greenhouse microclimate temperature system control model, and the formula is as follows:
[0058]
[0059] Where T out (t) and T in (t) are the outdoor and indoor temperatures at time t, K; V is the greenhouse space, m 2 ; ρ is the air density, kg / m 3 ; cρ is the specific heat of gas at constant volume, J / (kg·K); k is the energy conversion coefficient of sunlight radiation absorbed by greenhouse air, dimensionless; h c is the convective heat exchange coefficient between the greenhouse cover and indoor air, W / (m 2 ·K); A c is the greenhouse cover area, m 2 ; λE(t) is the crop evaporation potential rate at time t, W / m 2 ; V in is the indoor ventilation rate, m 3 / s;Q rad (t) is the solar radiation received by the greenhouse cover at time t, W / m 2 ;Q heat (t) is the output power of the temperature control facility at time t, W; t d Delay for heating the facility, s.
[0060] However, since soil is the largest energy storage medium in the greenhouse system, the present invention believes that the heat exchange between the air and the planting soil here will affect the calculation results and should be considered. In addition, the heat exchange between the air and the crop leaves also needs to be properly analyzed. In the heat exchange, the energy balance of the air in the greenhouse can be described as: air heat change = greenhouse cover heat exchange + soil surface heat exchange + vent heat exchange + crop leaf heat exchange + absorbed sunlight radiation - heat absorbed by plant transpiration + heat released by temperature control facilities. Therefore, formula (1) can be rewritten as:
[0061]
[0062] Among them, Q heat (t) = C h Cond(t) (3)
[0063] Where VR is the indoor ventilation rate, m3 / s;h s and h p are the convective heat exchange coefficients between soil and crop leaves and indoor air, W / (m 2 ·K); A p is the leaf area of greenhouse crops, m 2 ; k' is the light transmittance of the greenhouse cover, %; C h is the electric heat conversion rate, %; Cond(t) is the on-demand output of the temperature control facility at time t, W.
[0064] Arrange equations (2) and (3) to obtain equation (4):
[0065]
[0066] Definition: M(t) = h c A c +h s A s +ρc ρ VR+2h p A p (5)
[0067] From the above formula, we can see that the parameter M(t) is related to the greenhouse structure and internal environmental characteristic parameters, including: greenhouse cover, soil, area and heat exchange coefficient of planted crop leaves, as well as air density, specific heat capacity and indoor ventilation rate.
[0068] Regarding the influence of crop transpiration, the present invention adopts the Penman-Monteith equation and the Bonn ratio method
[12] , and derives the relationship between crop transpiration and indoor environmental parameters as follows:
[0069] λE(t)=0.28Q rad (t)+74.9VPD (6)
[0070]
[0071] Where: VPD is the indoor air saturated water vapor pressure difference, kPa; RH is the relative humidity of the air, %.
[0072] Combining equations (4) to (7), we get:
[0073]
[0074] From the above derivation, we can know that this system is a multi-factor complex time-varying system. To facilitate further derivation, let the intermediate variable N(t):
[0075] N(t)=M(t)T out (t)+kQ rad (t)Ac -λE(t)A c (9)
[0076] Substituting equations (5) and (9) into equations (4) and (8), we obtain equation (10):
[0077]
[0078] The intermediate variable N(t) is the outdoor temperature T out (t), crop evaporation potential rate λE(t), and the amount of solar radiation received by the cover layer Q rad (t) and other parameters are treated as interference items to simplify the calculation.
[0079] Referring to the observation data of a multi-span greenhouse in a certain experimental station from 8:00 to 18:00 for one month, the dynamic changes of M(t) were sorted out, and its fluctuation range was [36342.153, 36670.481], the mean was 36506, and the relative average change rate was only -0.42% to 0.44%. Therefore, M(t) can be regarded as a constant and expressed by the mean M', then formula (10) is transformed into formula (11).
[0080]
[0081] N′(t)=M′(t)T out (t)+kQ rad (t)A c -λE(t)A c (12)
[0082] Perform Laplace transform on both sides of equation (11), and substitute equation (12) into equation (13).
[0083]
[0084] N′(t)=M′(t)T out (t)+kQ rad (t)A c -λE(t)A c (14)
[0085] It is not difficult to find from (13) that the time-varying system can be approximated as a first-order inertia with time lag link under interference conditions, and Cond(s) is the transfer function of the on-demand output of the temperature control facility. The derived temperature system is nested with the classic first-order inertia with time lag link, and equations (15) and (16) are the transfer functions of the greenhouse temperature control system.
[0086]
[0087] in:
[0088] Where: K is the static gain; T is the time constant; T is the lag time.
[0089] 2. CPSO-PID controller structure:
[0090] The system parameters of the traditional PID controller cannot be adjusted automatically as the parameters of the controlled object change, making it difficult to obtain the optimal control of the time-varying system. The particle swarm algorithm has been introduced into the field of control system optimization because of its powerful optimization ability and the ability to complete adaptive parameter tuning, but the actual tuning process is not stable. In this regard, the core issues are: ① The uncertainty of the PSO optimization process makes the algorithm easy to fall into the local optimal solution, making the parameter optimization results volatile; ② The control results are highly sensitive to the initial values of the optimization parameters, and the particle population is often not configured ideally when it is randomly initialized. In order to solve the above problems and enhance its parameter optimization performance, many improvement methods have been proposed. For example: by improving the inertia weight and acceleration coefficient in the speed update calculation, a hybrid PSO algorithm with linear decreasing inertia weight and second-order oscillation to maintain population diversity is obtained; a cosine time-varying PSO algorithm that uses a dynamic acceleration coefficient to balance global and local searches and modify the inertia weight value range according to the distance between the real-time and average values of fitness; differential evolution is used to implement crossover selection on particles that fall into the local optimal to maintain the diversity of particles in the population, and an evolutionary differential PSO hybrid algorithm is obtained. But in fact, the randomness of the PSO algorithm cannot ensure the traversal of the solution space, and the inability to accurately lock the coordinates of the optimal solution is the fundamental reason for being trapped in the local extreme value. The chaotic mapping, because of its random trajectory and ergodic characteristics, makes the target not repeat all positions in the feasible domain according to the established development law. Based on the above reasons, the present invention adopts PID control adjusted by PSO parameters, and selects chaotic mapping as an improved mechanism of PSO, so as to establish a CPSO-PID greenhouse temperature control model. It has been verified by simulation and actual experiments that the temperature control effect of the controller is good. Its specific control structure is as follows Figure 1 shown.
[0091] PID controllers are generally linear in form, and control is accomplished by the deviation e(t) between the input value r(t) and the output value y(t):
[0092] e(f)=r(f)-y(t)(17)
[0093] By defining the controller output d(t)
[0094]
[0095] The proportion, integration and differentiation of the deviation are described in the form of linear superposition. The commonly used incremental digital PID control form is:
[0096]
[0097] In the formula, K p , K i , K d They are weighted forms of the system error signal and the integral and differential components respectively. The controller drives the controlled object by calculating the control signal, and its performance depends entirely on the rationality of the above three parameter settings.
[0098] 3. Particle swarm optimization algorithm based on Logistic chaotic sequence:
[0099] 3.1. Particle Swarm Optimization Algorithm:
[0100] The particle swarm optimization algorithm (PSO) uses the particles in the feasible domain space to continuously move in each iteration to achieve the optimization purpose. The basic algorithm updates the state according to the following formula:
[0101]
[0102] Where: i is the number of particles; v ij is the velocity of particle i in j-dimensional space, x ij is the position of particle i in j-dimensional space, h is the number of iterations; D is the dimension of the particle; c1, c2 are acceleration coefficients; w is the particle inertia weight; r1, r2 are random numbers in the interval [0, 1].
[0103] Commonly used error performance indicators include ISE, IAE, ITAE, ISTE, etc. The present invention uses the ITAE indicator because the control system running according to the indicator criteria has less oscillation in the immediate response and is more robust to parameters. The indicator can better repair long-standing errors. The lower the value, the better the performance, which can be expressed by the following formula:
[0104]
[0105] Where f is the algorithm fitness function, i.e., ITAE error equation; f avg is the average fitness of the algorithm; f min . is the minimum value of algorithm fitness.
[0106] 3.2. Adaptive weight of particle swarm algorithm:
[0107] Since this parameter determines the global search ability and local search ability of the particle swarm: a large value is conducive to search, but the convergence speed is slow; a small value accelerates convergence, but it is easy to fall into local extreme values. If you want particles to be able to balance search ability and convergence speed according to different conditions, each particle needs to be able to dynamically change its inertia weight w value during the search process to improve the optimization performance. For individuals whose objective function values are higher than the average target value, the inertia weight w value is small, which protects the particles; for individuals whose objective function values are lower than the average target value, the inertia weight w value is large, which is conducive to allowing particles to converge to the optimal solution. The dynamic adjustment mechanism of the inertia weight optimizes the optimization ability in real time. The present invention adopts an adaptive dynamic inertia weight coefficient, and the formula is as follows:
[0108]
[0109] Where: max and ω min are the upper and lower thresholds of the weight, ω max =0.9,ω min =0.4.
[0110] 3.3. Introducing Logistic Chaotic Sequence:
[0111] Although the initialization of the particle swarm ensures the randomness of the particles, some particles deviate excessively from the global optimal solution, increasing the moving distance and thus reducing the convergence efficiency of the algorithm; some particles are trapped in the local optimal solution, reducing the overall quality of the population solution. Chaotic mapping is a bounded nonlinear system with a deterministic dynamic form. Although it also has uncertain characteristics, its behavior trajectory experiences the entire domain in the attraction domain. For this reason, the chaotic sequence generated by the Logistic mapping is introduced into the PSO, which increases the ergodicity of the system while retaining the randomness. Chaos, which seems to be a random movement, is actually the sensitivity of the long-term behavior of the system to the initial conditions. The "butterfly effect" can be understood as a small difference in the initial value of the system that may change significantly after multiple iterations. The present invention applies the Logistic chaotic mapping method to form a uniform state of the initial distribution of particles, and uses chaotic variables to traverse the entire search space. This method improves the quality of the initial population, and activates the interference mechanism to replace some particles when the iteration stagnates to jump out of the local optimal solution.
[0112] Logistic mapping is one of the classic methods of chaotic systems and has been applied in various research fields in recent years. Figure 2 As shown, the corresponding expression is:
[0113] α (h+1)j =μα hj (1-α hj ) h=0,1,2,…,α j∈(0,1) (23)
[0114] Where: h is the number of chaotic traversal times; a j is the j-th dimension chaotic variable, α j ∈(0, 1); initialize to get n-dimensional random variable α ij =Rand(), (j=1, 2,…, n); m is the bifurcation coefficient, which takes a value of 4.
[0115] By traversing the population n-1 times through the above formula, we can get α (i+1)j =μα ij (1-α ij ), i∈[1, n-1], j∈[1, n]. Then map the Logistic sequence to the solution space according to the following formula, and take an integer upward to correct the position of particle i:
[0116] x ij =[1+(m-1)α ij ] (twenty four)
[0117] The particle swarm population diversity is calculated according to the following formula. If the diversity is lower than the set threshold, the chaotic interference mechanism is activated.
[0118]
[0119] In the formula: h is the number of chaotic mechanism traversal times; n is the number of particles; r is the maximum value of the search radius; is the size of the i-th particle in the j-th dimension during the h-th traversal; is the mean of the individuals in the jth dimension, the threshold The coefficient h is taken as 0.4.
[0120] After the chaos mechanism is activated, the first half of the N / 2 individuals in the solution set are disturbed by equation (26) according to the order of fitness values, and the variable The perturbation intensity can be obtained by the perturbation deviation CDD(x ij ) to adjust, and its value is calculated by the following formula:
[0121] CDD(x ij )=[δ(Hh)Rand()] (26)
[0122] Where: H is the maximum number of chaotic traversals; h is the current number of traversals; d is the proportional factor; Rand() is a random number in the interval [0, 1].
[0123] Each iteration recalculates the new position of the particle and selects the chaotic traversal H times during the iteration process The optimal particle generated in (h=1, 2, ..., H) is used as a new particle, and the new particle after disturbance calculated by the following formula replaces the original particle. This improves the diversity of the population, enhances the global optimization ability, and jumps out of the local optimal solution.
[0124]
[0125] 4. PID complete control process based on chaotic particle swarm improvement:
[0126] The improved PID temperature control process based on chaotic particle swarm takes the deviation e(t) and deviation variation rate de / dt of the instant temperature value collected in the greenhouse and the set temperature value as input, and the corresponding parameter K of PID p , K i , K d as the optimization object.
[0127] The specific steps of optimizing the PID controller of the temperature control system based on chaotic particle swarm are as follows:
[0128] Step 1. Set the PID control parameter K p , K i , K d As the optimization object. According to the current input value r(t) and the calculated output value y(t), the error function e(t) and de / dt are calculated to obtain the input signal of the greenhouse temperature control system.
[0129] Step 2. Use the Logistic chaotic sequence to initialize the particle swarm, randomly assign the positions and velocities of all particles, and give each particle an initial inertia weight.
[0130] Step 3. Calculate the fitness ITAE of each particle and sort the particles in the population of size N according to the fitness value.
[0131] Step 4. Determine the population diversity. If the diversity is lower than the threshold, activate the chaotic perturbation mechanism to interfere with the first N / 2 particles in the solution set. And randomly replace the original particles selected in the population with new particles. Otherwise, go to Step 5.
[0132] Step 5. Calculate the ITAE of the disturbed particle again. Each particle moves with reference to the optimal position experienced by itself and the entire population. Update the position and velocity of the particle and generate a new generation of particles.
[0133] Step 6. Use the K of the particle in the current iteration p , K i , K d Calculate the PID controller adjustment signal d(t).
[0134] Step 7. Define the error function between the input and output signals in the PID controller as e(t) = r(t) - y(t), and calculate its result.
[0135] Step8. Determine whether the termination condition is met. If the optimization error does not meet the condition or does not reach the maximum number of iterations, go to Step3; otherwise, go to Step9.
[0136] Step 9. Stop the process, output parameters Kp, Ki, Kd, and obtain the optimal output d(t) value. According to the transfer function relationship of the controlled object, calculate the optimal control output value y(t) to achieve closed-loop control.
[0137] PID control process based on parameter optimization of chaotic particle swarm Figure 5 As shown:
[0138] 5. Results and analysis:
[0139] The simulation experiment was implemented in the Simulink environment of Matlab2016b, and the effects of CPSO, PSO and genetic algorithm (GA) on PID controller under control parameter optimization were compared. The feasibility of the proposed control method was evaluated by comparing the convergence speed of the error performance index ITAE, the optimal solution of the parameters to be optimized Kp, Ki, Kd, the system deviation e(t) (ry response) and the controller output d(t). The computer configuration is I7-8700CPU, 16G memory. The greenhouse system transfer function K, T, t is measured in the same greenhouse environment as the full-scale physical test below: the indoor temperature is 16.9℃, the outdoor temperature is 12.1℃, and the wind speed is 1.6m / s. Initially, the heating system is turned off until the indoor and outdoor temperatures reach equilibrium, and the indoor temperature is set to 30℃. The electric fan heater and the temperature acquisition module (which can automatically acquire real-time temperature changes with a step size of 0.1s) are manually turned on until the indoor temperature no longer changes. Based on the classic step response identification algorithm of the least squares method, K = 0.89, T = 2100s, t = 500s is obtained. From formula (15), it can be seen that the transfer function model of the temperature control object is Tin(s) = 0.89e -500s / 2100s+1. The controller outputs an initial value d(t)=0; the number of input signal samples is 600. After simulating and calculating the PID controller output adjustment signal d(t), it is limited to d(t)=[-10,+10] according to the winter conditions of the controlled object.
[0140] The initial inertia factor of the particle swarm is w = 0.7, the speed range is [-1, 1], the acceleration coefficient is c1 = c2 = 1.5, the dimension is 3 (3 parameters to be optimized), the population size is 100, the maximum number of iterations is 100, and the minimum fitness value is 0.1. The maximum number of chaotic traversal searches is H = 9, the proportional factor d = 0.85, and the number of elite solution sets of the acceleration system is 10. The GA population size used for comparison is 100, the encoding method uses real number encoding, the crossover ratio is 0.6, and the maximum number of iterations is 100.
[0141] By comparison Figure 4 The response, error and parameter curves of each algorithm after the PID controller parameters are optimized show that the comprehensive performance of the CPSO-PID controller is better and it can quickly converge to the global optimal value of the parameters. However, in the early stage of iteration, during the particle initialization process of the PSO algorithm, the control system has not yet worked, resulting in unclear configuration basis of the position and velocity of the particles in the feasible domain. Therefore, it is difficult to optimize the system parameters at this stage, and the parameter optimization curve oscillates. However, when the particles are given information such as the control optimization object, the system error function and the optimization objective function, they quickly obtain the population convergence trend, and the optimization effect improves immediately. In particular, CPSO introduces the Logistic chaotic sequence, which improves the distribution of the initial particle population and thus increases the quality of the solution set in the early stage of iteration. It can capture the overall system knowledge more quickly, and basically get rid of the oscillation in 3 iterations. During the iteration process, the optimization of the PID parameters by the PSO algorithm stagnates, because the algorithm falls into the local optimal solution. However, due to the addition of the chaotic perturbation mechanism, the CPSO algorithm shows significant escape ability in both ITAE value iteration and parameter optimization, and updates better results than in the previous iteration many times. After the improvement, the control system's response speed, adjustment time, overshoot and other performance parameters are significantly improved. In addition, the step response of the PID controller optimized by the GA algorithm is relatively stable, but the overshoot of the ry response and the controller output d value are both the largest. This is mainly caused by the fact that GA is prone to fall into local extreme values, and the optimization effect of the PID control system is poor.
[0142] In order to verify the actual control performance, a full-scale physical test was conducted in a glass semi-enclosed greenhouse of a comprehensive experimental station. The greenhouse is built with three buildings in a north-south direction, each span is 2m long, each building has four spans, and the total area is 1152m2. Its width, length and height are 24m, 48m and 6.5m (ridge height). One electric heating fan is arranged every two spans, and the maximum power and climbing efficiency of the fan are 1680kW and 400kW / 5min respectively. The embedded control system written with improved PID control intelligently adjusts the fan heating to make the indoor temperature reach the set value - 19℃ during the day (8:00-18:00) and 13℃ at night (18:00-8:00). Two consecutive days with typical winter climate conditions were selected, and the model performance was compared with a group of 24h control test sections. GA-PID and traditional PID were used to control the greenhouse temperature on the first and second days respectively.
[0143] Table 1 Comparison of results using PID, GA-PID, PSO-PID and CPSO-PID controllers
[0144]
[0145] Figure 5 The temperature change curves of the GA-PID and PID control processes under similar outdoor temperatures and the same indoor set temperatures. As can be seen from the figure, when the set temperature rises from 13°C to 19°C (A zone), the temperature inside the greenhouse adjusted by GA-PID approaches the set point faster than the temperature adjusted by PID. Similarly, the response efficiency of the indoor temperature adjusted by GA-PID during the set value drop transition period (B zone) is also higher than that of the PID result. The difference in response efficiency can be caused by Figure 6 The input heat energy of GA-PID can be explained by the early decrease (A region) and early increase (B region) of the set temperature during the day-night transition. Figure 5 and Figure 6 It can be seen that when the solar radiation changes are similar during the day, the GA-PID strategy can avoid ineffective energy consumption, and the actual temperature is closer to the indoor temperature set point than the PID method. The optimization of PID parameters by GA reduces the overall energy input and the occurrence of continuous fluctuations during the experiment. Figure 5 It shows that daytime solar radiation has a positive impact on the heating effect, especially at noon. The temperature peaks controlled by both methods exceed the set value, which is beneficial to the growth of crops in the greenhouse, but the input heat energy provided by GA-PID is lower than that of PID.
[0146] from Figure 6It can be seen that since the parameters of PID are corrected in advance by GA, the response time of GA-PID is about 30 minutes earlier than that of PID in the rising and falling stages of energy consumption during the heating process. The input heat energy curve fluctuated significantly on the second day. Since the parameter optimization performed by GA improves the accuracy of the system regulation signal, the main line of the input heat energy on the first day is lower and has less fluctuation than that on the second day. The indoor temperature on the first day was basically controlled near the set value except for the influence of solar radiation during the day. The average temperature deviation of 0.58℃ on the first day in Table 1 is less than 0.67℃ on the second day, which further shows that GA-PID improves the accuracy of PID.
[0147] In order to reduce the error of the analysis results caused by the uncertainty of the external environment, CPSO-PID and PSO-PID were used to compare the temperature control on the third and fourth days of two consecutive periods with similar average values and changing trends of outdoor temperature and solar radiation. Figure 7 and Figure 8 The curves of the change of the indoor and outdoor temperature of the greenhouse, the set temperature and the input heat energy of the heating control process are shown in Table 1. According to the statistical data in Table 1, CPSO-PID has lower average temperature deviation and energy consumption than PSO-PID. When the iteration is stagnant, the chaotic perturbation mechanism is started to reinitialize some particles to improve the efficiency of heating control, and the Logistic chaotic sequence is used to improve the quality of the initial population of PSO to reduce invalid energy consumption. For units that are put into heating only when the system load is large, the startup response efficiency of the CPSO-PID method is higher than that of the PSO-PID method. Similarly, in the energy consumption comparison between the fifth and sixth days (Table 1), the corresponding CPSO-PID control of the indoor temperature process saves 1.65% energy than GA-PID. However, compared with the energy consumption of the GA-PID control system on the first day (external temperature is 5.34℃), the energy saving of the CPSO-PID method on the fourth day increases to 2.59%. The results show that the energy saving effect of CPSO-PID may increase when the outside temperature rises. Since the heating system load is higher when the outdoor temperature decreases, the fan runs at high power for a longer time, so the energy saving effect brought by the unit response advantage brought by PID parameter optimization is reduced. The proposed control method has the advantages of high response efficiency, reliable control, and energy saving, which are further verified by full-scale physical test analysis. The first to sixth days are consecutive dates.
[0148] 6. Conclusion:
[0149] The present invention establishes a greenhouse PID temperature control model based on the chaotic particle swarm algorithm. The model uses the particle swarm algorithm as the PID control system parameter K p , K i , K dA real-time tuning tool for the optimization process. In view of the high sensitivity of the optimization process to the initial value and the problem of being easily trapped in the local optimal solution, the Logistic chaotic sequence is used to improve the quality of the initial population of the algorithm, and some particles are disturbed and replaced when the iteration is stagnant to jump out of the local optimal solution. The simulation test shows that the CPSO-PID controller can quickly converge to the global optimal value of the parameters. Due to the addition of the chaotic perturbation mechanism, it shows significant escape ability in ITAE value iteration and parameter optimization. The full-scale physical test comparison of the multi-span greenhouse under similar outdoor temperature and the same indoor setting temperature shows that the PID control with GA tuning system parameters reduces the overall energy input and the occurrence of continuous fluctuations compared with the traditional PID without optimization, and the response efficiency is improved. The control effect of the CPSO algorithm after optimizing the PID parameters has lower average temperature deviation and energy consumption than the PSO algorithm. The comparison of the energy saving of CPSO-PID and GA-PID under different environments shows that when the temperature outside the greenhouse increases, the energy saving effect of the proposed temperature control model may increase. This controller makes up for the problem of unsatisfactory tuning of PID control parameters in nonlinear time-varying systems, and can be extended to environmental applications with different temperature, humidity and light conditions, thereby promoting the development of the field of optimal crop growth environment control in precision agricultural management.
[0150] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0151] In the description of the present invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0152] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A greenhouse temperature control method based on chaotic particle swarm PID controller, characterized in that: The following steps are involved: Based on the target greenhouse, construct a greenhouse temperature control system including a PID controller for controlling the temperature of the target greenhouse; Based on the particle swarm optimization algorithm PSO, after improving the algorithm by introducing the Logistic chaotic sequence, the parameters of the PID controller are adjusted, and a chaotic particle swarm PID controller is constructed. The temperature of the target greenhouse is controlled by the chaotic particle swarm PID controller.
2. The greenhouse temperature control method based on chaotic particle swarm PID controller according to claim 1 is characterized in that: In the process of building a greenhouse temperature control system, the heat exchange between the air and the planting soil is taken into consideration, and the air heat change used to describe the energy balance of the air in the greenhouse is constructed = heat exchange of the greenhouse cover + heat exchange of the soil surface + heat exchange of the vents + heat exchange of crop leaves + absorbed sunlight radiation - heat absorbed by plant transpiration + heat released by temperature control facilities.
3. The greenhouse temperature control method based on chaotic particle swarm PID controller according to claim 2 is characterized in that: In the process of constructing a greenhouse temperature control system, the transfer function of the greenhouse temperature control system is expressed as: In the formula, τ=t d , K is the static gain; T is the time constant; τ is the lag time, V is the greenhouse space, ρ is the air density, C ρ is the specific heat of gas at constant volume, C h is the electric-to-heat conversion rate, s represents the variable in the inertia link of the control system, t d Indicates a delay in facility heating time.
4. The greenhouse temperature control method based on chaotic particle swarm PID controller according to claim 3 is characterized in that: In the process of designing the PID controller, the control form of the PID controller is: Δd(t)=K p [e(t)-e(t-1)]+K i e(t)+K d [e(t)-2e(t-1)+e(k-2)] In the formula, e(t) is the deviation between the input value and the output value, K p , K i , K d They are weighted forms of the system error signal and the integral and differential components respectively.
5. The greenhouse temperature control method based on chaotic particle swarm PID controller according to claim 4 is characterized in that: In the process of tuning the parameters of the PID controller, the improved particle swarm optimization algorithm PSO is used to optimize K p , K i , K d Perform adjustment.
6. The greenhouse temperature control method based on chaotic particle swarm PID controller according to claim 5 is characterized in that: In the process of improving the particle swarm optimization algorithm PSO, based on the particle swarm optimization algorithm PSO, an adaptive dynamic inertia weight coefficient is used as the adaptive weight of the particle swarm optimization algorithm PSO.
7. The greenhouse temperature control method based on chaotic particle swarm PID controller according to claim 6 is characterized in that: In the process of improving the particle swarm optimization algorithm PSO, the Logistic chaos mapping method is applied to form a uniform state of initial particle distribution, and the chaotic variables are used to traverse the entire search space to improve the particle swarm optimization algorithm PSO.
8. The greenhouse temperature control method based on chaotic particle swarm PID controller according to claim 7 is characterized in that: In the process of temperature control by the chaotic particle swarm PID controller, the specific process of the chaotic particle swarm PID controller controlling the temperature of the target greenhouse is as follows: Step 1. Set the PID control parameter K p , K i , K d as the optimization object; according to the current input value r(t) and the calculated output value y(t), the error function e(t) and de / dt are calculated to obtain the input signal of the greenhouse temperature control system; Step 2. Use the Logistic chaotic sequence to initialize the particle swarm, randomly assign the positions and velocities of all particles, and assign an initial inertia weight to each particle; Step 3. Calculate the fitness ITAE of each particle and sort the particles in the population of size N according to the fitness value; Step 4. Determine the population diversity: If the diversity is lower than the threshold, activate the chaotic perturbation mechanism to interfere with the first N / 2 particles in the solution set, and randomly replace the original particles selected in the population with new particles; otherwise, go to Step 5; Step 5. Calculate the ITAE of the disturbed particles again. Each particle moves with reference to the optimal position experienced by itself and the entire population, update the position and velocity of the particle, and generate a new generation of particles. Step 6. Use the K of the particle in the current iteration p , K i , K d Calculate the PID controller adjustment signal d(t); Step 7. Define the error function between the input and output signals in the PID controller as e(t) = r(t) - y(t), and calculate its result; Step 8. Determine whether the termination condition is met. If the optimization error is not met or the maximum number of iterations is not reached, go to Step 3; otherwise, go to Step 9; Step 9. Stop the process and output parameter K p , K i , K d , get the optimal output d(t) value, calculate the optimal control output value y(t) according to the transfer function relationship of the controlled object, and realize closed-loop control.
9. Greenhouse temperature control system based on chaotic particle swarm PID controller, characterized in that: include: A system building module, for building a greenhouse temperature control system including a PID controller based on a target greenhouse, for controlling the temperature of the target greenhouse; The temperature control module is used to adjust the parameters of the PID controller based on the particle swarm optimization algorithm PSO, after improving the algorithm by introducing the Logistic chaotic sequence, to construct a chaotic particle swarm PID controller, and to control the temperature of the target greenhouse through the chaotic particle swarm PID controller.
10. The greenhouse temperature control system based on chaotic particle swarm PID controller according to claim 9, characterized in that: The temperature control module is also used to control the temperature of the target greenhouse through the chaotic particle swarm PID controller. The specific process is as follows: Step 1. Set the PID control parameter K p , K i , K d as the optimization object; according to the current input value r(t) and the calculated output value y(t), the error function e(t) and de / dt are calculated to obtain the input signal of the greenhouse temperature control system; Step 2. Use the Logistic chaotic sequence to initialize the particle swarm, randomly assign the positions and velocities of all particles, and assign an initial inertia weight to each particle; Step 3. Calculate the fitness ITAE of each particle and sort the particles in the population of size N according to the fitness value; Step 4. Determine the population diversity: If the diversity is lower than the threshold, activate the chaotic perturbation mechanism to interfere with the first N / 2 particles in the solution set, and randomly replace the original particles selected in the population with new particles; otherwise, go to Step 5; Step 5. Calculate the ITAE of the disturbed particles again. Each particle moves with reference to the optimal position experienced by itself and the entire population, update the position and velocity of the particle, and generate a new generation of particles. Step 6. Use the K of the particle in the current iteration p , K i , K d Calculate the PID controller adjustment signal d(t); Step 7. Define the error function between the input and output signals in the PID controller as e(t) = r(t) - y(t), and calculate its result; Step 8. Determine whether the termination condition is met. If the optimization error is not met or the maximum number of iterations is not reached, go to Step 3; otherwise, go to Step 9; Step 9. Stop the process and output parameter K p , K i , K d , get the optimal output d(t) value, calculate the optimal control output value y(t) according to the transfer function relationship of the controlled object, and realize closed-loop control.
Citation Information
Patent Citations
Thunder locating method based on chaos particle swarm optimization (PSO) algorithm
CN102967770A
Chaos particle swarm based thermal power unit load optimal distribution method
CN104850908A
A self-adaptive inertia weight chaotic particle swarm algorithm
CN109697299A
Greenhouse temperature and humidity method controlled by particle swarm BP neural network PID
CN114036813A
Cited By
Data processing method and system based on improved particle swarm optimization and applied to automatic driving longitudinal control
CN119872611A
Laboratory temperature and humidity intelligent monitoring and adjusting method based on artificial intelligence
CN120029393A
Cooling and heating air supply control method and system based on magnetic suspension air conditioning unit
CN120868583A
A cooling and heating air supply control method and system based on a magnetic suspension air conditioning unit
CN120868583B
Fishery pond water temperature control optimization method based on swarm intelligence algorithm
CN121115957A
