A simulation method and system for PLC control equipment
By constructing parameter vectors and control vectors, building a simulation environment, and adjusting the control coefficients of the PID control algorithm in real time, the hysteresis problem of the temperature control system of the PLC control equipment is solved, and the accuracy of temperature control and simulation accuracy are improved.
Patent Information
- Application Number
- CN202510819546.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-19
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2045-06-19
AI Technical Summary
In complex industrial production environments, the hysteresis of the temperature control system leads to large errors in the simulation results and actual temperature, affecting the accuracy of temperature control.
By obtaining the actual temperatures of multiple production cycles, constructing the parameter vector and control vector of the first-order inertial pure lag model, building a simulation environment, using the Z-N method to tune the PID control algorithm, calculate the fluctuation eigenvalue and eigenvector, clustering period, training the neural network model, and adjusting the control coefficient of the PID control algorithm in real time.
It improves the simulation accuracy of PLC control equipment, enhances the accuracy of temperature control, reduces simulation errors, and improves the automation level of industrial production.
Smart Images

Figure CN120315366B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of automation control technology, and in particular to a simulation method and system for a PLC control device. Background Art
[0002] Temperature control is crucial in industrial production, directly impacting product quality, production efficiency, energy consumption, and equipment safety. PLC-controlled devices can be flexibly programmed using the highly precise Proportional-Integral-Derivative (PID) algorithm for temperature control, enabling real-time monitoring and remote management, significantly improving the automation and economic efficiency of industrial production. For industrial processes with complex temperature fluctuations, simulation of PLC-controlled devices can not only pre-verify the feasibility of control algorithms, thereby reducing actual hardware consumption, but also allow adjustment of control algorithm parameters within the simulation environment to improve temperature control accuracy.
[0003] However, due to the complex industrial production environment, the temperature control system in the PLC control equipment has a certain hysteresis in temperature control. The traditional method usually uses a first-order inertia pure hysteresis model with fixed parameters to approximate its hysteresis. However, due to changes in environmental factors such as thermal conductivity during the industrial production process, the first-order inertia pure hysteresis model with fixed parameters will cause a large error between the simulation results of the temperature data and the actual temperature. As production continues, the simulation error continues to expand, causing the simulation accuracy of the PLC control equipment to decline, affecting the accuracy of temperature control in subsequent industrial production. Summary of the Invention
[0004] In order 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 to the technical problem of this application is to provide a simulation method and system for a PLC control device, including the following steps:
[0006] In a first aspect, an embodiment of the present application provides a simulation method for a PLC control device, the method comprising the following steps:
[0007] The actual temperature at all times in each period of multiple production cycles in the industrial production process is obtained, and the model parameters of the constructed first-order inertia pure lag model are identified. All model parameters corresponding to each period are combined into a parameter vector. The ZN method is used to adjust all control coefficients in the PID control algorithm, including the proportional coefficient, integral coefficient, and differential coefficient, to form a control vector.
[0008] For each production cycle, a simulation environment for PLC control equipment is built, and based on the parameter vector and control vector of each period, the actual temperature at all times in each period is simulated to obtain the simulated temperature at each time in each period;
[0009] Analyze the deviation between the actual temperature of all production cycles in each period and the predicted value when fitting the curve, and calculate the fluctuation characteristic value of each period. Based on the average level and change rate of the actual temperature of all production cycles in each period, combined with the fluctuation characteristic value, construct the characteristic vector of each period, and cluster all periods.
[0010] The actual hysteresis value and simulated hysteresis value of each time period in each production cycle are determined by combining the proportional coefficient of each time period and the fluctuation characteristic value of all time periods in the cluster to which it belongs through the correlation change of actual temperature and simulated temperature between different local ranges in each time period in each production cycle.
[0011] Based on the difference between the actual hysteresis value and the simulated hysteresis value, the parameter error of each period in each production cycle is calculated. Combined with the actual temperature, parameter vector and control vector, the neural network model is trained and imported into the simulation environment to simulate the PLC control equipment, adjust the control coefficient of the PID control algorithm in real time, and control the temperature.
[0012] Preferably, the first-order inertia pure hysteresis model is: ,in, is the static amplification factor; is the time constant; is the lag time, is the Laplace operator; where the model parameters 、 and , forming a parameter vector.
[0013] Preferably, the obtaining of the simulated temperature at each moment in each time period includes: based on the actual temperature at all moments in each time period, simulating the temperature at all moments in the next time period with the first-order inertia pure lag model corresponding to the parameter vector of each time period and the PID control algorithm corresponding to the control vector, thereby obtaining the simulated temperature at each moment in each time period in each production cycle, wherein the simulated temperature at each moment in the first time period is the corresponding actual temperature.
[0014] Preferably, the calculation of the fluctuation characteristic value of each time period includes:
[0015] Perform anomaly 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 in each time period of each production cycle after excluding the abnormal time, and calculate the mean absolute error;
[0016] The fluctuation characteristic value is the mean of the mean absolute errors of all production cycles in each time period.
[0017] Preferably, the method for constructing the feature vector is:
[0018] The average of the actual temperatures at all times of all production cycles in each period is recorded as the average temperature;
[0019] The sum of the differences in actual temperature at all adjacent moments in each period of each production cycle is recorded as the rate of change; the sum of the average rate of change of all production cycles in each period is recorded as the average rate;
[0020] The average temperature, the average rate, and the fluctuation characteristic value of each time period are combined into a characteristic vector.
[0021] Preferably, determining the actual hysteresis value and the simulated hysteresis value of each time period in each production cycle includes:
[0022] Divide all moments in each period of each production cycle into multiple local periods;
[0023] Calculate the correlation between the actual temperature and the simulated temperature at all times between two adjacent local time periods in each time period, and record them as the first correlation and the second correlation respectively;
[0024] All local time periods under each time period are numbered in chronological order; using the sequence number corresponding to each local time period as a weight, the first correlation degree and the second correlation degree of all local time periods under any time period are weighted and summed, respectively recorded as the first sum value and the second sum value;
[0025] Calculating the average value of the fluctuation characteristic values of all time periods in the cluster to which each time period belongs in each production cycle; normalizing the product of the proportional coefficient of each time period and the average value;
[0026] The actual hysteresis value is the product of the normalized result and the first sum value; the simulation hysteresis value is the product of the normalized result and the second sum value.
[0027] Preferably, the parameter error is a normalized value of the difference between the actual hysteresis value and the simulated hysteresis value in each time period in each production cycle.
[0028] Preferably, after training the neural network model, the model is introduced into a simulation environment, including:
[0029] The parameter errors of each period in each production cycle are used as training labels, and the actual temperatures at all times in all periods in all production cycles, the parameter vectors and control vectors of all periods, and the training labels are combined into a training set;
[0030] Based on the training set, the neural network model is trained, and the trained neural network model is imported into the simulation environment.
[0031] Preferably, the PLC control device is simulated, the control coefficient of the PID control algorithm is adjusted in real time, and the temperature is controlled, including: using the actual temperature at all times in each time period of the current production cycle, through the 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 lag model, 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, and the PLC control device controls the actual temperature of the next time period in the current production cycle in real time.
[0032] In a second aspect, an embodiment of the present application further provides 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, wherein when the processor executes the computer program, the system implements the steps of any one of the above-mentioned methods for simulating a PLC control device.
[0033] This application has at least the following beneficial effects:
[0034] This application builds a simulation environment to obtain the simulated temperature based on the actual temperature of each time period. Its beneficial effect is to facilitate the subsequent analysis of the lag deviation between the actual temperature and the simulated temperature; through the differences in the actual temperatures of different production cycles in the same time period during multiple industrial production processes in the historical period, the fluctuation characteristic values of each time period are calculated. Its beneficial effect is that the fluctuation of the actual temperature is taken into account to reflect the complexity of the heat conduction process, and then the interference and control instability of the PLC control equipment when controlling the temperature in different industrial production processes are explained; the characteristic vector of each time period is constructed and all time periods are clustered. Its beneficial effect is that the rate of change and fluctuation of the actual temperature are taken into account to distinguish time periods with different degrees of fluctuation, so as to subsequently improve the adaptability of the neural network to time periods with different degrees of fluctuation in the industrial production process and avoid overfitting of the neural network; the actual lag value and simulated lag value of each time period in each production cycle are determined. Its beneficial effect is that the actual lag value and simulated lag value of each time period in each production cycle are determined by evaluation. Estimate the speed of change of actual temperature and simulated temperature in local time periods under each time period to evaluate the lag of actual temperature and simulated temperature control in this period, and calculate the parameter error of each time period in each production cycle. Its beneficial effect is that it takes into account the lag deviation between actual temperature and simulated temperature to illustrate the control deviation when the parameter vector corresponds to the first-order inertia pure lag model for subsequent temperature control, thereby reflecting the accuracy of temperature control; after the neural network model is trained, it is imported into the simulation environment, the PLC control equipment is simulated, the control coefficient of the PID control algorithm is adjusted in real time, and the temperature is controlled. Its beneficial effect is that it realizes real-time adjustment of the parameters of the first-order inertia pure lag model, avoids the simulation error caused by the use of the same parameter model in different time periods, improves the generalization ability of the neural network and enhances the reliability of the neural network output model parameters, thereby improving the simulation accuracy of the PLC control equipment, and thus improving the accuracy of temperature control in industrial production. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The following is a detailed description of a simulation method for a PLC control device of the present application with reference to the accompanying drawings.
[0036] Figure 1 A flowchart of a method for simulating a PLC control device provided in an embodiment of the present application;
[0037] Figure 2 A flowchart of the steps of the method for obtaining the actual hysteresis value of each time period in each production cycle provided in an embodiment of the present application. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solutions and advantages of this application more clearly understood, the following further describes in detail a method and system for simulating a PLC control device proposed in this application, in conjunction with the accompanying drawings and implementation examples. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0039] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.
[0040] See also Figure 1 , which shows a flowchart of a method for simulating a PLC control device provided by one embodiment of the present application, the method comprising the following steps:
[0041] Step 1: Obtain the actual temperature at all times in each period of multiple production cycles in the industrial production process, and identify the model parameters of the constructed first-order inertia pure lag model. All model parameters corresponding to each period are composed into a parameter vector. The ZN method is used to adjust the proportional coefficient, integral coefficient and differential coefficient in the PID control algorithm to form a control vector.
[0042] In this embodiment, an industrial furnace in the metallurgical industry is used as an example to accurately control the actual temperature inside the furnace. The actual temperature inside the industrial furnace is monitored during multiple industrial production processes in a historical period. Each entire industrial production process in the historical period is recorded as a production cycle, and the actual temperature at each moment in multiple production cycles is collected.
[0043] In this embodiment, it is assumed that the duration of a production cycle is 7 hours, the time interval for collecting the actual temperature is 1 second, and the actual temperature at each moment in 50 production cycles is collected. As other implementation methods, the implementer can set it according to the actual situation.
[0044] Divide all moments in a production cycle into multiple time periods;
[0045] In this embodiment, all 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 methods, the implementer can set it according to the actual situation.
[0046] The hysteresis of the temperature control system in the PLC control equipment in the industrial production process is approximately represented by establishing a first-order inertia pure lag model. Its transfer function is:
[0047]
[0048] in, is the static amplification factor; is the time constant; is the lag time, is the Laplace operator;
[0049] It should be noted that the first-order inertia pure lag model is a well-known technology and will not be described in detail here.
[0050] Based on the actual temperature at all times in each period of each production cycle, the model parameters of the first-order inertia pure lag model are identified to obtain all model parameters corresponding to each period of each production cycle. 、 and , forming a parameter vector;
[0051] In this embodiment, the relay feedback method is used to identify the model parameters of the first-order inertia pure lag model. 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.
[0052] 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 differential coefficients , forming the control vector;
[0053] 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.
[0054] At this point, the actual temperature at each moment in each period of each production cycle, as well as the parameter vector and control vector of each period, are obtained.
[0055] 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; based on 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.
[0056] Since the actual temperature changes in different industrial production processes are highly similar, the actual temperature changes in different production cycles in the same period are analyzed and the fluctuation characteristic values are calculated, specifically:
[0057] Perform anomaly 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 in each time period of each production cycle after excluding the abnormal time, and calculate the mean absolute error;
[0058] In this embodiment, the 3σ criterion, namely the Laida criterion, is adopted for anomaly detection. The 3σ criterion is a well-known technology and will not be described in detail here. As other implementation methods, the implementer may adopt other methods of the existing technology, such as the LOF (Local Outlier Factor) algorithm, etc. This embodiment does not impose any special restrictions on this. Secondly, a polynomial fitting algorithm is adopted for curve fitting. The highest order of the polynomial in the polynomial fitting algorithm is 2. As other implementation methods, the implementer may set it according to the actual situation.
[0059] It should be noted that the calculation of mean absolute error is a well-known technology, mean absolute error MAE = ,in, For the The actual temperature at a moment, For the fitting curve The predicted temperature at each moment, n is the number of all remaining moments in each period of each production cycle after excluding abnormal moments.
[0060] The mean of the mean absolute errors of all production cycles in each period is taken as the fluctuation characteristic value of each period;
[0061] It should be noted that the larger the mean absolute error, the greater the deviation between the actual temperature data and the fitted temperature data, the larger the resulting fluctuation characteristic value, and the greater the degree of fluctuation of the actual temperature of different industrial production processes during this period, reflecting that the heat conduction process is more complex, the temperature control system in the PLC control equipment is more subject to interference, the temperature control accuracy is poor, and the control stability is low.
[0062] Based on this, the characteristic vector is constructed through the fluctuation characteristic value, specifically:
[0063] The average of the actual temperatures at all times of all production cycles in each period is recorded as the average temperature;
[0064] The sum of the differences in actual temperatures at all adjacent moments in each period of each production cycle is recorded as the rate of change;
[0065] In this embodiment, the sum of the absolute values of the differences between the actual temperatures at all adjacent moments in each time period in each production cycle is recorded as the rate of change.
[0066] The sum of the average change rates of all production cycles in each period is recorded as the average rate;
[0067] The average temperature, the average rate and the fluctuation characteristic value of each time period are combined into a characteristic vector;
[0068] It should be noted that the average temperature reflects the average level of the actual temperature during the period, and the average rate reflects the severity of the actual temperature change. The higher the rate of change of the actual temperature, the greater the average rate; conversely, if the actual measured temperature shows a stable change, the temperature change rate is lower and the average rate is smaller.
[0069] Therefore, all time periods are classified by eigenvectors, thereby dividing time periods with different degrees of volatility into:
[0070] Clustering the feature vectors of all time periods to obtain multiple clusters;
[0071] In this embodiment, the DBSCAN (Density-Based Spatial Clustering of Applications with Noise) clustering algorithm is used for clustering, wherein the cutoff distance in the clustering algorithm is 1.5 times the mean of the DTW distance between any two eigenvectors, and the minimum sample size is 10. The DBSCAN clustering algorithm is a well-known technology and will not be described in detail here. As other implementation methods, implementers may adopt other methods of the existing technology, such as a hierarchical clustering algorithm, etc., and this embodiment does not impose any special restrictions on this.
[0072] At this point, multiple clusters are obtained.
[0073] Step 3: For each production cycle, a simulation environment for the PLC control equipment is built, and based on the parameter vector and control vector of each time period, the actual temperature at all times of each time period is simulated to obtain the simulated temperature at each time period; through the relevant changes in actual temperature and simulated temperature between different local ranges in each time period in each production cycle, combined with the proportional coefficient of each time period and the fluctuation characteristic values of all time periods in the cluster to which it belongs, the actual lag value and simulated lag value of each time period in each production cycle are determined.
[0074] Heat conduction changes at different times during industrial production processes exhibit strong regularity. Consequently, the primary heat conduction mode and its environmental parameters vary at different times throughout the production process, leading to variations in the hysteresis of temperature control. Based on this analysis, a first-order inertia pure lag model with different model parameters was simulated at different times.
[0075] Therefore, the temperature control process is simulated by the actual temperature at all times in each period of each production cycle, using the parameter vector and control vector of the period, as follows:
[0076] For each production cycle, by building a simulation environment for PLC control equipment, based on the actual temperature at all times in each period, using the first-order inertia pure lag model corresponding to the parameter vector of each period and the PID control algorithm corresponding to the control vector, the temperature at all times in the next period is simulated to obtain the simulated temperature at each time in each period of each production cycle;
[0077] In this embodiment, a simulation environment is built using the Simulink simulation tool, wherein the simulation process is a well-known technology and will not be described in detail here. It should be noted that the length of the simulation temperature vector is 20.
[0078] It should be noted that for the first period, the simulated temperature cannot be determined. Therefore, the simulated temperature at each moment in the first period is the actually measured temperature at the corresponding moment.
[0079] Furthermore, increased temperature fluctuations mean that the temperature control system is not responding promptly enough to temperature changes, reflecting increased hysteresis in temperature control. When temperature fluctuations are strong in industrial production processes, the heat conduction process is complex, making temperature control more difficult. The temperature control system struggles to quickly adjust the parameters of the first-order inertia pure lag model and PID control algorithm to adapt to temperature changes, resulting in significant hysteresis. The stronger the temperature fluctuations in industrial production processes, the greater the hysteresis in the temperature control system.
[0080] Secondly, the proportional coefficient is a key parameter in the PID control algorithm, used to adjust the response speed of the temperature control system. The larger the proportional coefficient, the stronger the temperature control change. Therefore, for the same temperature change rate, the larger the proportional coefficient corresponding to each time period, the greater the hysteresis of the temperature control in that period.
[0081] Furthermore, for the actual temperature and simulated temperature at all moments in each time period in each production cycle, there are differences in temperature in different local ranges. The faster the temperature changes in the first half, the weaker the hysteresis, indicating that the response to the temperature change is relatively rapid. Therefore, the hysteresis characteristic values are calculated respectively by calculating the change rates of the actual temperature and simulated temperature in different local ranges in each time period. The flowchart of the steps of the method for obtaining the actual hysteresis value of each time period in each production cycle provided by this embodiment is as follows: Figure 2 As shown, specifically:
[0082] Divide all moments in any period of each production cycle into multiple local periods;
[0083] In this embodiment, all moments in any time period in each production cycle are evenly divided into four local time periods. As other implementation methods, implementers can set them according to actual conditions.
[0084] Calculate the correlation between the actual temperature at all times in each partial period of any time period and the actual temperature at all times in the previous partial period of any time period, and record it as a first correlation;
[0085] Calculating the correlation between the simulated temperature at all moments in each partial period of any time period and the simulated temperature at all moments in the previous partial period of time, recorded as a second correlation;
[0086] In this embodiment, the degree of correlation is measured by calculating the reciprocal of the Euclidean distance between the actual temperature at all moments in each local time period under any time period and the actual temperature at all moments in the previous local time period, and calculating the reciprocal of the Euclidean distance between the simulated temperature at all moments in each local time period under any time period and the simulated temperature at all moments in the previous local time period. As other implementation methods, the implementer may adopt other methods of the prior art, such as the reciprocal of the DTW distance, cosine similarity, etc., and this embodiment does not impose any special restrictions on this.
[0087] It should be noted that the smaller the correlation degree is, the greater the difference between the actual temperature and the simulated temperature in each local period and its previous local period is, the faster the temperature change rate in the two local periods is, and the weaker the hysteresis of the temperature control is.
[0088] Numbering all local time periods under any time period in chronological order;
[0089] Taking the sequence number corresponding to each local time period as the weight, perform weighted summation of the first correlations of all local time periods under any time period, and record it as the first sum value;
[0090] Taking the serial number corresponding to each local time period as the weight, the second correlation of all local time periods under any time period is weighted and summed, which is recorded as the second sum value;
[0091] Calculating the average value of the fluctuation characteristic values of all time periods in the cluster to which any time period belongs in each production cycle;
[0092] In this embodiment, the inverse tangent function is used for normalization processing, wherein the inverse tangent function is a well-known technology and will not be described in detail here. As other implementation methods, the implementer can adopt other methods of the existing technology, such as the sigmoid function, etc. This embodiment does not impose any special restrictions on this.
[0093] Normalizing the product of the proportional coefficient of any time period and the average value; and multiplying the normalized result and the first sum value as the actual hysteresis value of any time period in each production cycle;
[0094] The product of the normalized result and the second sum value is used as the simulation hysteresis value of any period in each production cycle;
[0095] It should be noted that by using the serial number as the weight, all local time periods of the actual temperature and the simulated temperature are weighted respectively to evaluate the hysteresis of the entire time period. The temperature fluctuation within the time period and the intensity of temperature control are evaluated through the average value and the proportional coefficient, thereby reflecting the complexity of the heat conduction process and the hysteresis of the proportional coefficient for drastic temperature changes. The larger the obtained hysteresis characteristic value, the stronger the hysteresis of the temperature control system in this time period.
[0096] At this point, the actual temperature and simulation hysteresis value of each period in each production cycle are obtained.
[0097] Step 4: Based on the difference between the actual hysteresis value and the simulated hysteresis value, the parameter error of each period in each production cycle is calculated. After training the neural network model based on the actual temperature, parameter vector and control vector, it is imported into the simulation environment to simulate the PLC control equipment, adjust the control coefficient of the PID control algorithm in real time, and control the temperature.
[0098] Furthermore, based on the actual hysteresis value and the simulated hysteresis value, the parameter error of the first-order inertia pure hysteresis model is determined, specifically:
[0099] The normalized value of the difference between the actual hysteresis value and the simulated hysteresis value in each period of each production cycle is used as the parameter error in each period of each production cycle;
[0100] In this embodiment, the square of the difference between the actual lag value and the simulated lag value in each time period in each production cycle is normalized as the parameter error of each time period in each production cycle; the inverse tangent function is used for normalization, wherein the inverse tangent function is a well-known technology and will not be described here. As other implementation methods, the implementer can adopt other methods of the existing technology, such as the sigmoid function, etc., and this embodiment does not impose any special restrictions on this.
[0101] 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 will be when subsequent temperature control is performed using the parameter vector through a first-order inertia pure lag model during this period.
[0102] The parameter errors of each period in each production cycle are used as training labels, and the actual temperatures at all times in all periods in all production cycles, the parameter vectors and control vectors of all periods, and the training labels are combined into a training set;
[0103] Using the training set as input of the neural network model to train the neural network model;
[0104] In this embodiment, an MLP (Multilayer perceptron) neural network model is used for training, wherein the loss function of the neural network model adopts the cross entropy loss function, and the optimizer adopts the Adam optimizer. The training of the MLP (Multilayer perceptron) neural network model is a well-known technology and will not be repeated here.
[0105] By importing the trained neural network model into the simulation environment, the actual temperature at all times in each period of the current production cycle is used to obtain the parameter vector of the next period through the trained neural network model in the simulation environment, and the transfer function of the first-order inertia pure lag model is updated. The updated first-order inertia pure lag model is used in combination with the control vector to adjust the proportional coefficient, integral coefficient and differential coefficient of the PID control algorithm to perform real-time control of the actual temperature of the next period.
[0106] 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, comprising 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 any one of the above-mentioned methods for simulating a PLC control device are implemented.
[0107] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. In addition, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0108] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0109] The above-described embodiments merely represent several implementation methods of the present application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the present application. It should be noted that a person skilled in the art can make a number of modifications and improvements without departing from the concept of the present application. Therefore, any simple modifications, equivalent changes, and modifications 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 shall fall within the scope of protection of the technical solution of the present application.
Claims
1. A simulation method for a PLC control device, characterized in that: The method comprises the following steps: The actual temperature at all times in each period of multiple production cycles in the industrial production process is obtained, and the model parameters of the constructed first-order inertia pure lag model are identified. All model parameters corresponding to each period are combined into a parameter vector. The ZN method is used to adjust all 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, a simulation environment for PLC control equipment is built, and based on the parameter vector and control vector of each period, the actual temperature at all times in each period is simulated to obtain the simulated temperature at each time in each period; Analyze the deviation between the actual temperature of all production cycles in each period and the predicted value when fitting the curve, and calculate the fluctuation characteristic value of each period. Based on the average level and change rate of the actual temperature of all production cycles in each period, combined with the fluctuation characteristic value, construct the characteristic vector of each period, and cluster all periods. By combining the correlation changes of actual temperature and simulated temperature between different local ranges in each time period of each production cycle, and combining the proportional coefficient of each time period and the fluctuation characteristic values of all time periods in the cluster to which it belongs, the actual lag value and simulated lag value of each time period in each production cycle are determined. Specifically, all moments in each time period of each production cycle are divided into multiple local time periods; the correlation degree of actual temperature and simulated temperature at all moments between two adjacent local time periods in each time period is calculated, and recorded as the first correlation degree and the second correlation degree respectively; all local time periods in each time period are numbered in chronological order; the first correlation degree and the second correlation degree of all local time periods in any time period are weighted and summed with the serial number corresponding to each local time period as the weight, and recorded as the first sum value and the second sum value respectively; the average value of the fluctuation characteristic values of all time periods in the cluster to which each time period in each production cycle belongs is calculated; the product of the proportional coefficient of each time period and the average value is normalized; 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; Based on the difference between the actual hysteresis value and the simulated hysteresis value, the parameter error of each time period in each production cycle is calculated, and the actual temperature, parameter vector and control vector are combined. The parameter error of each time period in each production cycle is used as a training label, and the actual temperature at all times in all time periods in all production cycles, the parameter vectors and control vectors of all time periods, and the training labels are used 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 a simulation environment. The actual temperature at all times in each time period of the current production cycle is used to obtain the parameter vector of the next time period through the neural network model in the simulation environment, and the transfer function of the first-order inertia pure lag model is updated. The updated first-order inertia pure lag model is used in combination with the control vector to adjust the proportional coefficient, integral coefficient and differential coefficient of the PID control algorithm, and the PLC control device controls the actual temperature of the next time period in the current production cycle in real time.
2. A simulation method for a PLC control device according to claim 1, characterized in that: The first-order inertia pure lag model is: ,in, is the static amplification factor; is the time constant; is the lag time, is the Laplace operator; where the model parameters 、 and , forming a parameter vector.
3. A simulation method for a PLC control device according to claim 1, characterized in that: The obtaining of the simulated temperature at each moment in each time period includes: based on the actual temperature at all moments in each time period, using the first-order inertia pure lag model corresponding to the parameter vector of each time period and the PID control algorithm corresponding to the control vector, simulating the temperature at all moments in the next time period, thereby obtaining the simulated temperature at each moment in each time period in each production cycle, wherein the simulated temperature at each moment in the first time period is the corresponding actual temperature.
4. The simulation method for a PLC control device according to claim 1, wherein: The calculation of the fluctuation characteristic value of each time period includes: Perform anomaly 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 in each time period of each production cycle after excluding the abnormal time, and calculate the mean absolute error; The fluctuation characteristic value is the mean of the mean absolute errors of all production cycles in each time period.
5. The simulation method for a PLC control device according to claim 1, wherein: The method for constructing the feature vector is: The average of the actual temperatures at all times of all production cycles in each period is recorded as the average temperature; The sum of the differences in actual temperature at all adjacent moments in each period of each production cycle is recorded as the rate of change; the sum of the average rate of change of all production cycles in each period is recorded as the average rate; The average temperature, the average rate, and the fluctuation characteristic value of each time period are combined into a characteristic vector.
6. A simulation method for a PLC control device according to claim 1, characterized in that: The parameter error is the normalized value of the difference between the actual hysteresis value and the simulated hysteresis value in each period of each production cycle.
7. 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, the steps of the simulation method of a PLC control device as described in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Intelligent PLC data analysis and optimization control system
CN119045408A
Information processing apparatus, information processing method, and program
EP2961061A1