Intelligent Regulation of Temperature and Humidity in Vegetable Greenhouses Based on Single Neuron PID Algorithm

: In order to meet the demands of autonomy and control optimization in solar greenhouse control systems, this paper developed an intelligent temperature and humidity control system for greenhouses based on the Single Neuron Proportional Integral Derivative (SNPID) algorithm. The system is centered around the Huada HC32F460 Micro-Controller Unit (MCU) and the RT-Thread operating system, integrated with the SNPID control algorithm. Through comprehensive simulation, model construction, and comparative experiments, this system was thoroughly evaluated in comparison with traditional PID control systems (cPID) that rely on overseas software and hardws-buare. Simulation results show that our new system significantly outperforms traditional PID (Pro-portional Integral Derivative) systems in terms of temperature control stability and accuracy. Experimental data further confirm that, while ensuring cost-effectiveness, the new system achieves a remarkable 50.2% improvement in temperature and humidity control precision compared to traditional systems. The temperature Root Mean Square Error (RMSE) in the experimental greenhouse is 0.734 compared to 1.594 in the comparison greenhouse, indicating better stable temperature con-trol capability. The vents in the experimental greenhouse have a maximum opening of 67 cm and a minimum of 5 cm, showing a quick response property to high temperatures. In contrast, the control greenhouse has a maximum vent opening of 55 cm, remaining unchanged during the test period, which reflects its slower response to temperature fluctuations. These results demonstrate the significant advantages of the designed solar greenhouse temperature and humidity control system in terms of autonomy and control optimization, providing an efficient and economical solution for solar greenhouse environmental management. This system shows significant practical application perspective in promoting intelligent agriculture and sustainable agricultural production, highlighting its broad impact and potential significance.


Introduction
With the rapid development of the global agricultural industry, solar greenhouses, as facilities capable of providing optimized growing environments for crops, are increasingly gaining widespread attention.These greenhouses utilize natural sunlight, combined with modern agricultural technology, to provide ideal growth conditions for various inefficient, but also challenges the precise control of the crop growth environment [6][7][8][9][10].Therefore, the introduction and application of intelligent control technology have become the key technological approach to modernizing solar greenhouse management and improving crop yield and quality [11][12][13].
In recent years, some solar greenhouses have introduced modern intelligent control technologies, achieving automated control of temperature and humidity.These greenhouse systems not only encompass classical automatic control theories, but also support nonlinear, time-varying, and complex systems.For instance, PID control systems that combine expert systems [14], genetic algorithms [15], fuzzy control [16], and neural networks [17] maintain the simplicity and convenience of PID, while significantly enhancing accuracy, stability, and robustness.In recent years, with the increasing demands for controlling complex industrial systems and nonlinear dynamic systems, various advanced control algorithms have emerged.Among these, single neuron PID control and finite-time adaptive event-triggered control based on fuzzy logic are particularly noteworthy in their applications for stochastic nonlinear systems.Single neuron PID control combines the advantages of traditional PID controllers and neural networks, enabling the effective handling of system disturbances and uncertainties through online PID parameter adjustments.However, with the increasing complexity of control systems, single neuron PID control may face certain limitations in some scenarios.In contrast, finite-time adaptive event-triggered control based on fuzzy logic can handle more complex system dynamics and multiple constraints, offering better adaptability and robustness.In recent years, significant progress has been made in the study of the stability of nonlinear systems based on fuzzy control and adaptive control.For example, Wang et al. [18] proposed a finitetime adaptive fuzzy event-triggered control method for nonstrict feedback stochastic nonlinear systems with multiple constraints.This method achieves system stability within a finite time and offers good adaptability and robustness, making it particularly suitable for complex nonlinear systems.The method enhances control adaptability through fuzzy logic systems and reduces system communication burdens via an event-triggered mechanism, thereby improving overall system efficiency.Additionally, Yuan et al. [19] investigated the rapid finite-time stability in the mean square sense of stochastic nonlinear systems and applied it to a single-joint robotic arm.This study not only emphasizes the practical application of achieving system stability within a finite time, but also demonstrates the effectiveness of the method in robotic arm control.Experimental verification and application tests proved the practicality and effectiveness of the method, providing valuable references for the design of control systems in other fields.
Nonetheless, fuzzy logic-based control methods still have several shortcomings in practical applications.Firstly, their design and implementation are complex, requiring the handling of multiple constraints and input delays of fuzzy logic systems and event-triggered mechanisms, which undoubtedly increases the difficulty of development and debugging [19,20].Secondly, such control methods demand substantial computational resources, which may not be suitable for real-time control and embedded systems with limited computational resources [21,22].Moreover, although fuzzy event-triggered control has a certain degree of adaptability, its complex design process might result in less robustness in dealing with uncertainties and external disturbances compared to single neuron PID control [23,24].Regarding the scope of application, single neuron PID control, due to its simple design and low computational resource requirements, is widely used in industrial control, process control, and other fields, offering high flexibility.In contrast, fuzzy event-triggered control is mostly used for specific types of nonlinear stochastic systems and has a relatively narrower application scope, requiring customized designs for specific systems [25,26].Furthermore, fuzzy event-triggered control relies on complex data transmission mechanisms, reducing data transmission through event-triggered mechanisms but still requiring the design of complex triggering conditions and communication strategies, which increases the difficulty of system implementation to some extent [27,28].In conclusion, although finite-time adaptive event-triggered control based on fuzzy logic demonstrates unique advantages in handling complex nonlinear systems, its drawbacks in terms of design complexity, computational resource requirements, and flexibility in practical applications still need to be balanced and optimized in specific applications.Additionally, the following literature provides important references for the direction of this study.For example, Yang et al. [29] extensively explored an observer-based event-triggered adaptive fuzzy control strategy in their research, which is applicable to fractional order nonlinear multi-input multioutput systems containing unknown time-varying delays and actuator faults.By constructing an adaptive fuzzy state observer and a serial parallel estimation system, this method can effectively handle the problem of complexity explosion.Through dynamic surface control technology, it has been proven that the signal of the closed-loop system is semi-globally consistent and ultimately bounded, effectively avoiding Zeno behavior and emphasizing its stability and robustness.Wang et al. [18] proposed a finite time adaptive fuzzy event-triggered control strategy for nonstrict feedback stochastic nonlinear systems.This strategy takes into account time-varying output constraints and input delays.By constructing a random nonlinear mapping and using the Pade approximation method to handle input delays, the number of data transmissions is reduced and the impact of tracking errors is alleviated.Finally, the semi-global finite time stability of the closed-loop signal in a probabilistic sense is demonstrated through stability analysis, fully demonstrating its accuracy and stability.Liu et al. [30] studied the finite time containment control problem of fractional order nonlinear multiagent systems with event-triggered inputs.This study developed a new Lyapunov stability lemma and designed an event-triggering condition that combines control inputs and a decreasing function related to errors to reduce communication burden and balance the relationship between system performance and communication resources, ensuring that followers are guided to the convex hull composed of leaders within a limited time.Chen et al. [31] investigated the synchronization problem of fractional order chaotic systems with input delays.By proposing an event-triggered adaptive neural network backstepping sliding mode controller, this method not only reduces the use of communication resources, but also enhances the robustness of the system by introducing fractional order dynamic surface control technology and sliding terms, effectively handling the impact of input delay, and proving the boundedness of all closed-loop signals.Despite significant advancements, current technologies exhibit notable limitations when dealing with the complexity and dynamic changes of greenhouse environments.For example, in the field of greenhouse environment management, Abbood H M et al. [15] developed an intelligent monitoring model based on Radial Basis Function (RBF) neural networks, aimed at optimizing the microclimate of greenhouses by precisely adjusting set points.In a 2021 study, Jia Y. [32] published research on an intelligent greenhouse remote control system based on fuzzy neural networks, which uses fuzzy logic and neural networks to handle complex variables of the greenhouse environment, enhancing the intelligence of remote monitoring.Cheng Y. [16] explored an intelligent control system for agricultural greenhouses based on fuzzy PID control, which optimizes the greenhouse environment by combining fuzzy logic with PID control, improving the system's adaptability and robustness.In a 2020 study, Qun R. [33] investigated intelligent control technologies for agricultural greenhouse operating robots based on a fuzzy PID path tracking algorithm, aiming to enhance navigation precision and adaptability in complex greenhouse environments.Elanchezhian A and their team [34] evaluated various models used to predict microclimatic parameters inside greenhouses, highlighting the utility of these models in accurately simulating and predicting greenhouse conditions.Yao Y. et al. [35] introduced a research study in which a finite-time tracking control strategy is used for handling nonstrict feedback state delay nonlinear systems with full state constraints and unmodeled dynamics.Although precise in theory, this method could be complex and demanding on computational resources in practice.In a 2023 study, Hou Y. et al. [36] introduced an adaptive finite-time fuzzy control method suitable for uncertain nonlinear systems with asymmetric full state constraints, which optimizes the control process through fuzzy logic to address the system's uncertainties and asymmetry.Despite the achievements of the above literature, there are still the following limitations: The various greenhouse environment management technologies mentioned in the literature generally exhibit several major limitations: 1. High computational burden and implementation difficulty: Most systems mentioned in the studies, such as the intelligent monitoring model based on RBF neural networks and the remote control system based on fuzzy neural networks, rely on complex neural networks or fuzzy logic.While these technologies are effective in handling data uncertainty and fuzziness, they also significantly increase the system's computational demands and the difficulty of implementation.2. Complexity in system maintenance and adjustment: Systems such as fuzzy PID control systems and nonlinear system control strategies with full state constraints, although enhancing operational flexibility and precision, have complex configuration and maintenance processes that usually require indepth expertise, limiting their application in resource-constrained environments.3. High implementation costs: The complex system structure and high computational resource demands lead to increased implementation costs, such as the agricultural greenhouse operating robot based on the fuzzy PID path tracking algorithm, which, although increasing the flexibility and efficiency of path tracking, may limit its widespread application in actual agricultural production due to high costs.4. Gap between theory and practical application: Some theoretically precise control strategies may be overly complex in practice, demanding high computational resources, which may hinder their application in the real world, especially in regions with underdeveloped technological infrastructure.To address the challenges of high computational burdens and complex system maintenance in greenhouse environment management, this study proposes a novel adaptive PID controller integrated with a multilayer perceptron neural network.This controller does not rely on preset models, but adjusts control parameters online through self-learning capabilities, fully leveraging its high adaptability and strong anti-interference ability.This makes the controller particularly suitable for dynamic, rapidly changing, and complex greenhouse environments.Specifically tailored to the characteristics and needs of northern China's inclined solar greenhouses, we have designed and implemented an intelligent temperature and humidity control system.This system focuses on air temperature as the main control target and air humidity as the secondary target, developed on a domestic independent software and hardware platform.By improving existing control algorithms and adapting low-cost hardware, this system achieves automated precise control of temperature and humidity in the greenhouse, meeting the needs of unattended operation, remote monitoring, and intervention control.The goal of this research is to provide a practical, low-cost, and efficient solution for intelligent control of solar greenhouses in China, promoting the development of smart agriculture.Additionally, this study also provides new theoretical and technical support for intelligent control of solar greenhouses, looking forward to contributing to global agricultural technology innovation.This field of intelligent greenhouse management technology has made several novel contributions, including: 1. Simplified control system design: This study significantly simplifies the design and implementation process of the greenhouse control system using a single neuron PID controller.This simplification reduces the reliance on complex algorithms and advanced computational resources, making the system easier to implement and maintain, especially suitable for resource-limited environments.2. Improved operational convenience and technological accessibility: The simplicity and efficiency of the single neuron PID control system allow nonprofessional users to easily understand and operate, significantly lowering the technical threshold, enhancing system popularity and user-friendliness.3. Rapid response to external environmental changes: Due to its directness and efficiency, the single neuron structure can quickly respond to external environmental changes, timely adjusting key parameters such as temperature and humidity, ensuring optimal growing conditions in the greenhouse, thus improving crop growth efficiency and quality.4. Reduced costs and enhanced economic benefits: Due to low computational demands and system simplicity, the single neuron PID controller reduces operational costs, making intelligent greenhouse technology more economically viable.This is particularly applicable to budget-limited small and medium agricultural operations. 5. Ease of maintenance and expandability: The system's simple design not only facilitates daily maintenance and troubleshooting, but also allows for technological upgrades and functional expansion based on specific needs, providing higher flexibility and customization.
The rest of the paper is structured as follows: Section 2 provides a system overview, concisely explaining the composition of the system and its functions.Section 3 delves into the design process of the system, covering various aspects of algorithm design.Section 4 discusses the practical implementation of the algorithms on the hardware platforms, detailing the integration challenges and solutions.Section 5 focuses on the validation of the designed system, including simulation comparison tests based on simulation models and comparative tests in actual greenhouse conditions, to ensure the effectiveness and reliability of the system.

