Ppid temperature control method, system, computer device and readable storage medium

By combining neural network models to dynamically adjust PID parameters, the problems of difficult parameter tuning and poor adaptive ability of traditional PID controllers in complex temperature control systems are solved, achieving more precise temperature control and stronger anti-disturbance capability, thereby improving production efficiency and equipment life.

CN122195159APending Publication Date: 2026-06-12ZHUZHOU RUIDEER METALLURGICAL EQUIP MFG CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHUZHOU RUIDEER METALLURGICAL EQUIP MFG CO LTD
Filing Date
2026-04-10
Publication Date
2026-06-12

AI Technical Summary

Technical Problem

Traditional PID controllers are difficult to tune in complex temperature control systems, have poor adaptive capabilities, limited disturbance rejection capabilities, and are unable to cope with nonlinear, large hysteresis, and time-varying characteristics, resulting in increased overshoot, longer settling time, decreased steady-state accuracy, and slow response speed.

Method used

By combining a neural network model and acquiring real-time and buffered data, the control error and error change rate are calculated. The temperature trend is predicted using an LSTM neural network, and the PID parameters are dynamically adjusted to achieve adaptive control.

Benefits of technology

It significantly reduces overshoot, shortens settling time, enhances anti-interference capabilities, maintains optimal performance, improves temperature control accuracy and consistency, reduces energy consumption, and extends equipment life.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122195159A_ABST
    Figure CN122195159A_ABST
Patent Text Reader

Abstract

The application discloses a PID temperature control method, comprising the following steps: acquiring instant data and buffer data in a data set; calculating corresponding control error and control error change rate according to the instant data; inputting the instant data, the buffer data and the corresponding control error and control error change rate as input features into a preset neural network model to obtain PID parameters of the input features; driving an executing mechanism to execute according to the PID parameters; updating a historical temperature measurement value sequence according to instant data at a current moment, acquiring a temperature measurement value after execution and a set temperature value, and returning to the step of calculating corresponding control error and control error change rate according to instant data. The application further discloses a PID temperature control system, a computer device and a readable storage medium. The application realizes dynamic self-adaptive setting of PID parameters by instant data and buffer data, real-time output of PID parameters, significant improvement of control performance and reduction of debugging threshold.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of automatic control technology, and in particular to a PID temperature control method, system, computer device, and readable storage medium. Background Technology

[0002] Proportional-Integral-Derivative (PID) controllers are widely used in industrial temperature control due to their simple structure, robustness, and ease of engineering implementation. However, traditional PID controllers face challenges in parameter tuning when dealing with complex temperature control systems (such as high-temperature sintering furnaces and heat treatment furnaces) exhibiting nonlinearity, large time lag, and time-varying characteristics. For these complex systems, the experience-based trial-and-error method or the classic ZN tuning method struggles to obtain optimal PID parameters. The tuning process is time-consuming, labor-intensive, and highly dependent on the engineer's experience. Furthermore, they exhibit poor adaptability: when ambient temperature fluctuates, equipment characteristics change (such as heater aging), or the set process curve is switched, fixed PID parameters cannot guarantee continuously optimal control performance, easily leading to increased overshoot, longer settling time, and decreased steady-state accuracy. Finally, they have limited disturbance rejection capabilities: for external thermal disturbances in the production process, traditional PID controllers mainly rely on integral action to eliminate steady-state error, resulting in slow response speed and poor dynamic recovery performance.

[0003] To address these issues, researchers have attempted to combine neural networks with PID control, for example, using backpropagation (BP) neural networks to adjust PID parameters online. However, traditional feedforward neural networks such as BP and RBF are static networks, making it difficult to effectively process and remember long-term dependencies in time-series data. They cannot use historical temperature change trends for prediction and advance compensation, thus their effectiveness is limited when dealing with systems with large time lags, and they are prone to getting trapped in local optima, resulting in unstable training. Summary of the Invention

[0004] The main objective of this invention is to provide a PID temperature control method, system, computer device, and readable storage medium, aiming to solve the technical problems described in the background section.

