Simulation method and system for PLC control equipment
The method and system for simulating PLC control devices adjust PID algorithms in real-time using neural networks to address lag issues in temperature control, improving precision and stability by adapting to changing industrial conditions.
Patent Information
- Application Number
- CN202510819546.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-19
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2045-06-19
AI Technical Summary
The hysteresis of the temperature control system of PLC control equipment in complex industrial production environments leads to a decrease in simulation accuracy, affecting the temperature control accuracy.
By obtaining actual temperature data, a first-order inertial pure lag model is constructed, the PID control algorithm is tuned using the Z-N method, combined with neural network model training, and the control coefficients are adjusted in real time to reduce lag errors.
It improves the simulation accuracy of PLC control equipment, enhances the accuracy and stability of temperature control, and adapts to industrial production processes with different degrees of fluctuation.
Smart Images

Figure CN120315366A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of automation control technology, and particularly to a simulation method and system for a PLC control device. Background Art
[0002] Temperature control is crucial in industrial production, which directly affects product quality, production efficiency, energy consumption, and equipment safety. When a PLC control device conducts temperature control, it can be flexibly programmed through a high-precision PID (Proportional-Integral-Derivative) algorithm to achieve functions such as real-time monitoring and remote management, significantly improving the automation level and economic benefits of industrial production. For an industrial production process with complex temperature changes, the simulation of a PLC control device can not only pre-verify the feasibility of the control algorithm, thereby reducing the actual consumption of hardware, but also adjust the parameters of the control algorithm in a simulation environment, thereby improving the accuracy of temperature control.
[0003] However, due to the complex industrial production environment, the temperature control system in a PLC control device has a certain lag in temperature control. Traditional methods usually use a first-order inertial pure lag model with fixed parameters to approximately represent its lag. However, in the industrial production process, environmental factors such as the thermal conductivity coefficient change, and the first-order inertial pure lag model with fixed parameters will cause a large error between the simulation result of temperature data and the actual temperature. Moreover, as production continues, the simulation error continues to expand, resulting in a decrease in the simulation accuracy of the PLC control device and affecting the accuracy of temperature control in subsequent industrial production. Summary of the Invention
[0004] To solve the above technical problems, a simulation method and system for a PLC control device are provided to solve the existing problems.
[0005] The solution of this application to solve the technical problem is to provide a simulation method and system for a PLC control device, including the following steps: In a first aspect, an embodiment of this application provides a simulation method for a PLC control device, and the method includes the following steps: Obtain the actual temperature at all moments in each time period under multiple production cycles during the industrial production process, identify the model parameters of the constructed first-order inertial pure lag model, form a parameter vector with all the model parameters corresponding to each time period, and use the Z-N method to tune all the control coefficients in the PID control algorithm, including the proportional coefficient, integral coefficient, and differential coefficient, to form a control vector; For each production cycle, by building a simulation environment of the PLC control device and based on the parameter vector and control vector of each time period, simulate the actual temperature at all moments in each time period to obtain the simulated temperature at each moment in each time period; Analyze the deviation between the actual temperature of all production cycles in each time period and the predicted value during curve fitting, and calculate the fluctuation characteristic value of each time period; construct the characteristic vector of each time period according to the average level and change rate of the actual temperature of all production cycles in each time period, combined with the fluctuation characteristic value, and cluster all time periods; Based on the relevant changes in the actual temperature between different local ranges within each time period in each production cycle and the relevant changes in the simulated temperature, combined with the proportionality coefficient of each time period and the fluctuation characteristic value of all time periods within the cluster to which it belongs, determine the actual lag value and the simulated lag value of each time period in each production cycle; Based on the difference between the actual lag value and the simulated lag value, calculate the parameter error of each time period in each production cycle. After training the neural network model in combination with the actual temperature, parameter vector and control vector, import it into the simulation environment, simulate the PLC control device, adjust the control coefficient of the PID control algorithm in real time, and control the temperature.
[0006] Preferably, the first-order inertial pure lag model is: , where is the static amplification coefficient; is the time constant; is the lag time, is the Laplace operator; among them, the model parameters , and form the parameter vector.
[0007] Preferably, the obtaining of the simulated temperature at each moment within each time period includes: based on the actual temperature at all moments within each time period, using the first-order inertial pure lag model corresponding to the parameter vector of each time period and the PID control algorithm corresponding to the control vector, simulate the temperature at all moments within the next time period, so as to obtain the simulated temperature at each moment within each time period in each production cycle, where the simulated temperature at each moment within the first time period is the corresponding actual temperature.
[0008] Preferably, the calculation of the fluctuation characteristic value of each time period includes: Perform anomaly detection on the actual temperature at all moments of all production cycles in each time period to obtain the anomaly moments; perform curve fitting on the actual temperature of the remaining all moments after removing the anomaly moments within each time period in each production cycle, and calculate the mean absolute error; The fluctuation characteristic value is the mean value of the mean absolute error of all production cycles in each time period.
[0009] Preferably, the construction method of the characteristic vector is: Record the mean value of the actual temperature at all moments of all production cycles in each time period as the average temperature; The sum of the differences in the actual temperatures at all adjacent moments within each time period of each production cycle is denoted as the change rate; the sum of the average change rates of all production cycles under each time period is denoted as the average rate. The average temperature, the average rate, and the fluctuation eigenvalue of each time period are combined to form a feature vector.
[0010] Preferably, determining the actual lag value and the simulation lag value for each time period of each production cycle includes: All the moments within each time period of each production cycle are divided into multiple local time periods. The correlation degrees between the actual temperatures and the simulation temperatures at all moments between two adjacent local time periods under each time period are calculated respectively, and denoted as the first correlation degree and the second correlation degree. All the local time periods under each time period are numbered in chronological order; with the serial number corresponding to each local time period as the weight, the first correlation degree and the second correlation degree of all the local time periods under any one time period are weighted and summed respectively, and denoted as the first sum value and the second sum value. Calculate the average value of the fluctuation eigenvalues of all the time periods within the cluster to which each time period of each production cycle belongs; normalize the product of the proportionality coefficient of each time period and the average value. The actual lag value is the product of the normalized result and the first sum value; the simulation lag value is the product of the normalized result and the second sum value.
[0011] Preferably, the parameter error is the normalized value of the difference between the actual lag value and the simulation lag value for each time period of each production cycle.
[0012] Preferably, after training the neural network model, importing it into the simulation environment includes: Using the parameter error of each time period of each production cycle as the training label, the actual temperatures at all moments within all time periods of all production cycles, the parameter vectors and control vectors of all time periods, and the training label are combined to form a training set. Based on the training set, the neural network model is trained, and the trained neural network model is imported into the simulation environment.
[0013] Preferably, simulating the PLC control device, adjusting the control coefficients of the PID control algorithm in real time, and controlling the temperature includes: using the actual temperatures at all moments in each time period of the current production cycle, obtaining the parameter vector of the next time period through the neural network model in the simulation environment, updating the transfer function of the first-order inertia pure lag model, and using the updated first-order inertia pure lag model, combined with the control vector, to adjust the proportional coefficient, integral coefficient, and differential coefficient of the PID control algorithm. The PLC control device controls the actual temperature of the next time period in the current production cycle in real time.
[0014] In a second aspect, an embodiment of the present application further provides a simulation system for a PLC control device, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, the steps of the simulation method for a PLC control device described in any one of the above are implemented.
[0015] The present application has at least the following beneficial effects: In this application, a simulation environment is built, and based on the actual temperature in each period, the simulated temperature is obtained. The beneficial effect is to facilitate subsequent analysis of the lag deviation between the actual temperature and the simulated temperature. By analyzing the differences in the actual temperatures of different production cycles in the same period during multiple industrial production processes in historical periods, the fluctuation characteristic values of each period are calculated. The beneficial effect is to consider the fluctuation of the actual temperature to reflect the complexity of the heat conduction process, and further illustrate the interference situation and control instability suffered by the PLC control device during temperature control in different industrial production processes. The eigenvectors of each period are constructed and all periods are clustered. The beneficial effect is to consider the change rate and fluctuation of the actual temperature to distinguish periods with different fluctuation degrees, so as to improve the adaptability of the neural network to periods with different fluctuation degrees in the industrial production process and avoid overfitting of the neural network. The actual lag value and the simulated lag value of each period in each production cycle are determined. The beneficial effect is to evaluate the lag of the control of the actual temperature and the simulated temperature in a local period at each period by evaluating the change rate of the actual temperature and the simulated temperature, and calculate the parameter error of each period in each production cycle. The beneficial effect is to consider the lag deviation between the actual temperature and the simulated temperature to illustrate the control deviation when using the parameter vector corresponding to the first-order inertial pure lag model for subsequent temperature control, and further reflect the accuracy of temperature control. After training the neural network model, it is imported into the simulation environment to simulate the PLC control device, and the control coefficients of the PID control algorithm are adjusted in real time to control the temperature. The beneficial effect is to realize the real-time adjustment of the parameters of the first-order inertial pure lag model, avoid the simulation error caused by using the model with the same parameters in different periods, improve the generalization ability of the neural network and enhance the reliability of the output model parameters of the neural network, thereby improving the simulation accuracy of the PLC control device and further enhancing the temperature control accuracy in industrial production. Brief Description of the Drawings
[0016] The following further elaborates on a simulation method for a PLC control device of this application with reference to the drawings.
[0017] Figure 1 It is a flowchart of the steps of a simulation method for a PLC control device provided by an embodiment of this application; Figure 2 It is a flowchart of the steps of a method for obtaining the actual lag value of each period in each production cycle provided by an embodiment of this application. Detailed Description of the Specific Embodiment
[0018] To make the objectives, technical solutions and advantages of this application more clear and understandable, the following further details a simulation method and system for a PLC control device proposed in this application in combination with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not used to limit this application.
[0019] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which this application belongs.
[0020] Please refer to Figure 1 , which shows a flowchart of the steps of a simulation method for a PLC control device provided in an embodiment of this application. The method includes the following steps: Step 1, obtain the actual temperatures at all moments in each time period under multiple production cycles in the industrial production process, identify the model parameters of the constructed first-order inertial pure time-delay model, form a parameter vector with all the model parameters corresponding to each time period, and use the Z-N method to tune the proportional coefficient, integral coefficient, and differential coefficient in the PID control algorithm to form a control vector.
[0021] In this embodiment, taking an industrial furnace in the metallurgical industry as an example, accurately control the actual temperature in the furnace. By monitoring the actual temperature in the industrial furnace during multiple industrial production processes in the historical period, each entire industrial production process in the historical period is recorded as a production cycle, and the actual temperatures at each moment in multiple production cycles are collected; In this embodiment, assume that the duration of a production cycle is 7 hours, the acquisition time interval of the actual temperature is 1 s, and the actual temperatures at each moment in 50 production cycles are collected. As other implementation manners, the implementer can set it according to the actual situation.
[0022] Divide all the moments in a production cycle into multiple time periods; In this embodiment, all the moments in each production cycle are divided into 1260 time periods, and each time period contains the actual temperatures of 20 moments. As other implementation manners, the implementer can set it according to the actual situation.
[0023] Approximate the lag of the temperature control system in the PLC control device during the industrial production process by establishing a first-order inertial pure time-delay model. Its transfer function is: Among them, is the static amplification coefficient; is the time constant; is the lag time, is the Laplace operator; It should be noted that the first-order inertial pure time-delay model is a well-known technology and will not be elaborated here.
[0024] Based on the actual temperature at all times in each period of each production cycle, the model parameters of the first-order inertial pure lag model are identified to obtain all model parameters corresponding to each period of each production cycle. , and , forming a parameter vector; In this embodiment, the relay feedback method is used to identify the model parameters of the first-order inertia pure lag model, wherein the process of identifying the model parameters of the first-order inertia pure lag model is a well-known technology and will not be described in detail here.
[0025] Based on all model parameters corresponding to each period in each production cycle , and , the ZN method is used to adjust and calculate the proportional coefficient in the PID (Proportional-Integral-Derivative) control algorithm , integral coefficient and the differential coefficient , forming the control vector; It should be noted that the relay feedback method and the ZN method (Ziegler-Nichols) are both well-known technologies and will not be described in detail here.
[0026] At this point, the actual temperature at each time in each period of each production cycle, as well as the parameter vector and control vector of each period, are obtained.
[0027] Step 2: Analyze the deviation between the actual temperature of all production cycles in each time period and the predicted value during curve fitting, and calculate the fluctuation characteristic value of each time period; according to the average level and change rate of the actual temperature of all production cycles in each time period, combined with the fluctuation characteristic value, construct the characteristic vector of each time period, and cluster all time periods.
[0028] Since the actual temperature changes in different industrial production processes have strong similarities, the actual temperature changes in different production cycles in the same period are analyzed and the fluctuation characteristic values are calculated, specifically: Perform abnormal detection on the actual temperature at all times of all production cycles in each time period to obtain the abnormal time; perform curve fitting on the actual temperature at all remaining times after excluding the abnormal time in each time period of each production cycle, and calculate the mean absolute error; In this embodiment, the 3σ criterion, i.e., the Pauta criterion, is adopted for anomaly detection. Among them, the 3σ criterion is a well-known technology and will not be elaborated here. As other implementation manners, implementers can adopt other methods of the prior art. For example, algorithms such as LOF (Local Outlier Factor) can be used. This embodiment does not make special restrictions on this; secondly, a polynomial fitting algorithm is adopted for curve fitting. Among them, the highest order of the polynomial in the polynomial fitting algorithm is 2. As other implementation manners, implementers can set it by themselves according to the actual situation.
[0029] It should be noted that the calculation of the mean absolute error is a well-known technology. The mean absolute error MAE = , where is the actual temperature at the -th moment, is the predicted temperature of the fitting curve at the -th moment, and n is the number of all remaining moments after excluding abnormal moments in each time period of each production cycle.
[0030] The mean value of the mean absolute errors of all production cycles in each time period is used as the fluctuation characteristic value of each time period; It should be noted that the larger the mean absolute error, the greater the deviation between the actual temperature data and the temperature data obtained by fitting, the larger the obtained fluctuation characteristic value, the greater the fluctuation degree of the actual temperature in different industrial production processes in this time period, which reflects that the heat conduction process is more complex, the temperature control system in the PLC control device is more interfered with by temperature, the accuracy of temperature control is poor, and the control stability is low.
[0031] Based on this, a feature vector is constructed through the fluctuation characteristic value. Specifically: The mean value of the actual temperatures of all moments of all production cycles in each time period is denoted as the average temperature; The sum of the differences between the actual temperatures of all adjacent moments in each time period of each production cycle is denoted as the change rate; In this embodiment, the sum of the absolute values of the differences between the actual temperatures of all adjacent moments in each time period of each production cycle is denoted as the change rate.
[0032] The sum of the average change rates of all production cycles in each time period is denoted as the average rate; The average temperature, the average rate, and the fluctuation characteristic value of each time period are combined to form a feature vector; It should be noted that the average temperature reflects the average level of the actual temperature during this period, and the average rate reflects the intensity of the change in the actual temperature. The higher the change rate of the actual temperature, the greater the average rate; conversely, if the actually measured temperature shows a stable change, the change rate of the temperature is lower, and the average rate is smaller.
[0033] Therefore, all periods are classified through the eigenvectors, so as to divide the periods with different fluctuation degrees. Specifically: Cluster the eigenvectors of all periods to obtain multiple clusters; In this embodiment, the DBSCAN (Density-Based Spatial Clustering of Applications with Noise) clustering algorithm is used for clustering. Among them, the truncation distance in the clustering algorithm is 1.5 times the mean of the DTW distances between all any two eigenvectors, and the minimum sample size is 10. Among them, the DBSCAN clustering algorithm is a well-known technology and will not be elaborated here. As other implementation manners, the implementer can adopt other methods of the existing technology, such as the hierarchical clustering algorithm, etc. This embodiment does not make special restrictions on this.
[0034] Thus, multiple clusters are obtained.
[0035] Step 3, for each production cycle, by building a simulation environment of the PLC control device and based on the parameter vectors and control vectors of each period, simulate the actual temperature at all moments of each period to obtain the simulated temperature at each moment within each period; through the relevant changes in the actual temperature and the simulated temperature between different local ranges within each period in each production cycle, respectively combine the proportionality coefficient of each period and the fluctuation characteristic value of all periods within the cluster to which it belongs to determine the actual lag value and the simulated lag value of each period in each production cycle.
[0036] The heat conduction changes at different moments during the industrial production process have strong regularity. Therefore, the main heat conduction methods and their environmental parameters will change at different periods of the entire production process, which will in turn lead to changes in the lag of temperature control. Based on the above analysis, a first-order inertial pure lag model with different model parameters is used for simulation for different periods.
[0037] Thus, through the actual temperature at all moments within each period in each production cycle, with the parameter vector and control vector of this period, the temperature control process is simulated. Specifically: For each production cycle, by building a simulation environment for PLC control equipment, based on the actual temperatures at all times within each time period, using the first-order inertia pure delay model corresponding to the parameter vector of each time period and the PID control algorithm corresponding to the control vector, simulate the temperatures at all times within the next time period to obtain the simulated temperatures at all times within each time period of each production cycle; In this embodiment, a simulation environment is built through the Simulink simulation tool. Among them, the process of simulation is a well-known technology and will not be elaborated here. It should be noted that the length of the simulated temperature vector is 20.
[0038] It should be noted that for the first time period, the simulated temperature cannot be determined. Therefore, the simulated temperatures at all times within the first time period are the actually measured temperatures at the corresponding times.
[0039] Furthermore, the intensification of temperature fluctuations means that the temperature control system does not respond to temperature changes in a timely manner, reflecting an increase in the hysteresis of temperature control. When the temperature fluctuations during industrial production are strong, it indicates that the heat conduction process is relatively complex at this time, the temperature control is difficult, and the temperature control system is difficult to quickly adjust the parameters of the first-order inertia pure delay model and the PID control algorithm to adapt to temperature changes, resulting in a large hysteresis phenomenon. The stronger the temperature fluctuations during industrial production, the stronger the hysteresis of the temperature control system.
[0040] Secondly, the proportional coefficient is an important parameter in the PID control algorithm and is used to adjust the response speed of the temperature control system. The larger the proportional coefficient, the stronger the control change for temperature. Therefore, at the same temperature change rate, the larger the proportional coefficient corresponding to each time period, the stronger the hysteresis of temperature control for that time period.
[0041] Furthermore, for the actual temperatures and simulated temperatures at all times within each time period of each production cycle, there are differences in temperature within different local ranges. The faster the temperature changes in the first half, the weaker the hysteresis, indicating a relatively rapid response to temperature changes. Therefore, by calculating the change rates of the actual temperatures and simulated temperatures within different local ranges of each time period respectively, the hysteresis characteristic values are calculated respectively. Among them, the step flow chart of the method for obtaining the actual hysteresis value of each time period provided in this embodiment is as Figure 2 shown, specifically: Divide all the times within any time period of each production cycle into multiple local time periods; In this embodiment, all the times within any time period of each production cycle are evenly divided into 4 local time periods. As other implementation manners, the implementer can set it according to the actual situation.
[0042] Calculate the correlation degree between the actual temperatures at all moments within each local time period under any given time period and the actual temperatures at all moments within the previous local time period, which is denoted as the first correlation degree; Calculate the correlation degree between the simulated temperatures at all moments within each local time period under any given time period and the simulated temperatures at all moments within the previous local time period, which is denoted as the second correlation degree; In this embodiment, the correlation degree is respectively measured by calculating the reciprocal of the Euclidean distance between the actual temperatures at all moments within each local time period under any given time period and the actual temperatures at all moments within the previous local time period, and calculating the reciprocal of the Euclidean distance between the simulated temperatures at all moments within each local time period under any given time period and the simulated temperatures at all moments within the previous local time period. As other implementation manners, implementers can adopt other methods of the prior art, for example, the reciprocal of the DTW distance, cosine similarity, etc. This embodiment does not make special limitations on this.
[0043] It should be noted that the smaller the correlation degree, the greater the difference between the actual temperature and the simulated temperature between each local time period and its previous local time period, the faster the temperature change rate within the two local time periods, and the weaker the hysteresis of temperature control.
[0044] Number all local time periods under any given time period in chronological order; Taking the serial number corresponding to each local time period as the weight, perform a weighted sum of the first correlation degrees of all local time periods under any given time period, which is denoted as the first sum value; Taking the serial number corresponding to each local time period as the weight, perform a weighted sum of the second correlation degrees of all local time periods under any given time period, which is denoted as the second sum value; Calculate the average value of the fluctuation characteristic values of all time periods within the cluster to which any given time period belongs in each production cycle; In this embodiment, the arctangent function is used for normalization processing. Among them, the arctangent function is a well-known technology and will not be elaborated here. As other implementation manners, implementers can adopt other methods of the prior art, for example, the sigmoid function, etc. This embodiment does not make special limitations on this.
[0045] Normalize the product of the proportional coefficient of any given time period and the average value; take the product of the normalization result and the first sum value as the actual hysteresis value of any given time period in each production cycle; Take the product of the normalization result and the second sum value as the simulated hysteresis value of any given time period in each production cycle; It should be noted that by weighting all local time periods of the actual temperature and the simulated temperature with the serial numbers as weights respectively to evaluate the hysteresis of the entire time period, and by using the average value and the proportionality coefficient to evaluate the temperature fluctuation situation within this time period and the intensity of temperature control, so as to reflect the complexity of the heat conduction process and the control hysteresis of the proportionality coefficient for the drastic temperature change. The larger the obtained hysteresis characteristic value is, the stronger the hysteresis degree of the temperature control system for temperature control in this time period is.
[0046] Thus, the actual temperature and the simulation hysteresis values of each time period in each production cycle are obtained.
[0047] Step 4: Based on the difference between the actual hysteresis value and the simulation hysteresis value, calculate the parameter error of each time period in each production cycle. Combine the actual temperature, the parameter vector and the control vector, train the neural network model, then import it into the simulation environment, simulate the PLC control device, adjust the control coefficient of the PID control algorithm in real time, and control the temperature.
[0048] Furthermore, based on the actual hysteresis value and the simulation hysteresis value, determine the parameter error of the first-order inertial pure lag model, specifically: Take the normalized value of the difference between the actual hysteresis value and the simulation hysteresis value in each time period of each production cycle as the parameter error of each time period in each production cycle; In this embodiment, take the result of normalizing the square of the difference between the actual hysteresis value and the simulation hysteresis value in each time period of each production cycle as the parameter error of each time period in each production cycle; use the arctangent function for normalization processing. The arctangent function is a well-known technology and will not be elaborated here. As other implementation manners, implementers can adopt other methods of the existing technology, such as the sigmoid function, etc. This embodiment does not make special restrictions on this.
[0049] It should be noted that the larger the parameter error is, the higher the hysteresis characteristic of the temperature control system and the lower the control accuracy when the temperature is controlled subsequently by the parameter vector through the first-order inertial pure lag model in this time period.
[0050] Take the parameter error of each time period in each production cycle as the training label, and form a training set with the actual temperature at all moments in all time periods of all production cycles, the parameter vectors and control vectors of all time periods, and the training label; Take the training set as the input of the neural network model and train the neural network model; In this embodiment, an MLP (Multilayer perceptron) neural network model is used for training. Among them, the cross-entropy loss function is used as the loss function of the neural network model, and the Adam optimizer is used as the optimizer. The training of the MLP (Multilayer perceptron) neural network model is a well-known technology and will not be elaborated here.
[0051] By importing the trained neural network model into the simulation environment, using the actual temperatures at all moments in each time period under the current production cycle, passing through the trained neural network model in the simulation environment, obtaining the parameter vector of the next time period, updating the transfer function of the first-order inertia pure-delay model, and using the updated first-order inertia pure-delay model, combined with the control vector, to adjust the proportional coefficient, integral coefficient, and differential coefficient of the PID control algorithm, and perform real-time control on the actual temperature of the next time period.
[0052] Based on the same inventive concept as the above method, an embodiment of the present application also provides a simulation system for a PLC control device, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the steps of any one of the above simulation methods for a PLC control device.
[0053] It should be understood that although Figure 1 the steps in the flowchart are shown in sequence according to the indication of the arrows, these steps do not necessarily have to be executed in the order indicated by the arrows. Unless there is a clear description in this article, there is no strict order limit for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 at least a part of the steps in
[0054] may include multiple sub-steps or multiple stages. These sub-steps or stages do not necessarily have to be executed at the same moment, but can be executed at different moments. The execution order of these sub-steps or stages does not necessarily have to be sequential, but can be executed alternately or in turn with at least a part of other steps or sub-steps or stages of other steps.
[0055] The above-described embodiments merely represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation to the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made. Therefore, any simple modification, equivalent change, and decoration made to the above embodiments based on the technical essence of the present application without departing from the content of the technical solution of the present application all fall within the protection scope of the technical solution of the present application.
Claims
1. A simulation method for a PLC control device, characterized in that, The method includes the following steps: Obtain the actual temperatures at all moments within each time period under multiple production cycles in the industrial production process, identify the model parameters of the constructed first-order inertial pure time-delay model, form a parameter vector with all the model parameters corresponding to each time period, and use the Z-N method to tune all the control coefficients in the PID control algorithm, including the proportional coefficient, integral coefficient, and differential coefficient, to form a control vector; For each production cycle, by building a simulation environment of the PLC control device and based on the parameter vector and control vector of each time period, simulate the actual temperatures at all moments within each time period to obtain the simulated temperatures at all moments within each time period; Analyze the deviation between the actual temperatures of all production cycles under each time period and the predicted values during curve fitting, and calculate the fluctuation characteristic values of each time period; according to the average level and change rate of the actual temperatures of all production cycles under each time period, combined with the fluctuation characteristic values, construct the characteristic vectors of each time period and perform clustering on all time periods; Based on the relevant changes in the actual temperatures and the relevant changes in the simulated temperatures between different local ranges within each time period of each production cycle, respectively combined with the proportional coefficient of each time period and the fluctuation characteristic values of all time periods within the cluster to which it belongs, determine the actual time delay value and the simulated time delay value of each time period in each production cycle; Based on the difference between the actual time delay value and the simulated time delay value, calculate the parameter error of each time period in each production cycle, combined with the actual temperature, parameter vector, and control vector, train the neural network model, import it into the simulation environment, simulate the PLC control device, adjust the control coefficients of the PID control algorithm in real time, and control the temperature.
2. The simulation method of a PLC control device according to claim 1, characterized in that, The first-order inertia pure-delay model is as follows: , where is the static amplification factor; is the time constant; is the delay time, is the Laplace operator; among them, the model parameters , and form a parameter vector.
3. The simulation method of a PLC control device according to claim 1, wherein, The obtaining of the simulated temperatures at all moments within each time period includes: based on the actual temperatures at all moments within each time period, using the first-order inertial pure time-delay model corresponding to the parameter vector of each time period and the PID control algorithm corresponding to the control vector, simulate the temperatures at all moments within the next time period, so as to obtain the simulated temperatures at all moments within each time period of each production cycle, where the simulated temperatures at all moments within the first time period are the corresponding actual temperatures.
4. The simulation method of a PLC control device according to claim 1, characterized in that The calculation of the fluctuation characteristic values of each time period includes: Perform anomaly detection on the actual temperatures at all moments of all production cycles under each time period to obtain the abnormal moments; perform curve fitting on the actual temperatures of the remaining all moments within each time period of each production cycle after excluding the abnormal moments, and calculate the mean absolute error; The fluctuation characteristic value is the mean of the mean absolute errors of all production cycles under each time period.
5. The simulation method of a PLC control device according to claim 1, wherein The construction method of the characteristic vector is: Denote the mean of the actual temperatures at all moments of all production cycles under each time period as the average temperature; Denote the sum of the differences between the actual temperatures of all adjacent moments within each time period of each production cycle as the change rate; denote the sum of the average change rates of all production cycles under each time period as the average rate; Form the characteristic vector with the average temperature, the average rate, and the fluctuation characteristic value of each time period.
6. The simulation method of a PLC control device according to claim 1, characterized in that, The determination of the actual time delay value and the simulated time delay value of each time period in each production cycle includes: Divide all moments within each time period of each production cycle into multiple local time periods; Calculate the correlation degrees between the actual temperature and the simulated temperature at all moments between two adjacent local time periods for each time period, and denote them as the first correlation degree and the second correlation degree respectively; Number all local time periods in chronological order for each time period; Using the serial number corresponding to each local time period as the weight, perform weighted summation on the first correlation degree and the second correlation degree of all local time periods in any time period respectively, and denote them as the first sum value and the second sum value; Calculate the average value of the fluctuation characteristic values of all time periods within the cluster to which each time period of each production cycle belongs; Normalize the product of the proportionality coefficient of each time period and the average value; The actual lag value is the product of the normalized result and the first sum value; The simulated lag value is the product of the normalized result and the second sum value.
7. The simulation method of a PLC control device according to claim 1, wherein, The parameter error is the normalized value of the difference between the actual lag value and the simulated lag value for each time period of each production cycle.
8. The simulation method of a PLC control device according to claim 1, characterized in that After training the neural network model, import it into the simulation environment, including: Using the parameter error of each time period of each production cycle as the training label, combine the actual temperature at all moments within all time periods of all production cycles, the parameter vectors and control vectors of all time periods, and the training label to form a training set; Based on the training set, train the neural network model, and import the trained neural network model into the simulation environment.
9. The simulation method of a PLC control device according to claim 1, characterized in that, Simulate the PLC control device, adjust the control coefficients of the PID control algorithm in real time, and control the temperature, including: Using the actual temperature at all moments within each time period of the current production cycle, obtain the parameter vector of the next time period through the neural network model in the simulation environment, update the transfer function of the first-order inertial pure lag model, and use the updated first-order inertial pure lag model to combine with the control vector to adjust the proportionality coefficient, integral coefficient, and differential coefficient of the PID control algorithm. The PLC control device controls the actual temperature of the next time period in the current production cycle in real time.
10. A simulation system for a PLC control device, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of a simulation method for a PLC control device as described in any one of claims 1-9.
Citation Information
Patent Citations
Intelligent PLC data analysis and optimization control system
CN119045408A
Information processing apparatus, information processing method, and program
EP2961061A1
Controlled system model generating method and apparatus
US20060241787A1