System Overview
This study is dedicated to the design and implementation of a temperature and humidity control system for sloped solar greenhouses, particularly focusing on the improvement of temperature control algorithms based on ventilation methods.As shown in Figure 1, the core components of the control system include sensors, a central controller, a main control board, and motors.The sensors are responsible for providing real-time temperature and humidity data.The central controller, serving as the core of human-machine interaction and system management, connects to the main control board and is also responsible for communication with the client unit's server.The main control board, connected to the motors and sensors, controls the operation of the motors based on temperature and humidity information, thereby adjusting the size of the ventilation openings to regulate indoor temperature and humidity.The central controller and main control board's core is an autonomous platform system-on-chip, comprising an independent MCU and operating system, forming an autonomous software and hardware platform.The MCU uses Huada Semiconductor's HC32F460 low-power MCU embedded processor, characterized by its low cost, low power consumption, and general architecture.The operating system employs the RT-Thread embedded real-time operating system [37,38], supporting multitasking processes such as multithreading, message queues, eventtriggering, and compatible with various communication protocols and peripherals, meeting the system's requirements for real-time and multitasking processing.
The heart of the control algorithm is the single neuron PID control [39], which uses neurons for online tuning of PID parameters, enhancing the controller's response speed and antiinterference capability, thereby achieving more stable, accurate, and smooth control effects in complex greenhouse environments.The control algorithm is deployed within the system-onchip of the main control board.Each main control board connects to a temperature and humidity sensor and a motor, controlling one ventilation opening.As shown in Figure 2, in large greenhouses, multiple main control boards can be configured to achieve coordinated control of multiple ventilation openings to meet the air temperature and humidity adjustment needs within the greenhouse.For example, in the scenario where a large greenhouse is divided into front, middle, and rear sections for segmented control, each master control board is connected to a sensor located near the upper middle part of a ventilation port.This ensures precise capture of the air status after ventilation adjustments, thus enabling effective control.
As depicted in Figure 2, the structure of the segmented control system for large greenhouses, each master control board is responsible for managing the ventilation ports of the corresponding section.Through the RS485 bus, a single master controller can cascade multiple master control boards, allowing users to view the dimensions of each managed ventilation port and temperature and humidity information through the master controller interface, and providing manual control options.Each greenhouse requires at most one master controller to perform these management functions.The master controller, acting as a functional enhancement module, does not directly participate in the environmental control of the greenhouse.Under strict budget constraints, the master controller can be omitted, and the system can operate solely through the master control boards for temperature and humidity adjustment and control.Through this study, we have successfully designed and implemented a solar greenhouse temperature and humidity control system with adaptive online tuning capability.This system can achieve stable, precise, and smooth temperature and humidity control in complex greenhouse environments, providing valuable reference for future research and application of solar greenhouse temperature and humidity control systems.

Algorithm Design
This study is dedicated to developing an efficient temperature and humidity control system for sloped solar greenhouses, aimed at optimizing the microclimate conditions within the greenhouse.The main strategy involves precise control of air temperature supplemented by humidity regulation to achieve comprehensive optimization of the greenhouse environment.The system employs ventilation regulation as the primary control strategy, which is not only efficient, but also cost-effective.Considering the limitations of the microcontroller's computational resources, we designed and implemented a lightweight control algorithm.This algorithm, primarily focused on air temperature, also integrates an auxiliary dehumidification function, ensuring effective operation under diverse environmental conditions.To enhance control efficiency, the algorithm innovatively incorporates a single neuron learning mechanism, endowing the system with the ability for self-learning and adaptive adjustment of PID parameters.This innovation not only improves the system's control precision, but also enhances its adaptability to various environmental conditions, significantly optimizing the efficiency and effectiveness of greenhouse environmental management.

Temperature and Humidity Decoupling Control Method
As society progresses, the manufacturing processes across various industries become increasingly complex.Often, these processes involve not just a single controlled and controlling variable, but may feature multiple control loops.To stably and precisely adjust multiple variables, multiple stages must be set.In such production states, there can be various degrees of correlation, coupling, and mutual influence among the loops.Controlling a single loop independently might, due to the coupling effect, interfere with other loops and, in severe cases, even affect the normal operation of the entire system.For systems with significant coupling, adjusting the controllers or matching the variables alone cannot achieve the ideal control effect.Therefore, decoupling becomes particularly crucial for multivariable systems with severe coupling.
Take, for example, the temperature and humidity environment in greenhouse environments, where temperature and humidity are strongly coupled.If the temperature inside the greenhouse increases while the internal air's moisture content remains unchanged, the saturation vapor pressure in the control system will change, leading to a decrease in internal humidity; conversely, an increase in humidity could also lead to a change in temperature.This coupling issue in the temperature and humidity control process indicates that adjusting a single parameter might trigger a chain reaction affecting other parameters.The greater the degree of coupling in actual production processes, the greater its impact on production, potentially even leading to system imbalance.Thus, decoupling the temperature and humidity in greenhouses can make the control of these variables more convenient.

