Electric load simulator control method based on 1D-CNN adaptive PID and backlash compensation

By using a 1D-CNN adaptive PID and gap compensation method, the PID parameters are adjusted in real time and gap inverse model feedforward compensation is performed, which solves the problem of insufficient dynamic feature extraction capability in traditional methods and improves the tracking accuracy and dynamic response robustness of the electric load simulator system.

CN121900156APending Publication Date: 2026-04-21JIANGSU UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JIANGSU UNIV OF SCI & TECH
Filing Date
2025-12-15
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

In existing electric load simulator systems, traditional neural network algorithms are insufficient in their ability to extract dynamic features from time-series data from sensor feedback. This results in slow convergence of adaptive PID controller parameters, making it difficult to accurately track rapidly changing system states and affecting the nonlinear disturbance suppression effect and dynamic tracking accuracy.

Method used

A one-dimensional convolutional neural network (1D-CNN) is used to adjust the PID parameters in real time, and combined with the gap inverse model feedforward compensation. The time window vector is constructed and input into the 1D-CNN for online training, and the Jacobian estimate is output. The gradient descent method is used to dynamically adjust the PID parameters, and the discrete gap inverse model is combined for compensation to build a closed-loop feedback mechanism.

Benefits of technology

It significantly improves the tracking accuracy and dynamic response robustness of the electric load simulator system under nonlinear disturbances, enhances the ability to identify and adaptively adjust the time-varying nonlinear characteristics of the system, and weakens the negative impact of mechanical backlash on the dynamic performance of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121900156A_ABST
    Figure CN121900156A_ABST
Patent Text Reader

Abstract

The invention discloses an electric load simulator control method based on 1D-CNN adaptive PID and backlash compensation. The method comprises the following steps: firstly, calculating an error between an expected torque instruction and an actual output torque, and constructing a time window vector containing the error, a control quantity and output; inputting the vector into a one-dimensional convolutional neural network for online training, and outputting a system Jacobian estimated value in real time; based on the estimated value, calculating the PID parameter adjustment amount through a gradient descent method to realize online self-tuning of the parameters; meanwhile, an angle sensor is used for collecting a rotation angle, and feedforward compensation is carried out on the motor through a gap inverse model; the system synthesizes the updated PID control quantity and compensation quantity to generate a loading instruction to drive a motor, and actual output is collected through a torque sensor to form closed-loop feedback; according to the method, the friction and the gap of the electric load simulator are compensated, so that the defects of weak feature extraction capability and slow parameter convergence of a traditional method under the condition of coping with nonlinear and time-varying disturbance in a system are effectively overcome, and the tracking precision and the dynamic response robustness of the electric load simulator to an expected torque instruction are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of electric load simulator technology, and particularly relates to an electric load simulator control method based on 1D-CNN adaptive PID and gap compensation. Background Technology

[0002] Currently, in fields such as industrial automation, aerospace testing, and high-precision robotics, electric load simulator systems are key equipment for performance testing and verification of servo drives, motors, and actuators. These systems require high-precision and high-dynamic reproduction of complex load torques under actual working conditions, and their control performance directly determines the accuracy and reliability of the test results. The core problem of this system is the strong disturbance (redundant torque) caused by the active movement of the tested object, which can compromise loading accuracy. Current mainstream research (such as feedforward control and disturbance observers) mainly focuses on suppressing this redundant torque. Under this premise, further improvements in system performance are primarily limited by the inherent nonlinear disturbances such as friction and backlash in the transmission chain. Therefore, improving the tracking accuracy, response speed, and ability to suppress nonlinear disturbances of electric load simulator systems has always been a continuous goal pursued in this technological field.

[0003] To address nonlinear disturbances in the system, particularly the adverse effects of mechanical friction and gear transmission backlash, existing technologies typically employ adjustable control strategies combined with feedforward compensation. Specifically, a common approach is to use an adaptive PID controller based on a traditional neural network, adjusting the proportional, integral, and derivative parameters of the controller online to adapt to dynamic system changes. Simultaneously, to specifically compensate for the nonlinear dead-zone effect caused by gear backlash, an inverse model feedforward compensator based on the backlash model is usually introduced, its output superimposed on the control signal to preemptively offset the effects of the backlash.

[0004] However, the aforementioned existing technical solutions have significant limitations. The traditional neural network algorithms they employ have inherent defects in structure and training characteristics, primarily manifested in insufficient ability to extract local dynamic features from time-series data such as sensor feedback. Furthermore, when the system encounters sudden load changes or complex multi-frequency excitations, they often exhibit slow parameter convergence and lag in adjustment. This limits the real-time adjustment capability of the adaptive PID controller, making it difficult to accurately track rapidly changing system states, thus affecting the overall control system's suppression of nonlinear disturbances and dynamic tracking accuracy. Summary of the Invention