[0005] In a first aspect, the present invention provides a PID temperature control method, comprising: acquiring real-time data and buffered data in the data set, wherein the real-time data includes the temperature measurement value at the current moment and the set temperature value, and the buffered data includes a sequence of historical temperature measurement values ​​for a first period prior to the current moment; The corresponding control error is calculated based on the measured temperature value and the set temperature value, and the control error change rate is calculated based on the control error and the control cycle corresponding to the measured temperature value. The real-time data, the buffered data, and the corresponding control error and control error change rate are used as input features and input into a preset neural network model to obtain the PID parameters of the input features; The actuator is driven to perform according to the PID parameters; Update the historical temperature measurement value sequence according to the current temperature measurement value, obtain the temperature measurement value and set temperature value after the execution process, and return to the step: calculate the corresponding control error according to the temperature measurement value and set temperature value, and calculate the control error change rate according to the control error and the control cycle corresponding to the temperature measurement value.

[0006] In one embodiment, the step of driving the actuator to perform actions according to the PID parameters includes: The PID parameters are smoothed and filtered to obtain real-time parameters; Based on the real-time parameters, the control increment is calculated; The current control quantity is calculated based on the control quantity increment. The current control quantity is limited and then converted into a physical signal, which drives the actuator to perform the operation.

[0007] In one embodiment, the step of smoothing and filtering the PID parameters to obtain real-time parameters can be replaced by: The PID parameters are subjected to a first-order low-pass filter based on a preset smoothing factor to obtain real-time parameters.

[0008] In one embodiment, the step of inputting the real-time data, the buffered data, and the corresponding control error and control error rate of change as input features into a preset neural network model to obtain the PID parameters of the input features includes: The real-time data, the buffered data, and the corresponding control error and control error rate of change are used as input features and input into a preset neural network model to obtain a three-dimensional vector. The three-dimensional vector is mapped to the feasible region of the preset PID parameters, and the PID parameters are calculated.

[0009] In one embodiment, the step of updating the historical temperature measurement sequence based on the current temperature measurement value includes: The current temperature measurement value is stored in the historical temperature measurement value sequence; Remove the temperature measurement value that has been stored the longest in the historical temperature measurement value sequence.

[0010] In one embodiment, the control error is equal to the set temperature value at the current moment minus the measured temperature value at the current moment, and the control error change rate is equal to the difference between the control error at the current moment and the control error at the previous moment, divided by the preset control period corresponding to the current moment.

[0011] In one embodiment, the preset neural network model is trained in the following manner: Acquire sample data under various operating conditions. The sample data for each operating condition includes multiple sets of sampling data. Each set of sampling data includes the temperature measurement value, the set temperature value, and the control quantity at the same timestamp. The sample data is traversed by sliding through a time window of a preset length. Based on the preset target corresponding to the time window, the optimal PID parameters within each time window are calculated according to the control quantity. The corresponding control error is calculated based on the temperature measurement value and the set temperature value in each group of sampled data, and the control error change rate is calculated based on the control error and the control cycle corresponding to the temperature measurement value. The historical temperature measurement sequence of the first period before the center time of the time window in the sample data, and the temperature measurement value, set temperature value, corresponding control error, and control error change rate corresponding to the center time are used as input training features, and the optimal PID parameters corresponding to the time window are used as output training features. These are then input into the neural network model for training to obtain the preset neural network model.

[0012] Secondly, the present invention also provides a PID temperature control system, the PID temperature control system comprising: The data acquisition module is used to acquire real-time data and buffered data in the dataset. The real-time data includes the temperature measurement value at the current moment and the set temperature value. The buffered data includes the historical temperature measurement value sequence of the first time period before the current moment. The calculation module is used to calculate the corresponding control error based on the measured temperature value and the set temperature value, and to calculate the control error change rate based on the control error and the control cycle corresponding to the measured temperature value. The neural network module is used to input the real-time data, the buffered data, and the corresponding control error and control error change rate as input features into a preset neural network model to obtain the PID parameters of the input features; The output execution module is used to drive the actuator to execute according to the PID parameters; The update loop module is used to update the historical temperature measurement value sequence according to the temperature measurement value at the current moment, obtain the temperature measurement value and the set temperature value after the execution process, and return to the step: calculate the corresponding control error according to the temperature measurement value and the set temperature value, and calculate the control error change rate according to the control error and the control cycle corresponding to the temperature measurement value.