Decoupler Design
Given the strong coupling characteristics of temperature and humidity inside greenhouse environments, effective methods must be adopted to decouple temperature and humidity to achieve single-loop control of these environmental variables.Although various decoupling methods each have their characteristics, they exhibit different degrees of limitations in practical applications.For instance, while adaptive decoupling algorithms are flexible, they are complex, computationally intensive, and lack robustness in the system; intelligent decoupling has theoretical support, but due to incomplete research, using intelligent decoupling alone fails to meet practical needs; traditional decoupling methods, due to their maturity, are more suitable for this study.
Among conventional decoupling methods, the diagonal matrix method, feedforward compensation method, and identity matrix method have seen extensive practical application.The identity matrix decoupling theoretically achieves the best decoupling effect because the characteristic of the decoupled generalized object is one, but it is difficult to implement, especially in cases of complex object characteristics where decoupling may not be achievable.The diagonal matrix decoupling is similar to the identity matrix method, but also struggles to effectively decouple complex objects due to differences in transfer functions.In contrast, due to its simple network structure, good stability, and high efficiency, the feedforward compensation decoupling method has become the most widely used.
Based on the above analysis, this paper opts to use the feedforward compensation decoupling method to design a temperature and humidity decoupler.The basic structure of this method is shown in Figure 3; the system input consists of two signals, X1(s) and X2(s), representing temperature and humidity, respectively; the system outputs are Y1(s) and Y2(s), reflecting the system's response to temperature and humidity; the controller uses a single neuron PID controller, with transfer function models labeled as GP21(s) and GP12(s).Moreover, the mutual coupling transfer functions of temperature and humidity in the system are G11(s), G21(s), G22(s), G12(s), ensuring that the control system can effectively decouple in response to changes in temperature and humidity, thereby maintaining the stability of the internal environment of the vegetable greenhouses.The feedforward compensation technique was initially developed to mitigate disturbances in systems, and is similarly applicable to decoupling control systems.In practical applications, the impact of the controller's output U1 on the output variable Y2, and U2 on Y1, are considered internal disturbances.This method enables effective elimination of these disturbances.According to the principle of disturbance compensation in feedforward compensation, the influence of U1 on the controlled parameter Y2 is governed by Equation (1), while U2's impact on Y1 is described by Equation (2).To ensure the complete neutralization of the effects of U1 on Y2 and U2 on Y1, the conditions in Equations ( 3) and (4) need to be fulfilled.
Based on satisfying the conditions outlined in the aforementioned equations, we can derive the mathematical model for the temperature and humidity decoupling stage, GP21(s), as indicated in Equation (5).Similarly, the mathematical model for the humidity to temperature decoupling stage, GP12(s), is represented by Equation (6).By analyzing the transfer function matrix of the control system (Equation ( 7)) and applying Equations ( 5) and ( 6), we can compute and determine the mathematical models for the decoupling compensation stages GP21(s) and GP12(s), represented by Equations ( 8) and (9), respectively.This series of models and compensation techniques offers an effective solution for the design of control systems, ensuring high accuracy and stability.
After integrating the decoupling stages for temperature and humidity into the control system, the original system-comprising two mutually influencing coupled systems-transforms into two independent single-input single-output systems.This transformation prevents interference between the outputs of various variables, thereby simplifying the control process.Through this decoupling, each system can be adjusted independently, significantly enhancing the control's flexibility and precision.The equivalent system's structure post-decoupling is detailed in Figure 4.This approach not only optimizes control strategies, but also offers a more efficient and intuitive solution for managing complex systems.The implementation procedure of the single neuron PID decoupling control algorithm is outlined as follows: Step (1): Initialization.Set initial weight coefficients, proportional coefficients, and learning rates for the proportional, integral, and derivative aspects for two single neuron controllers.
Step (2): Data Collection.Collect actual temperature and humidity readings from the decoupling control system, compare these to preset values, and compute the current control errors for temperature and humidity.
Step (3): State Transition.Process the obtained control errors to produce the state variables required for neuronal control, which serve as the network's two groups of input signals.
Step (4): Weight Adjustment.Employ the supervised Hebb learning rule to update and adjust the weight coefficients for controlling temperature and humidity.
Step (5): Control Output Calculation.Based on the updated weight coefficients, calculate the control outputs for temperature and humidity at the current moment.
Step ( 6): Iterative Loop.Return to Step (2) to commence the next cycle of temperature and humidity sampling and control.This algorithm enhances the performance of traditional PID controllers by integrating concepts and mechanisms from neural networks, rendering them more adept at handling complex and nonlinear control environments.

Simulation Experiments and Results Analysis
By integrating the SNPID controller with the feedforward compensation decoupler, the decoupling control system is structured to manage temperature and humidity environmental variables, enabling temperature and humidity decoupling simulation experiments in greenhouse environments to validate the decoupling effects.The design of the simulation experiment for assessing the decoupling effects of temperature and humidity is outlined as follows: Phase 1: The environmental temperature is set to 25 °C and humidity to 60%.Phase 2: The temperature setting is adjusted to 30 °C, with the humidity setting remaining constant.
Phase 3: The humidity setting is adjusted to 70%, while the temperature setting remains unchanged.
The initial parameters for the single neuron PID decoupling controller in disturbance and dynamic tests are detailed in Table 1.In the undecoupled dynamic test, the decoupling components GP21(s) and GP12(s) are omitted from the control system, with the controller's PID parameters set as outlined in Table 1. Figure 5 displays the temperature and humidity control curves without decoupling, revealing the coupling impact between these variables.The temperature control curve in Figure 5 shows that initially, the temperature rises sharply and peaks quickly before dropping and fluctuating, eventually stabilizing.During the second phase, from 100 to 150 s, alterations in the temperature set point induce fluctuations, with noticeable oscillations in the temperature curve indicating system instability due to humidity's coupling effects.
The humidity control curve in Figure 5 illustrates a rapid increase at the start, followed by several fluctuations before stabilizing.In the third phase, from 150 to 200 s, changes in the humidity set point lead to a significant change in humidity, causing fluctuations in an otherwise stable temperature.This further confirms the disturbance of humidity regulation on temperature stability, showcasing the system's coupling problems.
Overall, Figure 5 vividly illustrates the interplay and coupling between temperature and humidity, which significantly disrupts the system's operational stability, highlighting the necessity of decoupling.In the absence of effective decoupling, any adjustment in temperature or humidity could provoke unstable responses in the system, adversely affecting the productivity and quality control within the greenhouse.(2) Dynamic test The dynamic test utilizes a single neuron PID decoupling controller.Figure 6 depicts the results of temperature and humidity control using this controller during the dynamic test.The experiment is segmented into three stages, adjusting the set points for temperature and humidity across these phases to evaluate the controller's effectiveness and responsiveness.
As indicated by the temperature control curve in Figure 6, during the first stage, the temperature is set at 25 °C.The temperature quickly rises, overshooting to approximately 37 °C, then rapidly decreases and stabilizes at 25 °C within 21 s.In the second stage, the set point increases to 30 °C.The temperature starts to climb at 100 s, reaches the new set point in 4 s, begins to decrease after 8 s, and stabilizes at the set point after 18 s, demonstrating a quick response and minimal overshoot.
The humidity control curve in Figure 6 for the first stage shows a set point of 60%, with humidity rapidly rising and briefly overshooting to 90% before gradually declining to stabilize at 60% around 47 s.In the third stage, the humidity set point is raised to 70%, with humidity starting to increase at 150 s, achieving the new set point in 11 s, and thereafter maintaining stability.These graphs reveal that the single neuron PID decoupling controller manages temperature and humidity variations with rapid responsiveness and commendable steady-state performance.Despite some overshoot during adjustments, the controller efficiently adapts to new set points and swiftly stabilizes following perturbations, demonstrating its efficacy in dynamic control despite certain structural limitations that occasionally prevent perfect stabilization at set points.(3) Perturbation experiments Figure 7 illustrates the control outcomes for temperature and humidity using a single neuron PID decoupling controller during a disturbance test.Disturbance signals were applied to both temperature and humidity at 100 s within the test to evaluate the control system's responsiveness and stability.According to the temperature control curve shown in Figure 7, the temperature initially rose rapidly, then overshot and quickly decreased to the set point, maintaining relative stability thereafter.At 100 s, the system received a disturbance signal that increased the temperature by 2 °C, resulting in a brief rise and oscillation in temperature, but it swiftly stabilized near the original set point by approximately 120 s.This indicates that the control system possesses excellent disturbance suppression capabilities and rapid recovery characteristics.
Likewise, the humidity control curve in Figure 7 indicates that at 100 s, the humidity was subjected to a disturbance signal that increased by 3%.This led to a brief increase and minor fluctuations in humidity before the system quickly adjusted, stabilizing back at the original set point around 110 s.This further demonstrates the control system's ability to swiftly adjust its response to disturbances, effectively maintaining the stability of environmental parameters.
In summary, Figure 7 showcases the single neuron PID decoupling controller's ability to respond to disturbances in a dynamic environment, quickly reverting to a stable state despite changes in external conditions, thus confirming its efficacy and reliability in practical applications.

Overview of Traditional PID
The acronym PID stands for "Proportional," "Integral," and "Differential," which are derived from the initial letters of these three English words.These terms represent three fundamental control strategies.A PID controller is a type of parallel controller widely used in the field of automatic control.It integrates these three control methods to adjust errors during the control process, thereby stabilizing the controlled system.For instance, in process control models like greenhouse temperature control, PID controllers are commonly used to achieve precise regulation.In most cases, a control system will include at least one standard PID controller and a specific control target.The operating principle of a standard PID controller is illustrated in Figure 8: the controller receives the error between the actual value and the set value of the controlled parameter as input.It then adjusts this through proportional, integral, and differential calculations, thereby outputting a control signal and acting on the controlled object to achieve the purpose of closed-loop control.

Control System Structure
In the field of fuzzy control systems research, systems are typically classified into single-variable fuzzy control and multivariable fuzzy control.To ensure the effectiveness of control while avoiding excessive system complexity, this study employs a two-dimensional variable fuzzy controller, hereinafter referred to as the fuzzy controller.The operational framework of this fuzzy control system is illustrated in Figure 9.In this system, the fuzzy controller is integrated with a traditional PID controller: the fuzzy controller is responsible for real-time adjustment of PID parameters, while the PID controller directly controls the system based on these adjustments.Specifically, the inputs to the fuzzy controller include the error (E) and the rate of change of the error (EC).According to the principles of fuzzy control, this process encompasses three stages: fuzzification of input variables, aggregation of fuzzy rules, and defuzzification.Ultimately, the controller outputs three adjustment parameters, ΔKP, ΔKI, and ΔKD, which are then used as inputs to the traditional PID controller, allowing for real-time dynamic adjustment of PID control coefficients.This integration not only optimizes control precision, but also enhances the system's adaptability to complex dynamic environments.
In Equations ( 10) to ( 12), KP, KI, and KD represent the current values adjusted by fuzzy control; KP0, KI0, and KD0 denote the initial values of the control coefficients; , , and represent the proportional factors.

