Improved-lstm-based fuzzy-pid garbage can temperature prediction and control system and method
By using improved LSTM and fuzzy PID control algorithms, combined with temperature and humidity sensors and environmental monitoring equipment, accurate prediction and stable control of the temperature of the food waste bin were achieved, solving the problems of resource waste and low control precision, and achieving the goal of low carbon and energy saving.
Patent Information
- Application Number
- CN202311041044.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-18
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2043-08-18
AI Technical Summary
Existing technologies cannot accurately predict temperature changes in food waste bins, resulting in wasted resources in the cooling system and low control precision, making it difficult to maintain temperature stability in high-temperature environments.
An improved Long Short-Term Memory (LSTM) network combined with a fuzzy PID control algorithm is used. Temperature and humidity sensors and environmental monitoring equipment are used to monitor data in real time. The LSTM model is used to predict the temperature inside the garbage bin and adjust the fan speed to achieve precise temperature control.
It achieves stable temperature maintenance of the trash can under high-temperature conditions, avoiding resource waste and achieving low-carbon and energy-saving effects.
Smart Images

Figure CN117262535B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of neural network prediction and temperature control, and particularly relates to a fuzzy PID garbage can temperature prediction and control system and method based on an improved LSTM. BACKGROUND
[0002] Kitchen waste is rich in various organic matter and inorganic salt. In summer, the outdoor temperature is relatively high, and kitchen waste is prone to rot and deterioration during collection, storage and transportation, emitting foul odor and affecting the living environment. The use of a wet curtain-fan system as a cooling system provides a normal temperature storage environment for kitchen waste, reduces the rate of kitchen waste rot and deterioration, and can improve the kitchen waste storage environment. However, since the cooling principle is forced ventilation and evaporative cooling, outdoor environmental factors will affect the cooling effect of the garbage can, and traditional methods such as linear programming cannot confirm and predict the temperature in the garbage can. With the proposal of the carbon peak and carbon neutralization targets in China, improving the environment and reducing carbon emissions have become the research direction of various industries. Therefore, how to accurately predict the temperature and control the cooling system to reduce resource waste has become a problem that needs to be solved.
[0003] Neural networks have self-organizing, self-learning, and nonlinear dynamic processing characteristics, and are suitable for garbage can temperature prediction models with nonlinear changes. Traditional PID control systems have poor robustness and low control accuracy, and are not suitable for nonlinear temperature control. Therefore, in order to accurately predict the real-time temperature of the garbage can, the application uses an improved long short-term memory (LSTM) network and optimizes the PID control algorithm to predict the temperature in the garbage can according to outdoor environmental factors and feedback control the speed of the fan according to the prediction results, maintaining the stability of the temperature in the garbage can while achieving low-carbon energy-saving effect. SUMMARY
[0004] In view of the deficiencies in the prior art, the application provides a fuzzy PID garbage can temperature prediction and control system and method based on an improved LSTM, which accurately predicts the temperature, adjusts the fan speed in advance, maintains the temperature stability of the garbage can in a high-temperature environment, and avoids resource waste caused by keeping the fan running at full speed in a low-temperature environment, achieving low-carbon energy-saving effect.
[0005] The application achieves the above technical purpose through the following technical means.
[0006] A fuzzy PID temperature prediction and control system for a trash can based on an improved LSTM includes multiple temperature and humidity sensors installed inside the trash can to detect internal temperature and humidity data. Environmental monitoring equipment is placed outside the trash can to detect outdoor temperature, wind speed, relative humidity, and solar irradiance. A waterproof electrical control cabinet is installed on the outer wall of the trash can, housing a control system including a microcontroller, relays, a SCR regulator, and a 4G transmission module. The temperature and humidity sensors, the evaporative cooling pad / fan system, and the environmental monitoring equipment are all connected to the control system to transmit detection data and receive control signals. The control system transmits data to the cloud and an external computer via the 4G transmission module. The external computer performs predictive analysis and sends the prediction results back to the control system, which then controls the evaporative cooling pad / fan system.
[0007] Furthermore, the evaporative cooling pad-fan cooling device includes a fan installed at the air inlet on one side of the garbage bin, an evaporative cooling pad installed at the air outlet on the other side of the garbage bin, a water tank on the ground on one side of the evaporative cooling pad, a water pump placed in the water tank, the water pump connected to a water pipe, and a nozzle installed at the other end of the water pipe above the evaporative cooling pad for spraying water onto the evaporative cooling pad.
[0008] A method for predicting and controlling the temperature of a garbage bin using the above-mentioned fuzzy PID control system based on improved LSTM includes the following steps:
[0009] Step 1: Define the data sampling format based on feature encoding;
[0010] Step 2: The control system collects data according to the set sampling method and further transmits the data to the cloud and external computer for analysis and processing. The external computer uses outdoor environmental data, garbage bin internal temperature data, garbage bin internal humidity data, and fan speed as sample data.
[0011] Step 3: Process the sample data using the normalization method, and divide 80% of the sample data into the training set and the remaining 20% into the test set;
[0012] Step 4: Initialize the fuzzy PID controller based on LSTM model predictive control;
[0013] Step 5: Initialize the LSTM neural network based on the sample data processed in Step 3;
[0014] Step 6: An external computer introduces a conventional fuzzy PID control algorithm, combines it with data detected by temperature and humidity sensors, and sends instructions to the control system. The control system uses a thyristor speed controller to perform preliminary feedback control adjustment of the fan speed and obtains the temperature data inside the garbage bin for the day.
[0015] Step 7: The external computer uses the LSTM neural network initialized in step 5 to predict the overall average temperature in the garbage can based on the data obtained in step 6, and on this basis, introduces the fuzzy PID control algorithm based on the LSTM model predictive control initialized in step 4, and adjusts the fan speed in advance through the thyristor speed regulator, so that the temperature in the garbage can is always controlled at 25°C, keeping the temperature in the garbage can constant.
[0016] Further, the specific process of step 1 is as follows:
[0017] According to the characteristics of different time periods, and excluding the half hour before and after the system is turned on, the daily 8:30-10:30, 10:30-12:30, 12:30-14:30, 14:30-17:00 are classified into four data time periods, and the control system classifies and encodes the data according to the data collected in different time periods. The encoding form includes four kinds of (xi, 1, 0, 0, 0), (xi, 0, 1, 0, 0), (xi, 0, 0, 1, 0), (xi, 0, 0, 0, 1), xi represents the data collected by the control system.
[0018] Further, the specific formula for processing the sample data in step 3 is as follows:
[0019]
[0020] In the formula, x i is the transformed data of the ith input variable, i is a natural number excluding 0; X io is the experimental data; X max , X min are the maximum and minimum values in the observed values, respectively.
[0021] Further, the specific process of step 4 is as follows:
[0022] Let the current environmental temperature be T(k), and the set temperature be T ref , then the current temperature error e(k) = T ref -T(k), k represents the current time;
[0023] The output of the PID controller is:
[0024] u(k) = u p (k) + u i (k) + u d (k);
[0025] Where, u p (k), u i (k), u d(k) are the outputs of the proportional, integral, and derivative parts, respectively, and are respectively:
[0026] u p (k) = K p e(k);
[0027]
[0028] u d (k) = K d (e(k) - e(k-1));
[0029] wherein K p , K i , and K d are the proportional, integral, and derivative coefficients, respectively;
[0030] The control law of the LSTM model predictive control is:
[0031]
[0032] wherein, represents the fan speed obtained by model prediction; K c is an adjustment parameter; p represents a prediction time domain; e(k+i|k) represents a prediction error after i time in the prediction time domain at the current time k, and the prediction error is represented as:
[0033]
[0034] The output of the PID controller combined with the LSTM model predictive control is:
[0035]
[0036] By adjusting the parameter K c , the environmental temperature can be maintained at the set temperature T ref .
[0037] Further, the specific process of step 5 is as follows:
[0038] A fuzzy layer and a fuzzy inference layer are introduced into the LSTM neural network, wherein the fuzzy inference layer utilizes the rules of fuzzy logic to perform fuzzy reasoning and fuzzy inference according to the membership degrees of the input fuzzy sets, thereby obtaining the output fuzzy set; before training the LSTM neural network, the test setting time steps are trained in advance, and the hyperparameters in the LSTM neural network are set, that is, by controlling different time steps with the same other parameters, the influence of different time steps on the LSTM neural network is tested through multiple experiments and debugging in terms of convergence, convergence speed, and prediction error, and finally the time step corresponding to the optimal prediction accuracy is selected; then the sample data is used to train and test the LSTM neural network.
[0039] The present application has the following advantages:
[0040] The present application can adjust the fan speed in real time according to the preset temperature, which not only adapts to environmental changes, maintains the temperature stability of the garbage can in a high-temperature environment, but also avoids resource waste caused by keeping the fan running at full speed in a low-temperature environment, further realizing the goal of low energy consumption. BRIEF DESCRIPTION OF DRAWINGS
[0041] Figure 1 It is a front view of the garbage can of the present application;
[0042] Figure 2 It is an axonometric view of the garbage can of the present application;
[0043] Figure 3 It is a fuzzy LSTM neural network structure diagram of the present application;
[0044] Figure 4 It is a fuzzy PID control flowchart based on improved LSTM of the present application.
[0045] In the figure: 1-environmental monitoring equipment; 2-waterproof electric control cabinet; 3-temperature and humidity sensor; 4-wet curtain-fan cooling device; 401-fan; 402-water tank; 403-water pump; 404-water pipe; 405-wet curtain. DETAILED DESCRIPTION
[0046] The present application will be further described below in conjunction with the drawings and specific embodiments, but the scope of protection of the present application is not limited thereto.
[0047] Referring to Figure 1 , 2 The fuzzy PID garbage can temperature prediction and control system based on improved LSTM of the present application comprises an environmental monitoring equipment 1, a waterproof electric control cabinet 2, a wet curtain-fan cooling device 4, and a temperature and humidity sensor 3. A plurality of temperature and humidity sensors 3 are installed inside the garbage can for detecting temperature data and humidity data inside the garbage can. An environmental monitoring equipment 1 is placed outside the garbage can, which comprises a temperature sensor, a wind speed sensor, a humidity sensor, and a light sensor for detecting outdoor environmental data including outdoor temperature, air speed, air relative humidity, and solar radiation intensity. The waterproof electric control cabinet 2 is installed on the outer wall of the garbage can and has a built-in control system comprising a single-chip microcomputer, a relay, a silicon-controlled regulator, a 4G transmission module, etc. The temperature and humidity sensor 3 and the environmental monitoring equipment 1 are connected to the waterproof electric control cabinet 2 for data transmission.
[0048] Referring to Figure 1 , 2The wet curtain-fan cooling device 4 comprises a fan 401, a water tank 402, a water pump 403, a water pipe 404 and a wet curtain 405. An air inlet is formed on one side of the garbage can, and the fan 401 is installed at the air inlet on the one side of the garbage can. An air outlet is arranged on the other side of the garbage can, and the wet curtain 405 is installed at the air outlet on the other side of the garbage can. The water tank 402 is installed on the ground on one side of the wet curtain 405, the water pump 403 is placed in the water tank 402 and connected with the water pipe 404, and a plurality of spray heads are arranged at the other end of the water pipe 404 and located above the wet curtain 405, for spraying water on the wet curtain 405.
[0049] Referring to Figure 3 , 4 The improved LSTM-based fuzzy PID garbage can temperature prediction and control method comprises the following processes:
[0050] Step 1: Set the data sampling form based on feature coding;
[0051] According to different time periods and excluding the half hour before and after the system is turned on, 8:30-10:30, 10:30-12:30, 12:30-14:30 and 14:30-17:00 are classified as four data time periods. The control system classifies and encodes the data according to the data collected in different time periods. For example, the data xi collected by each sensor is the data of the 10:30-12:30 time period, and the control system samples in the form of (xi, 0, 1, 0, 0).
[0052] Step 2: Data acquisition;
[0053] The data collected by the temperature and humidity sensor 3 and the environmental monitoring equipment 1 is transmitted to the single-chip microcomputer of the control system, the single-chip microcomputer converts the data and further transmits the data to the cloud and an external computer through the 4G module for analysis and processing. The external computer collects outdoor environment data and garbage can related variables as sample data, wherein the outdoor environment data includes outdoor temperature, air speed, air relative humidity and solar radiation intensity, and the garbage can related variables include garbage can internal temperature, garbage can internal humidity and fan 401 speed. All data are real-time data collected by each sensor, and the sampling interval is 1 minute.
[0054] Step 3: Sample data processing;
[0055] 80% of the sample data obtained in step 1 is divided into a training set by using an external computer, and the remaining 20% is a test set. In order to maintain the consistency of all data, the sample data is processed by using a normalization method.
[0056]
[0057] In the formula, xi Xi(i=1,2,3,4,…) is the transformed data of the ith input variable. i The value range is 0-1; X io Xi is the experimental data; X max Xi is the experimental data; X min The maximum and minimum values in the observation data (i.e., the data collected by each sensor) are respectively.
[0058] Step 4: Initialize the fuzzy PID controller based on the LSTM model predictive control in the external computer.
[0059] The current environmental temperature is T(k), and the set temperature is T ref The current temperature error is e(k) = T ref -T(k), k represents the current time.
[0060] The output of the PID controller is represented as:
[0061] u(k) = u p (k) + u i (k) + u d (k).
[0062] Wherein, u p (k), u i (k), and u d (k) are the outputs of the proportional, integral, and derivative parts, respectively, which are:
[0063] u p (k) = K p e(k);
[0064]
[0065] u d (k) = K d (e(k) - e(k-1));
[0066] Wherein, K p , K i , and K d are the proportional, integral, and derivative coefficients, respectively.
[0067] The control law of the model predictive control is:
[0068]
[0069] Wherein, represents the fan speed obtained by model prediction; K c is the adjustment parameter; p represents the prediction time domain; e(k+i|k) represents the prediction error after i time in the prediction time domain when the current time is k, and the prediction error is represented as:
[0070]
[0071] The output of the PID controller combined with the LSTM model predictive control is represented as:
[0072]
[0073] By adjusting the parameters K c , K p , K i , K d , the control system can be stabilized, and the ambient temperature can be maintained at the set temperature T ref . Figure 4 In the formula, ec represents the error change rate; e represents the system error; and de / dt represents the system error differential.
[0074] Step 5: The external computer initializes the LSTM neural network based on the sample data processed in step 3.
[0075] A fuzzy layer and a fuzzy reasoning layer are introduced into the LSTM neural network to enhance its processing capability for fuzzy and uncertain information and ensure that it can effectively process the fuzziness of the input data. The fuzzy reasoning layer uses the rules of fuzzy logic to perform fuzzy reasoning and fuzzy inference according to the membership degree of the input fuzzy set, thereby obtaining the fuzzy set of the output. This makes the LSTM neural network more robust and interpretable when processing problems with fuzziness.
[0076] Before training the LSTM neural network, the test setting time step is trained in advance, and the hyperparameters in the LSTM neural network are set. That is, by controlling different time steps and keeping other parameters the same, the influence of different time steps on the LSTM neural network is tested through multiple experiments and debugging in terms of convergence, convergence speed, and prediction error. Finally, the time step corresponding to the optimal prediction accuracy is selected.
[0077] Step 6: Fuzzy PID feedback control
[0078] The external computer introduces a conventional fuzzy PID control algorithm, analyzes and processes the data detected by the temperature and humidity sensor 3, and issues instructions to the control system. The control system performs simple feedback control on the fan 401 through the silicon controlled speed regulator to increase or decrease its speed, thereby stabilizing the temperature in the garbage can at around the preset temperature (i.e., 25℃) and obtaining the temperature data in the garbage can and the speed data of the fan 401 on the same day.
[0079] Step 7: The external computer uses the LSTM neural network initialized in step 5 to predict the overall average temperature in the garbage can based on the temperature data in the garbage can obtained in step 6, and on this basis, introduces the fuzzy PID control algorithm based on the LSTM model predictive control initialized in step 4, and adjusts the speed of the fan 401 in advance through the thyristor speed regulator, so as to control the temperature in the garbage can at 25°C at all times, and maintain the stability of the temperature in the garbage can.
[0080] The above embodiments are preferred embodiments of the present application, but the present application is not limited to the above embodiments, and any obvious improvements, replacements or modifications made by those skilled in the art without departing from the essential content of the present application shall fall within the protection scope of the present application.
Claims
1. A garbage can temperature prediction and control method using an improved LSTM-based fuzzy PID garbage can temperature prediction and control system, characterized in that, The improved LSTM-based fuzzy PID garbage can temperature prediction and control system comprises a plurality of temperature and humidity sensors (3) installed inside the garbage can for detecting the temperature and humidity data inside the garbage can, and an environmental monitoring device (1) placed outside the garbage can for detecting outdoor temperature, air speed, air relative humidity and solar radiation intensity; a waterproof electric control cabinet (2) is installed on the outer wall of the garbage can, the waterproof electric control cabinet (2) is internally provided with a control system comprising a single-chip microcomputer, a relay, a silicon-controlled regulator, a 4G transmission module, the temperature and humidity sensor (3), the wet curtain-fan cooling device (4) and the environmental monitoring device (1) are all signal-connected with the control system to transmit detection data and receive control signals, the control system transmits data to the cloud and an external computer through the 4G transmission module, and the external computer performs prediction analysis; the wet curtain-fan cooling device (4) comprises a fan (401) installed at an air inlet on one side of the garbage can, a wet curtain (405) installed at an air outlet on the other side of the garbage can, a water tank (402) arranged on the ground on one side of the wet curtain (405), a water pump (403) placed in the water tank (402), a water pipe (404) connected with the water pump (403), and a spray head arranged at the other end of the water pipe (404) and located above the wet curtain (405) for spraying water onto the wet curtain (405); The garbage can temperature prediction and control method comprises the following processes: Step 1: setting a data sampling form based on feature coding; Step 2: the control system collects data according to the set sampling form, and further transmits the data to the cloud and an external computer for analysis and processing, and the external computer takes outdoor environmental data, garbage can internal temperature data, garbage can internal humidity data and fan (401) speed as sample data; Step 3: the sample data is processed by normalization, and the sample data is divided into a training set and a test set; Step 4: initializing a fuzzy PID controller based on LSTM model prediction control; Step 5: initializing an LSTM neural network based on the sample data processed in step 3; Step 6: the external computer introduces a conventional fuzzy PID control algorithm, combines the data detected by the temperature and humidity sensor (3), and issues an instruction to the control system, the control system adjusts the fan (401) speed through the silicon-controlled regulator for preliminary feedback control, and obtains the garbage can temperature data of the day; Step 7: the external computer uses the LSTM neural network initialized in step 5 to predict the overall average temperature in the garbage can according to the data obtained in the PID feedback control scene in step 6, and on this basis, introduces the fuzzy PID controller based on LSTM model prediction control initialized in step 4 to adjust the fan (401) speed in advance, so as to control the temperature in the garbage can at 25℃ all the time and keep the temperature in the garbage can constant; The specific process of step 4 is as follows: Let the current ambient temperature be T(k), and the set temperature be T ref Then the current temperature error is e(k) = T ref - T(k), k represents the current time; The output of the PID controller is: u(k) = u p (k) + u i (k) + u d (k); where u p (k), u i (k), u d (k) are the outputs of the proportional, integral, derivative parts, respectively: u p (k) = K p e(k); u d (k) = K d (e(k) - e(k - 1)); wherein Kp, Ki, and Kd are proportional, integral, and derivative coefficients, respectively. p Kp, Ki, and Kd are proportional, integral, and derivative coefficients, respectively. i Kp, Ki, and Kd are proportional, integral, and derivative coefficients, respectively. d Kp The control law of the LSTM model prediction control is: wherein, Npred(k+i|k) represents the fan speed predicted by the model; K c is an adjustment parameter; p represents a prediction horizon; e(k+i|k) represents a prediction error at a time k, after i time units in the prediction horizon, the prediction error being expressed as: The output of the PID controller combined with the LSTM model prediction control is: By adjusting the parameter K c The ambient temperature is maintained at the set temperature T ref .
2. The garbage can temperature prediction and control method of claim 1, wherein, The specific process of step 1 is as follows: According to different time period characteristics, and excluding system opening and closing half an hour, 8:30-10:30, 10:30-12:30, 12:30-14:30, 14:30-17:00 are classified as four data time periods, the control system classifies and encodes the data according to the data collected in different time periods, and the encoding forms include (xi, 1, 0, 0, 0), (xi, 0, 1, 0, 0), (xi, 0, 0, 1, 0), (xi, 0, 0, 0, 1), xi represents the data collected by the control system.
3. The trash can temperature prediction and control method of claim 1, wherein, In step 3, the specific formula for processing the sample data by using the normalization method is as follows: In the formula, x i is the transformed data of the i-th input variable, i is a natural number excluding 0; X io is experimental data; X max , X min are the maximum value and the minimum value in the observation value respectively.
4. The trash can temperature prediction and control method of claim 1, wherein, The specific process of step 5 is as follows: In the LSTM neural network, a fuzzy layer and a fuzzy reasoning layer are introduced, wherein the fuzzy reasoning layer utilizes the rules of fuzzy logic to perform fuzzy reasoning and fuzzy inference according to the membership degrees of the input fuzzy set, thereby obtaining the output fuzzy set; before training the LSTM neural network, the time steps are trained in advance, and the hyperparameters in the LSTM neural network are set, that is, by controlling different time steps, the remaining parameters are the same, through multiple experiments and debugging of the influence of different time steps on the LSTM neural network, including convergence, convergence speed and prediction error, the optimal prediction accuracy corresponding time step is finally selected; then the sample data is used to train and test the LSTM neural network.
Citation Information
Patent Citations
Intelligent temperature control garbage can
CN113525969A
Greenhouse environment control system
CN114489200A
Method for predicting temperature of dustbin based on BP neural network
CN114781239A