[0013] Thirdly, the present invention provides a computer device, the computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the method as described in any one of the first aspects.

[0014] Fourthly, the present invention provides a readable storage medium, characterized in that the readable storage medium stores a PID temperature control program, which, when executed by a processor, implements the steps of the PID temperature control method as described in any one of the first aspects.

[0015] The aforementioned PID temperature control method, by acquiring real-time and buffered data and combining the long-term memory and trend prediction capabilities of the neural network model, can "anticipate" the overshoot that may be caused by large system lag and adjust parameters in advance, significantly reducing the overshoot, shortening the settling time, and significantly enhancing anti-interference ability and robustness. It reduces the dependence on expert experience, can adapt to the time-varying and nonlinear characteristics of the equipment, maintains optimal performance in the long term, and more precise temperature control directly improves product quality and consistency. At the same time, it reduces temperature overshoot and oscillation, reduces energy consumption, and extends the service life of the equipment. Attached Figure Description

[0016] Figure 1 This is an application environment diagram of the PID temperature control method in one embodiment of the present invention; Figure 2 This is a schematic diagram of the application terminal structure of the PID temperature control method in one embodiment of the present invention; Figure 3 This is a flowchart illustrating a PID temperature control method in one embodiment of the present invention; Figure 4 This is a flowchart illustrating a method for training a neural network model in one embodiment of the present invention. Figure 5 This is a flowchart illustrating a PID temperature control method in one embodiment of the present invention; Figure 6 This is a schematic diagram of the temperature control device in one embodiment of the present invention. Detailed Implementation

[0017] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0018] The PID temperature control method provided in this application embodiment can be applied to, for example, Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or located in the cloud or on other network servers. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. Server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.

[0019] Those skilled in the art will understand that Figure 1 The terminal structure shown does not constitute a limitation on the terminal and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0020] Firstly, referring to Figure 3 This invention provides a PID temperature control method, which can be applied to... Figure 2 Taking the terminal in the example, the explanation includes: S110, acquire real-time data and buffered data in the dataset, wherein the real-time data includes the temperature measurement value at the current moment and the set temperature value, and the buffered data includes the historical temperature measurement value sequence of the first time period before the current moment; Acquiring real-time data includes acquiring the temperature measurement value T(t) of the controlled object (or its high-fidelity simulation model) at the current time t, receiving its set temperature value r(t) (which can be a constant value or a dynamic process curve), and acquiring buffered data in the dataset, including acquiring the historical temperature measurement values ​​of the first time period before the current time t and constructing a sequence H(t). The length of this first time period is set to L, then H(t) = [T(t-L+1), T(t-L+2), ..., T(t-1)]. It should be noted that this data acquisition is performed in each control cycle Ts, that is, data is acquired once per control cycle. In addition, when acquiring real-time data at each time, the temperature measurement value is stored in a circular buffer, which is used to extract the most recent historical temperature measurement values ​​of a preset length and construct a sequence. Data acquisition can be achieved by deploying a data acquisition controller on the controlled object. The controller can be a reasonably performing reference controller (such as an empirically tuned PID or fuzzy PID) or a controller that allows the application of excitation signals.

[0021] S120, calculate the corresponding control error based on the measured temperature value and the set temperature value, and calculate the control error change rate based on the control error and the control cycle corresponding to the measured temperature value; In this step, the control error e(t) at the current moment is calculated according to the control error e(t) = set temperature value r(t) - temperature measurement value T(t); the control error change rate ec(t) at the current moment is calculated according to the control error change rate ec(t) = (control error e(t) at the current moment - control error e(t-1) at the previous moment) / control period Ts, where the current moment (t) is the time of the latest data acquisition, and the previous moment (t-1) is the time of the last data acquisition based on the current moment.