Control Principle
In this study, the input variables of the system are initially fuzzified, transforming deterministic values into fuzzy vectors.During this process, the error (E), the rate of change of the error (EC), and the adjustment parameters ΔKP, ΔKI, and ΔKD are uniformly defined within a seven-level scale: Negative Big (NB), Negative Medium (NM), Negative Small (NS), Zero (O), Positive Small (PS), Positive Medium (PM), and Positive Big (PB).The domain of these fuzzy sets comprises the integer set {−6, −5, −4, −3, −2, −1, 0, 1, 2, 3, 4, 5, 6}, and all membership functions utilize triangular shapes to simplify the calculation process and enhance intuitive interpretation.Specific assignments for fuzzy variables are detailed in Table 2 of the study.The fuzzy control rule table is based on the summarized experience of operators and experts, guiding the output decisions of the fuzzy controller.For instance, when both the error E and the rate of change of the error EC are large, ΔKP should be increased to accelerate the system response, while ΔKI and ΔKD should be decreased to avoid oversaturation and significant overshooting during the control process.The specific fuzzy control rules are displayed in Tables 3-5.Based on these control rules, the fuzzy vector outputs for ΔKP, ΔKI, and ΔKD are obtained.These fuzzy vectors are then converted into specific numerical values through the center of maximum method, thereby allowing real-time adjustment of the parameters in the traditional PID controller.Through this method, the fuzzy control system can flexibly adjust its control strategy based on realtime data, thus enhancing its ability to adapt to complex changing environments while ensuring system stability and response speed.The greenhouse system is a complex system; with the help of MATLAB/Simulink, a simulation model was constructed, as shown in Figure 10.The PID parameters were adjusted using the critical ratio method.The proportional coefficient is 0.8, the integral coefficient is 0.005, and the differential coefficient is 32.89.Input the proportional factors for inputs and outputs, as well as the fuzzy control rules, into the adaptive fuzzy PID controller.

Design of SNPID Controller
Single neuron networks are a significant branch in the field of intelligent control, inspired by studies of brain physiology.These networks mimic the working mechanisms and processes of the brain, forming an entirely artificial network with a directed graph topology.The basic principles of neural control include using neuron models to simulate the transmission and processing mechanisms of neural cell electrical signals.Within this framework, single neuron networks handle information by responding to continuous or intermittent input states, optimizing the generation of control commands.
In terms of complex system control, single neuron networks demonstrate remarkable advantages.Compared to traditional PID control algorithms, single neuron PID control algorithms show superior performance in improving the quality of control systems, adapting to environmental changes, and enhancing the robustness of control systems.Therefore, research on neuron networks in control and recognition has become a focal point in the current field of control systems.
The SNPID algorithm is an advanced control strategy that has evolved from the traditional PID algorithm and is widely used in the control field [40,41].This algorithm combines the adaptive learning characteristics of artificial neurons, enabling it to dynamically adjust PID parameters based on system errors, significantly enhancing control precision and system robustness [42].The self-learning capability of the neuron endows the SNPID algorithm with powerful adaptability when dealing with nonlinear, uncertain, and timevarying systems.This not only maintains the simplicity and high reliability of the traditional PID algorithm design, but also significantly improves its control performance in complex dynamic systems [43,44].Compared to traditional PID, the SNPID algorithm exhibits stronger adaptability and real-time performance, making it particularly suitable for handling systems with complex nonlinearity and time-varying characteristics, such as greenhouse environment control.In practical applications, the SNPID algorithm has been successfully applied to various control system designs, including DC (direct current) stepper motors, pH (potential of hydrogen) control systems, and agricultural machinery [45,46], demonstrating faster adjustment times and lower error rates than traditional PID and fuzzy PID algorithms.Therefore, given the complex nonlinearity and dynamic characteristics of greenhouse environments, as well as the computational resource limitations of control systems, adopting the SNPID algorithm can be considered an effective solution to meet the demands for adaptability, interference resistance, and response speed of control algorithms.In this study, we employed the SNPID algorithm for air temperature control.Figure 11 comprehensively illustrates the structure of the controller design based on the SNPID algorithm, revealing its application and working mechanism in the regulation of greenhouse environments.In the SNPID controller depicted in Figure 11, adjustment of the vent opening to u(k) the core component is a neuron with three inputs and three outputs.The neuron's input parameters are directly related to the temperature difference, denoted as ( )  e k , and include 1 ( ) ( ) . The neuron employs a supervised Hebbian learning rule for its learning process, a rule formulated by combining the supervised Δ (Delta) learning rule with the Hebbian learning rule [47].According to this learning mechanism, the adjustment formulas for the three input weights of the neuron, kp w , ki w , kd w , can be derived.These specific formulas are detailed in Equations ( 13) to (15).
In this context, kp  , ki  , kd  represent the learning rates, playing a crucial role in the adjustment of the neuron's weights.For the weight adjustment, the error from the previous moment is used as a teacher signal, denoted as ( ) z k and ( ) ( 1) z k e k   .This design ensures that the neuron's learning process can adaptively adjust based on actual error conditions, thereby enhancing the accuracy and efficiency of the entire greenhouse temperature control system.Determining the learning rates kp  , ki  , and kd  is a key step, requiring multiple adjustments during the experimentation process to precisely set these parameters.To assist this debugging process, we referred to general methods provided in the existing literature [48][49][50].After determining the learning rates, the next step is to adjust the neuron's weight output through normalization.The main purpose of normalization is to ensure the convergence of the system's control and to expedite this process [51].The outputs after normalization determine the proportional, integral, and derivative coefficients of the PID controller, which are crucial elements in the control process.The specific formulas for normalization are detailed in Equations ( 16) to (19).Through this series of steps, the SNPID control system can more accurately reflect and adapt to dynamic changes during the system's learning process, thus improving the performance and efficiency of the entire greenhouse control system.This process not only optimizes the controller's response, but also enhances the system's adaptability to changes in the greenhouse environment.
The core of the control algorithm described in this study is centered on the tuning process of a single neuron.Initially, the system is initialized by inputting error values, which form the basis for subsequent adjustments.Then, based on these error inputs, the system precisely adjusts the control weights to optimize the control process.Finally, the adjusted PID (Proportional-Integral-Derivative) control coefficients are calculated and outputted, critically affecting the controller's performance and responsiveness.During this process, the self-learning function of the single neuron allows for the PID coefficients to be adaptively adjusted online according to changes in error.This mechanism not only enables real-time adjustment of PID coefficients, thereby significantly enhancing control precision, but also allows for effective operation on low-cost computational platforms due to the lightweight and low complexity characteristics of the single neuron tuning module.Although the accuracy of a single neuron might be slightly reduced compared to a Multi-Layer Perceptron (MLP), its impact on improving PID control is still significant.After completing the PID coefficient tuning, the control laws of the SNPID controller are derived based on the principles of incremental PID, as shown in Equations ( 20) and (21).The rules for setting these coefficients reflect a critical balance between system response speed and stability: larger coefficient values can speed up system response but may lead to greater overshoot; smaller values slow down the response but contribute to enhanced stability [52][53][54][55].
The SNPID controller, while retaining the classic structure of PID, introduces adaptability in its control coefficients.This adaptability allows the SNPID to dynamically adjust its proportional, integral, and differential coefficients based on the changes in error.Therefore, compared to traditional PID controllers with fixed coefficients, the SNPID offers superior tracking performance and robustness when dealing with systems characterized by nonlinearity and significant time delays [56,57].In the temperature and humidity control system designed in this study, the workflow of the SNPID controller is illustrated in Figure 12.This flowchart elaborately displays the real-time adjustment and control execution process of the SNPID controller, thereby demonstrating its efficient adaptability and control capabilities in dynamic environments.For large agricultural greenhouses, considering the relatively slow changes in temperature, the control cycle of the SNPID controller should be appropriately long to reduce the frequency of control operations and allow the temperature to stabilize.Based on this characteristic, the control cycle is set to respond once every 5 to 10 min.Such a setting helps to smooth out short-term temperature fluctuations and reduces the system's overreaction.In each control cycle, the controller calculates the difference between the average air temperature over the past five minutes (denoted as i T ) and the target temperature (denoted as g T ).The controller's output is the adjustment amount of the ventilation opening, denoted as ( )  u k , which represents the current opening area of the ventilation as a percentage of its maximum area.
To illustrate specifically, consider a ventilation opening with a transverse width of 60 m and a top length of 1.5 m, with a maximum area of 90 square meters.The actuator controlling this ventilation opening is a constant-speed DC motor, set at a certain speed v M .If the area of the ventilation opening in the previous control cycle was ( 1)   A k  with a corresponding opening degree of ( 1)  u k  , the area of the ventilation opening at the previous moment can be determined using formula For the current moment, the area of the ventilation opening is set to , with an area change of  , and the maximum longitudinal length of the opening is l .Therefore, the relationship between the change in the opening degree of the ventilation ( ) u k  and the running time of the constant-speed DC motor t is as shown in Equation (22).Based on the change in opening degree, the required running time of the motor can be calculated.This calculation process is crucial for achieving temperature control, as it ensures that the adjustment of the ventilation opening matches the needs of temperature change.
Based on the theoretical framework and formulae of the algorithm, this study employs the Simulink toolkit within MATLAB 2023 software to construct a simulation model of the SNPID controller for experimental verification of the proposed method.The SNPID controller utilizes an input mechanism based on discrete incremental PID.Therefore, the specific implementation of the SNPID controller simulation model can be referred to in Figure 13.x k and