[0005] Purpose of the Invention: The purpose of this invention is to provide a control method for an electric load simulator based on 1D-CNN adaptive PID and backlash compensation. This method is primarily applied to an electric load simulator system with strong motion disturbances. The system includes a test servo motor that generates active motion, a torque motor for applying load torque, and transmission and measurement components connecting the two. By using 1D-CNN to accurately adjust PID parameters in real time and combining it with backlash inverse model feedforward compensation, friction and backlash in the electric load simulator are compensated. This solves the problem of insufficient control accuracy caused by weak feature extraction capabilities and slow convergence in traditional solutions, thereby significantly improving the tracking accuracy and dynamic response robustness of the electric simulator system under nonlinear disturbances.

[0006] Technical solution: The electric load simulator control method based on 1D-CNN adaptive PID and backlash compensation described in this invention includes the following steps:

[0007] S1, Input the load into the electric load simulator system at the... Desired torque command for each control cycle ;

[0008] S2, The load is collected by the torque sensor at the first... Actual output torque per control cycle Calculate the desired torque command Compared with actual output torque Torque error between ;

[0009] S3, Collect the first To the Torque error in the first control cycle, the first To the The PID control quantity of the first control cycle and the first control cycle To the The actual output torque signal of the load in each control cycle is used to construct a time window vector. , where N is the preset time window size;

[0010] S4. The time window vector Input a pre-defined one-dimensional convolutional neural network (1D-CNN), train the 1D-CNN online and update the network weights in real time, and output the Jacobian estimate of the electric load simulator system at the current time. ;

[0011] S5. Based on gradient descent and the Jacobian estimate. Decompose the gradient of the loss function and calculate the adjustment amounts of the scaling, integral, and derivative parameters. , , This enables adaptive online updating of PID parameters;

[0012] S6. Use the updated PID parameters. , , The PID control input for the current control cycle is calculated by combining the current and historical torque errors. ;

[0013] S7. Real-time acquisition of the driven shaft rotation angle of the servo motor via an angle sensor. The angle of the drive shaft of the torque motor after compensation was calculated using a discrete backlash inverse model. ;

[0014] S8, the electric load simulator system, based on the PID control quantity Angle with the drive shaft It generates and executes loading instructions, driving the torque motor to load the servo motor;

[0015] S9. The actual output torque of the load is collected again in real time by the torque sensor. The actual output torque Feedback is sent to step S2 to build a closed-loop feedback mechanism.

[0016] This invention constructs time window vectors in real time using 1D-CNN and trains them online to output Jacobian estimates. Combined with gradient descent, it dynamically and adaptively adjusts PID parameters, effectively improving the controller's parameter adaptability and response speed under nonlinear disturbances. Simultaneously, based on angle sensor information, it utilizes a backlash inverse model for feedforward compensation to accurately eliminate steady-state errors and hysteresis caused by mechanical backlash. Through the combined effect of PID control and backlash compensation, it achieves high-precision tracking of the desired torque command, significantly enhancing the system's dynamic response robustness and overall control accuracy under complex operating conditions.

[0017] Preferably, the time window vector mentioned in step S3 The expression is:

[0018]

[0019] In the formula, N represents the size of the time window, i.e., the number of historical data retrieved by the 1D-CNN. For the first Torque error per control cycle For the first Torque error per control cycle For the first The PID control quantity for each control cycle. For the first PID control quantity per control cycle For the first The actual output torque of the load in each control cycle For the first The actual output torque of the load in each control cycle.

[0020] This preferred scheme comprehensively captures the dynamic historical information of the system by constructing a multi-dimensional time window vector that integrates torque error, control quantity and actual output torque. This provides a sufficient and structured data foundation for subsequent accurate feature extraction and Jacobian estimation of 1D-CNN, thereby enhancing the controller's ability to identify the time-varying nonlinear characteristics of the system and its forward-looking adaptive adjustment.

[0021] Preferably, the one-dimensional convolutional neural network (1D-CNN) described in step S4 consists of an 8-layer network structure, which collaboratively performs online estimation of the system's Jacobian, including:

[0022] Input layer : Receive the time window vector The time step is N, and the number of output channels is 3;

[0023] First convolutional layer : Perform one-dimensional convolution operation on the output of the input layer to extract temporal primary local features;

[0024] Max pooling layer Pooling is performed on the output of the first convolutional layer to compress the data volume;