[0022] S130, the real-time data, the buffered data, and the corresponding control error and control error change rate are used as input features and input into a preset neural network model to obtain the PID parameters of the input features; It is important to note that before using the real-time temperature measurement value T(t), the set temperature value r(t), the historical temperature measurement value sequence H(t), and the corresponding control error e(t) and control error change rate ec(t) as input features, normalization processing is performed to obtain the normalized temperature measurement value T_norm(t), the normalized set temperature value r_norm(t), the normalized historical temperature measurement value sequence H_norm(t), and the corresponding normalized control error e_norm(t) and normalized control error change rate ec_norm(t), thus obtaining the input feature vector X(t), i.e., X(t) = [e_norm(t), ec_norm(t), r_norm(t), T_norm(t), H_norm(t)]. X(t) is then input into a preset neural network model to obtain the output result Y(t) of X(t), which is the PID parameters [Kp'(t), Ki'(t), Kd'(t)] at the current time t.

[0023] In addition, before the PID temperature control method begins, system initialization and model loading are required, namely loading the preset neural network model into memory and initializing the initial PID parameters [Kp0, Ki0, Kd0] of the PID controller, which can be set to empirical or conservative values. In addition, the control period Ts, the length L of the historical temperature measurement value sequence and the parameter smoothing factor α are set. This preset neural network model belongs to the LSTM neural network.

[0024] S140, drive the actuator to execute according to the PID parameters; like Figure 5 As shown, it specifically includes: S141, Perform smoothing filtering on the PID parameters to obtain real-time parameters; In this step, to avoid control oscillations caused by sudden changes in output parameters, the PID parameters [Kp'(t), Ki'(t), Kd'(t)] at the current time t are smoothed using a first-order low-pass filter. Specifically, a smoothing factor α (0 < α ≤ 1) is used to control the aggressiveness of the PID parameter adjustment. Kp(t) = α * Kp'(t) + (1-α) * Kp(t-1) Ki(t)= α * Ki'(t) + (1-α) * Ki(t-1) Kd(t)= α * Kd'(t) + (1-α) * Kd(t-1) Where Kp'(t), Ki'(t), and Kd'(t) are the results of mapping the output feature vector of the preset neural network model, i.e., the PID parameters (as described in subsequent embodiments), Kp(t), Ki(t), and Kd(t) are the calculated real-time parameters, and α is a preset smoothing factor. Step S141 can also be replaced by: S141, performing a first-order low-pass filter on the PID parameters according to the preset smoothing factor to obtain the real-time parameters.

[0025] S142, Calculate the control increment based on the real-time parameters; In this step, based on the real-time parameters [Kp(t), Ki(t), Kd(t)], the incremental PID algorithm is used to calculate the control increment Δu(t), i.e.: Δu(t) = Kp(t)*[e(t)-e(t-1)] + Ki(t)*e(t)*Ts + Kd(t)*[ec(t)-ec(t-1)] / Ts S143, calculate the current control quantity based on the control quantity increment; In this step, the current control quantity u(t) is calculated based on the control quantity increment Δu(t) obtained in the previous step, that is: u(t) = u(t-1) + Δu(t) S144, the current control quantity is limited and then converted into a physical signal, and the actuator is driven to perform the operation according to the physical signal.

[0026] In this step, the current control quantity u(t) calculated in the previous step is limited to be within the allowable range of the actuator (such as a heater). Then, the current control quantity u(t) is converted into a physical signal (such as PWM duty cycle, 4-20mA current), and the actuator is driven to execute according to the physical signal.

[0027] S150, update the historical temperature measurement value sequence according to the current temperature measurement value, obtain the temperature measurement value and set temperature value after the execution process, and return to the step: calculate the corresponding control error according to the temperature measurement value and set temperature value, and calculate the control error change rate according to the control error and the control cycle corresponding to the temperature measurement value.

[0028] In this step, the step of updating the historical temperature measurement value sequence based on the current temperature measurement value includes: Store the current temperature measurement value into the historical temperature measurement value sequence; remove the temperature measurement value that has been stored the longest in the historical temperature measurement value sequence.

[0029] Specifically, the length of the historical temperature measurement value sequence H(t) is set to L, and this length remains unchanged. After calculating the control quantity u(t) at the current time t, the temperature measurement value T(t) at the current time t is stored in H(t), and the first temperature measurement value in the time sequence (the temperature measurement value with the longest storage time) is deleted from H(t).

[0030] It is important to note that the time for acquiring data after the execution process belongs to the next control cycle of the current moment. That is, relevant data is acquired once in each control cycle. This can be understood as: acquiring the first relevant data of the first moment t in the first control cycle (the relevant data includes real-time data and buffered data in the dataset; the real-time data includes the current temperature measurement value and the set temperature value; the buffered data includes the historical temperature measurement value sequence of the first time period before the current moment); after steps S120, S130, and S140, updating the historical temperature measurement value sequence according to the temperature measurement value of the first moment, and then acquiring... Take the second relevant data at the second moment in the second control cycle, and then perform steps S120, S130, and S140 based on the second relevant data. Update the historical temperature measurement value sequence based on the temperature measurement value at the second moment. Then, take the third relevant data at the third moment in the third control cycle, and perform steps S120, S130, and S140 based on the third relevant data. ... Update the historical temperature measurement value sequence based on the temperature measurement value at the (a-1)th moment, and then take the a-th relevant data at the a-th moment in the a-th control cycle, and perform steps S120, S130, and S140 based on the a-th relevant data.

[0031] In this embodiment, real-time data and buffered data are acquired, and the buffered data (refer to the embodiment) is processed to obtain input features. These features are then input into a preset neural network model to obtain results. The temperature is controlled based on the results, and this is used for cyclical / continuous control. The long-term memory and trend prediction capabilities of this control method can "anticipate" overshoot that may be caused by large system lag, thereby reducing proportional and integral actions in advance. For typical temperature control objects, compared with traditional PID and fuzzy PID, this method significantly reduces overshoot, controls steady-state error within a smaller range, improves control accuracy, and enables more precise temperature trajectory tracking. For processes such as semiconductor diffusion, precision injection molding, and biopharmaceuticals, this directly translates into higher product qualification rates, better product performance indicators, and more stable batch-to-batch consistency, creating core value. At the same time, this method dynamically adjusts PID parameters, using more aggressive parameters in the early stage of heating to accelerate the response, and switching to more robust parameters when approaching the set value to prevent overshoot. This adaptive capability significantly shortens the system settling time (the time to enter the steady-state error band), improving production cycle time. Furthermore, when the system is subjected to external thermal disturbances (such as sudden changes in ambient temperature or door opening / closing) or internal characteristic changes (such as load changes), this method can quickly detect error trends and adjust PID parameters in real time to strengthen the suppression of disturbances. The system recovers to steady state faster than traditional PID control. This control method has stronger robustness, and the optimized control curve reduces overshoot and oscillations in the controlled object's temperature. The heating and cooling equipment operates more smoothly with fewer start-stop cycles, directly reducing energy consumption. It also reduces the mechanical and thermal stress on actuators (such as heating elements and power supply frames), effectively extending equipment lifespan and reducing maintenance costs.

[0032] In one embodiment, such as Figure 4 As shown, the preset neural network model is trained in the following way: S211, acquire sample data under multiple operating conditions. The sample data for each operating condition includes multiple sets of sample data. Each set of sample data includes the temperature measurement value, the set temperature value, and the control quantity at the same timestamp. On the target controlled object (or its high-fidelity simulation model), deploy a data acquisition controller or data acquisition device. This controller can be a reasonably high-performance reference controller (such as an empirically tuned PID or fuzzy PID), or a controller that allows the application of excitation signals, synchronously and at high speed acquiring and storing the following data: timestamp, set temperature value r(t), temperature measurement value T(t), and control quantity u(t), where the set temperature value r(t) can be a constant value or a dynamic process curve, and the timestamp is a value or mark used to identify a specific moment.

[0033] Multiple operating conditions are included, such as step change of setpoint, ramp change, and application of typical external thermal disturbances, to cover the dynamic range of the object. The step change condition involves instantaneously changing the setpoint temperature from one constant value to another, used to test and record the system's response characteristics to sudden changes in the target, such as recording the complete process of jumping from 200℃ to 500℃. The ramp change condition involves gradually changing the setpoint temperature at a constant rate, such as increasing or decreasing by a certain number of degrees per minute, used to test and record the system's ability to track continuously changing targets, such as recording the complete process of ramping up from 200℃ to 800℃. The disturbance condition involves artificially applying external disturbances (such as opening the furnace door, changing the load, changing the ambient temperature, etc.) to the system when it is in a steady state, causing the system to deviate from the steady state, used to test and record the system's recovery ability after being disturbed, such as recording the disturbance response process of opening the furnace door for 30 seconds at a constant temperature of 500℃.

[0034] S212, the sample data is traversed by sliding a time window of a preset length, and the optimal PID parameters in each time window are calculated based on the preset target corresponding to the time window and the control quantity. For the collected data, a time window of a preset length (W in the example) is slid, for example, from t-W+1 to t (t is the sampling time); within each window, the target controlled object is approximated as a low-order model (such as first-order inertia plus pure time delay), or the input and output data within the window are directly used; the time window covers W consecutive sampling times (time stamps), and each sampling time t is a control cycle interval.

[0035] For example, with the minimization of the control performance index within the window as the preset objective (such as ITAE: time multiplied by absolute error integral), an optimization algorithm (such as gradient descent or particle swarm optimization) is used to solve for a set of "optimal" PID parameters [Kp*(t), Ki*(t), Kd*(t)] within the window. This set of PID parameters is used as the "expert signal" label Y*(t) at the center time t of the window. The optimization algorithm can refer to existing technologies.

[0036] S213, calculate the corresponding control error based on the temperature measurement value and the set temperature value in each group of sampled data, and calculate the control error change rate based on the control error and the control cycle corresponding to the temperature measurement value; In this step, the corresponding control error is calculated based on the temperature measurement value and the set temperature value in each group of sampled data. That is, the corresponding control error is calculated based on the temperature measurement value and the set temperature value at the center time of each window in each group of sampled data. The control error e(t) = set temperature value r(t) - temperature measurement value T(t). Correspondingly, the control error change rate ec(t) = (control error e(t) - previous control error e(t-1)) / control period Ts. The previous control error e(t-1) is the control error at the center time of the previous time window.

[0037] S214, the historical temperature measurement value sequence of the first period before the center time of the time window in the sample data, and the temperature measurement value, set temperature value, corresponding control error, and control error change rate corresponding to the center time are used as input training features, and the optimal PID parameters corresponding to the time window are used as output training features. These are input to the neural network model for training to obtain the preset neural network model.

[0038] Obtain the historical temperature measurement sequence H(t) for the first time period before the center time of the time window. Let the first time period be L, i.e., H(t) = [T(t-L+1), T(t-L+2), ..., T(t-1)]. All temperature measurements in this historical temperature measurement sequence should be within the time window corresponding to the center time (specifically, the left half of the window). Use the temperature measurement T(t) corresponding to the center time, the set temperature value r(t), the corresponding control error e(t), and the control error change rate ec(t) as input training features. These input training features need to be normalized so that all components are within the same numerical range. For each sampling time (center time) t, generate corresponding training samples {input features X(t), output labels Y*(t)}, where X(t) = [e_norm(t), ec_norm(t), r_norm(t), T_norm(t), H_norm(t)] (where _norm represents the normalized value), and Y*(t) = [Kp*(t)]. [Ki*(t), Kd*(t)]; Construct an LSTM neural network model with sequential input and single-step output, using mean squared error loss and the Adam optimizer for training, and use a validation set for early stopping to prevent overfitting; Then evaluate the model performance on an independent test set. After the model passes the test, solidify the trained model parameters (weights and biases) and convert them into a format that can run in an embedded C language environment (such as a static array or using an embedded AI inference library). The validation set and test set can be obtained from sample data with reference to existing technologies.

[0039] In this embodiment, through multi-condition data acquisition during offline training, optimization of the optimal PID parameter labels using rolling time windows, and input feature design based on historical temperature sequences, the neural network can learn a control strategy that approximates the global optimum. This overcomes the problem of traditional PID parameter tuning relying on experience and struggling to obtain optimal parameters. It can perceive the long-term trend of temperature changes, thereby having the ability to predict lag effects and adjust parameters in advance, significantly improving the control quality of objects with large lags. By collecting sample data under various operating conditions (step, ramp, disturbance), covering the complete dynamic range of the controlled object, the trained model can adapt to different setpoint changes and external disturbance scenarios, and can be deployed and applied without retraining.

[0040] In one embodiment, step S130, which involves inputting the real-time data, the buffered data, and the corresponding control error and control error rate of change as input features into a preset neural network model to obtain the PID parameters of the input features, includes: S131, the real-time data, the buffered data, and the corresponding control error and control error change rate are used as input features and input into a preset neural network model to obtain a three-dimensional vector; In this step, the input feature vector is input into the preset neural network model, which performs forward propagation calculation. The final output layer will generate a three-dimensional vector O(t), O(t)=[o1(t), o2(t), o3(t)]. Each output value in O(t) is mapped to the interval [0, 1] through the Sigmoid activation function.

[0041] S132, the three-dimensional vector is mapped to the feasible region of the preset PID parameters, and the PID parameters are calculated.

[0042] In this step, the output is mapped to the actual PID parameter range, that is: Kp'(t) = Kp_min + (Kp_max - Kp_min) * o1(t) Ki'(t) = Ki_min + (Ki_max - Ki_min) * o2(t) Kd'(t) = Kd_min + (Kd_max - Kd_min) * o3(t) The initially tuned PID parameters [Kp'(t), Ki'(t), Kd'(t)] are obtained, where [Kp_min, Kp_max], [Ki_min, Ki_max] and [Kd_min, Kd_max] are the feasible regions of the preset PID parameters set according to the prior knowledge of the controlled object.

[0043] In this step, the input features are fed into the neural network to obtain a three-dimensional normalized vector, which is then linearly mapped to the preset feasible region of PID parameters. The neural network directly outputs the appropriate PID parameters based on the current system state (error, temperature, historical temperature, etc.) without manual intervention, which solves the problem of difficult traditional PID parameter tuning and ensures the physical validity and safety of the output parameters.

[0044] Secondly, referring to Figure 6 Based on the same inventive concept, the present invention also provides a PID temperature control system for implementing the PID temperature control method described above, the PID temperature control system comprising: The data acquisition module 110 is used to acquire real-time data and buffered data in the dataset. The real-time data includes the temperature measurement value and the set temperature value at the current moment. The buffered data includes the historical temperature measurement value sequence of the first time period before the current moment. The calculation module 120 is used to calculate the corresponding control error based on the measured temperature value and the set temperature value, and to calculate the control error change rate based on the control error and the control cycle corresponding to the measured temperature value. The neural network module 130 is used to input the real-time data, the buffered data, and the corresponding control error and control error change rate as input features into a preset neural network model to obtain the PID parameters of the input features; Output execution module 140 is used to drive the actuator to execute according to the PID parameters; The update loop module 150 is used to update the historical temperature measurement value sequence according to the temperature measurement value at the current moment, obtain the temperature measurement value and the set temperature value after the execution process, and return to the step: calculate the corresponding control error according to the temperature measurement value and the set temperature value, and calculate the control error change rate according to the control error and the control cycle corresponding to the temperature measurement value.

[0045] The solution provided by this device is similar to the solution described in the above method. Therefore, the specific limitations of one or more PID temperature control device embodiments provided below can be found in the limitations of the PID temperature control method described above, and will not be repeated here.

[0046] Each module in the aforementioned PID temperature control device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0047] Thirdly, the present invention provides a computer device, the computer device including a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, it implements the steps of the method as described in any one of the first aspects, and the method implemented when the computer program is executed can refer to various embodiments of the PID temperature control method in this application, which will not be repeated here.