( )
x k , respectively.These inputs are then fed into the weight adjustment modules (namely, get_wkp,get_wki and get_wkd) for processing.
The core principle of the weight adjustment module is based on supervised Hebbian learning, which adjusts the neuron weights based on the input errors.The adjusted weights are subsequently input into the PID coefficient tuning module (get_PID), where the PID coefficients are tuned according to Equations ( 16) to (19).Finally, the incremental control signal ( ) u k  is calculated as the output according to Equations ( 20) and (21).

Temperature and Humidity Control Algorithm Design
The crux of this design centers on the SNPID controller, supplemented by a dehumidification algorithm, aiming to adjust the air temperature and humidity in the greenhouse based on preset times, temperature, and humidity values.Taking the daylight hours from 7:00 to 19:00 as an example, and particularly considering the ideal temperature range for tomato growth is 20 °C to 30 °C [58], we set the target temperatures for the morning and afternoon to 24 °C and 25 °C, respectively, given the large area of the greenhouse and the limitations of ventilation regulation.The primary task of the SNPID controller is to regulate the ventilation openings to ensure the greenhouse temperature remains within ±1 °C of the target temperature.Additionally, we set a low-temperature alert at 18 °C and a high-temperature alert at 28 °C for corresponding ventilation adjustments.
During the critical periods of 7:00 to 8:00 and 18:00 to 19:00, if the humidity inside the greenhouse exceeds 80% and the temperature is above 19 °C, the auxiliary dehumidification algorithm will be activated.This process is mainly controlled by the SNPID controller, known as the SNPID auto-control mode.Furthermore, we introduced Morning Breeze and Evening Breeze modes, focusing on dehumidification operations.Under specific temperature conditions, the system will enter a preparatory mode before transitioning from Morning Breeze to SNPID auto-control mode to ensure a smooth control transition.
The entire workflow of the temperature and humidity control algorithm is shown in Figure 14.If the trigger conditions for Morning Breeze, Preparatory, and Evening Breeze modes are not met, the system will directly switch to the SNPID auto-control mode, with the SNPID controller responsible for adjusting the ventilation openings.The following will introduce the control algorithm using the SNPID auto-control mode as an example.The essence of the SNPID controller lies in its unique SNPID control algorithm.To illustrate with a specific example, suppose the greenhouse is cultivating tomatoes, and during the daylight hours of 7:00 to 19:00, the Morning Breeze, Preparatory, and Evening Breeze modes are not triggered, then the greenhouse temperature will be controlled by the SNPID auto-control mode.At night, from 19:00 to the following morning at 7:00, to maintain the temperature, the ventilation openings will be sealed.
In some cases, if the Morning Breeze, Preparatory, and Evening Breeze modes are all triggered, such as after the Morning Breeze and Preparatory modes have ended and before the Evening Breeze mode begins, the temperature control of the greenhouse is still executed by the SNPID auto-control mode.This mode is the core control mode of the entire system, responsible for maintaining the ideal temperature of the greenhouse under complex and dynamic environmental conditions.The workflow of this mode is displayed in Figure 15.Table 6 comprehensively presents the operating procedures of the SNPID auto-control mode, along with its relevant parameters and conditions.This table clearly displays the control flow and operational steps under the SNPID auto-control mode and details the system's responses and handling methods under various temperature and humidity conditions in the greenhouse.In traditional embedded platforms, firmware updates typically involve replacing storage or using programmers to burn new system code.This not only increases time and cost investments, but also, due to the high-level permissions required, improper operations can easily lead to damage to hardware and software integrity, thereby significantly increasing maintenance risks.Thus, reducing the frequency of operations that require high permissions is crucial for enhancing project stability.By incorporating a bootloader and supporting In-Application Programming (IAP) technology, it is possible to deploy bootloader code programmatically in the initial phase.Subsequently, the bootloader can use communication ports such as USB serial ports or RS485 serial ports to achieve online updates of RT-Thread system code without needing to replace hardware or use high-permission JTAG ports.During the update process, the bootloader first downloads the new program to a reserved area in internal storage and performs program verification after the download is complete.Once verification is successful, the program is written into the main system data area, thus achieving a seamless system update.Additionally, the program verification mechanism further enhances the security and reliability of the update process.
The bootloader also possesses basic safeguard functions.Without bootloader support, the system might return to a faulty state upon restart after encountering severe errors that cannot be resolved by reset.In such cases, it is impossible to repair via communication means such as serial ports, and reprogramming through a programmer is required, which is not only time-consuming and labor-intensive, but also carries higher risks.However, due to its simple structure and high stability, the bootloader does not participate in actual control, and can effectively isolate itself from complex control codes and operating systems, maintaining independence.Therefore, in the event of a main system crash, the integrity of the bootloader's code remains unaffected, and the system can still reboot into bootloader mode to communicate with the external world for fault repair.
In this design, the bootloader implements basic judgment-wait-jump functionality.By default, the system waits for 5 s.If no command represented by the number 0 is received through the USB serial port during this period, the system will jump to the main system space to perform regular business functions.If a command represented by the number 0 is received during the waiting period, the bootloader activates the IAP function, receives the upgrade data packet via the Ymodem protocol from the port, writes the data to the main system area after parity checks, and then jumps to the updated application to execute corresponding functions after the update is complete.Additionally, in its workflow, the bootloader also needs to load the Huada Chip Function Library Device Driver Library Utility, configure the Clock Management Unit (CMU) to high-speed mode at 168 MHz, set up the timer to count at a frequency of 1 ms, and enable the UART serial port to support efficient communication and timing management.The workflow design of the bootloader is detailed in Figure 16.After the bootloader starts and completes initialization, it polls the serial port approximately every 5 milliseconds within a 5 s window.If no command represented by the number 0 is received during this period, the bootloader will deactivate the peripherals that were enabled during this time, such as GPIO and UART, and then jump to the main system to continue execution.Conversely, if a command represented by the number 0 is received, the bootloader activates the Ymodem library to receive firmware update data from the serial port according to the Ymodem protocol.After the data are received, they undergo parity checking.If the check is successful, the new firmware is written to the system.Subsequently, the system will jump to the updated main system to perform corresponding functions.If the check fails or if an error occurs during data transmission, the bootloader will discard the received data and output an error message via the serial port, stating "Transmission error, please resend."It will then check again if the command represented by the number 0 is received from the serial port to decide whether to continue receiving firmware data or jump to the main system.This process ensures the safety and reliability of the firmware update while providing an error handling mechanism to address potential data transmission issues.

Tsraide's Real-Time System Porting
Considering that the Huada HC32F460 chip has not received support from RT-Thread at the early stage of system development, it is necessary in this design to integrate the source code of the RT-Thread real-time operating system with Huada's Device Driver Library.This integration enables RT-Thread to run smoothly on this MCU.The version of the RT-Thread system used in this porting is 3.1.3,and its program files have been categorized and organized according to their functions.The specific functions corresponding to the files are described in Table 7.  17, the 'app' folder is used to store user programs, and all subsequent functional module codes are placed here.The 'startup' folder contains essential files needed for startup, such as 'main.c','startup_hc32f460.s','ddl_config.h',and 'rtconfig.h'.The 'driver' folder houses the function codes from the Device Driver Library, while the 'finsh' folder contains the codes for RT-Thread's terminal manager component.The 'cpu' folder and 'rtt' folder store the codes related to the ARM processor and the RT-Thread kernel source code, respectively.In the project configuration files 'ddl_config.h'and 'rtconfig.h',the FinSH, GPIO, and USART components are enabled through macro definitions.Additionally, this design involves writing library functions related to register unprotection, clock configuration, interrupt handling, timers, and serial communication.
After completing the porting and code writing, compilation and debugging were conducted.Once the compilation was successful, the program was burned onto the device, and upon startup, a preset welcome screen (as shown in Figure 20) was displayed through the terminal output, verifying the proper functioning of program logic and serial communication.These steps ensured the normal operation of the control system software modules within the software environment, providing solid software support for the overall system's stability and functionality.Both the central control unit and the main control board are implemented using the autonomous MCU HC32F460, connected through the RS485 bus.A single central control unit can manage multiple main control boards, and a single main control board is only managed by one central control unit.It can also work independently without the central control unit.The structure of the central control unit is relatively simple, with GSM module providing networking function, EEPROM module storing equipment information of the central control unit, power module supplying power to the equipment, screen and button module for staff operation, RS485 module providing connection function with the main control board, and the central control unit mainly serving as a transfer management function and not responsible for actual control.The design process is similar to the main control board, but the components carried are different, which will not be repeated here.In addition to supporting components such as RS485 module, power supply, buttons, digital tube, buzzer, and module, the main control board also adds motor drive and motor detection modules to achieve motor control functions, temperature and humidity sensor module, and achieving detection of the greenhouse environment.At the same time, it also provides debugging/burning modules for debugging and program burning.
As shown in Figure 22, the design scheme of the central controller includes a main control board, which can be connected to other central controllers and main control boards through RS485 interface, and also supports independent operation.All code related to control functions is executed in the on-chip system.The main control board is equipped with digital tubes to provide basic display functions and integrates buttons to achieve basic user interaction.In addition, two relays are installed on the main control board, which are connected to the motor and controlled to turn on or off through GPIO to achieve forward and reverse rotation of the motor.This design does not limit the model of the motor, so it can be compatible with DC motors produced by multiple manufacturers.The operating speed of the motor is a fixed speed.By changing the direction of rotation of the motor, the motor can roll up or unfold the plastic film on the roof to adjust the size of the roof ventilation opening.Due to the fixed width of the plastic film, the adjustment of the ventilation opening is actually equivalent to controlling the roll up length of the ceiling film, which is the circumference of the motor rotation.Considering the constant speed operation characteristics of the motor, the adjustment of the ventilation opening can be achieved by controlling the running time of the motor.Therefore, by precisely controlling the running time of the motor, the length of the film covering the ventilation opening can be adjusted, thereby changing the opening area of the ventilation opening.
This article focuses on the software and hardware development of the main control board.The stable driving of the main control board hardware and the accurate execution of software programs are key to ensuring the normal operation of control algorithms, thereby achieving the predetermined control functions.The successful deployment and operation of the single neuron PID control algorithm on the main control board is the algorithm core of this design scheme.