[0025] Second convolutional layer : Perform one-dimensional convolution operation on the output of the max pooling layer to extract high-level abstract temporal features;

[0026] Global average pooling layer Global mean pooling is performed on the output of the second convolutional layer to aggregate global channel information;

[0027] Flattening layer Adjust the shape of the tensor output by the global average pooling layer;

[0028] Fully connected layer : Perform feature mapping on the output of the flattened layer;

[0029] Output layer : Jacobian estimate of the output system .

[0030] This preferred scheme constructs a 1D-CNN network structure containing multi-level convolution, pooling, and fully connected layers, which sequentially achieves primary feature extraction, data denoising and compression, high-level abstract feature mining, and global information aggregation of time-series signals. Finally, it accurately outputs the system Jacobian estimate, effectively enhancing the neural network's ability to deeply represent and generalize the dynamic characteristics of the system, thereby significantly improving the accuracy and real-time performance of online adaptive adjustment of PID parameters.

[0031] Preferably, the computational logic of each layer of the one-dimensional convolutional neural network (1D-CNN) is as follows:

[0032] Input layer The output channel has 3 channels, which are used to output three time series: stress torque error, PID control quantity, and actual load output.

[0033] First convolutional layer Second convolutional layer Using the ReLU activation function, the formula for calculating the activation of the m-th output channel at output position n is:

[0034]

[0035] In the formula, ReLU is the activation function. For the number of channels, Here, B is the weight, X is the input tensor, P is the convolution padding, S is the stride, and K is the kernel size.

[0036] Max pooling layer To compress data volume, the maximum value of each pooling window is retained. The output of the m-th output channel at output position n is calculated using the following formula:

[0037]

[0038] In the formula, Indicates the pooling window size. Indicates the pooling step size;

[0039] Global average pooling layer The average value of each pooling window is calculated to aggregate global channel information. The output calculation formula for the m-th output channel is as follows:

[0040]

[0041] In the formula, The length of the input sequence;

[0042] Flattening layer : Simply adjust the shape of the tensor to synthesize multi-channel data into single-channel data without changing the nature of the data;

[0043] Fully connected layer Using the ReLU activation function, the output calculation formula at output position n is:

[0044]

[0045] Output layer Output the Jacobian estimate through a linear activation function. The calculation formula is:

[0046] .

[0047] This preferred scheme, through the clearly defined operational logic of ReLU activation function, max pooling and global average pooling, and linear output in each layer of 1D-CNN, achieves the extraction of nonlinear local features from multi-channel time series data layer by layer, noise reduction while retaining key information, and effective aggregation of global dynamic characteristics, ultimately accurately mapping to the system Jacobian estimate. This ensures the computational efficiency, stable convergence, and high-precision modeling capability of complex nonlinear dynamics of the system in the online identification process of the neural network.

[0048] Preferably, the internal weights W of the one-dimensional convolutional neural network (1D-CNN) are updated in real time using gradient descent, and the specific update logic is as follows:

[0049] Optimization objective definition: The objective is updated with the weights of minimizing the instantaneous performance loss. The instantaneous performance loss expression is:

[0050]

[0051] In the formula, For the first Torque error per control cycle;

[0052] Weight update rule: The weights are updated using gradient descent, and the update rule is as follows:

[0053]

[0054] In the formula, The learning rate of the neural network. / This is the partial derivative of the performance loss with respect to the network weights;

[0055] Gradient chain decomposition: / and / Proportional relationship, that is:

[0056]

[0057] In the formula, The Jacobian estimate is the output of the 1D-CNN. / Let be the partial derivative of the Jacobian estimate with respect to the network weights;

[0058] The final weight adjustment formula is:

[0059]

[0060] In the formula, Positive constant coefficients For the first Network weights for each control cycle For the first Network weights for each control cycle.

[0061] This preferred scheme updates the 1D-CNN weights using gradient descent driven by an instantaneous performance loss function based on the square of the torque error. It establishes a proportional relationship between the loss function and the partial derivatives of the Jacobian estimate with respect to the weights using the chain rule, enabling the network weights to be adaptively adjusted in real time and in a targeted manner according to the current control error and system sensitivity. This effectively enhances the neural network's online learning ability and tracking accuracy for dynamic changes in the system, thereby ensuring the real-time accuracy of the Jacobian estimate and the convergence stability of the entire adaptive control loop.

[0062] Preferably, in step S5, the adjustment amount of the PID parameters is calculated using the following formula: the adjustment amount of the PID parameters is calculated using the gradient descent method, and the parameter adjustment amount... Along the loss function The negative gradient direction is calculated using the following formula:

[0063] The core formula for gradient descent:

[0064]

[0065] In the formula, Learning rate ( ), = (1 / 2) This is due to instantaneous performance loss;

[0066] Gradient chain decomposition:

[0067]

[0068] In the formula, / = , / = , / = , The Jacobian estimate is the output of the 1D-CNN;

[0069] PID control partial derivative calculation:

[0070] Using positional PID The expression for time;

[0071]

[0072] To each , , Find the partial derivative as follows:

[0073]

[0074]

[0075]

[0076] In the formula, , , ;

[0077] The final formula for parameter adjustment is obtained as follows:

[0078]

[0079]

[0080] In the formula, , , The learning rates are the proportional parameter, integral parameter, and derivative parameter, respectively. For the first Torque error per control cycle For the first Torque error per control cycle For the first Torque error per control cycle For the first Torque error per control cycle.

[0081] This preferred scheme decomposes the adjustment of PID parameters by instantaneous performance loss into a product relationship based on torque error, system Jacobian estimation, and the partial derivatives of the PID control quantity with respect to the parameters using the gradient descent method. This allows the proportional, integral, and derivative parameters to be accurately and adaptively corrected online based on current and historical error dynamics and system sensitivity. This effectively enhances the parameter self-tuning capability and dynamic response accuracy of the PID controller when facing system nonlinearity and external disturbances, and significantly improves the torque tracking accuracy and closed-loop control stability of the electric load simulator system.

[0082] Preferably, in step S6, the PID parameters are updated online according to the following formula:

[0083]

[0084]

[0085]

[0086] In the formula, , , The first The proportional, integral, and derivative parameters updated after each control cycle. , , The first The proportional, integral, and derivative parameters for each control cycle. , , These are the PID parameter adjustment values.

[0087] This preferred scheme achieves recursive online real-time updates of control parameters by directly accumulating the calculated PID parameter adjustments to the parameter values ​​of the previous cycle. This enables the proportional, integral, and derivative actions to continuously and smoothly adapt to dynamic changes in the system, effectively enhancing the controller's ability to track and adapt to time-varying operating conditions and nonlinear disturbances. As a result, the electric load simulator system maintains high-precision and robust torque control performance throughout the entire operation.

[0088] Preferably, in step S6, the PID control quantity is updated online according to the following formula:

[0089]

[0090] In the formula, For the first PID control quantity per control cycle For the first Torque error per control cycle Let be the torque error in the j-th control cycle.

[0091] This preferred solution dynamically generates precise PID control quantities by combining real-time updated PID parameters with current and historical torque errors. This enables the controller to adjust the output in a timely manner according to transient changes in system errors, effectively enhancing the system's dynamic tracking capability and interference suppression performance for the desired torque, thereby significantly improving the accuracy and response speed of the electric load simulator control.

[0092] Preferably, in step S7, the mathematical expression of the discrete gap inverse model is:

[0093]

[0094] In the formula, The angle of rotation of the drive shaft. The angle of rotation of the driven shaft. For the first The driven shaft rotation angle per control cycle The transmission ratio is... This represents the total clearance width between the gears.

[0095] This preferred solution uses a discrete backlash inverse model to dynamically generate a feedforward command for the drive shaft angle, which includes the transmission ratio and backlash compensation, based on a comparison of the current and previous cycle driven shaft angle changes. This effectively pre-compensates for the nonlinear dead zone and motion lag caused by gear backlash, significantly improving the response speed and control accuracy of torque loading, thereby fundamentally reducing the negative impact of mechanical transmission backlash on the dynamic performance of the electric load simulator system.

[0096] Preferably, in step S9, the closed-loop feedback mechanism is specifically implemented as follows:

[0097] The torque sensor collects the actual output torque of the load in real time. , will the Feedback is sent to step S2 for calculating the first... Torque error per control cycle By combining online training of 1D-CNN with real-time updating of PID parameters and dynamic compensation of gap inverse model, a closed-loop control loop is constructed.

[0098] This preferred solution continuously introduces the system output into the control loop through real-time torque feedback, enabling torque error calculation, online neural network training, adaptive PID parameter updates, and gap feedforward compensation to form a closely coordinated closed-loop mechanism. This effectively enhances the system's real-time perception and dynamic suppression capabilities against changes in internal parameters and external disturbances, thereby ensuring that the electric load simulator system maintains high-precision and highly robust stable tracking performance throughout the entire operation.