[0048] Fourthly, the present invention provides a readable storage medium, characterized in that the readable storage medium stores a PID temperature control program, which, when executed by a processor, implements the steps of the PID temperature control method as described in any one of the first aspects, which will not be repeated here.

[0049] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0050] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.

[0051] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0052] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0053] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A PID temperature control method, characterized in that, The PID temperature control method includes: Acquire real-time data and buffered data in the dataset. The real-time data includes the temperature measurement value at the current moment and the set temperature value. The buffered data includes a sequence of historical temperature measurement values ​​for the first time period prior to the current moment. The corresponding control error is calculated based on the measured temperature value and the set temperature value, and the control error change rate is calculated based on the control error and the control cycle corresponding to the measured temperature value. The real-time data, the buffered data, and the corresponding control error and control error change rate are used as input features and input into a preset neural network model to obtain the PID parameters of the input features; The actuator is driven to perform according to the PID parameters; Update the historical temperature measurement value sequence according to the current temperature measurement value, obtain the temperature measurement value and set temperature value after the execution process, and return to the step: calculate the corresponding control error according to the temperature measurement value and set temperature value, and calculate the control error change rate according to the control error and the control cycle corresponding to the temperature measurement value.

2. The PID temperature control method as described in claim 1, characterized in that, The step of driving the actuator to perform operations according to the PID parameters includes: The PID parameters are smoothed and filtered to obtain real-time parameters; Based on the real-time parameters, the control increment is calculated; The current control quantity is calculated based on the control quantity increment. The current control quantity is limited and then converted into a physical signal, which drives the actuator to perform the operation.