Main Control Board Program Process Design
This article takes the control system scheme of a single central controller and a single main control board as an example to explain the independent operation ability of the main control board and its ability to interact with the central controller through RS485 bus and Modbus communication protocol.As shown in Figure 23, the program workflow of this system includes steps such as starting the device, executing Bootloader, jumping to the main system program, and executing various status checks and control tasks.After the system starts, the Huada HC32F460 chip on the main control board will enable its internal processor and memory resources.The first step is to execute the bootloader stored in the first address segment of the memory, which is responsible for program updates and system jumps.After completing these initial steps, the system will enter the main system program and first perform the preparatory work, including checking the network status, sensor status, device resources, and reporting the system status.After completing these preparations, the system will perform automatic or manual temperature and humidity control tasks according to the configuration.After the control task is completed, the system may shut down or continue to wait for the next control task.
In this system, the main control board and the central controller each contain multiple functional modules.Table 8 shows a brief introduction to the functions of the main control board and the central control module.All these functional modules run in the RT Thread real-time operating system, and they work together and communicate based on the thread management, message queue, and interrupt management functions provided by the system.By using the driver management function of the system, call the Huada Device Driver Library function to access hardware resources and achieve control functions.In terms of software development, the main control board and the central controller adopt similar methods.This article will take the main control board as an example to provide a detailed introduction to the design and implementation process of functional modules.After the system is started, the main control board functional modules will be initialized sequentially.The initialization process of the system is shown in Figure 24.

Design and Implementation of Thread Time Slices and Interrupt Priority Tables
In this design, the priority table for each thread and interrupt is designed as shown in Table 9. Manual temperature and humidity control thread 10 ms 25 In this design, we adopted the RT Thread real-time operating system, which supports 0 to 255 thread priorities and is managed through a multilayer priority table.However, considering that the thread scheduling requirements for this project are not too complex, we have chosen to use a single-layer priority table.This configuration allows us to manage 0 to 31 priorities, which is sufficient to meet the needs of the current design.
In terms of specific priority allocation, the functional module threads are set to medium priority.In contrast, Modbus threads and automatic control threads are given higher priority.This setting ensures that these threads can complete tasks without preempting high priority threads at the bottom of the system, while also avoiding the problem of insufficient processor resources due to low priority.Through this priority configuration, we can effectively balance the system's responsiveness and resource allocation.

Automatic Temperature and Humidity Control Module
This section takes the automatic temperature and humidity control module as an example to explain in detail the deployment process of control algorithms in hardware.The temperature and humidity automatic control module is mainly responsible for automatic adjustment of temperature and humidity when the system is set to automatic control mode.The workflow of this module is shown in Figure 25, which begins with the initialization of the system.Firstly, the system will start and initialize the RT Thread operating system, followed by necessary human-machine interaction operations.This stage includes receiving user input and adjusting system settings.After completing human-computer interaction, the system will perform real-time tasks related to temperature and humidity control.These tasks are responsible for adjusting temperature and humidity settings based on current environmental data to maintain the set environmental conditions.
During real-time task execution, if any errors or exceptions are encountered, the system will enter the "error exception handling" phase.This stage includes error detection and user notification.If an error is detected, the system will record relevant error information and may prompt the user to intervene.In the absence of errors, the system continues to execute subsequent real-time tasks.
After the real-time task is completed, the system will collect environmental data, which is crucial for achieving precise temperature and humidity control.The system first determines whether the data collection is successful.If successful, store the data for future use; if it fails, handle the data collection exception and attempt to collect the data again.
After the data collection and processing are completed, it marks the end of a working phase of the temperature and humidity control module.The entire workflow is iterative, emphasizing the importance of data collection and processing while maintaining suitable environmental conditions, and systematically addressing any possible errors and anomalies.
The initialization of the temperature and humidity automatic control module is the starting point of the key steps in the system.After initialization, the system first performs a series of checks on the motor and sensors to ensure that all functional components are in normal working condition.Afterwards, the control module executes automatic control tasks based on the instructions in the message queue, which are centered around the SNPID controller.
When the system is not set to automatic control mode, the temperature and humidity control module will enter a waiting state and do not perform any operations.In automatic control mode, the module will continuously listen to the message queue.This mechanism ensures that the system can flexibly respond to external commands, immediately stopping automatic control or maintaining the current automatic control state based on the received message.10.Through the examples in the table, we can gain a detailed understanding of the specific logic of implementing automatic temperature and humidity control through program code, including key technical details such as task scheduling, message processing, and exception management.

Temperature Control Testing Based on Simulation Modeling
In this section, we focus on conducting thorough simulation tests of the SNPID control algorithm to accurately assess its performance.As the first step of verification, we employ a step response test to evaluate the algorithm's fundamental performance indicators, which is a standard method for assessing the response speed and stability of control systems.Through this test, we gain preliminary insights into how the algorithm adjusts its output under sudden changes in input conditions.
Subsequently, to comprehensively evaluate the effectiveness of the SNPID control algorithm in controlling temperature within a simulated greenhouse environment, we conducted a series of greenhouse temperature tracking simulation experiments.These experiments simulate temperature variations within the greenhouse and examine the SNPID algorithm's adjustment and control capabilities under these changing conditions.For a more in-depth analysis and validation, we compared these results with those obtained using traditional PID control algorithms.This comparison allows us to more clearly understand the advantages and limitations of the SNPID algorithm in practical applications compared to traditional methods.

