Model predictive controller control system, method, device and equipment and storage medium
By introducing data interfaces and script mechanisms into the model prediction controller system, dynamically modifying and affecting controller parameters, the problem of insufficient flexibility and adaptability of existing controllers in complex operating conditions is solved, and more efficient control effects are achieved.
Patent Information
- Application Number
- CN202510310082.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-17
- Publication Date
- 2025-06-13
AI Technical Summary
Existing predictive controllers lack sufficient flexibility and adaptability when facing complex and dynamic operating conditions.
By introducing data interfaces, control pre-operation scripts and control post-operation scripts into the model prediction controller system, dynamically modify the parameters of the target controller, and affect the controller behavior through the script entry point, achieving flexible control under different working conditions.
It improves the flexibility, intelligence level and adaptability of the controller, and can implement different control plans according to different working conditions and control needs, reducing manual intervention.
Smart Images

Figure CN120143623A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of controllers, and particularly to a model predictive controller control system, method, device, equipment and storage medium. Background Art
[0002] Model predictive control uses an existing model, the accurate state of the system, and future control quantities to predict the future output of the system. Since the future control quantities are unknown, they need to be solved according to certain conditions to obtain a sequence of future control quantities, and after each control cycle ends, the system re-predicts the future output of the system based on the current actual state.
[0003] In related technologies, existing predictive controllers are suitable for relatively stable working conditions and are difficult to respond in a timely manner when the characteristics of the controlled object or control indicators change significantly. In the face of complex and dynamically changing working conditions, they often lack sufficient flexibility and adaptability. Summary of the Invention
[0004] In view of this, the present invention provides a model predictive controller control system, method, device, equipment and storage medium to solve the problem that existing predictive controllers lack sufficient flexibility and adaptability under special working conditions.
[0005] In a first aspect, the present invention provides a model predictive controller control system, which includes a data interface, a pre-control operation script, and a post-control operation script:
[0006] The data interface is used to provide interfaces for different parameters of the target controller, and determine the parameter list and permissions accessed by the pre-control operation script and the post-control operation script;
[0007] The pre-control operation script is used to modify the parameters of the target controller according to the real-time data and variable history of the parameter list read by the target controller before the target controller performs control calculations;
[0008] The post-control operation script is used to process the output result of the parameters of the target controller according to the calculation result of the target controller and the working condition data after the target controller performs control calculations to obtain the target output result.
[0009] In the present invention, for a petrochemical plant with variable raw materials and frequent switching of processing schemes, the parameters of the target controller are dynamically modified by using scripts; the script entry points in the two stages or multiple stages before and after the controller operation are utilized to enable scripts at different positions to affect the controller; the access control technology for the parameters of each variable is used to control the parameters; script processing mechanisms are provided respectively before and after the control operation, allowing users to perform different optimization processes at different stages, thereby improving the control effect, without relying on manual adjustment, and implementing different control schemes according to different working conditions and control requirements.
[0010] In an alternative embodiment, the system further includes: a security and permission management module, configured to manage the editing and execution permissions of the pre-control-operation script and the post-control-operation script according to user permissions, and determine whether the target parameters of the target controller exceed a preset assignment range; when the parameters of the target controller exceed the preset assignment range, it is determined that the target parameter assignment fails.
[0011] In this manner, the security and permission management module provides security protection for the target controller during script writing, debugging, and running, prevents misoperations, ensures that the script is executed in a controlled environment, prevents the execution of malicious code, and avoids the abnormal conditions in the script from affecting the operation of the controller.
[0012] In an alternative embodiment, the system further includes: an operation log module and a monitoring module:
[0013] The operation log module is configured to record the log information of the pre-control-operation script and the post-control-operation script executed each time, and add a digital watermark to the log information of each cycle;
[0014] The monitoring module is configured to display the execution status and historical records of the pre-control-operation script and the post-control-operation script currently.
[0015] In this manner, the modification of variables during the running process is recorded by the operation log module, which is convenient for engineers to view the parameter modification process later. Through the monitoring module, the changes of auxiliary variables related to the script and some custom information output by the script itself can be seen during the running process, which is convenient for engineers to intuitively view the output information on the interface.
[0016] In a second aspect, the present invention provides a model predictive controller control method, which is applied to the model predictive controller system according to any item in the first aspect. The method includes:
[0017] Read the parameters of the target controller;
[0018] Map the parameters of the target controller to the member variables of the pre-control-operation script and the post-control-operation script, and write and generate the pre-control-operation script and the post-control-operation script;
[0019] Run the pre-control operation script to modify the target parameters of the target controller to obtain the modified target parameters;
[0020] Based on the modified target parameters, use the target controller to perform calculations to obtain a control result;
[0021] Run the post-control operation script to process the control result to obtain the target output result.
[0022] In the present invention, by mapping the parameters of the target controller to the member variables of the script, writing and debugging the script, controlling the script to run, and implementing the reading and writing of the controller variables by executing the script code, thereby affecting the behavior of the controller, the control scheme optimization of different operating points is achieved, manual intervention is avoided as much as possible, and the flexibility, intelligence level and adaptive ability of the controller are improved.
[0023] In an optional implementation manner, writing and generating the pre-control operation script and the post-control operation script includes:
[0024] Read the default parameter list of the target controller;
[0025] Modify the parameters of the target controller according to the real-time data and variable history of the parameter list read by the target controller to obtain the modified parameters;
[0026] Assign the modified parameters to the target controller.
[0027] In this method, generate a script with dynamic code that maps the controller and auxiliary variables to the local variables of the script object; through the script entry points in two stages or multiple stages of the pre-control operation script and the post-control operation script, the scripts at different positions are used to affect the controller; by writing the script, it is convenient to execute the script code to implement the reading and writing of the controller variables, thereby affecting the behavior of the controller.
[0028] In an optional implementation manner, the method further includes:
[0029] Judge whether the parameters of the target controller exceed the preset assignment range;
[0030] When the parameters of the target controller exceed the preset assignment range, modify the target parameters until the target parameters are within the preset assignment range.
[0031] In this method, before the target controller outputs, check whether the output result of the target controller will exceed the limit according to the preset safety limit, and in the case of exceeding the limit, control the variable to be stuck within the preset assignment range, further ensuring the control effect of the target controller.
[0032] In a third aspect, the present invention provides a model predictive controller control device for executing the model predictive controller control method according to any one of the second aspects. The device includes:
[0033] a parameter reading module for reading the parameters of the target controller;
[0034] a script writing module for mapping the parameters of the target controller to the member variables of the pre-control operation script and the post-control operation script, and writing and generating the pre-control operation script and the post-control operation script;
[0035] a first script running module for running the pre-control operation script, modifying the target parameters of the target controller, and obtaining the modified target parameters;
[0036] a controller operation module for performing operations using the target controller based on the modified target parameters to obtain a control result;
[0037] a second script running module for running the post-control operation script, processing the control result, and obtaining a target output result.
[0038] In a fourth aspect, the present invention provides a computer device, including: a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to execute the model predictive controller control method according to the second aspect or any corresponding embodiment thereof.
[0039] In a fifth aspect, the present invention provides a computer-readable storage medium, on which computer instructions are stored, and the computer instructions are used to cause a computer to execute the model predictive controller control method according to the second aspect or any corresponding embodiment thereof.
[0040] In a sixth aspect, the present invention provides a computer program product, including computer instructions, and the computer instructions are used to cause a computer to execute the model predictive controller control method according to the second aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for use in the description of the specific embodiments or the prior art. Obviously, the following drawings are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0042] Figure 1 is a schematic structural diagram of a model predictive controller control system according to an embodiment of the present invention.
[0043] Figure 2 It is a schematic diagram of a predictive control principle according to an embodiment of the present invention.
[0044] Figure 3 It is a schematic structural diagram of a DMC according to an embodiment of the present invention.
[0045] Figure 4 It is a schematic flow diagram of a model predictive controller control method according to an embodiment of the present invention.
[0046] Figure 5 It is a schematic flow diagram of a controller configuration according to an embodiment of the present invention.
[0047] Figure 6 It is a schematic flow diagram of the execution of a controller runtime script according to an embodiment of the present invention.
[0048] Figure 7 It is a schematic interface diagram of adding an auxiliary variable according to an embodiment of the present invention.
[0049] Figure 8 It is a schematic interface diagram of a script editor according to an embodiment of the present invention.
[0050] Figure 9 It is a structural block diagram of a model predictive controller control device according to an embodiment of the present invention.
[0051] Figure 10 It is a schematic hardware structure diagram of a computer device according to an embodiment of the present invention. Specific Embodiments
[0052] To make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are some but not all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0053] In the related art, existing predictive controllers are applicable to relatively stable working conditions and are difficult to respond in a timely manner when the characteristics of the controlled object or control indicators change significantly. In the face of complex and dynamically changing working conditions, they often lack sufficient flexibility and adaptability.
[0054] To solve the above problems, an embodiment of the present invention provides a model predictive controller control system. The model predictive controller control system in this embodiment is applicable to the usage scenarios of various complex petrochemical refining devices with obvious process dynamics, variable raw material properties, variable processing schemes, and variable operation modes. By providing the model predictive controller control system of the present invention, for petrochemical devices with variable raw materials and frequent switching of processing schemes, the parameters of the target controller are dynamically modified using scripts; the script entry points in two stages or multiple stages before and after the controller operation are utilized to enable scripts at different positions to affect the controller; the access control technology for the parameters of each variable is used to control the parameters; script processing mechanisms are provided respectively before and after the control operation, allowing users to perform different optimization processes at different stages, thereby improving the control effect, without relying on manual adjustment, and implementing different control schemes according to different working conditions and control requirements.
[0055] According to an embodiment of the present invention, an embodiment of a model predictive controller control system is provided. Figure 1 It is a schematic architecture diagram of a model predictive controller control system according to an embodiment of the present invention, as Figure 1 shown. The system includes a data interface 1, a pre-control-operation script 2, and a post-control-operation script 3: The data interface 1 is used to provide interfaces for different parameters of the target controller, and determine the parameter list and permissions accessed by the pre-control-operation script 2 and the post-control-operation script 3; the pre-control-operation script 2 is used to modify the parameters of the target controller according to the real-time data of the parameter list read by the target controller and the variable history before the target controller executes control calculation; the post-control-operation script 3 is used to process the output result of the parameters of the target controller according to the calculation result of the target controller and the working condition data after the target controller executes control calculation to obtain the target output result.
[0056] In an optional implementation manner, the system further includes: a security and permission management module, which is used to manage the editing and execution permissions of the pre-control-operation script and the post-control-operation script according to the user permissions, and determine whether the target parameters of the target controller exceed the preset assignment range; when the parameters of the target controller exceed the preset assignment range, it is determined that the target parameter assignment fails.
[0057] In this manner, the security and permission management module provides security protection for the target controller during script writing, debugging, and running, prevents misoperations, ensures that the script is executed in a controlled environment, prevents the execution of malicious code, and avoids the influence of exceptions in the script on the controller operation.
[0058] In an alternative embodiment, the system further includes: an operation log module and a monitoring module. The operation log module is used to record the log information of the script before each control operation and the script after the control operation, and add a digital watermark to the log information for each cycle. The monitoring module is used to display the execution status and historical records of the script before the current control operation and the script after the control operation.
[0059] In this manner, the modification of variables during the operation process by the operation log module will be recorded, which is convenient for engineers to view the process of parameter modification in the later stage. Through the monitoring module, the changes of auxiliary variables related to the script and some custom information output by the script itself can be seen during the operation, which is convenient for engineers to intuitively view the output information on the interface.
[0060] In an example, the script writing and debugging of the programmable script for the model predictive controller variable parameters include: a script editor: which has a built-in code editor that supports syntax highlighting, auto-completion, and error prompts. Debugging support: monitoring the script operation and implementing variable monitoring through the operation log. Syntax check: checking the syntax before saving, and if there are errors, giving the location and error message prompts, and the incorrect script is not allowed to be saved.
[0061] The script environment setting of the programmable script for the model predictive controller variable parameters includes: script management: providing a separate interface in the controller configuration software to manage the script before the control operation and the script after the control operation, including editing, syntax check, saving, and loading functions. In addition to the controller variables (CV, MV, DV, and global settings, etc.), auxiliary variables (referred to as "data items" in the software) are added as needed to introduce information outside the controller for requirements such as operating condition judgment and result output. Code dynamic generation: through dynamic code generation, mapping the attributes and operation functions of the controller's global and local variables to the local attributes and functions directly accessible by the script object. Among them, MPC (Model Predictive Control); MV (Manipulated Variable, the variable that can be adjusted within this unit and has a significant impact on other parameters, such as the bottom heating steam flow rate of the distillation column and the top reflux flow rate); CV (Controlled Variable, the main controlled index, such as the top temperature of the distillation column); DV (Disturbance Variable, the parameter that has an impact on this unit but cannot be adjusted within the scope of this unit, such as the feed flow rate, temperature, and composition from upstream of a distillation column).
[0062] The data interface 1 includes: - Data input / output interface: For the global settings of the controller, a programming interface is set for each CV, MV, and DV. Read / write permissions are provided for upper and lower limits, weights, rate limits, optimization options, historical data, etc., and a read-only interface is provided for currently read values, calculation results, etc., to ensure that the script can conveniently access and modify the parameters and real-time data of the controller. - Process calculation function library: Provides common process calculation functions, which are used as a script library for users to call, and dynamically loads assemblies that conform to the interface in the form of plugins. Among them, the calculation function library can insert code directly at the appropriate position after being written. For example, to calculate statistical metrics of certain parameters, since the above statistical metrics are often used, the corresponding code is pre-written and placed in the custom function area, and can be directly referenced when needed later.
[0063] Exemplarily, for the auxiliary variables that read values from the DCS, a read-only access interface to the current data and history is opened; for local auxiliary variables, it is allowed to generate the current value through calculation. For example, a total flow can be obtained by adding several flows.
[0064] The execution of the pre-control-operation script 2 includes: Before performing the control calculation, run the pre-control-operation script 2 to modify the parameters of the controller and variables to implement a customized control scheme. Exemplarily, run the pre-control-operation script 2 to read the real-time air temperature and adjust the temperature control range of a distillation column in real time according to the air temperature. Since the upper and lower limits of the MPC controller are adjusted manually, and the lag in manual adjustment of the upper and lower limits of the MPC controller is very large, there is a problem of inability to respond in a timely manner.
[0065] The execution of the post-control-operation script 3 includes: After the control calculation, run the post-control-operation script 3 to process the MV output and the predicted value of the CV, and record the operation log.
[0066] The security and permission management module includes: - Sandboxed execution: Ensure that the script is executed in a controlled environment to prevent the execution of malicious code and avoid the abnormal conditions in the script from affecting the operation of the controller. - Permission control: Manage the editing and execution permissions of the script according to the user permissions. A preset range of values that can be assigned is set for each parameter. If the range is exceeded, the assignment fails and the reason is recorded in the log.
[0067] The operation log and monitoring module includes: - Log recording: Record the detailed log of each script execution, including input data, modified parameters, and output results. Add a digital watermark to the log information of each cycle. - Monitoring interface: Provide a real-time monitoring interface to display the current execution status and historical records of the script. During the operation process, the modification of variables will be recorded for the convenience of engineers to view the process of parameter modification later. At the same time, the changes of auxiliary variables related to the script can also be seen during the operation, and the script itself can also output some custom information, which can be seen on the interface.
[0068] In an implementation scenario, predictive control is a class of model-based optimal control algorithms directly proposed from industrial process applications. Its emergence is firstly due to the urgent needs of industrial practice and also inspired by in-depth observation and research on production processes and their characteristics. Its appearance has solved difficult problems such as strong coupling and large time delays in process control, adding new vitality to process control. Predictive control can generally be described by the following three basic characteristics:
[0069] ① Prediction model: Use a model to predict the motion law of the controlled object and the error of the controlled parameter at future moments, and use it as the basis for determining the current control action, so that the control strategy adapts to the memory, causality and lag of the controlled object, and the expected control effect can be obtained.
[0070] ② Feedback correction: Use measurable information to correct the predicted value of the controlled parameter at each sampling moment, and suppress the errors caused by model mismatch and interference. Use the corrected predicted value as the basis for calculating the optimal control, so that the robustness of the control system is significantly improved.
[0071] ③ Receding horizon optimization: Predictive control is an optimal control strategy, whose control goal is to minimize a certain performance index, and uses the prediction deviation to calculate the control action sequence, but only the first control action sequence is actually executed. At the next sampling moment, the control action sequence needs to be recalculated according to the prediction deviation at that time. The calculation of this control action sequence is not like optimal control that calculates the optimal result at one time, but is continuously carried out cyclically according to the sampling time, so it is called receding horizon optimization.
[0072] The above three basic characteristics of predictive control are the specific manifestations of the concepts of model, feedback control and optimization in cybernetics. It inherits the optimal idea, improves the robustness, can handle multiple objectives and various constraints, and thus meets the actual requirements of industrial processes, so it has developed rapidly in theory and application. So far, representative algorithms of predictive control include MAC based on convolution model, DMC algorithm based on step response model, generalized predictive control algorithm GPC based on difference equation model, SFPC algorithm based on state space model, UPC based on system matrix model and so on.
[0073] Figure 2 It is a schematic diagram of the principle of predictive control according to an embodiment of the present invention, as Figure 2 shown, in the figure y S represents the set value, and y R (k) represents the expected value curve of the output. k = 0 is the current moment, and the curve on the left of the 0 moment represents the past output and control. According to the known object model, the output y M(k) (k = 1, 2, … P). The predictive control algorithm is to calculate the control quantities u(k) (k = 0, 1, … L - 1) at the current and the next L moments according to their difference e(k) from the desired output y R (k), and to minimize e(k). Here, P is called the prediction horizon, and L is called the control horizon.
[0074] The dynamic matrix control (DMC) based on the step response can include: The dynamic matrix control is a predictive control algorithm based on the step response model of the object. Figure 3 It is a schematic structural diagram of a DMC according to an embodiment of the present invention. The DMC structure is as Figure 3 shown.
[0075] Given the unit step response curve, the amplitudes a k at the sampling moments k = 1, 2, … can be measured. The output at the k-th moment is caused by all the input increments before the k-th moment, that is:
[0076]
[0077]
[0078] where Δu(k - i) = u(k - i) - u(k - i - 1) is the control increment at the (k - i)-th moment. The prediction model in DMC adopts the above step response expression. However, to distinguish it from the true expression of the object, the output of the prediction model is often denoted as:
[0079]
[0080] In the formula is the coefficient used for prediction calculation, y M (k) is the model output, that is, the output prediction value. If a unit pulse with a width of 1 is applied to the input end of the object, according to the superposition principle, it is not difficult to see that the amplitude of the impulse response curve at the sampling moment should be h 1 = a 1 , h 2 = a 2 - a 1 , …, h i = a i - a i-1 , …, and there is By writing the control increment as the control quantity in formula (1), we can obtain:
[0081]
[0082] For a stable object with self-balancing ability, after a certain moment N, it can be approximately considered that the step response amplitude no longer changes, that is, a N = aN+1 = …, so there is h N+1 = h N+2 = … = 0. At this time, the unit step response of the object can be denoted as:
[0083]
[0084] So the unit step response calculated by the model can be denoted as:
[0085]
[0086] Here, N is called the model length. In the case where the object has pure time delay, and The first few terms of are 0.
[0087] Using Equation (5) and we can obtain:
[0088]
[0089] Output prediction: Let the current time be k and the prediction step be L. If the control increment sequence at the current and future times is Δu(k), Δu(k + 1), Δu(k + 2), …, Δu(k + L - 1), then after time L, there is Δu(k + L) = Δu(k + L + 1) = … = 0. So the predicted output value at future times should be:
[0090]
[0091]
[0092] Denote the predicted output vector y M from time k + 1 to k + P and the control increment vector Δu from time k to k + L - 1 as
[0093] y M = [y M (k + 1), y M (k + 2), …, y M (k + P)] T (9)
[0094] Δu = [Δu(k), Δu(k + 1), …, Δu(k + L - 1)] T (10)
[0095] Then the predicted output value can be denoted as:
[0096] y M = AΔu + s (11)
[0097] where A is a P×L dimensional matrix
[0098]
[0099] A is composed of object dynamic response coefficients and is called the dynamic matrix. Obviously, AΔu represents the influence of the current and future control on the output, while s represents the output generated by the past control.
[0100] Feedback correction: The above model prediction does not consider the effects of model errors and disturbances. Therefore, although appropriate control can make the predicted output y M (k + j) of the model approach the expected output value y R (k + j) at time k + j, it cannot guarantee that the actual future output y(k + j) of the system approaches y R (k + j). To better estimate the error and calculate a more accurate control quantity, the output prediction should be corrected. However, since the model error and the noise and disturbances at future times are generally not easy to measure, usually the deviation of the previous moment's prediction value is used for approximate correction. According to this method, the correction value of the output prediction is
[0101]
[0102] In the above formula, to calculate y C (k + j), y(k + j - 1) - y M (k + j - 1) is required, but at time k, y(k + j - 1) is an unknown quantity. To enable the calculation to proceed, the corrected predicted value y C (k + j - 1) is used to replace the measured value y(k + j - 1). After such a substitution, the general expression for the corrected output prediction value can be obtained as:
[0103] y C (k + j) = y M (k + j) + [y(k) - y M (k)], j = 1, 2, …, P (13)
[0104] And the deviation of the output prediction is:
[0105] e(k + j) = y R (k + j) - y C (k + j), j = 1, 2, …, P (14)
[0106] Rolling optimization: Rolling optimization is an optimal control strategy of predictive control. It takes the reference trajectory as the optimization goal, minimizes a certain performance index within a certain future time through the optimal control algorithm, calculates the control action sequence using the prediction deviation, but only the current control action is actually executed. It is repeated at the next moment.
[0107] Reference trajectory: When there is a step change in the setpoint, if it is required that the output quickly tracks this change, it is often necessary to apply a control quantity with a large amplitude. This is often very difficult to achieve in engineering. Even if it can be achieved, it often leads to unstable output changes. Therefore, in predictive control, a reference trajectory is generally set to gradually transition the output from the current value to the setpoint. Let the setpoint be y S , which can be a constant or a certain time function. The commonly used reference trajectory is in the form of a first-order exponential, that is:
[0108] y R (k) = y(k) (15)
[0109] y R (k + j) = αy(k + j - 1) + (1 - α)y S = α j y(k) + (1 - α j )y S , j = 1, 2, …, P (16)
[0110] The reference trajectory represented by the above formula is equivalent to the step response curve of a first-order inertia link, where α = exp(-T / T f ), called the softening coefficient, and T is the sampling period.
[0111] Performance index: The task of the control algorithm is to calculate the implementable control quantity based on the deviation between the predicted output value y C (k + j) and the expected output value y R (k + j), so that the output of the object can approach the desired reference trajectory as much as possible. For this purpose, an index characterizing this characteristic needs to be given. The commonly used form is:
[0112]
[0113] In the above formula, q i is the weighting coefficient of the error term, and r i is the weighting coefficient of the control term.
[0114] The model predictive controller control system provided in this embodiment, for petrochemical plants with variable raw materials and frequent switching of processing schemes, realizes dynamic modification of the parameters of the target controller by using scripts; uses the script entry points in the two stages or multiple stages before and after the controller operation to realize the influence of the script at different positions on the controller; uses the access right control technology of the parameters of each variable to realize the control of the parameters; provides script processing mechanisms before and after the control operation respectively, allowing users to perform different optimization processes at different stages, thereby improving the control effect, not relying on manual adjustment, and realizing different control schemes according to different working conditions and control requirements.
[0115] According to an embodiment of the present invention, an embodiment of a model predictive controller control method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. And although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.
[0116] In this embodiment, a model predictive controller control method is provided, which can be used in the above-mentioned model predictive controller control system. Figure 4 It is a flowchart of the model predictive controller control method according to an embodiment of the present invention, as Figure 4 shown, the process includes the following steps:
[0117] Step S401, read the parameters of the target controller.
[0118] Step S402, map the parameters of the target controller to the member variables of the pre-control-operation script and the post-control-operation script, and write and generate the pre-control-operation script and the post-control-operation script.
[0119] In an alternative embodiment, writing and generating the pre-control-operation script and the post-control-operation script includes:
[0120] Step a1, read the default parameter list of the target controller.
[0121] Step a2, modify the parameters of the target controller according to the real-time data and variable history of the parameter list read by the target controller to obtain the modified parameters.
[0122] Step a3, assign the modified parameters to the target controller.
[0123] In this method, dynamic code generation scripts are generated by mapping the controller and auxiliary variables to local variables of the script object; different positions of the script affect the controller through the script entry points of the pre-control-operation script and the post-control-operation script in two stages or multiple stages; by writing scripts, it is convenient to execute the script code to read and write the controller variables, thereby affecting the behavior of the controller.
[0124] Step S403, run the pre-control-operation script to modify the target parameters of the target controller to obtain the modified target parameters.
[0125] Step S404, based on the modified target parameters, use the target controller to perform calculations to obtain a control result.
[0126] Step S405, run the post-control-operation script to process the control result to obtain the target output result.
[0127] In an alternative embodiment, the method further includes:
[0128] Step b1: Determine whether the parameters of the target controller exceed a preset assignment range.
[0129] Step b2: When the parameters of the target controller exceed the preset assignment range, modify the target parameters until the target parameters are within the preset assignment range.
[0130] In this manner, by checking whether the output result of the target controller will exceed the limit according to the preset safety limit before the target controller outputs, and controlling the variable card within the preset assignment range in the case of overlimit, the control effect of the target controller is further ensured.
[0131] In an example, the script environment setting of the programmable script for the variable parameters of the model predictive controller includes: the script environment setting generates a "class" in the C# language. In the class, the variables of the controller are turned into the attributes of the class, and each attribute has many parameters that can be adjusted. To expand the function, only having the variables of the controller (CV, MV, DV, and global settings, etc.) is not enough, and auxiliary variables need to be introduced. For example, to determine whether the device temperature is going to rise, the ambient (atmospheric) temperature can be introduced to see if the air temperature changes to assist in determining whether the device temperature is going to rise. The input of the script environment setting is the controller configuration, and the output is the code framework. Among them, in the code framework, the variables of the controller (CV, MV, DV, and global settings, etc.) are mapped to the member variables of the script class, and each member variable has several parameters that can be accessed, such as the switch, upper and lower limits, and optimization coefficient of CV.
[0132] After mapping the variables of the controller to the member variables of the script class using the data interface, set the parameter list and permissions accessible by the script: for example, the upper and lower limits of CV are allowed to be read-only and cannot be directly modified, that is, the upper and lower limits of CV have the get permission; for example, the weight of the variable is readable and writable, but the write is protected, that is, the permission of the variable weight is get set, and the set performs corresponding security processing. Similarly, the auxiliary variables also have corresponding access parameter lists and permissions.
[0133] The input for the script writing and debugging of the programmable script for the variable parameters of the model predictive controller is the above-generated code framework. In the code framework, in addition to the CV, MV, and DV of the controller being mapped to the member variables of the script class, some auxiliary variables that need to be read and written or locally stored are introduced for the convenience of script use. Taking the air temperature as an example, the air temperature is not a controlled variable or an interference variable in the controller. Using the air temperature as the basis for modifying the upper and lower limits, that is, the auxiliary variables outside the controller variables are used as a member of the class for easy access and use.
[0134] The script execution process means that after the controller is loaded by the online control program, the script class is compiled into an assembly and then loaded into this program. The script has an interface to access the controller variables and can read and write the controller variables by executing the script code, thereby affecting the behavior of the controller.
[0135] Among them, security and permission management are carried out throughout the script writing, debugging, and running processes to protect security and prevent misoperations. Any modifications to variables during the running process will be recorded for later engineers to view the process of parameter modification. At the same time, the changes in auxiliary variables related to the script can also be seen during the running process, and the script itself can output some custom information, which can be viewed on the interface.
[0136] In an implementation scenario, taking the example of adjusting the upper and lower limits of the CV according to the temperature, the script configuration is completed through the controller configuration and the simulation software (C&S), and is divided into two steps: script writing and script debugging. Figure 5 It is a schematic flowchart of a controller configuration according to an embodiment of the present invention, as Figure 5 shown. The overall process of the controller configuration including the script configuration includes: importing the model; introducing the conventional variable configuration; optionally, adding custom functions and / or adding auxiliary variable parameters; using the conventional variable configuration to write the controller script; debugging the controller script; and saving the configuration corresponding to the script to achieve the adjustment of the upper and lower limits of the CV.
[0137] Figure 6 It is a schematic flowchart of the execution of a script during the operation of a controller according to an embodiment of the present invention, as Figure 6 shown. The execution process of the script during the operation of the controller includes:
[0138] (1) Reading DCS data (DCS is a basic control system, distributed control system, and DCS data can be accessed through the OPC interface).
[0139] (2) Running the pre-control script: In this process, data processing, fault diagnosis, controller parameters, etc. are performed on the input data, and the operation of the controller is affected by modifying the parameters.
[0140] (3) Executing the MPC (Model Predictive Control) control operation: In this process, the controller operation based on MPC is executed. Exemplarily, the operation generally assigns values to parameters to achieve the intervention of the control operation. For example, in this solution, the upper and lower limits of a CV in the controller variables are modified.
[0141] (4) Post-run control script: This process can override the control results of the MPC, etc. Specifically, overriding means replacing the existing control effect. For example, sometimes on-site, according to the instructions given by the operator, a compensation amount needs to be added to the existing MV calculation result, that is, modifying the calculation output of the controller.
[0142] (5) Write the result to the DCS: Perform operations such as amplitude limiting on the final result and output it to the DCS. Exemplarily, the data read is from on-site sensors, such as data on flow rate, temperature, pressure, liquid level, valve position, etc., and the output is the set value of the PID controller or the valve position. Before output, according to the pre-set safety limits, check whether the output result will exceed the limit. In the case where the output result exceeds the limit, adjust the output result to be stuck at the pre-set safety limit value.
[0143] Among them, Figure 7 is a schematic diagram of the interface for adding auxiliary variables according to an embodiment of the present invention, as Figure 7 shown. The added auxiliary variables include: two local variables and one read variable are added. The local variables store the default upper and lower limits, and the read variable reads the air temperature every cycle. Figure 8 is a schematic diagram of the interface of a script editor according to an embodiment of the present invention, as Figure 8 shown. The script editing includes: first, reading the default upper and lower limits, then modifying these two numbers according to the air temperature, and finally assigning these two numbers as the new upper and lower limits to CV1 as the actual control upper and lower limits.
[0144] The model predictive controller control method provided in this embodiment maps the parameters of the target controller to the member variables of the script, writes and debugs the script, controls the script to run, reads and writes the controller variables by executing the script code, thereby affecting the behavior of the controller, realizing the optimization of the control scheme at different operating points, avoiding excessive manual intervention, and improving the flexibility, intelligence level and adaptive ability of the controller.
[0145] In this embodiment, a model predictive controller control device is also provided. This device is used to implement the above embodiments and preferred implementation manners, and those that have been described will not be repeated. As used hereinafter, the term "module" can be a combination of software and / or hardware that realizes a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0146] This embodiment provides a model predictive controller control device, as Figure 9 shown, including:
[0147] A parameter reading step 901, which is used to read the parameters of the target controller. For details, please refer to Figure 4Step S401 of the illustrated embodiment will not be elaborated herein.
[0148] Script writing step 902 is used to map the parameters of the target controller to the member variables of the pre-control operation script and the post-control operation script, and write and generate the pre-control operation script and the post-control operation script. For details, please refer to Figure 4 Step S402 of the illustrated embodiment will not be elaborated herein.
[0149] First script running step 903 is used to run the pre-control operation script, modify the target parameters of the target controller, and obtain the modified target parameters. For details, please refer to Figure 4 Step S403 of the illustrated embodiment will not be elaborated herein.
[0150] Controller operation step 904 is used to perform an operation using the target controller based on the modified target parameters to obtain a control result. For details, please refer to Figure 4 Step S404 of the illustrated embodiment will not be elaborated herein.
[0151] Second script running module is used to run the post-control operation script, process the control result, and obtain the target output result 705. For details, please refer to Figure 4 Step S405 of the illustrated embodiment will not be elaborated herein.
[0152] In some alternative embodiments, script writing step 902 includes:
[0153] Parameter list reading unit is used to read the default parameter list of the target controller.
[0154] First parameter modification unit is used to modify the parameters of the target controller according to the real-time data and variable history of the parameter list read by the target controller, and obtain the modified parameters.
[0155] Parameter assignment unit is used to assign the modified parameters to the target controller.
[0156] In some alternative embodiments, the model predictive controller control device includes:
[0157] Assignment range judgment unit is used to judge whether the parameters of the target controller exceed the preset assignment range.
[0158] Second parameter modification unit is used to modify the target parameters when the parameters of the target controller exceed the preset assignment range until the target parameters are within the preset assignment range.
[0159] The further function descriptions of the above-mentioned various modules and units are the same as those of the corresponding embodiments above, and will not be elaborated herein.
[0160] The model predictive controller control device in this embodiment is presented in the form of a functional unit. Here, the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and a memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0161] An embodiment of the present invention further provides a computer device having the above Figure 9 model predictive controller control device shown.
[0162] Please refer to Figure 10 , Figure 10 which is a schematic structural diagram of a computer device provided by an alternative embodiment of the present invention. As shown in Figure 10 , the computer device includes: one or more processors 10, a memory 20, and an interface for connecting each component, including a high-speed interface and a low-speed interface. Each component communicates with each other using different buses and can be installed on a common motherboard or installed in other ways as needed. The processor can process instructions executed within the computer device, including instructions stored in the memory or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some alternative embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (such as a server array, a set of blade servers, or a multi-processor system). Figure 10 In
[0163] , a single processor 10 is taken as an example.
[0164] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0165] The memory 20 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created according to the use of the computer device and the like. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some alternative embodiments, the memory 20 may optionally include a memory remotely provided with respect to the processor 10, and these remote memories may be connected to the computer device through a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0166] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk, or a solid-state drive; the memory 20 may further include a combination of the above types of memories.
[0167] The computer device further includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30, and the output device 40 may be connected through a bus or other means. Figure 10 Taking connection through a bus as an example.
[0168] The input device 30 may receive input digital or character information, and generate key signal inputs related to the user settings and function controls of the computer device, such as a touch screen, a keypad, a mouse, a trackpad, a touchpad, a pointing stick, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED), and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes, but is not limited to, a liquid crystal display, a light-emitting diode, a display, and a plasma display. In some alternative embodiments, the display device may be a touch screen.
[0169] Embodiments of the present invention also provide a computer-readable storage medium. The method according to the embodiments of the present invention can be implemented in hardware, firmware, or be implemented as computer code that can be recorded on a storage medium, or be implemented as computer code that is originally stored in a remote storage medium or a non-transitory machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code, and when the software or computer code is accessed and executed by the computer, the processor, or the hardware, the method shown in the above embodiments is implemented.
[0170] A part of the present invention can be applied as a computer program product, for example, computer program instructions, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should be able to understand that the forms of existence of computer program instructions in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Herein, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible by the computer.
[0171] Although the embodiments of the present invention are described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A model predictive controller control system, characterized in that: The system includes a data interface, a pre-control operation script, and a post-control operation script: The data interface is used to provide an interface for different parameters of the target controller and determine the parameter list and permissions accessed by the pre-control operation script and the post-control operation script; The pre-control operation script is used to modify the parameters of the target controller according to the real-time data and variable history of the parameter list read by the target controller before the target controller performs the control calculation; The post-control operation script is used to process the output results of the parameters of the target controller according to the calculation results and working condition data of the target controller after the target controller performs the control calculation, so as to obtain the target output result.
2. The system according to claim 1, characterized in that The system also includes: a security and authority management module, which is used to manage the editing and execution permissions of the pre-control operation script and the post-control operation script according to user permissions, and to determine whether the target parameter of the target controller exceeds a preset assignment range; when the parameter of the target controller exceeds the preset assignment range, it is determined that the target parameter assignment has failed.
3. The system according to claim 1, characterized in that The system also includes: an operation log module and a monitoring module: The operation log module is used to record the log information of each execution of the script before the control operation and the script after the control operation, and add a digital watermark to the log information of each cycle; The monitoring module is used to display the execution status and historical records of the current pre-control operation script and the post-control operation script.
4. A model predictive controller control method, characterized in that: Applied to the model predictive controller system according to any one of claims 1 to 3, the method comprises: Read the parameters of the target controller; Mapping the parameters of the target controller to member variables of a pre-control operation script and a post-control operation script, and writing and generating the pre-control operation script and the post-control operation script; Running the pre-control operation script to modify the target parameters of the target controller to obtain modified target parameters; Based on the modified target parameters, using the target controller to perform calculations to obtain a control result; The control operation script is run to process the control result to obtain the target output result.
5. The method according to claim 4, characterized in that The step of writing and generating the pre-control operation script and the post-control operation script includes: Reading the default parameter list of the target controller; Modifying the parameters of the target controller according to the real-time data and variable history of the parameter list read by the target controller to obtain modified parameters; The modified parameters are assigned to the target controller.
6. The method according to claim 4, characterized in that The method further comprises: Determining whether the parameter of the target controller exceeds a preset value range; When the parameter of the target controller exceeds a preset value range, the target parameter is modified until the target parameter is within the preset value range.
7. A model predictive controller control device, characterized in that: For executing the model predictive controller control method according to any one of claims 4 to 6, the device comprises: Parameter reading module, used to read the parameters of the target controller; A script writing module, used for mapping the parameters of the target controller into member variables of a pre-control operation script and a post-control operation script, and writing and generating the pre-control operation script and the post-control operation script; A first script running module is used to run the pre-control operation script to modify the target parameters of the target controller to obtain modified target parameters; A controller operation module, used to perform operation using the target controller based on the modified target parameters to obtain a control result; The second script running module is used to run the post-control operation script, process the control result, and obtain the target output result.
8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the model predictive controller control method according to any one of claims 4 to 6 by executing the computer instructions.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the model predictive controller control method according to any one of claims 4 to 6.
10. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the model predictive controller control method according to any one of claims 4 to 6.