3. The PID temperature control method as described in claim 2, characterized in that, The step of performing smoothing filtering on the PID parameters to obtain real-time parameters can be replaced by: The PID parameters are subjected to a first-order low-pass filter based on a preset smoothing factor to obtain real-time parameters.

4. The PID temperature control method as described in claim 1, characterized in that, The step of inputting the real-time data, the buffered data, and the corresponding control error and control error rate of change as input features into a preset neural network model to obtain the PID parameters of the input features includes: The real-time data, the buffered data, and the corresponding control error and control error rate of change are used as input features and input into a preset neural network model to obtain a three-dimensional vector. The three-dimensional vector is mapped to the feasible region of the preset PID parameters, and the PID parameters are calculated.

5. The PID temperature control method as described in claim 1, characterized in that, The step of updating the historical temperature measurement value sequence based on the current temperature measurement value includes: The current temperature measurement value is stored in the historical temperature measurement value sequence; Remove the temperature measurement value that has been stored the longest in the historical temperature measurement value sequence.

6. The PID temperature control method as described in claim 1, characterized in that, The control error is equal to the set temperature value at the current moment minus the measured temperature value at the current moment, and the control error change rate is equal to the difference between the control error at the current moment and the control error at the previous moment, divided by the preset control period corresponding to the current moment.