Step Response Performance Test of SNPID Algorithm
In this section, we focus on showcasing the theoretical performance test results of the SNPID control algorithm.To conduct an effective PID performance test, we simplified the temperature model of the solar greenhouse, modeling it as a nonlinear first-order inertia system with a time delay [51].Although this model is a simplified version, it provides sufficient accuracy to compare the performance of different control algorithms.The related transfer function is detailed in Equation (23) in the text.
In our study, this transfer function is used to abstractly describe the greenhouse environment.It is important to emphasize that, while this transfer function does not completely conform to the full thermodynamic simulation model of a solar greenhouse, it effectively captures key system characteristics of the greenhouse model.This approximation method is particularly suitable for conducting step response tests, providing a practical basis for evaluating and comparing the performance of different control strategies [59,60].
In traditional PID control, determining the PID coefficients usually relies on a trialand-error method [61,62].This method involves continuously adjusting the PID coefficients and tuning time and minimizing the overshoot to determine the optimal coefficients for the traditional PID controller, set as    12 lists the associated performance metrics.In the step response tests, SNPID exhibited a smaller overshoot (only 0.03%) and demonstrated superior rise time, settling time, and peak time compared to both AFPID and cPID.Specifically, SNPID showed a 26.6% reduction in rise time, an 11.5% reduction in settling time, and a 24.3% reduction in peak time.Relative to cPID control, SNPID achieved a 9.038% decrease in rise time, a 1.49% decrease in settling time, and a 5.327% reduction in peak time.These results indicate that in terms of step response control performance, the Single Neuron PID algorithm outperforms both the traditional PID and Adaptive Fuzzy PID control algorithms.After completing the step response test simulations, this study proceeded to integrate the SNPID controller and the traditional PID (cPID) controller with the mathematical model of a solar greenhouse.The aim was to verify and compare the temperature tracking performance of these systems under control.The structure of this greenhouse simulation model is detailed in Figure 28, where we focus on several key components: the ventilation opening input module, the heat component analysis module, and the heat-to-temperature conversion module.The output of the PID controller, u(k), serves as the input for the ventilation opening module, calculating the required size of the ventilation openings.The motor module (Motor Model) adjusts the size of the ventilation openings based on these calculations, thereby altering the heat distribution inside the greenhouse.These distributions correspond to the parts of the simulation model that include heat from solar radiation and the heat stored in the walls Q st [63].Through this process, after the total heat inside the greenhouse changes, the adjusted internal air temperature of the greenhouse can be obtained after processing by the heat-to-temperature conversion module.In this study, the controlled greenhouse simulation model displayed in Figure 29 was designed with two independent simulation models for a direct comparison of control effects: one equipped with a Single Neuron PID (SNPID) controller and the other with a traditional PID (cPID) controller.Specifically, both greenhouse models, namely, Greenhouse Model and Greenhouse Model1, utilize the solar greenhouse thermodynamic simulation model described in Figure 28.The target temperature for both models was set at 25 °C, with an initial temperature of 20 °C.The simulation time frame mainly focused on daytime, considering that in actual greenhouse environments, ventilation openings are typically closed at night to maintain temperature.Therefore, our simulation started at sunrise (t = 0 h) and lasted for 12 h.Solar radiation was simulated as a Gaussian normal distribution curve, peaking at 500 W/m² around noon, and then the radiation intensity dropped to 0 after t ≥ 8.3 h.This curve is displayed in Figure 30.Additionally, the trend of the external temperature was designed to match the changes in sunlight, with a temperature range of 16-21 °C.During the night, the external temperature was set to a constant 16 °C.This setting aimed to assess whether the controllers could effectively implement insulation strategies under continuous low temperature conditions.In the simulation experiments, we set a goal: to maintain the internal temperature of the greenhouse during the day at the optimal growth temperature for tomatoes, approximately a constant level of 25 °C.At night, due to the lack of solar heat input, the control system needs to minimize ventilation cooling to ensure effective operation of the controller, and ensure that the ventilation openings are completely closed to prevent heat loss.Additionally, to increase the challenge of the simulation and test the algorithm's resistance to environmental changes, we introduced Gaussian noise into the external temperature input, simulating the impact of environmental noise on the temperature control system.Figure 31a shows the changes in the internal temperature of the greenhouse under SNPID and cPID control strategies.Figure 31b shows the trends in ventilation opening adjustments under these two control strategies.In these illustrations, the temperature and ventilation adjustment curves under SNPID control demonstrate the effectiveness of the Single Neuron PID control algorithm, while the cPID control curves reflect the performance of the traditional PID control algorithm.
Specifically, during the periods from t = 0 h to t = 1.9 h and t = 5.7 h to t = 12 h, both control systems face the challenge of achieving the set target temperature indoors.As shown in Figure 31b, both control systems can precisely close the ventilation openings to minimize heat loss and maintain the internal temperature of the greenhouse.During the phase from t = 1.9 h to t = 5.7 h, thanks to strong solar radiation, both control systems stabilize the indoor temperature around the target temperature of approximately 25 °C.In responding to external disturbances, the SNPID control system shows higher efficiency, limiting temperature fluctuations to a smaller range, between 26.40 °C and 23.76 °C, while the temperature range for the cPID control system is larger, between 27.12 °C and 22.99 °C.This comparison indicates that the Single Neuron PID control system is superior to the traditional PID control system in terms of stability and accuracy in temperature control.
As shown in Figure 31b, by analyzing the changes in the opening of the ventilation, we can see that the SNPID controller adjusts more actively and frequently compared to the cPID controller.In some peak periods, the adjustment extent is even about 40% higher than the traditional controller, reflecting its rapid response characteristic, which allows it to adapt quickly to environmental changes while maintaining control precision.Furthermore, in the face of external disturbances, the SNPID and cPID controllers adopted different strategies to stabilize the temperature, with these differences particularly evident at t = 3.33 h.As shown in Figure 32, the immediate adjustments to the ventilation openings made by these two controllers in response to interference signals reflect their respective adaptability and efficiency.By comparing these two control strategies, we can more accurately evaluate the performance of each controller in dynamic environments.Under temperature fluctuations caused by Gaussian noise, the Single Neuron PID controller (SNPID) and the traditional PID controller (cPID) exhibited different adaptation and response patterns.Particularly when facing disturbances, the SNPID controller managed to control the peak temperature fluctuation at 26.4 °C, while the peak for the cPID controller reached 27.12 °C.Notably, the SNPID controller required only 0.157 h to readjust the temperature back to within the range of 25 °C ± 0.5 °C (achieved at t = 3.487 h), while the cPID controller required at least 0.285 h.Before the next wave of disturbance, the cPID controller was even unable to stabilize the temperature, highlighting the significant advantage of SNPID in quickly restoring a stable state.Its adjustment time is at least 45.0% faster than that of cPID.Overall, the SNPID controller demonstrated rapid and proactive response capabilities in dealing with disturbances, enabling it to stabilize temperature at a higher speed.Compared to the traditional cPID controller, the SNPID controller exhibits superior performance in several key aspects such as stability, adaptability, and interference resistance.Particularly noteworthy is the SNPID controller's performance in terms of system overshoot, which is crucial for agricultural production scenarios that require precise temperature control.The ability of the SNPID controller to achieve such performance is mainly due to its unique algorithm design, which allows for rapid adaptation to environmental changes and precise adjustment of control parameters.This efficient control mechanism not only improves the accuracy of temperature control, but also enhances the overall system's stability and reliability in the face of external changes.Therefore, the SNPID controller holds significant application value in modern precision agriculture and other fields requiring precise environmental control.

Control System Testing Based on Real Greenhouses
After successfully designing and validating the control algorithm through simulation, we further applied this algorithm to the main control board of an actual greenhouse, conducting on-site temperature and humidity control tests.The core task of this phase was to verify the functionality of the system components and the control efficacy of the developed algorithm, along with detailed recording and analysis of the overall control performance.
Given the crucial role of the main control board in executing control tasks, we first conducted rigorous tests of its functional usability, including checking the stability of the hardware, the responsiveness of the software, and the accurate execution of control commands.After comprehensively testing and confirming the normal functioning of the main control board, we shifted our focus to further in-depth testing and evaluation of the control algorithm's performance.This process covered not only the adaptability and stability assessment of the algorithm under different environmental conditions, but also included a detailed analysis of its response efficiency and control precision under actual greenhouse conditions.These on-site tests provided us with direct evidence of the algorithm's performance in practical applications, marking an important step from theory to practice.

Main Control Board Function Test
After completing the wiring of the main control board with the 220 V mains power, sensors, motor power supply module, and motor, and powering up the system, the working status of the system is as shown in Figure 33a.On the left side of the system is the main control board unit, and on the right side marked as the WX-DC2412 unit is the motor drive module, responsible for driving high-power DC motors.Once the system is powered on, the indicator light on the main control board lights up, and the LED digital tube sequentially displays the current temperature, humidity, vent opening, and motor current values, as shown separately in Figure 33b-e.
Specifically, the digital tube in Figure 33b displays "T26.6",indicating the current temperature is 26.6 °C.Due to the display limitation of the seven-segment digital tube, the letter T is used here with "-|" pattern.Figure 33c shows "H24.1",indicating the relative humidity is 24.1%; Figure 33d displays "P046", indicating the vent opening is 46 cm, which can be adjusted by the user via a toggle switch; Figure 33e shows "A 01", indicating the motor current is 0.01 A. These intuitive display messages make monitoring and adjusting the system state simple and direct.

Temperature and Humidity Control Effect Test
In this study, the control algorithm we developed was field-validated in a standard experimental greenhouse in Dandong, Liaoning Province.The interior and exterior environments of this greenhouse are depicted in Figure 34.This east-west sloping solar greenhouse covers an area of approximately 400 square meters, with its ventilation opening centrally located at the top.It is a rectangular shape, measuring 20 m wide and 1.5 m high, covered with transparent plastic film.To precisely adjust the area of the ventilation opening, we used a motor drive to roll up and down the plastic film.Such a setup allows for fine-tuning of the vent opening according to the instructions of the control algorithm, effectively controlling the temperature and humidity inside the greenhouse.The motor's speed is set at 15 cm per second to ensure smooth and rapid response in opening the vents.
For a comprehensive evaluation of the performance of the control algorithm, we selected a control greenhouse with a similar structure and orientation for comparison, which used a traditional PID control algorithm based on the STM32F407.Given the consistent structure and orientation of the two greenhouses and similar external environmental influences, this provided an effective benchmark for comparing algorithm performance.The testing was conducted remotely, with local engineers responsible for installing and configuring the control systems and programs, deploying the control algorithm according to the methods described in Section 3, and transmitting the test data back in real-time.These data were then used for in-depth analysis and evaluation to ensure the accuracy and reliability of the conclusions drawn.A. Testing the effectiveness of air temperature control in chambers The control system underwent a preliminary test lasting about 5 h on February 20th, using the proportional coefficient k = 0.04 and learning rates kp  = i k  = kd  = 1 as the parameter set for the SNPID algorithm, as in the simulation tests.The test results indicated that this set of parameters could converge the temperature to the target level.Therefore, on March 5th, we conducted a 24 h practical test using the same parameter set.
According to the meteorological data, on March 5th, the highest temperature in Dandong City was 5 °C, and the lowest was −3 °C, indicating a cold climate.Considering that the crop being cultivated was tomatoes, with an optimal growth temperature of 25 °C, we set the following control objectives: during the sunny hours (9:00 to 15:00), the air temperature inside the greenhouse should be maintained between 24 °C and 26 °C, with a deviation of ±1 °C from the optimal growth temperature.If the temperature deviation from the optimal growth temperature was within ±1 °C for 80% of the control period, the control accuracy was considered to be ±1 °C.At other times, the temperature should be as close as possible to the target value of 25 °C.The control accuracy for both the experimental greenhouse and the control greenhouse was set at 6 min, meaning the ventilation openings were adjusted every 6 min.
On March 5th, the experiment we conducted displayed a comparison of temperature changes between the experimental greenhouse equipped with an autonomous platform control system and improved algorithm, and the control greenhouse using traditional control methods, as shown in Figure 35a.During the sunny hours (9:00 to 15:00), the average temperature of both the experimental and control greenhouses successfully remained within the range of 25 ± 1 °C, with the experimental greenhouse averaging 24.9 °C and the control greenhouse averaging 25.8 °C.
It is noteworthy that the two greenhouses showed significant differences in the amplitude of temperature fluctuations.The Root Mean Square Error (RMSE) of the temperature in the experimental greenhouse was 0.734, while that in the control greenhouse was 1.594, indicating greater temperature stability in the experimental greenhouse.Particularly in the experimental greenhouse, 90.2% of the temperature readings were within the range of 25 ± 1 °C, compared to only 40% in the control greenhouse.During the night and early morning hours, both greenhouses exhibited good insulation performance, with no significant temperature fluctuations.
The adjustment of the ventilation opening is a key factor in controlling the greenhouse temperature.As shown in Figure 35b, the adjustments in the experimental greenhouse were more active and sensitive, with a maximum opening of 67 cm, showing a rapid response to high temperatures, and a minimum length of 5 cm, indicating appropriate adjustments at lower temperatures.In contrast, the ventilation adjustments in the control greenhouse were more conservative, with a maximum opening of 55 cm, and remained unchanged during certain periods, reflecting a less timely response to temperature fluctuations.From these analyses, it is evident that the experimental greenhouse using the SNPID algorithm demonstrated higher stability and precision in temperature control.The temperature control accuracy of the experimental greenhouse reached ±1 °C, compared to ±2.5 °C in the control greenhouse.According to the above description and analysis, the comparison of temperature management and ventilation control between the experimental greenhouse and the control greenhouse is shown in Table 13.These results effectively validate the adaptability and robustness of the SNPID algorithm, proving its ability to enhance the precision and stability of temperature control in greenhouses in practical applications.In this test, although air humidity was considered a secondary control target and no strict control standards were set, we explored the effects of humidity control by introducing Morning Breeze and Evening Breeze modes.These modes aim to manage humidity more effectively during specific periods.
According to the humidity curve in Figure 36, we observed several key points: First, during periods of abundant sunlight, as temperature control became the primary objective, both greenhouses reduced humidity to a minimum level of about 40% by adjusting ventilation ports.Second, the experimental greenhouse triggered the Morning Breeze mode at 8:09 AM and the Evening Breeze mode between 4:05 PM and 4:35 PM.However, the activation of these modes did not show a significant difference in humidity control between the experimental and control greenhouses.
A deeper analysis of the data in the charts revealed that the current humidity control strategy did not achieve the expected results, indicating that adjustments to the control algorithm might be necessary.Comparing the humidity data of the experimental and control greenhouses, although both showed similar fluctuation trends, there were significant differences in response time and magnitude.These differences could be caused by several factors: First, minor changes in external environmental conditions, such as sudden temperature fluctuations or rainfall, could lead to rapid changes in humidity.Second, internal greenhouse conditions, such as soil moisture and plant water status, also affect air humidity.For example, an increase in soil moisture can raise air humidity through evaporation.Additionally, differences in the opening and closing strategies of ventilation ports, even under the same control policy, could result in variations in humidity control due to sensor data delays or inconsistencies in the ventilation system's response speeds.Finally, the transpiration of vegetation is an important factor; differences in the growth status and types of vegetation in different greenhouses can cause variations in humidity responses, especially during the day when photosynthesis is most active.
To better understand how these factors affect humidity control and to improve our strategies in future work, we plan to take the following steps: (1) Collect environmental data at a higher frequency to monitor humidity changes more precisely; (2) Adjust control parameters such as the frequency and extent of ventilation openings; (3) Explore humidity management methods that are more coordinated with temperature control; (4) Conduct a deeper study on the relationship between plant transpiration and changes in greenhouse humidity.We hope that these measures will allow us to more accurately assess and optimize humidity control strategies, achieving efficient humidity management under different environmental conditions.