[0099] Beneficial Effects: Compared with existing technologies, this invention has the following significant advantages: 1. By using a one-dimensional convolutional neural network to estimate the system Jacobian in real time and adaptively adjust the PID parameters, combined with feedforward compensation from the gap inverse model, it effectively overcomes the shortcomings of traditional methods in terms of weak feature extraction capability and slow parameter convergence under nonlinear and time-varying disturbances, significantly improving the tracking accuracy and dynamic response robustness of the electric load simulator system to the desired torque command; 2. By using 1D-CNN to perform deep feature extraction on the time-series data of historical error, control quantity, and output torque, online training is conducted and the system Jacobian estimate is output, realizing real-time and accurate identification of the system's dynamic characteristics, and providing a basis for PID parameter estimation. Gradient descent optimization provides a reliable basis and enhances the system's adaptability to complex working conditions; 3. By dynamically calculating the active shaft angle compensation amount through a discrete backlash inverse model, the nonlinear error caused by gear transmission backlash is compensated by feedforward compensation. Combined with adaptive PID closed-loop control, the influence of backlash nonlinearity and external disturbances on the output torque is effectively suppressed, improving the system's stability and anti-interference ability; 4. The 1D-CNN network structure is lightweight, and the network weights and PID parameters are updated online with the gradient descent method. It does not rely on a precise offline model and realizes synchronous real-time optimization of control parameters and compensation amount, ensuring rapid convergence and continuous high-precision control of the system during continuous operation. Attached Figure Description

[0100] Figure 1 This is a schematic diagram of the method flow of the present invention;

[0101] Figure 2 This is a diagram of the 1D-CNN network structure of the present invention;

[0102] Figure 3 This is a schematic diagram of the tooth gap in the present invention;

[0103] Figure 4 This is a graph showing the gap hysteresis nonlinear characteristic of the present invention. Detailed Implementation

[0104] The technical solution of the present invention will be further described below with reference to the accompanying drawings.

[0105] This invention provides a simulation control method for an electric load circuit based on 1D-CNN adaptive PID and backlash compensation, such as... Figure 1 As shown, it includes the following steps:

[0106] (1) Input the desired torque command for the load;

[0107] (2) Calculate the torque error of the load;

[0108] (3) Construct a time window vector that includes torque error, PID control quantity and actual load output;

[0109] (4) Input the time window vector into a one-dimensional convolutional neural network (1D-CNN), train it online through 1D-CNN, and output the Jacobian estimate of the system;

[0110] (5) Based on the gradient descent method and Jacobi estimation, the PID parameter adjustment is calculated to realize the online update of PID parameters;

[0111] (6) Use the updated PID parameters to solve for the control quantity;

[0112] (7) The system uses an angle sensor to collect the rotation angle of the load in real time and performs angle compensation on the motor through the inverse gap model;

[0113] (8) The system responds and executes the loading command;

[0114] (9) The actual output torque of the load is collected in real time by the torque sensor to construct a closed-loop feedback mechanism.

[0115] The desired torque of the load described in step (1) is input into the electric load simulator system as the torque command desired in the k-th control cycle. The system drives a torque motor, which in turn drives the load to rotate via a spring rod.

[0116] The error in the load torque mentioned in step (2) is determined by the system acquiring the actual output torque of the load through a torque sensor. ,calculate and The error between the two values ​​is used as the input error of the PID controller, and the specific calculation formula is as follows:

[0117]

[0118] In step (3), the system collects torque error, PID control quantity, and actual load output torque signal over a certain period of time to construct a time window vector containing all three. The specific expression is as follows:

[0119]

[0120] Step (4) involves estimating the Jacobian of the system using 1D-CNN to construct a 1D-CNN Jacobian estimator. The Jacobian of the system is estimated, where the 1D-CNN mainly consists of an 8-layer network structure, denoted as . ( ).

[0121] It is the input layer, receiving the data shown in formula (2). The matrix has a time step of N and 3 output channels, and is used for three time series: stress torque error, PID control quantity, and actual load output.

[0122] , It is a convolutional layer. Extracting primary local features from time series sequences. More advanced and abstract temporal features are extracted from the downsampled feature map. In a one-dimensional convolutional neural network, the activation output of the m-th output channel of a convolutional layer at output position n is calculated using the following formula:

[0123]

[0124] In the formula, Input the number of channels. B is the weight, B is the bias, and X is the input tensor. is the number of filters (i.e., the number of output channels), P is convolution padding, S is stride, K is kernel size, and ReLU is activation function.

[0125] This is a max pooling layer, which mainly retains the maximum value within each pooling window, thereby compressing the data volume. The calculation formula for the output of the m-th output channel at output position n is as follows:

[0126]

[0127] In the formula, Indicates the pooling window size. This indicates the pooling step size.

[0128] This is a global average pooling layer. It calculates the average value within each pooling window to further compress the data volume and aggregate global channel information. The output calculation formula for the m-th output channel of the global average pooling layer is as follows:

[0129]

[0130] in This indicates the length of the input sequence.

[0131] It is a flattening layer that only changes the shape of the tensor, integrating multi-channel data into single-channel data.

[0132] It is a fully connected layer. The formula for calculating the output at output position n of a fully connected layer is as follows:

[0133]

[0134] This is the output layer, which, through a linear activation function, ultimately outputs the Jacobian estimate. The output calculation formula is as follows:

[0135]

[0136] To ensure Accurate estimation requires real-time updates of the 1D-CNN's internal weights W. The optimization objective is defined as minimizing the instantaneous performance loss, expressed as follows:

[0137]

[0138] The weights are updated using gradient descent, with the following update rules:

[0139]

[0140] In the formula, It is the learning rate of the neural network, and The following relationship can be obtained using the chain rule:

[0141]

[0142] The final weight adjustment formula is as follows:

[0143]

[0144] In the formula, It is a positive constant coefficient.

[0145] Step (5) describes the gradient descent method for calculating the PID parameter adjustment. According to the gradient descent method, the parameter adjustment... Should follow the loss function The negative gradient direction is calculated using the following formula:

[0146]

[0147] in It's the learning rate. , It is to minimize the instantaneous performance loss, as shown in formula (8). .because If it cannot be calculated directly, it can be decomposed into a series of computable terms using the chain rule, as shown in the following formula:

[0148]

[0149] According to formula (7) right Differentiate as follows:

[0150]

[0151] according to right Differentiate as follows:

[0152]

[0153] according to right Differentiate as follows:

[0154]

[0155] In the formula, This refers to the Jacobian of the system, representing the system's sensitivity, which is the output of the 1D-CNN. To estimate Based on the specific mathematical form of the PID controller, a positional PID controller is used. Formula for time:

[0156]

[0157] according to To each , , Find the partial derivative as follows:

[0158]

[0159]

[0160]

[0161] Based on formulas (13), (14), (15), and (16), substituting formulas (18), (19), and (20) into formula (12), we can obtain the final PID parameter increment formula:

[0162]

[0163]

[0164]

[0165] In the formula, , , These are the learning rates for each parameter of the PID.

[0166] The formula for updating the PID control quantity in step (6) is as follows:

[0167]

[0168]

[0169]

[0170]

[0171] The gap inverse model described in step (7). By inserting a compensation signal at the command end through the mathematical inverse model, the nonlinear hysteresis caused by the "gap" in the mechanical transmission system can be pre-counted, allowing the actual output to accurately track the desired command without completely relying on the feedback loop for adjustment. To simplify the model, let , Since the controller samples at fixed time intervals, a discrete gap inverse model is adopted, and its mathematical expression formula is as follows:

[0172]

[0173] In the formula, The angle of rotation of the drive shaft. The angle of rotation of the driven shaft. This refers to the actual clearance width on the left side between the gears. This refers to the actual clearance width on the right side between the gears. The transmission ratio is... This represents the total clearance width between the gears. When When the driven shaft rotates to the left, it means that the driving shaft is within the gear clearance and the driving and driven shafts are not in contact; therefore, the driving shaft must rotate to the left. angle; when When the driven shaft rotates to the right, and the driving and driven shafts are not in contact, the driving shaft must rotate to the right. angle; when When the driven shaft rotates in the same direction and angle, it means that the driving and driven shafts are in contact and rotate together.

[0174] The system is executed in step (8). The system receives the compensated control command and drives the torque motor to load the servo motor.

[0175] Step (9) describes the acquisition of load data by the torque sensor. The torque sensor acquires the actual output torque signal of the load and feeds it back to the system, forming a complete closed-loop control circuit to achieve precise control of the load torque.

[0176] The following example illustrates this embodiment:

[0177] Figure 1This is a flowchart of 1D-CNN adaptive PID and gap compensation. First, the desired torque command of the load is input. The system calculates the error between the desired load torque and the actual load output torque in real time. A time window vector is constructed relating the torque error, the PID control input, and the actual load output. This time window vector is input into the 1D-CNN, which performs Jacobian estimation on the system. Then, the PID parameter adjustment is calculated using the gradient descent method, updating the PID parameters and the PID control input. Next, the torque motor is compensated using the gap inverse model. The system drives the motor to load the servo motor. The torque sensor collects the actual load output torque and finally feeds it back to the system, forming a closed loop.