7. The PID temperature control method as described in claim 1, characterized in that, The preset neural network model is trained in the following way: Acquire sample data under various operating conditions. The sample data for each operating condition includes multiple sets of sampling data. Each set of sampling data includes the temperature measurement value, the set temperature value, and the control quantity at the same timestamp. The sample data is traversed by sliding through a time window of a preset length. Based on the preset target corresponding to the time window, the optimal PID parameters within each time window are calculated according to the control quantity. The corresponding control error is calculated based on the temperature measurement value and the set temperature value in each group of sampled data, and the control error change rate is calculated based on the control error and the control cycle corresponding to the temperature measurement value. The historical temperature measurement sequence of the first period before the center time of the time window in the sample data, and the temperature measurement value, set temperature value, corresponding control error, and control error change rate corresponding to the center time are used as input training features, and the optimal PID parameters corresponding to the time window are used as output training features. These are then input into the neural network model for training to obtain the preset neural network model.

8. A PID temperature control system, characterized in that, The PID temperature control system includes: The data acquisition module is used to acquire real-time data and buffered data in the dataset. The real-time data includes the temperature measurement value at the current moment and the set temperature value. The buffered data includes the historical temperature measurement value sequence of the first time period before the current moment. The calculation module is used to calculate the corresponding control error based on the measured temperature value and the set temperature value, and to calculate the control error change rate based on the control error and the control cycle corresponding to the measured temperature value. The neural network module is used to input the real-time data, the buffered data, and the corresponding control error and control error change rate as input features into a preset neural network model to obtain the PID parameters of the input features; The output execution module is used to drive the actuator to execute according to the PID parameters; The update loop module is used to update the historical temperature measurement value sequence according to the temperature measurement value at the current moment, obtain the temperature measurement value and the set temperature value after the execution process, and return to the step: calculate the corresponding control error according to the temperature measurement value and the set temperature value, and calculate the control error change rate according to the control error and the control cycle corresponding to the temperature measurement value.

9. A computer device, characterized in that, The computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the PID temperature control method as described in any one of claims 1 to 7.

10. A readable storage medium, characterized in that, The readable storage medium stores a PID temperature control program, which, when executed by a processor, implements the steps of the PID temperature control method as described in any one of claims 1 to 7.