Conclusions
This study comprehensively explored the design and optimization process of a temperature and humidity control system for sloped solar greenhouses.It focused on the software and hardware design and implementation of a control system based on an autonomous platform, the development of innovative temperature and humidity control algorithms, and the testing of these systems in real-world environments.The specifics are as follows: 1.In terms of engineering implementation, this study successfully utilized an embedded MCU chip with domestic intellectual property rights to build the hardware framework and developed an embedded real-time operating system.2. Regarding theoretical algorithms, this study designed and validated a control algorithm based on the Single Neuron PID to optimize temperature and humidity control in solar greenhouses.Simulation tests showed that this algorithm outperforms the traditional PID algorithm in key performance indicators such as overshoot, rise time, settling time, and peak time.3. Field tests further confirmed its effectiveness, especially in maintaining the stability and precision of temperature within the greenhouse, significantly improving temperature control accuracy.Specifically, the experimental greenhouse using the SNPID algorithm and autonomous software and hardware platform successfully maintained the temperature within the set range of 25 ± 1 °C for 90.2% of the time, compared to only 40% for the control greenhouse using traditional PID algorithm and foreign software and hardware platforms.Additionally, the experimental greenhouse demonstrated a lower Root Mean Square Error (RMSE) in temperature compared to the control greenhouse, confirming the effectiveness of the SNPID algorithm in improving the efficiency and stability of temperature control.However, in terms of humidity control, although Morning Breeze and Evening Breeze modes were introduced, the differences in these strategies were not apparent in the practical application comparison experiments, indicating a need for more in-depth experiments and optimization of humidity control strategies in future work.
Overall, this study provides a set of solutions for temperature and humidity control in sloped solar greenhouses, including the design of an autonomous control system, innovation in control algorithms, and practical testing of the system.The implementation of this research holds significance for smart agriculture and sustainable agricultural production.Future studies should further explore the applicability of this algorithm under different environmental conditions and consider its potential applications in other aspects of temperature and humidity control technology.

Figure 1 .
Figure 1.Abstract structure of slant type solar greenhouse.

Figure 2 .
Figure 2. Schematic structure of sectional control system for a large greenhouse.

Figure 6 .
Figure 6.Temperature and humidity curves of a single neuron PID decoupling control dynamic experiment.

Figure 7 .
Figure 7. Temperature and humidity curves of single neuron PID decoupling control perturbation test.

Figure 9 .
Figure 9. Block diagram of the fuzzy PID control system.

Figure 14 .
Figure 14.Temperature and humidity control algorithm workflow.

4. 2 .
Control System Software and Hardware Architecture Design 4.2.1.Overall Hardware DesignThis control system consists of two parts: the main control board and the central controller.The part directly related to the control task and connecting external devices such as motors and sensors is called the main control board, responsible for actual greenhouse environment regulation.The part that provides an interactive interface, connects to the unit cloud server, and is responsible for networking, uploading greenhouse information, receiving instructions, managing the main control board, and other functions is called the central controller.It is responsible for monitoring and managing the working status of the main control board, as shown in the block diagram in Figure21.

Figure 21 .
Figure 21.Hardware Architecture of Control System.

Figure 22 .
Figure 22.Main control board design scheme.

9
Motor status detection module: used to call the electricity meter to read the working status of the motor -10 Motor drive module: used to control the on/off of relays -11 Temperature and humidity sensor monitoring module: used to read the values of temperature and humidity sensors -12 Modbus module: used to configure Modbus communication -13 Temperature and humidity automatic control module: used for automatic control of temperature and humidity -14 Temperature and humidity manual control module: used to receive manual control information -

Figure 24 .
Figure 24.Initialization process of various functional modules on the main control board.

Figure 25 .
Figure 25.Workflow of Temperature and Humidity Automatic Control Module.

 = 1 .
04.In the case of the SNPID controller, the parameter set is defined as k = 0.04, with kp We conducted a comparative analysis by simultaneously testing the step responses of the traditional PID controller, the Adaptive Fuzzy PID controller, and the SNPID controller in a greenhouse model.The simulation structure is shown in Figure26, where SNPID, cPID, and AFPID represent the simulation modules for the Single Neuron PID control algorithm, the traditional PID control algorithm, and the Adaptive Fuzzy PID, respectively.

Figure 27
Figure 27 presents the step response performance simulation results, and Table12lists the associated performance metrics.In the step response tests, SNPID exhibited a smaller overshoot (only 0.03%) and demonstrated superior rise time, settling time, and peak time compared to both AFPID and cPID.Specifically, SNPID showed a 26.6% reduction in rise time, an 11.5% reduction in settling time, and a 24.3% reduction in peak time.Relative to cPID control, SNPID achieved a 9.038% decrease in rise time, a 1.49% decrease in settling time, and a 5.327% reduction in peak time.These results indicate that in terms of step response control performance, the Single Neuron PID algorithm outperforms both the traditional PID and Adaptive Fuzzy PID control algorithms.

Figure 27 .
Figure 27.Simulation results of the comparison test of the step response.

Figure 31 .
Figure 31.Variation curves of controlled temperature and vent opening of greenhouse.(a) Controlled Temperature Curves of Greenhouse Under SNPID And cPID Control and (b) SNPID and cPID Output Vent Opening Change Curve.

Figure 32 .
Figure 32.Details of temperature profiles before and after t = 3.33 h.

Figure 33 .
Figure 33.Schematic diagram of the working state of the main control board.(a) the working status of the system, (b) current temperature, (c) relative humidity, (d) vent opening and (e) motor current.

Figure 34 .
Figure 34.Internal and external views of the experimental Chinese solar greenhouse.

Figure 35 .
Figure 35.Plot of variation in greenhouse temperature and air opening size.(a):Internal Air Temperature and (b) Tuyere Size.

Table 1 .
Parameter list of single neuron PID decoupling control system.

Table 2 .
Assignment table of fuzzy variables.

Table 3 .
Fuzzy Control Rules for Δ .

Table 4 .
Fuzzy Control Rules for Δ

Table 5 .
Fuzzy Control Rules for Δ

Table 6 .
SNPID self-control mode operation and response flow.

Table 7 .
Code Corresponding Function Table.Based on the template routines provided by Huada, this design has integrated the RT-Thread source code and enabled core components within the project, as shown in Figures 17-19.In Figure

Table 8 .
Comparison Table of Main Control Board and Central Controller Function Modules.

Table 9 .
Time slices and interrupt priority table.

Table 10 .
Function Code Example of Temperature and Humidity Automatic Control Module.//Algorithm for Temperature and Humidity Automatic Control Module.The functional codes of the SNPID controller are shown in Table11.

Table 12 .
Step Response Performance Metrics.

Table 13 .
Comparison of temperature management and ventilation control between experimental greenhouse and comparison greenhouse.
B. Testing the effectiveness of air humidity control in chambers