Method and device for adding disturbance to model during model linearization
In the process of model linearization, the dynamic adaptive perturbation method is used to dynamically scale the disturbance value based on the configuration of the disturbance rate and the working point, thereby solving the problems of linearization accuracy and adaptability of the nonlinear model, improving the accuracy and stability of DC motor control, and reducing the response time and overshoot.
Patent Information
- Application Number
- CN202510762550.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-09
- Publication Date
- 2025-09-12
AI Technical Summary
In the modeling and control of complex systems, the linearization processing of nonlinear models has differences in linearization effect and accuracy due to different disturbance addition methods, which affects the control effect. Especially in DC motor speed control, traditional methods have poor adaptability to the dimensional and amplitude differences of different operating points.
Through dynamically adaptive disturbance value size, based on the dual configuration of disturbance rate and operating point, the disturbance value is dynamically scaled to match the actual working conditions, model linearization is achieved, and a linearized motor control model is constructed, including obtaining the disturbance rate and linearized operating point, judging whether the conditions are met within the simulation step, calculating the disturbance value and performing differential operations, and constructing a linearized model.
The control accuracy and robustness of the motor control model are improved, the response time and overshoot of the system to reach steady state are reduced, the time for obtaining the linearization model is saved, and the adaptability to different operating points is improved.
Smart Images