[0178] Figure 2 This is a diagram of a 1D-CNN network architecture. The input time window vector contains three channels (for stress torque error, PID control input, and actual load output value, respectively). Assume each channel has a data dimension of... Then the input layer ( The input format is as follows: (high width Number of channels); First convolutional layer ( The convolutional kernel size is 5, the number of input channels is 3, the stride is 1, there is no convolution padding, the ReLU activation function is used, and the number of filters is 16. After the input data is processed by this layer, the output feature map dimension is... First max pooling layer ( The pooling window size is 2, the stride is 2, and the output dimension after processing by this layer is... ; Second convolutional layer ( The convolution kernel size is 3, the number of input channels is 16, the stride is 1, there is no convolution padding, the ReLU activation function is used, the number of filters is 32, and the output feature map dimension is [missing value]. Global pooling layer ( The pooling window size is 28, the stride is 1, and the output dimension is... ; Flattening layer ( The 32-channel data is integrated into a single channel, and the output format is as follows: Fully connected layer ( It uses the ReLU activation function, contains 10 neurons, and has an output dimension of [missing information]. Output layer ( It uses a linear activation function, contains one neuron, and the final output dimension is... Jacobi estimates.

[0179] Figure 3 This is a diagram of tooth gap. Figure 4 This is a graph showing the nonlinear characteristics of the gap hysteresis. Figure 3 and Figure 4It can be seen that v refers to the driving shaft and w refers to the driven shaft. This refers to the actual clearance width on the left side between the gears. This refers to the actual clearance width on the right side between the gears. The transmission ratio is given. When the driving shaft moves to the right (or left), it must first pass through the clearance region before contacting the driven shaft and then moving together. When the driving shaft is within the clearance region, the driven shaft remains stationary, thus generating a hysteresis nonlinear characteristic.

[0180] The above embodiments further demonstrate that the 1D-CNN adaptive PID and gap compensation of the present invention have better PID control effect. By compensating for friction and gap in the electric load simulator, the robustness and real-time performance of the electric load simulator system are improved.

Claims

1. A control method for an electric load simulator based on 1D-CNN adaptive PID and backlash compensation, characterized in that, Includes the following steps: S1, Input the load into the electric load simulator system at the... Desired torque command for each control cycle ; S2, The load is collected by the torque sensor at the first... Actual output torque per control cycle Calculate the desired torque command Compared with actual output torque Torque error between ; S3, Collect the first To the Torque error in the first control cycle, the first To the The PID control quantity of the first control cycle and the first control cycle To the The actual output torque signal of the load in each control cycle is used to construct a time window vector. , where N is the preset time window size; S4. The time window vector Input a pre-defined one-dimensional convolutional neural network (1D-CNN), train the 1D-CNN online and update the network weights in real time, and output the Jacobian estimate of the electric load simulator system at the current time. ; S5. Based on gradient descent and the Jacobian estimate. Decompose the gradient of the loss function and calculate the adjustment amounts of the scaling, integral, and derivative parameters. , , This enables adaptive online updating of PID parameters; S6. Use the updated PID parameters. , , The PID control input for the current control cycle is calculated by combining the current and historical torque errors. ; S7. The rotation angle of the driven shaft of the load is collected in real time by an angle sensor. The angle of the drive shaft of the torque motor after compensation was calculated using a discrete backlash inverse model. ; S8, the electric load simulator system, based on the PID control quantity Angle with the drive shaft It generates and executes loading instructions, driving the torque motor to load the servo motor; S9. The actual output torque of the load is collected again in real time by the torque sensor. The actual output torque Feedback is sent to step S2 to build a closed-loop feedback mechanism.

2. The method according to claim 1, characterized in that, The time window vector mentioned in step S3 The expression is: In the formula, N represents the size of the time window, i.e., the number of historical data retrieved by the 1D-CNN. For the first Torque error per control cycle For the first Torque error per control cycle For the first The PID control quantity for each control cycle. For the first PID control quantity per control cycle For the first The actual output torque of the load in each control cycle For the first The actual output torque of the load in each control cycle.

3. The method according to claim 1, characterized in that, The one-dimensional convolutional neural network (1D-CNN) described in step S4 consists of an 8-layer network structure. These 8 layers work together to perform online estimation of the system's Jacobian, including: Input layer : Receive the time window vector The time step is N, and the number of output channels is 3; First convolutional layer : Perform one-dimensional convolution operation on the output of the input layer to extract temporal primary local features; Max pooling layer Pooling is performed on the output of the first convolutional layer to compress the data volume; Second convolutional layer : Perform one-dimensional convolution operation on the output of the max pooling layer to extract high-level abstract temporal features; Global average pooling layer Global mean pooling is performed on the output of the second convolutional layer to aggregate global channel information; Flattening layer Adjust the shape of the tensor output by the global average pooling layer; Fully connected layer : Perform feature mapping on the output of the flattened layer; Output layer : Jacobian estimate of the output system .

4. The method according to claim 3, characterized in that, The computational logic of each layer of the one-dimensional convolutional neural network (1D-CNN) is as follows: Input layer The output channel has 3 channels, which are used to output three time series: stress torque error, PID control quantity, and actual load output. First convolutional layer Second convolutional layer Using the ReLU activation function, the formula for calculating the activation of the m-th output channel at output position n is: In the formula, ReLU is the activation function. For the number of channels, Here, B is the weight, X is the input tensor, P is the convolution padding, S is the stride, and K is the kernel size. Max pooling layer To compress data volume, the maximum value of each pooling window is retained. The output of the m-th output channel at output position n is calculated using the following formula: In the formula, Indicates the pooling window size. Indicates the pooling step size; Global average pooling layer The average value of each pooling window is calculated to aggregate global channel information. The output calculation formula for the m-th output channel is as follows: In the formula, The length of the input sequence; Flattening layer : Simply adjust the shape of the tensor to synthesize multi-channel data into single-channel data without changing the nature of the data; Fully connected layer Using the ReLU activation function, the output calculation formula at output position n is: Output layer Output the Jacobian estimate through a linear activation function. The calculation formula is: 。 5. The method according to claim 1, characterized in that, The internal weights W of the one-dimensional convolutional neural network (1D-CNN) are updated in real time using gradient descent. The specific update logic is as follows: Optimization objective definition: The objective is updated with the weights of minimizing the instantaneous performance loss. The instantaneous performance loss expression is: In the formula, For the first Torque error per control cycle; Weight update rule: The weights are updated using gradient descent, and the update rule is as follows: In the formula, The learning rate of the neural network. / This is the partial derivative of the performance loss with respect to the network weights; Gradient chain decomposition: / and / Proportional relationship, that is: In the formula, The Jacobian estimate is the output of the 1D-CNN. / Let be the partial derivative of the Jacobian estimate with respect to the network weights; The final weight adjustment formula is: In the formula, Positive constant coefficients For the first Network weights for each control cycle For the first Network weights for each control cycle.

6. The method according to claim 1, characterized in that, In step S5, the adjustment amount of the PID parameters is calculated using the following formula: The adjustment amount of the PID parameters is calculated using the gradient descent method. Along the loss function The negative gradient direction is calculated using the following formula: The core formula for gradient descent: In the formula, Learning rate ( ), = (1 / 2) This is due to instantaneous performance loss; Gradient chain decomposition: In the formula, / = , / = , / = , The Jacobian estimate is the output of the 1D-CNN; PID control partial derivative calculation: Using positional PID The expression for time; ; respectively , , Find the partial derivative as follows: ; ; In the formula, , , ; The final formula for parameter adjustment is obtained as follows: ; ; In the formula, , , The learning rates are the proportional parameter, integral parameter, and derivative parameter, respectively. For the first Torque error per control cycle For the first Torque error per control cycle For the first Torque error per control cycle For the first Torque error per control cycle.

7. The method according to claim 1, characterized in that, In step S6, the PID parameters are updated online according to the following formula: ; ; In the formula, , , The first The proportional, integral, and derivative parameters updated after each control cycle. , , The first The proportional, integral, and derivative parameters for each control cycle. , , These are the PID parameter adjustment values.

8. The method according to claim 7, characterized in that, In step S6, the PID control quantity is updated online according to the following formula: In the formula, For the first PID control quantity per control cycle For the first Torque error per control cycle Let be the torque error in the j-th control cycle.

9. The method according to claim 1, characterized in that, In step S7, the mathematical expression of the discrete gap inverse model is: In the formula, The angle of rotation of the drive shaft. The angle of rotation of the driven shaft. For the first The driven shaft rotation angle per control cycle The transmission ratio is... This represents the total clearance width between the gears.

10. The method according to claim 1, characterized in that, In step S9, the closed-loop feedback mechanism is specifically implemented as follows: The torque sensor collects the actual output torque of the load in real time. , will the Feedback is sent to step S2 for calculating the first... Torque error per control cycle By combining online training of 1D-CNN with real-time updating of PID parameters and dynamic compensation of gap inverse model, a closed-loop control loop is constructed.