Figure CN120630684A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of industrial control technology, and in particular to a method and device for adding disturbance to a model during model linearization. Background Art
[0002] In the modeling and control of complex systems, nonlinear or complex models often present difficulties in analysis and control. For example, in DC motor speed control, the nonlinear coupling between speed and armature current complicates parameter adjustment for linear controllers (such as PID and LQR). The solution to this problem is to linearize the controlled system near a specific operating point.
[0003] There are many methods for linearization, including the perturbation method. However, depending on how the perturbation is added, the linearization effect and the accuracy of the linear model can vary, affecting control effectiveness. Traditional perturbation methods rely on analytical derivatives or fixed increments, and are less adaptable to differences in dimension and amplitude at different operating points. Summary of the Invention
[0004] This application provides a method and apparatus for adding disturbances to a model during model linearization, which allows the disturbance value to be dynamically adaptive, thereby improving control accuracy and robustness. The technical solution is as follows.
[0005] In a first aspect, a method for adding disturbance to a model during model linearization is provided, the method comprising:
[0006] Obtaining a user-configured disturbance rate and a linearization operating point, wherein the disturbance rate represents the ratio between the disturbance value and the value of the disturbed parameter of the controlled object, and the linearization operating point is used to indicate the simulation time for performing linearization calculation on the nonlinear motor control model;
[0007] In each simulation step, determining whether the current moment satisfies the conditions of the linearization operating point;
[0008] If the condition of the linearization operating point is met at the current moment, determining a disturbance value corresponding to each parameter to be linearized of the controlled object in the nonlinear motor control model based on a current value of each parameter to be linearized and the disturbance rate;
[0009] Add the corresponding disturbance value to each parameter to be linearized;
[0010] Performing a differential operation on each parameter after the disturbance value is added and each parameter before the disturbance value is added to obtain a linearized motor control model;
[0011] A linearized controller is instructed to control the motor using the linearized motor control model.
[0012] In some embodiments, each parameter to be linearized includes an input parameter, an output parameter, and a state parameter, and performing a differential operation on each parameter after adding a disturbance value and each parameter before adding the disturbance to obtain a linearized motor control model includes:
[0013] Obtaining an input sensitivity matrix based on a difference between an input parameter after adding the disturbance value and an input parameter before adding the disturbance value and a difference between a state parameter after adding the disturbance value and a state parameter before adding the disturbance value;
[0014] Obtaining a first output sensitivity matrix based on a difference between an output parameter after adding the disturbance value and an output parameter before adding the disturbance value and a difference between a state parameter after adding the disturbance value and a state parameter before adding the disturbance value;
[0015] Obtaining a second output sensitivity matrix based on a difference between the output parameter after adding the disturbance value and the output parameter before adding the disturbance value and a difference between the input parameter after adding the disturbance value and the input parameter before adding the disturbance value;
[0016] Obtaining a state sensitivity matrix based on a difference between the state parameters after the disturbance value is added and the state parameters before the disturbance value is added;
[0017] The linearized motor control model is constructed based on the input sensitivity matrix, the first output sensitivity matrix, the second output sensitivity matrix, and the state sensitivity matrix.
[0018] In some implementations, determining whether the current moment satisfies the linearization operating point condition includes:
[0019] If the current value of the parameter to be linearized at the current moment reaches the target value in the linearization working point, determining that the condition of the linearization working point is met at the current moment;
[0020] If the current moment reaches the target moment in the linearization working point, it is determined that the current moment meets the condition of the linearization working point.
[0021] In some embodiments, determining the disturbance value corresponding to each parameter to be linearized of the controlled object in the nonlinear motor control model based on the current value of each parameter to be linearized and the disturbance rate includes:
[0022] A disturbance value corresponding to each parameter to be linearized is determined based on a current value of each parameter to be linearized of the controlled object in the nonlinear motor control model, a reference magnitude of each parameter to be linearized, and the disturbance rate, wherein the reference magnitude is determined based on a nominal maximum value of the corresponding parameter.
[0023] In some embodiments, the perturbation value is related to the absolute value of the parameter in an exponentially increasing manner.
[0024] In some embodiments, determining the disturbance value corresponding to each parameter to be linearized of the controlled object in the nonlinear motor control model based on the current value of each parameter to be linearized and the disturbance rate includes:
[0025] Based on the following formula, determine the disturbance value corresponding to each parameter to be linearized;
[0026]
[0027] Where r represents the perturbation rate configured by the user, x represents the parameter to be linearized, ΔX represents the perturbation value corresponding to the parameter to be linearized, and EPS is a positive value.
[0028] In some embodiments, the method further comprises:
[0029] Identify the linearization work area from the canvas based on the input and output markers added by the user;
[0030] The nonlinearized motor control model is extracted from the linearized operating region.
[0031] In a second aspect, a device for adding disturbance to a model during model linearization is provided, the device comprising:
[0032] an acquisition unit, configured to acquire a disturbance rate and a linearization operating point configured by a user, wherein the disturbance rate represents a ratio between a disturbance value and a value of a disturbed parameter of the controlled object, and the linearization operating point indicates a simulation time for performing a linearization calculation on a nonlinear motor control model;
[0033] The processing unit is configured to determine, within each simulation step, whether a condition of the linearization operating point is satisfied at a current moment; if the condition of the linearization operating point is satisfied at the current moment, determine a disturbance value corresponding to each parameter to be linearized based on a current value of each parameter to be linearized of the controlled object in the nonlinear motor control model and the disturbance rate; add a corresponding disturbance value to each parameter to be linearized; and perform a differential operation on each parameter after the disturbance value is added and each parameter before the disturbance is added to obtain a linearized motor control model;
[0034] The control unit is configured to instruct the linearization controller to control the motor using the linearized motor control model.
[0035] In some embodiments, each parameter to be linearized includes an input parameter, an output parameter, and a state parameter, and the processing unit is used to obtain an input sensitivity matrix based on the difference between the input parameter after adding the disturbance value and the input parameter before adding the disturbance value, and the difference between the state parameter after adding the disturbance value and the state parameter before adding the disturbance value; obtain a first output sensitivity matrix based on the difference between the output parameter after adding the disturbance value and the output parameter before adding the disturbance value, and the difference between the state parameter after adding the disturbance value and the state parameter before adding the disturbance value; obtain a second output sensitivity matrix based on the difference between the output parameter after adding the disturbance value and the output parameter before adding the disturbance value, and the difference between the input parameter after adding the disturbance value and the input parameter before adding the disturbance value; obtain a state sensitivity matrix based on the difference between the state parameter after adding the disturbance value and the state parameter before adding the disturbance value; and construct the linearized motor control model based on the input sensitivity matrix, the first output sensitivity matrix, the second output sensitivity matrix, and the state sensitivity matrix.
[0036] In some embodiments, the processing unit is configured to determine that the current moment satisfies a condition of the linearization operating point if the current value of the parameter to be linearized at the current moment reaches a target value in the linearization operating point; and to determine that the current moment satisfies the condition of the linearization operating point if the current moment reaches the target moment in the linearization operating point.
[0037] In some embodiments, the processing unit is configured to determine a disturbance value corresponding to each parameter to be linearized based on a current value of each parameter to be linearized of the controlled object in the nonlinear motor control model, a reference magnitude of each parameter to be linearized, and the disturbance rate, wherein the reference magnitude is determined based on a nominal maximum value of the corresponding parameter.
[0038] In some embodiments, the perturbation value is related to the absolute value of the parameter in an exponentially increasing manner.
[0039] In some embodiments, the processing unit is configured to determine a disturbance value corresponding to each parameter to be linearized based on the following formula:
[0040]
[0041] Where r represents the perturbation rate configured by the user, x represents the parameter to be linearized, ΔX represents the perturbation value corresponding to the parameter to be linearized, and EPS is a positive value.
[0042] In some embodiments, the processing unit is further configured to identify a linearized working area from the canvas based on input tags and output tags added by a user; and extract the nonlinear motor control model from the linearized working area.
[0043] In a third aspect, a server is provided, comprising a processor coupled to a memory, wherein the memory stores at least one computer program instruction, the at least one computer program instruction being loaded and executed by the processor to cause the server to implement the method provided in the first aspect or any optional embodiment of the first aspect. Specific details of the server provided in the third aspect can be found in the first aspect or any optional embodiment of the first aspect, and are not further described here.
[0044] In a fourth aspect, a computer-readable storage medium is provided, which stores at least one instruction. When the instruction is executed on a computer, the computer executes the method provided by the first aspect or any optional method of the first aspect.
[0045] In a fifth aspect, a computer program product is provided, which includes one or more computer program instructions. When the computer program instructions are loaded and run by a computer, the computer executes the method provided by the first aspect or any optional method of the first aspect.
[0046] In a sixth aspect, a chip is provided, comprising an interface circuit and a processing circuit, through which part or all of the operations of the method provided in the first aspect or any optional manner of the first aspect are executed.
[0047] It can be seen that the embodiments of the present application have the following beneficial effects:
[0048] The embodiment of the present application introduces a dynamic disturbance method during the linearization process of the motor control model, and through the dual configuration of the disturbance rate and the working point, realizes dynamic scaling of the disturbance value with the value of the disturbed parameter, realizes dynamic matching of the disturbance value with the actual working condition, avoids the problem of insufficient or excessive disturbance caused by fixed disturbance, improves the adaptability of the motor control model to the dimensional and amplitude differences of different working points, and improves the control accuracy and stability of the motor based on the motor control model.
[0049] Furthermore, compared with the traditional manual derivation of a linearized motor control model, the linearized motor control model can be automatically obtained, which greatly saves the time required to obtain the linearized motor control model.
[0050] Furthermore, after providing a linearized motor control model for the controller according to the method of the embodiment of the present application, the response time and overshoot of the system to reach a steady state are reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1This is a flow chart of a method for adding disturbance to a model during model linearization provided by an embodiment of the present application;
[0052] Figure 2 This is a schematic diagram of a function curve provided in an embodiment of the present application;
[0053] Figure 3 1 is a schematic structural diagram of a device for adding disturbance to a model during model linearization provided by an embodiment of the present application;
[0054] Figure 4 This is a structural diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0055] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0056] The following is an explanation of some terminology concepts involved in the embodiments of this application.
[0057] Perturbation: This refers to the step of changing the value of a parameter. For example, changing the value of a parameter from x to x + deltax is called a perturbation.
[0058] Perturbation rate: The ratio between the disturbance value and the current value of the disturbed parameter, that is, disturbance value = current value of the disturbed parameter * disturbance rate, where = is understood as "proportional to", and the two ends of = are not completely equal, but just satisfy this proportional relationship. The disturbance rate is usually a ratio, generally a percentage. In order to facilitate interaction, GCKontrol incorporates the concept of "percentage" into the value, so a concept of "perturbation rate" is defined. The disturbance rate of GCKontrol is to replace the percentage sign of the disturbance rate with *0.01. For example, if the disturbance rate is 1%, it should be configured as 0.01 in GCKontrol.
[0059] Perturbation value: the value of delta x.
[0060] This application proposes a dynamic adaptive perturbation method that adds perturbations defined by exponential functions to the model's input and state parameters to achieve numerical linearization. Taking a DC motor as an example, perturbations are applied to the angular velocity w and voltage u at the operating point (w0, u0), respectively. The output angular velocity increment is measured, and a numerical differential estimation of the motor system's state space matrix is performed. This method, in turn, obtains a local linear model, improving control accuracy and robustness.
[0061] The inventive concept of the embodiments of the present application is introduced below.
[0062] GCKontrol version 9.0 requires the linearization toolbox, which supports automatic numerical linearization of any nonlinear industrial control system near the operating point. This provides an efficient, versatile, and engineering-ready numerical linearization tool for industrial control systems. The core of the linearization algorithm is the "perturbation method," which adds additional "quantities" to the model and observes changes in the model's output to further determine the model's characteristics.
[0063] While the concept and logic of the perturbation method are relatively consistent, different algorithms define the location and magnitude of the perturbation differently or invisibly. Alternatively, they rely on fixed increments or analytical derivatives, making it difficult to account for varying amplitude dimensions and failing when the operating point is zero. For example, in the case of a DC motor, when the motor speed or current is near zero, a fixed, small increment often fails to accurately reflect the system's response to the perturbation.
[0064] Therefore, in the process of linearizing the model using the "perturbation method", it was decided to design a scientific and correct perturbation method exclusive to the GCKontrol software that is adapted to its underlying operation logic to achieve the linearization of nonlinear models or complex models.
[0065] This linearization method will bring the following engineering effects: in DC motor speed control projects, through automatic disturbance linearization, the operating point linear model can be obtained within seconds, saving more than 70% of the time compared with traditional manual derivation; in motor speed closed-loop control, after using this method to linearize the model to design the PID controller, the system's response time to reach steady state and overshoot will be reduced.
[0066] The perturbation method used in GCKontrol adds perturbations to the model's input parameters and state parameters. The magnitude of the perturbation is positively correlated with the absolute value of the input or state parameter, and is also affected by the model's magnitude.
[0067] The novel approach of this application lies in the way the disturbance is defined. First, the disturbance rate and reference magnitude are customized. The disturbance rate is used to control the relationship between the disturbance value and the operating point size. The reference magnitude is usually selected as the nominal maximum value of the parameter to be linearized (such as the maximum speed or maximum voltage of the motor). The default disturbance rate of GCKontrol is 10 -5 .
[0068] Secondly, for each parameter to be linearized (input parameter or state parameter), a disturbance value is calculated based on the current value of the parameter to be linearized and the disturbance rate. The disturbance value is defined as a positive number. The disturbance value is related to the absolute value of the parameter to be linearized in an exponentially increasing manner so that sufficient perturbation is generated at the large operating point. In order to ensure the existence and continuity of the disturbance value near 0, a very small positive EPS (10 -9) to ensure that measurable increments can be obtained near small working points and zero points.
[0069] Finally, at the specified operating point, the calculated disturbance is applied to each parameter to be linearized, and the simulation is repeated. By comparing the change in each parameter (output parameter or state parameter) after the disturbance is added with the change before the disturbance, the influence coefficient of each parameter on the dynamic characteristics of the system is estimated based on the ratio between the change in the state derivative and the disturbance value, and the ratio between the change in the output and the disturbance. This is the corresponding element of the Jacobian matrix.
[0070] The state sensitivity and input sensitivity matrices obtained by the above differences, as well as the linear approximation of the output function to the state and input, are used together to construct a standard linear state space model to achieve linear approximation of the controlled object and provide accurate gain information for the design of linear controllers such as PID or LQR.
[0071] The following is an example of the method flow provided in the embodiments of the present application.
[0072] Please refer to the attached Figure 1 , attached Figure 1 This is a flow chart of a method for adding disturbance to a model during model linearization provided by an embodiment of the present application. Figure 1 The method shown can be provided as an implementation of the perturbation algorithm of the GCKontrol linearization toolbox, for example, Figure 1 The method shown is implemented by the interaction between the client and server of the GCKontrol linearization toolbox. The shaded part is the part where the perturbation method is involved. Figure 1 The method shown includes the following steps.
[0073] Step S101: The client uses GCKontrol software to open a project or create a new project.
[0074] Step S102: The client configures the solver as a continuous solver.
[0075] Step S103: The client receives the linearization working area marked by the user on the model.
[0076] For example, before starting a simulation, the user adds input markers and output markers on the canvas to indicate that the area between the input markers and the output markers is used as the linearization working area, and uses the UI interactive dialog box to enable the linearization function.
[0077] Step S104: The client receives the disturbance rate and linearization operating point configured by the user.
[0078] The disturbance rate is a positive floating-point number that represents the ratio of the disturbance value to the value of the disturbed parameter of the controlled object. The default value is 1e-5, but you can manually edit the disturbance rate. A higher disturbance rate results in a larger increment at the same operating point.
[0079] The linearization operating point indicates the simulation time at which linearization calculations are performed on a nonlinear motor control model. The operating point represents the point at which the motor control model reaches a stable state under specific control inputs, such as the point at which the speed and current of a DC motor stabilize under a given voltage and load. After saving the configured disturbance rate and linearization operating point, start the simulation.
[0080] Step S105: The client sends the disturbance rate and the linearized operating point to the server.
[0081] In step S110 , the server obtains parameters to which disturbances need to be added from the nonlinear motor control model.
[0082] In step S111 , the server receives the user-configured disturbance rate and the user-configured linearization operating point sent by the client, thereby obtaining the disturbance rate and the linearization operating point.
[0083] Furthermore, after simulation begins, the GCKontrol server automatically identifies the linearization region and extracts the linearized model. For example, based on the user-added input and output markers, the server identifies the linearization region from the canvas, starting from the input marker and ending at the output marker. The server then extracts the nonlinear motor control model from the linearization region.
[0084] Considering that linearization is usually performed on a certain part of the project, such as the controlled object, not all modules of the project need to be linearized. Clearly defining the linearization area through input markers / output markers can avoid unnecessary calculations on irrelevant modules and improve linearization efficiency.
[0085] Step S112: within each simulation step, the server determines whether the current moment satisfies the conditions of the linearization working point.
[0086] As a specific example, when the linearization operating point variable is an engineering parameter, the linearization operating point condition is determined to be met at the current moment if the current value of the parameter to be linearized reaches the target value of the linearization operating point or enters the target operating point range for the first time. For example, in a DC motor control model, the linearization operating point condition is determined to be met when the current reaches the target current or the speed reaches the target speed.
[0087] As a specific example, when the linearized operating point variable is time, if the current moment reaches the target moment in the linearized operating point or enters the operating point target interval for the first time, it is determined that the current moment meets the linearized operating point condition.
[0088] The above-mentioned situations can all serve as situations where the conditions for the linearization operating point are met, providing users with multiple configuration entries. When any of the above situations determines that the conditions for the linearization operating point are met at the current moment and that the project contains a valid linearization region (a module exists from the input mark to the output mark), the linearization calculation can be started.
[0089] By judging whether the conditions of the linearization working point are met at the current moment, linearization-related calculations are performed only when the conditions of the linearization working point are met. If the conditions of the linearization working point are not met, linearization-related calculations are skipped and not performed, thereby avoiding the overall simulation speed being greatly affected by the linearization calculations.
[0090] Step S113: If the linearization operating point condition is met at the current moment, the server determines the disturbance value corresponding to each parameter to be linearized based on the current value and disturbance rate of each parameter to be linearized of the controlled object in the nonlinear motor control model.
[0091] In some embodiments, within a simulation step where linearization calculation is required, the server identifies each parameter to be linearized in the motor control model (including input parameters, output parameters, and state parameters), and based on the current values of the input parameters to be linearized and the state parameters to be linearized and the disturbance rate value configured by the user, determines the disturbance value corresponding to the input parameters to be linearized and the disturbance value corresponding to the state parameters to be linearized, respectively, so as to add disturbance to the input parameters and the state parameters, respectively.
[0092] In some implementations, a disturbance value corresponding to each parameter to be linearized is determined based on a current value of each parameter to be linearized of the controlled object in the nonlinear motor control model, a reference magnitude of each parameter to be linearized, and a disturbance rate.
[0093] The reference magnitude is determined based on the nominal maximum value of the corresponding parameter. This reference magnitude is also referred to as engineering data accuracy. By defining the perturbation magnitude based on both engineering data accuracy and user-configured conditions, the perturbation magnitude dynamically adapts, improving the robustness of the algorithm.
[0094] In some embodiments, the disturbance value is associated with the absolute value of the parameter in an exponentially increasing manner. For example, based on the following formula, the disturbance value corresponding to each parameter to be linearized is determined.
[0095]
[0096] Where r represents the disturbance rate configured by the user, x represents the parameter to be linearized, ΔX represents the disturbance value corresponding to the parameter to be linearized, and EPS is a positive value. -|X| and e |X| The correlation reflects that the perturbation value is exponentially related to the absolute value of the parameter. EPS is 10^-9, which represents a very small non-zero positive value. The EPS in the above formula has the same meaning as the EPS in the error calculation. For example, when the absolute value of the difference between two numbers is less than the EPS, the two numbers are considered to be numerically equal, that is, |x1-x2| <EPS。
[0097] By using the EPS term in the above disturbance value definition formula, the disturbance value is always greater than 0. The disturbance will not be invalidated because the disturbance value is 0, nor will the linearization calculation be affected by the existence of an initial increment. The disturbance value is scientifically defined near the origin.
[0098] In step S114 , the server adds a corresponding disturbance value to each parameter to be linearized.
[0099] In step S115 , the server performs a differential operation on each parameter after the disturbance value is added and each parameter before the disturbance is added to obtain a linearized motor control model.
[0100] In some embodiments of the differential operation, the server obtains an input sensitivity matrix based on the difference between the input parameters after adding the disturbance value and the input parameters before adding the disturbance value, and the difference between the state parameters after adding the disturbance value and the state parameters before adding the disturbance value; obtains a first output sensitivity matrix based on the difference between the output parameters after adding the disturbance value and the output parameters before adding the disturbance value, and the difference between the state parameters after adding the disturbance value and the state parameters before adding the disturbance value; obtains a second output sensitivity matrix based on the difference between the output parameters after adding the disturbance value and the output parameters before adding the disturbance value, and the difference between the input parameters after adding the disturbance value and the input parameters before adding the disturbance value; obtains a state sensitivity matrix based on the difference between the state parameters after adding the disturbance value and the state parameters before adding the disturbance value; and constructs a linearized motor control model based on the input sensitivity matrix, the output sensitivity matrix, and the state sensitivity matrix.
[0101] For example, the state sensitivity matrix is obtained by dividing the difference between the derivative of the state parameter after the disturbance value is added and the derivative of the state parameter before the disturbance value is added by the difference between the state parameter after the disturbance value is added and the state parameter before the disturbance value is added. The input sensitivity matrix is obtained by dividing the difference between the derivative of the state parameter after the disturbance value is added and the derivative of the state parameter before the disturbance value is added by the difference between the input parameter after the disturbance value is added and the input parameter before the disturbance value is added. The first output sensitivity matrix is obtained by dividing the difference between the output parameter after the disturbance value is added and the output parameter before the disturbance value is added and the difference between the state parameter after the disturbance value is added and the state parameter before the disturbance value is added. The second output sensitivity matrix is obtained by dividing the difference between the output parameter after the disturbance value is added and the output parameter before the disturbance value is added by the difference between the input parameter after the disturbance value is added and the input parameter before the disturbance value is added.
[0102] In an example of a differential operation, if the output parameter is represented by y, then for the state parameter, the ratio between the state parameter and the disturbance value is delta y / delta x, where delta y = y'-y, y' is the output parameter after the disturbance is added, y is the parameter before the disturbance is added, and delta x is the disturbance added to x. The calculation result corresponds to the matrix C; similarly, for the input parameter u, the ratio is delta y / delta u, delta u represents the disturbance added to the input parameter u, and the calculation result corresponds to the matrix D. If the state equation is represented by dx / dy, then for the state parameters, the ratio is (dx' / dt - dx / dt) / delta x, where x' = x + delta x represents the state parameter after the perturbation, and x represents the state parameter before the perturbation. This calculation corresponds to matrix A. Similarly, for the input parameters, the ratio is defined as (dx' / dt - dx / dt) / delta u, and the calculation corresponds to matrix B, where matrix A is the state sensitivity matrix, matrix B is the input sensitivity matrix, matrix C is the linear approximation of the output parameters to the state parameters, and matrix D is the linear approximation of the output parameters to the input parameters. In the steady-state state (a prerequisite for linearization), the above process is equivalent to taking the partial derivatives of the state equation and the output equation with respect to the state quantity X and input u, respectively, which is the calculation process of the Jacobian matrix.
[0103] In step S116 , the server instructs the linearization controller to control the motor using the linearized motor control model.
[0104] A linearized controller is, for example, a controller such as PID or LQR that controls the controlled object based on a linearized model. A linearized motor control model is, for example, a linear state-space model. For example, a linearized motor control model is used to replace the original nonlinear motor control model at the operating point. The linearized motor control model is directly connected to the controller and transmits the output parameters back to the controller. In a PID controller, a step response is usually input to the controller and the state-space model, and then the coefficients of the PID controller are adjusted to achieve a well-functioning and correctly responsive PID controller designed for the nonlinear motor model. Specifically, a step signal was originally directly added to the PID controller and the nonlinear motor control model, and the parameters of the PID controller were modified according to the step response of the PID controller. However, due to the high computational complexity of the nonlinear model and the tendency of the designed PID controller to overfit, a linear model is chosen to approximate the original nonlinear model at the operating point, which can achieve the same design effect while saving computing power.
[0105] Taking a model with single input, single output, and single state quantity as an example, the following first introduces where the disturbance is specifically added in step S114 and how it affects the linearization calculation.
[0106] If the input parameter is defined as u, the output parameter is defined as y, and the state parameter is defined as X, the model can be expressed as
[0107]
[0108] y=g(X,u);
[0109] If disturbances ΔX and Δu are added near the steady-state operating point (x0, u0), then X = X0 + ΔX, u = u0 + Δu.
[0110] Perform Taylor expansion on the differential equation at the operating point and ignore the higher-order terms, then we have:
[0111]
[0112] Since (X0,u0) is a stable point, f(X0,u0)=0, then we have the approximate equation:
[0113]
[0114] Corresponding to the form of the state space, we get:
[0115]
[0116] Perform Taylor expansion on the state equation at the operating point and ignore the higher-order terms, then:
[0117]
[0118] Then there is an approximate equation:
[0119]
[0120] Corresponding to the form of the state space, we get:
[0121]
[0122] It can be seen that the size of the disturbance value directly determines the effect of linearization, so it is very important to define the disturbance value scientifically and reasonably.
[0123] The definition of the state disturbance value ΔX in GCKontrol is as follows:
[0124]
[0125] Where r represents the user-defined perturbation rate value, and the function curve is as follows Figure 2 As shown in , the same definition is applied to the perturbation value of input u. After adding the perturbation, the linearized state space matrix can be calculated according to the above formula.
[0126] from Figure 2 The curve shows that the disturbance value is defined continuously and the curve is smooth. Specifically, the disturbance value ΔX is defined at and near the origin, is continuous within the real range, and is proportional to the absolute value of the state parameter |X|. This ensures that the linearization does not cause large calculation errors due to excessively large or small disturbance values.
[0127] Figure 3 is a structural diagram of an apparatus 300 for adding disturbance to a model during model linearization provided by an embodiment of the present application. The apparatus 300 includes:
[0128] An acquisition unit 310 is configured to acquire a user-configured disturbance rate and a linearization operating point, wherein the disturbance rate represents the ratio between the disturbance value and the value of the disturbed parameter of the controlled object, and the linearization operating point indicates the simulation time for performing linearization calculations on the nonlinear motor control model;
[0129] The processing unit 320 is configured to determine, within each simulation step, whether a linearization operating point condition is satisfied at the current moment; if the linearization operating point condition is satisfied at the current moment, determine a disturbance value corresponding to each parameter to be linearized based on a current value and a disturbance rate of each parameter to be linearized of the controlled object in the nonlinear motor control model; add a corresponding disturbance value to each parameter to be linearized; and perform a differential operation on each parameter after the disturbance value is added and each parameter before the disturbance is added to obtain a linearized motor control model.
[0130] The control unit 330 is configured to instruct the linearization controller to control the motor using the linearized motor control model.
[0131] In some embodiments, each parameter to be linearized includes an input parameter, an output parameter, and a state parameter. The processing unit 320 is configured to obtain an input sensitivity matrix based on the difference between the input parameter after adding the disturbance value and the input parameter before adding the disturbance value, and the difference between the state parameter after adding the disturbance value and the state parameter before adding the disturbance value; obtain a first output sensitivity matrix based on the difference between the output parameter after adding the disturbance value and the output parameter before adding the disturbance value, and the difference between the state parameter after adding the disturbance value and the state parameter before adding the disturbance value; obtain a second output sensitivity matrix based on the difference between the output parameter after adding the disturbance value and the output parameter before adding the disturbance value, and the difference between the input parameter after adding the disturbance value and the input parameter before adding the disturbance value; obtain a state sensitivity matrix based on the difference between the state parameter after adding the disturbance value and the state parameter before adding the disturbance value; and construct a linearized motor control model based on the input sensitivity matrix, the first output sensitivity matrix, the second output sensitivity matrix, and the state sensitivity matrix.
[0132] In some embodiments, the processing unit 320 is configured to determine that the current moment satisfies the condition of the linearization operating point if the current value of the parameter to be linearized at the current moment reaches the target value in the linearization operating point; and to determine that the current moment satisfies the condition of the linearization operating point if the current moment reaches the target moment in the linearization operating point.
[0133] In some embodiments, the processing unit 320 is configured to determine a disturbance value corresponding to each parameter to be linearized based on a current value of each parameter to be linearized of the controlled object in the nonlinear motor control model, a reference magnitude of each parameter to be linearized, and a disturbance rate, wherein the reference magnitude is determined based on a nominal maximum value of the corresponding parameter.
[0134] In some embodiments, the perturbation value is related to the absolute value of the parameter in an exponentially increasing manner.
[0135] In some embodiments, the processing unit 320 is configured to determine a disturbance value corresponding to each parameter to be linearized based on the following formula:
[0136]
[0137] Where r represents the perturbation rate configured by the user, x represents the parameter to be linearized, ΔX represents the perturbation value corresponding to the parameter to be linearized, and EPS is a positive value.
[0138] In some implementations, the processing unit 320 is further configured to identify a linearized working region from the canvas based on input tags and output tags added by the user; and extract a nonlinear motor control model from the linearized working region.
[0139] Figure 4 The computer device 400 includes a processor 401 coupled to a memory 402. The memory 402 stores at least one computer program instruction. The at least one computer program instruction is loaded and executed by the processor 401 to enable the computer device 400 to implement Figure 1 The method provided in the embodiment.
[0140] In some embodiments, a computer-readable storage medium is further provided, wherein the storage medium stores at least one instruction, which, when executed on a computer, causes the computer to execute the above-mentioned Figure 1 The method provided in the embodiment.
[0141] In some embodiments, a computer program product is further provided. The computer program product includes one or more computer program instructions. When the computer program instructions are loaded and executed by a computer, the computer performs the above Figure 2 The method provided in the embodiment.
[0142] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
[0143] A refers to B, which means that A is the same as B or A is a simple variant of B.
[0144] The terms "first" and "second" and so on, used in the description and claims of the embodiments of this application, are used to distinguish different objects, not to describe a specific order of objects, and should not be construed as indicating or implying relative importance. For example, the first output sensitivity matrix and the second output sensitivity matrix are used to distinguish different output sensitivity matrices, not to describe a specific order of output sensitivity matrices, and should not be construed as implying that the first output sensitivity matrix is more important than the second output sensitivity matrix.
[0145] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in accordance with the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).
[0146] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for adding disturbances to a model during model linearization, characterized in that: The method comprises: Obtaining a user-configured disturbance rate and a linearization operating point, wherein the disturbance rate represents the ratio between the disturbance value and the value of the disturbed parameter of the controlled object, and the linearization operating point is used to indicate the simulation time for performing linearization calculation on the nonlinear motor control model; In each simulation step, determining whether the current moment satisfies the conditions of the linearization operating point; If the condition of the linearization operating point is met at the current moment, determining a disturbance value corresponding to each parameter to be linearized of the controlled object in the nonlinear motor control model based on a current value of each parameter to be linearized and the disturbance rate; Add the corresponding disturbance value to each parameter to be linearized; Performing a differential operation on each parameter after the disturbance value is added and each parameter before the disturbance value is added to obtain a linearized motor control model; A linearized controller is instructed to control the motor using the linearized motor control model.
2. The method according to claim 1, characterized in that Each parameter to be linearized includes an input parameter, an output parameter, and a state parameter. Differential operation is performed on each parameter after adding the disturbance value and each parameter before adding the disturbance to obtain a linearized motor control model, including: Obtaining an input sensitivity matrix based on a difference between an input parameter after adding the disturbance value and an input parameter before adding the disturbance value and a difference between a state parameter after adding the disturbance value and a state parameter before adding the disturbance value; Obtaining a first output sensitivity matrix based on a difference between an output parameter after adding the disturbance value and an output parameter before adding the disturbance value and a difference between a state parameter after adding the disturbance value and a state parameter before adding the disturbance value; Obtaining a second output sensitivity matrix based on a difference between the output parameter after adding the disturbance value and the output parameter before adding the disturbance value and a difference between the input parameter after adding the disturbance value and the input parameter before adding the disturbance value; Obtaining a state sensitivity matrix based on a difference between the state parameters after the disturbance value is added and the state parameters before the disturbance value is added; The linearized motor control model is constructed based on the input sensitivity matrix, the first output sensitivity matrix, the second output sensitivity matrix, and the state sensitivity matrix.
3. The method according to claim 1, characterized in that The determining whether the current moment satisfies the condition of the linearization working point includes: If the current value of the parameter to be linearized at the current moment reaches the target value in the linearization working point, determining that the condition of the linearization working point is met at the current moment; If the current moment reaches the target moment in the linearization working point, it is determined that the current moment meets the condition of the linearization working point.
4. The method according to claim 1, wherein The determining of the disturbance value corresponding to each parameter to be linearized based on the current value of each parameter to be linearized of the controlled object in the nonlinear motor control model and the disturbance rate includes: A disturbance value corresponding to each parameter to be linearized is determined based on a current value of each parameter to be linearized of the controlled object in the nonlinear motor control model, a reference magnitude of each parameter to be linearized, and the disturbance rate, wherein the reference magnitude is determined based on a nominal maximum value of the corresponding parameter.
5. The method according to claim 1, wherein The perturbation value is related to the absolute value of the parameter in an exponentially increasing manner.
6. The method according to claim 5, characterized in that The determining of the disturbance value corresponding to each parameter to be linearized based on the current value of each parameter to be linearized of the controlled object in the nonlinear motor control model and the disturbance rate includes: Based on the following formula, determine the disturbance value corresponding to each parameter to be linearized; Where r represents the perturbation rate configured by the user, x represents the parameter to be linearized, ΔX represents the perturbation value corresponding to the parameter to be linearized, and EPS is a positive value.
7. The method according to claim 1, characterized in that The method further comprises: Identify the linearization work area from the canvas based on the input and output markers added by the user; The nonlinearized motor control model is extracted from the linearized operating region.
8. A device for adding disturbance to a model during model linearization, characterized in that: The device comprises: an acquisition unit, configured to acquire a disturbance rate and a linearization operating point configured by a user, wherein the disturbance rate represents a ratio between a disturbance value and a value of a disturbed parameter of the controlled object, and the linearization operating point indicates a simulation time for performing a linearization calculation on a nonlinear motor control model; The processing unit is configured to determine, within each simulation step, whether a condition of the linearization operating point is satisfied at a current moment; if the condition of the linearization operating point is satisfied at the current moment, determine a disturbance value corresponding to each parameter to be linearized based on a current value of each parameter to be linearized of the controlled object in the nonlinear motor control model and the disturbance rate; add a corresponding disturbance value to each parameter to be linearized; and perform a differential operation on each parameter after the disturbance value is added and each parameter before the disturbance is added to obtain a linearized motor control model; The control unit is configured to instruct the linearization controller to control the motor using the linearized motor control model.
9. A server, characterized in that: The server includes: a processor, the processor is coupled to a memory, the memory stores at least one computer program instruction, and the at least one computer program instruction is loaded and executed by the processor, so that the server implements the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The storage medium stores at least one instruction, and when the instruction is executed on a computer, the computer executes the method according to any one of claims 1 to 7.