Intelligent control system and method for servo motor
By constructing an intelligent control system for servo motors, utilizing CNN-Transformer networks and a reference disturbance observer, and combining Lyapunov stability theory, the tracking accuracy and stability problems of traditional servo motor controllers under nonlinear disturbances are solved, achieving high-precision and stable control of servo motors.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN VEINAR TECH CO LTD
- Filing Date
- 2025-08-22
- Publication Date
- 2026-04-24
AI Technical Summary
Traditional servo motor controllers struggle to effectively compensate for nonlinear disturbances and time-varying interference, leading to decreased tracking accuracy and deteriorated control performance. In particular, they are prone to estimation drift and overcompensation jitter under complex operating conditions.
A CNN-Transformer-based intelligent control method is adopted, which combines a benchmark disturbance observer and Lyapunov stability theory. Through multi-scale temporal feature tensors and an adaptive fusion mechanism, the disturbances of the servo motor are predicted and compensated in real time. The system stability is ensured by using an extended state observer and a safety constraint filter.
It achieves high-precision tracking and stable control of servo motors, effectively suppresses nonlinear disturbances, avoids estimation drift and overcompensation jitter, and improves the robustness and control accuracy of the system.
Smart Images

Figure CN120896490B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of servo motor control technology, and specifically discloses a servo motor intelligent control system and method. Background Technology
[0002] Servo motors are subject to various disturbances during actual operation, including load variations, frictional torque, external interference, and parameter perturbations. These disturbances are characterized by time-varying, nonlinear, and uncertainties. When a servo motor operates under complex conditions, especially in the nonlinear operating region or when model mismatch exists, the system is prone to estimation drift, meaning the state estimate gradually deviates from the actual value. Furthermore, when attempting to compensate for these disturbances, traditional control methods often cause overcompensation jitter, manifested as high-frequency oscillations in the control output.
[0003] Traditional linear controllers, such as PID controllers and state feedback controllers, are designed based on linearized models and exhibit significant limitations when faced with the aforementioned complex disturbances. These controllers struggle to effectively compensate for nonlinear disturbances and time-varying interferences, and cannot adapt to changes in system parameters and the effects of unmodeled dynamics. As disturbances accumulate and change, the tracking accuracy of the servo motor decreases significantly, position tracking errors increase, speed fluctuations intensify, and the control performance of the servo system is severely affected.
[0004] With the increasing demands for high-precision control, servo motor control systems urgently need an intelligent control method that can effectively cope with nonlinear disturbances, avoid estimation drift and overcompensation jitter, and improve tracking accuracy.
[0005] In view of this, this application proposes a servo motor intelligent control system and method. Summary of the Invention
[0006] To achieve the above objectives, the present invention provides a servo motor intelligent control system and method, the specific technical solution of which is as follows:
[0007] A servo motor intelligent control method, comprising:
[0008] Collect servo motor operating status data, including position, speed, current and acceleration data, and construct servo motor state vector;
[0009] Based on the theoretical parameters of the servo motor, a servo motor state observation equation is constructed as a reference disturbance observer. The servo motor state vector is input into the reference disturbance observer, and the reference disturbance observer outputs the observed state and disturbance value of the servo motor. The observation residual data is calculated based on the observed state and the servo motor state vector.
[0010] A multi-scale temporal feature tensor is constructed based on the observed residual data and the servo motor state vector. A CNN-Transformer network is then built, and the multi-scale temporal feature tensor is input into the CNN-Transformer network to predict the future perturbation of the servo motor.
[0011] The perturbation results predicted by the CNN-Transformer network are adaptively fused with the perturbation results output by the benchmark perturbation observer. The weights of the adaptive fusion are dynamically adjusted based on the prediction confidence and historical data of the benchmark perturbation observer. The fusion result is used as the perturbation compensation for the servo motor in the future period.
[0012] A constraint filter and amplitude limiter based on Lyapunov stability theory provide safety constraints for disturbance compensation.
[0013] The disturbance compensation after safety constraints is input into the servo motor control system to suppress disturbances in the servo motor in future time periods. The CNN-Transformer network is continuously optimized through an online incremental learning mechanism to continuously suppress disturbances.
[0014] Preferably, the acquisition of servo motor operating status data includes: acquiring servo motor position data using an encoder; obtaining servo motor speed data by performing a first-order differential on the position data; acquiring servo motor current data from the three-phase current of the servo motor using a Hall current sensor; converting the servo motor current data into direct-axis current and quadrature-axis current through Clarke and Park transformations; and calculating servo motor acceleration data by performing a first-order differential on the speed data.
[0015] Preferably, a state-space model of the servo motor is established based on the theoretical parameters of the servo motor, and the state-space model is constructed according to the dynamic equations of the servo motor.
[0016] The continuous-time state equation of the servo motor is constructed based on the dynamic equation of the servo motor. The continuous-time state equation is then discretized, and the zero-order hold method is used to convert the continuous-time state equation into a discrete-time state equation suitable for digital control.
[0017] Based on the discrete-time state equation, an extended state observer is designed. The extended state observer estimates the non-measurable disturbance as an extended state and defines the combination of state variables and disturbance terms as the extended state vector.
[0018] Preferably, the observation equations of the reference perturbation observer are designed, and the reference perturbation observer is constructed based on the extended state observer. The observation equation structure of the reference perturbation observer includes the estimated value of the extended state, the output measurement value, and the observer gain matrix.
[0019] The observer gain matrix is determined using a pole placement method, which places the observer's poles within a specific region to ensure its convergence properties.
[0020] The position and velocity components in the servo motor state vector are used as the measurement output input reference disturbance observer, and the current component is used as the control input reference disturbance observer. The reference disturbance observer outputs the observed state of the servo motor, which includes position estimation and velocity estimation, and simultaneously outputs the disturbance estimation value, which is used as the total disturbance currently experienced by the servo motor.
[0021] The observation residual data is calculated. The residual data is the difference between the measured value and the output value of the reference disturbance observer in the observation state. The residual vector contains position residual and velocity residual, which are used to reflect the error of the reference disturbance observer and the influence of unmodeled dynamics.
[0022] Preferably, when constructing a multi-scale temporal feature tensor, the obtained residual data and servo motor state vector are processed by temporal windowing, and multi-time scale windows of different lengths are set.
[0023] For each time scale, a corresponding feature matrix is constructed, and the feature matrix at each scale is enhanced by frequency domain transformation, including: extracting frequency domain features using discrete cosine transform, and concatenating the time domain feature matrix and the frequency domain feature matrix along the feature dimension to form an enhanced feature matrix;
[0024] Unify the temporal dimension between feature matrices of different scales, and stack the enhanced feature matrices of multiple scales to form a multi-scale temporal feature tensor;
[0025] A CNN-Transformer network is constructed to predict the perturbation of a servo motor. Multi-scale temporal feature tensors are input into the CNN-Transformer network to predict the future perturbation of the servo motor.
[0026] Preferably, the perturbation results predicted by the CNN-Transformer network are adaptively fused with the perturbation results output by the baseline perturbation observer;
[0027] An adaptive weight dynamic adjustment mechanism is designed, which integrates the weights of the CNN-Transformer network prediction results and the weights of the baseline perturbation observer output results, with the two weights satisfying the normalization constraint.
[0028] The weight calculation formula is determined based on the prediction confidence of the CNN-Transformer network, the reliability of the baseline perturbation observer, and the preset basic weight factors.
[0029] The adaptive fusion result of the perturbation predicted by the CNN-Transformer network and the perturbation output by the baseline perturbation observer is used as the perturbation compensation for the servo motor in the future time period.
[0030] Preferably, the confidence level of the prediction perturbation of the CNN-Transformer network is calculated, and the confidence level of the prediction perturbation is calculated based on the statistical characteristics of the prediction variance of the output layer of the CNN-Transformer network and the historical prediction error.
[0031] The historical performance of the benchmark perturbation observer is evaluated, and a sliding window buffer is established to store the observer output and the corresponding actual perturbation value within a certain period. The moving average absolute error of the benchmark perturbation observer is calculated. Based on the moving average absolute error, the reliability of the observer is defined using a negative exponential function.
[0032] Preferably, a constraint mechanism is constructed based on Lyapunov stability theory to perform security constraint processing on the fused perturbation compensation signal;
[0033] Establish a closed-loop Lyapunov function. For the servo motor closed-loop control system with added disturbance compensation, design the constraints for disturbance compensation, including designing constraint filters and amplitude limiters.
[0034] The constraint filter is used to limit and smooth specific frequency components of disturbance compensation, and the amplitude limiter sets the upper and lower limits of the compensation signal according to the physical limitations of the servo motor and the output capability of the controller.
[0035] Preferably, the feedforward injection mechanism for disturbance compensation incorporates the disturbance compensation signal after safety constraints into the control loop of the servo motor as a feedforward compensation term;
[0036] The corrected controller output is the sum of the feedback controller output, the original feedforward control term, and the disturbance compensation term, wherein the disturbance compensation term is injected with the opposite value to offset the predicted future disturbance effects;
[0037] We construct an online incremental learning data management mechanism and an incremental learning update strategy for the CNN-Transformer network to continuously perform adaptive perturbation suppression on the servo motor.
[0038] A servo motor intelligent control system, used to implement the aforementioned servo motor intelligent control method, includes: a data acquisition module, a reference observation module, a disturbance prediction module, an adaptive fusion module, a safety constraint module, and a disturbance suppression module;
[0039] The data acquisition module is used to collect servo motor operating status data, including position, speed, current and acceleration data, and construct a servo motor state vector.
[0040] The reference observation module constructs a servo motor state observation equation as a reference disturbance observer based on the theoretical parameters of the servo motor. The servo motor state vector is input into the reference disturbance observer, and the reference disturbance observer outputs the observed state and disturbance value of the servo motor. The observation residual data is calculated based on the observed state and the servo motor state vector.
[0041] The disturbance prediction module shown constructs a multi-scale temporal feature tensor based on the observed residual data and the servo motor state vector, and then constructs a CNN-Transformer network. The multi-scale temporal feature tensor is input into the CNN-Transformer network to predict the future disturbance of the servo motor.
[0042] The adaptive fusion module adaptively fuses the perturbation results predicted by the CNN-Transformer network with the perturbation results output by the benchmark perturbation observer. The weights of the adaptive fusion are dynamically adjusted according to the prediction confidence and the historical data of the benchmark perturbation observer, and the fusion result is used as the perturbation compensation for the servo motor in the future period.
[0043] The safety constraint module uses a constraint filter and amplitude limiter based on Lyapunov stability theory to provide safety constraints for disturbance compensation.
[0044] The disturbance suppression module inputs the disturbance compensation after safety constraints into the servo motor control system to suppress disturbances in the servo motor in future time periods. It continuously optimizes the CNN-Transformer network through an online incremental learning mechanism to continuously suppress disturbances.
[0045] The beneficial effects of this invention are as follows: By collecting multi-dimensional operating status data such as position, speed, current and acceleration, this application constructs a complete servo motor state vector, realizing comprehensive perception and accurate description of the servo motor's operating status, and providing a rich real-time information foundation for subsequent disturbance observation and prediction.
[0046] The benchmark disturbance observer constructed based on theoretical parameters in this application can estimate system disturbances and observation states in real time. By calculating the observation residual data, it effectively captures the effects of model mismatch and unmodeled dynamics. The observation residual reflects the estimation error characteristics of the observer, providing key error information input for subsequent intelligent prediction.
[0047] This application constructs a multi-scale temporal feature tensor to capture the evolution of perturbations at different time scales. The CNN-Transformer network combines the local feature extraction capability of CNN with the long-range dependency modeling capability of Transformer to achieve accurate prediction of complex nonlinear perturbations, effectively overcoming the limitation of traditional methods in handling time-varying nonlinear perturbations.
[0048] The adaptive fusion mechanism constructed in this application makes full use of the real-time performance of the benchmark observer and the predictive ability of the neural network. By dynamically adjusting the fusion weights, it automatically selects the optimal disturbance estimation strategy under different operating conditions, which not only ensures the accuracy of disturbance compensation but also improves the robustness of the system and effectively avoids the estimation drift problem.
[0049] This application ensures the stability of the closed-loop system through a safety constraint mechanism based on Lyapunov stability theory. The constraint filter eliminates high-frequency noise and unreasonable compensation components, and the amplitude limiter prevents system oscillations caused by excessive compensation signals, fundamentally solving the overcompensation jitter problem and ensuring that disturbance compensation is implemented within a safe range.
[0050] This application injects disturbance compensation after safety constraints into the control system to actively suppress future disturbances and improve the tracking accuracy of the servo motor; the online incremental learning mechanism enables the CNN-Transformer network to continuously adapt to system changes and new disturbance modes, realizes continuous optimization of control performance, and ensures control accuracy in long-term operation. Attached Figure Description
[0051] Figure 1 A flowchart of a servo motor intelligent control method provided by the present invention;
[0052] Figure 2 The flowchart for benchmark perturbation observation and residual generation provided by this invention;
[0053] Figure 3 This invention provides a flowchart for predicting future disturbances in servo motors.
[0054] Figure 4 The flowchart of the predictive perturbation adaptive fusion provided by the present invention;
[0055] Figure 5 This invention provides a structural diagram of a servo motor intelligent control system. Detailed Implementation
[0056] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0057] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention can also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0058] Secondly, the term "an embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places throughout this specification does not necessarily refer to the same embodiment, nor is it a single embodiment or an embodiment selectively excluded from other embodiments.
[0059] Example 1
[0060] Reference Figures 1 to 4 This is the first embodiment of the present invention, such as Figure 1 As shown, a servo motor intelligent control method is provided, including:
[0061] Step 1: Collect servo motor operating status data, including position, speed, current and acceleration data. Perform digital filtering and normalization on the acquired data to construct the servo motor's state vector.
[0062] A high-precision encoder is used to acquire the position data of the servo motor. The pulse signal output by the encoder is converted into position data p(t) through an orthogonal decoding circuit, where t represents the sampling time. The velocity data v(t) is obtained by performing a first-order difference on the position data p(t), i.e., v(t) = [p(t) - p(t - Δt)] / Δt, where Δt is the sampling period. The current data i(t) is acquired from the three-phase current of the servo motor through a Hall current sensor and transformed into the dq coordinate system through Clarke and Park transforms to obtain the direct-axis current i. d (t) and quadrature axis current i q (t). The acceleration data a(t) is obtained by performing a first-order difference calculation on the velocity data, i.e., a(t) = [v(t) - v(t) - Δt)] / Δt.
[0063] Since the acquired raw data packets contain high-frequency noise and measurement errors, a second-order Butterworth low-pass digital filter is used for filtering. Filtering can effectively improve the signal-to-noise ratio and reduce the interference of measurement noise on subsequent control algorithms.
[0064] To eliminate the impact of differences in the dimensions of different physical quantities on subsequent neural network training, the filtered data is normalized using a minimum-maximum normalization method, mapping each state variable to the interval [0, 1]. For example, for a servo motor with a rated speed of 3000 rpm, the speed normalization range can be set to [-3600, 3600] rpm, and the current normalization range can be set to [-1.5, 1.5] times the rated current. Normalization ensures that each state variable of the servo motor has the same importance weight, preventing certain large-value state variables from dominating the subsequent neural network training process.
[0065] Constructing the state vector of the servo motor: in These are the normalized position, velocity, direct-axis current, quadrature-axis current, and acceleration data of the servo motor. This state vector comprehensively represents the motion and electrical states of the servo motor, providing a complete information foundation for subsequent disturbance observation and prediction.
[0066] Step 1 achieves accurate quantitative characterization of the servo motor's operating status through structured data acquisition and processing; multi-sensor fusion acquisition ensures the integrity of the status information; digital filtering effectively suppresses measurement noise; and normalization eliminates the influence of dimensions. The state vector constructed in this step provides high-quality input data for the subsequent intelligent control of the servo motor.
[0067] Step 2: Based on the theoretical parameters of the servo motor, construct the servo motor state observation equation as a reference disturbance observer. Input the servo motor's state vector into the reference disturbance observer, which outputs the observed state and disturbance value of the servo motor. Then, calculate the observation residual data based on the observed state and the servo motor's state vector. (See also...) Figure 2 This is a flowchart of the baseline perturbation observation and residual generation process for this step.
[0068] A state-space model is established based on the dynamic equations of the servo motor. The mechanical motion equations of the servo motor are as follows: Where J represents the moment of inertia and ω represents the angular velocity. T represents angular acceleration. e T represents electromagnetic torque. L B represents the load torque, and d represents the viscous friction coefficient. m This represents mechanical disturbance. The electromagnetic torque equation is T. e =K t i q K t i represents the torque constant. q This represents the quadrature-axis current. Based on the mechanical equations of motion and the electromagnetic torque equations, a continuous-time state equation is constructed. Where x = [θ, ω] T For state variables, θ represents angular position, and u = i q For the control input, d is the total disturbance term, and A, B, and E are the system matrix, input matrix, and disturbance matrix, respectively.
[0069] The continuous-time state equation is discretized, and the discrete-time state equation x(t+1)=Fx(t)+Gu(t)+Hd(t) is obtained by using the zero-order hold method, where k represents the discrete-time step. For the discrete system matrix, For discrete input matrices, E is the discrete perturbation matrix, Ts The sampling period.
[0070] Based on the discrete-time state equation, an extended state observer is designed to estimate the perturbation as an extended state. The extended state vector is defined as z = [x T ,d] T The corresponding extended state equation is z(t+1)=Φz(t)+Γu(t)+Ψξ(t), where Φ is the extended system matrix, Γ is the extended input matrix, ξ(t) represents the rate of change of the disturbance, and Ψ is the disturbance change matrix. The extended state observer can transform unmeasurable disturbances into observable state variables.
[0071] A baseline perturbation observer is constructed based on the extended state observer, and the observation equation of the baseline perturbation observer is designed as follows: in Let y(t) represent the estimated value of the extended state, C be the output measurement, and L be the observer gain matrix. The observer gain matrix is determined using the pole placement method, placing the observer poles within the unit circle to ensure convergence. The position and velocity components in the state vector X(t) obtained in step 1 are used as the measurement output y(t) and input to the reference perturbation observer, while the current component is used as the control input u(k) and input to the observer.
[0072] The observation status of the servo motor is output after the reference disturbance observer is running. and disturbance estimates The observation state includes position estimation. and speed estimation Disturbance estimate This reflects the total disturbance experienced by the servo motor.
[0073] To assess the accuracy of observations, the observation residual data are calculated. in This is the output prediction value based on the observed state. The residual vector r(t) = [r...] θ (t),r ω (t)] T Includes positional residual r θ (t) and velocity residual r ω (t); These residual data reflect the errors of the baseline perturbation observer and the effects of unmodeled dynamics, providing important error feature information for subsequent neural network training.
[0074] Step 2 establishes a baseline disturbance observer, enabling real-time estimation and state observation of servo motor disturbances. By extending the state observer, the disturbance is made observable. The calculation of the observation residuals provides a quantitative indicator for evaluating the observation accuracy. At the same time, these residual data contain the unmodeled characteristics of the system, providing valuable feature information for subsequent intelligent prediction algorithms, thereby enhancing the entire servo motor control system's ability to perceive complex disturbances.
[0075] Step 3 achieves accurate prediction of future perturbations of the servo motor by constructing a multi-scale temporal feature tensor and combining it with a CNN-Transformer network architecture. (See also...) Figure 3 This is a flowchart for predicting future disturbances to the servo motor in this step.
[0076] A multi-scale temporal feature tensor is constructed, and the observation residual data r(k) obtained in step 2 and the state vector X(t) in step 1 are subjected to temporal windowing processing; three different time scale window lengths are set, namely the short-term window W. s Mid-term window W m and long-term window W l Satisfying W s <W m <W l The relationship. For example, W can be set. s For 50 sampling points, W m For 200 sampling points, W l 500 samples were taken. For each time scale, a corresponding feature matrix was constructed. Where n r n is the dimension of the residual vector. x The dimension is the state vector.
[0077] To capture the perturbation features of different frequency components, frequency domain transformation enhancement is performed on the feature matrices at each scale; discrete cosine transform is used to extract the frequency domain features f. i =DCT(M i ), where i∈{s,m,l} represents different time scales, and DCT represents the discrete cosine transform operation. The time-domain feature matrix and the frequency-domain feature matrix are concatenated along the feature dimensions to form the enhanced feature matrix E. i =[M i ,f i To unify the time dimension across different scales, the short-term and medium-term feature matrices are upsampled to align their time dimension with the long-term window. Linear interpolation is used for upsampling to maintain feature continuity. Finally, the enhanced feature matrices from the three scales are stacked to form a multi-scale temporal feature tensor. The first dimension represents the number of scales, the second dimension represents the uniform time step, and the third dimension represents the enhanced feature dimension. Multi-scale means that it can simultaneously capture the transient changes and long-term trends of disturbances.
[0078] A CNN-Transformer network is constructed to predict perturbations in a servo motor. The CNN part of the CNN-Transformer network uses three one-dimensional convolutional layers to extract local temporal patterns. For example, the first convolutional layer contains 64 kernels with a kernel size of 7 and a stride of 1; the second layer contains 128 kernels with a kernel size of 5; and the third layer contains 256 kernels with a kernel size of 3. Each convolutional layer is followed by a batch normalization layer and a ReLU activation function, and a max pooling layer with a pooling window size of 2 is added after the second and third layers.
[0079] The feature maps output by the CNN are flattened and then mapped to the input dimension d of the Transformer through a linear projection layer. model For example, the input dimension d of the Transformer model It can be set to 512 dimensions. Position encoding uses a learnable position embedding matrix. Where L is the sequence length.
[0080] The Transformer part of the CNN-Transformer network consists of six encoder layers, each composed of a multi-head self-attention mechanism and a feedforward neural network. For example, the multi-head self-attention setup uses eight attention heads, each with a dimension of d. head =d model / 8 = 64. The formula for calculating self-attention is: Where Q, K, and V represent the query, key, and value matrices, respectively. For example, the feedforward neural network contains two linear layers, with the intermediate dimension expanded to 4×d. model =2048 dimensions, using GELU as the activation function. Residual connections and layer normalization are added after each sub-layer.
[0081] The Transformer encoder output is processed by global average pooling and two fully connected layers to finally output the perturbation prediction values for the next H time steps. The prediction time domain H is set according to the prediction requirements of the servo motor control system.
[0082] The network training employs the mean squared error loss function, and the optimizer uses the Adam algorithm. The initial learning rate can be set to 0.001, and a cosine annealing strategy is used for dynamic adjustment. Dropout regularization is implemented during training, with a dropout rate of 0.1 to prevent overfitting. This CNN-Transformer hybrid architecture effectively extracts local temporal features and mutation patterns in the CNN layers, while capturing long-range dependencies and global patterns in the Transformer layers. The complementary advantages of both enable accurate perturbation prediction for servo motors. Lightweight knowledge distillation techniques can be used to compress the CNN-Transformer network model size, making it easy to deploy in servo motor control systems.
[0083] Step 3, through the construction of multi-scale temporal feature tensors and the design of a CNN-Transformer network, enables the prediction of future disturbances of the servo motor. The multi-scale feature representation fully explores the disturbance patterns at different time scales, and the joint time-frequency domain features enhance the expressive power of the features. The CNN-Transformer network combines the local feature extraction capability of convolutional neural networks with the global modeling capability of Transformers, which can accurately predict the future evolution trend of complex nonlinear disturbances, providing a reliable prediction basis for the realization of predictive disturbance compensation for servo motors and significantly improving the disturbance suppression performance of the servo motor control system.
[0084] Step 4: Adaptively fuse the perturbation results predicted by the CNN-Transformer network with the perturbation results output by the baseline perturbation observer. The weights of the adaptive fusion are dynamically adjusted based on the prediction confidence and historical data from the baseline perturbation observer. The fused result is used as the perturbation compensation for the servo motor in future time periods. (Reference) Figure 4 This is the flowchart for the predictive perturbation adaptive fusion in this step.
[0085] The confidence score of the prediction perturbation of the CNN-Transformer network is calculated. The confidence score is evaluated based on the statistical properties of the prediction variance and historical prediction error of the CNN-Transformer network's output layer. During network training, Monte Carlo dropout is employed to maintain the activation of the dropout layer during inference, performing N... m The forward propagation yields the prediction set. in Indicates the Nth m The prediction results of the second forward propagation. Calculate the prediction mean. and prediction variance Confidence level is defined based on the inverse of variance. Where α pThe range of the value is (0,1). The smaller the variance, the more stable the prediction and the higher the confidence level.
[0086] Evaluate the historical performance of the benchmark perturbation observer and establish a sliding window buffer to store the most recent W h The observer output {d} for each sampling period o (kW h +1),d o (kW h +2),...,d o (k)} and the corresponding actual disturbance value. Calculate the moving average absolute error of the observer. Where d a This represents the actual perturbation value obtained through posterior analysis. The observer reliability β is defined as a negative exponential function based on the error. o =exp(-λ e ·e o ), where λ e λ is the attenuation coefficient, controlling the sensitivity of reliability to errors. For example, λ... e It can be set to 0.5, W h It can be set to 100 sampling points. As the observation error increases, the reliability index decreases, reflecting the degradation of the observer's performance.
[0087] Design an adaptive weight dynamic adjustment mechanism. Combine weights w. p and w o The contributions of the CNN-Transformer prediction and the baseline observer, respectively, satisfy w p +w o The normalization constraint is 1. The weight calculation formula is as follows: and Where ρ p and ρ o This is a preset base weighting factor that reflects the prior confidence in the two methods. For example, ρ can be set in the initial stage. p =0.4 and ρ o =0.6. These factors can be adjusted based on long-term performance statistics as the system operates and the network learns. To prevent sudden weight changes from affecting system stability, a first-order low-pass filter is used to smooth the weights. Where γ is the smoothing coefficient, with a value range of [0.9, 0.95], to ensure the continuity of weight changes.
[0088] Adaptive fusion is performed on the disturbance prediction of the servo motor. For the disturbance compensation at the h-th time step in the future, the fusion formula is as follows: in Let h be the prediction value of the CNN-Transformer network for the next h-th step. This represents the perturbation calculated by the baseline observer based on the current state vector. A linear prediction model is used for the calculated values from the baseline observer. Where Δd o (k)=[d o (k)-d o (k-1)] / T s T represents the rate of change of the disturbance. s The sampling period is d. The fused perturbation compensation sequence is d. f =[d f (k+1),d f (k+2),...,d f (k+H)] T It combines the nonlinear prediction capabilities of neural networks with the real-time tracking capabilities of observers.
[0089] Step 4 achieves the complementary advantages of model-driven and data-driven methods through an adaptive fusion mechanism. Quantitative evaluation of prediction confidence and historical performance provides an objective basis for weight adjustment, while the dynamic weight mechanism ensures the adaptability of the fusion algorithm to different operating conditions. The fused perturbation compensation combines the predictive power of the neural network with the real-time performance of the observer, significantly improving the accuracy and robustness of perturbation estimation compared to single methods, and providing a more reliable compensation signal for subsequent perturbation suppression.
[0090] Step 5 involves constructing a constraint mechanism based on Lyapunov stability theory to perform safety constraint processing on the fused disturbance compensation signal obtained in Step 4, ensuring that the compensation signal does not compromise system stability.
[0091] Establish the closed-loop Lyapunov function, and consider the servo motor closed-loop control system after adding disturbance compensation. Its state equation is expressed as follows: Where x c Let A be the state vector of the closed-loop system. c For the closed-loop system matrix, B c Let u be the closed-loop input matrix. c For controller output, d f To integrate disturbance compensation, d act For the actual perturbation, choose a quadratic Lyapunov function. Where P is a positive definite symmetric matrix, obtained by solving the Lyapunov equations. We obtain Q, which is a preset positive definite weight matrix.
[0092] Design a constrained filter based on the Lyapunov stability condition. To ensure system stability, the derivative of the Lyapunov function must satisfy... This leads to the constraint conditions for disturbance compensation. Where δ represents the safety margin. Design the constraint filter transfer function. Where ω n Let ω be the natural frequency, ζ be the damping ratio, and s be the Laplace variable. The filter parameters are determined based on the system bandwidth and stability margin requirements. For example, for a servo system with a bandwidth of 1kHz, ω can be set... n =2π×500rad / s, ζ=0.707, achieving critical damping response.
[0093] Discretizing the constraint filter yields the difference equation y. s (k)=b0d f (k)+b1d f (k-1)+b2d f (k-2)-a1y s (k-1)-a2y s (k-2), where y s (k) represents the filtered compensation signal, where b0, b1, b2 and a1, a2 are the discrete filter coefficients, calculated using bilinear transformation or the impulse invariance method. The filtering process not only limits the high-frequency components of the compensation signal, preventing the excitation of unmodeled high-frequency dynamics in the quasi-disturbance observer, but also ensures the smoothness of the compensation signal, avoiding drastic changes in the control quantity.
[0094] The compensation signal is saturated and constrained by an amplitude limiter. Based on the physical limitations of the servo motor and the output capability of the controller, the upper and lower limits d of the compensation signal are set. max and d min Amplitude limiting is achieved using a smooth saturation function f. sat (y s )=d max ·tanh(y s / d max When y s When >0; f sat (y s )=-d min ·tanh(y s / d min When y s When ≤0. Where tanh is the hyperbolic tangent function, it has the advantage of being continuously differentiable compared to a hard-saturated function, avoiding nonlinear oscillations at the amplitude limit boundary. For example, for a servo motor with a rated torque of 10 Nm, the amplitude limit of the disturbance compensation can be set to 30% of the rated torque, i.e., d max =3Nm.
[0095] A variable rate limiting mechanism is introduced to prevent abrupt changes in the compensation signal; the rate of change limit of the compensation signal, |Δd, is defined. c (t)|=|dc (t)-d c (t-1)|≤r max ·T s , where d c (t) represents the post-constraint compensation value at the current moment, r max For the maximum rate of change, T s The sampling period is specified. When the rate of change exceeds the limit, a linear interpolation method d is used. c (t)=d c (t-1)+sign(Δd c (t))·r max ·T s The correction is performed, where sign is the sign function. This rate limit prevents the impact of step changes in the compensation signal on the system.
[0096] Step 5, through a systematic safety constraint mechanism, ensures that disturbance compensation does not threaten system stability. Lyapunov stability theory provides theoretical guarantees, constraint filters suppress high-frequency interference and ensure signal smoothness, amplitude limiters prevent actuator saturation, and variable rate limits avoid control shocks. The multi-layered safety constraint mechanism works synergistically to fully leverage the disturbance compensation effect while maintaining stable system operation, achieving an optimized balance between control performance and stability, and providing a reliable guarantee for the high-performance and safe control of servo motors.
[0097] Step 6: Input the disturbance compensation after safety constraints into the servo motor control system to suppress disturbances in the future time period of the servo motor. Continuously optimize the CNN-Transformer network through an online incremental learning mechanism to continuously suppress disturbances.
[0098] Design a feedforward injection mechanism for disturbance compensation, and input the safety-constrained disturbance compensation signal d from step 5. c (k) is added as a feedforward compensation term to the control loop of the servo motor. The controller output is corrected to u. total (k)=u fb (k)+u ff (k)-d c (k), where u total (k) represents the total control output, u fb (k) is the output of the feedback controller, u ff (k) represents the original feedforward control term. Disturbance compensation term d c (k) is injected with the opposite value to offset the predicted future disturbances. The feedforward compensation structure maintains the stability design of the original controller while enhancing the disturbance suppression capability of the servo motor system.
[0099] An online incremental learning data management mechanism is constructed, and a circular buffer is established to store the latest servo motor control system operation data, including state vector sequences, disturbance observations, prediction results, and actual disturbances. The buffer adopts a first-in, first-out (FIFO) strategy, and its capacity is set to N. buffer There are 10 samples; each sample contains an input feature tensor. and corresponding disturbance labels i0∈[1,N buffer When new data arrives, its information gain is calculated. in For new sample features, Let ||·|| be the mean of the buffer samples. F This represents the Frobenius norm. It is only when the information gain exceeds a threshold θ... g New samples are added to the buffer only at this time to avoid the impact of redundant data on learning efficiency.
[0100] An incremental learning and update strategy for the CNN-Transformer network is constructed, employing an experience replay mechanism to update network parameters by randomly sampling small batches of data from a buffer. An incremental loss function is defined. in For the prediction loss of new data, To preserve historical knowledge from loss, λ is the regularization term. new , λ old , λ reg These correspond to the weight coefficients. Historical knowledge preservation is achieved through knowledge distillation, using the network's output before the update as the soft label z. old Calculate distillation loss Where z new To prevent catastrophic forgetting of the network model after the network output is updated, a small-batch data update strategy is designed to ensure that the network retains its memory of historical patterns.
[0101] Implement an adaptive learning rate adjustment mechanism to dynamically adjust the learning rate η(n) of the CNN-Transformer network based on changes in prediction performance. η ·∈(n)), where η0 is the initial learning rate, n is the update round, ∈(n) is the average prediction error in the nth round, and β η To adjust the coefficients, the learning rate is decreased to fine-tune the settings when the prediction error decreases; conversely, the learning rate is temporarily increased to accelerate adaptation when a new perturbation pattern is detected that causes an increase in error. The network parameters are updated using momentum stochastic gradient descent. Where θ is the network parameter and v is the momentum coefficient. The loss gradient is used. For example, the initial learning rate η0 can be set to 0.0001, and the momentum coefficient v can be set to 0.9.
[0102] Step 6 achieves active suppression of servo motor disturbances through feedforward compensation injection and multi-scale compensation strategies; the online incremental learning mechanism enables the CNN-Transformer network to continuously adapt to new disturbance patterns, and the knowledge distillation technique avoids the forgetting problem. The entire step realizes closed-loop optimization of disturbance compensation, enabling the servo motor control system to have adaptive evolution capabilities, continuously improve disturbance suppression performance in long-term operation, and significantly improve the robustness and control accuracy of the servo motor control system.
[0103] Example 2
[0104] Reference Figure 5 This is the second embodiment of the present invention, which provides a servo motor intelligent control system.
[0105] The system includes: a data acquisition module, a benchmark observation module, a disturbance prediction module, an adaptive fusion module, a security constraint module, and a disturbance suppression module.
[0106] The data acquisition module is used to collect servo motor operating status data, including position, speed, current and acceleration data, and to construct a servo motor state vector.
[0107] The reference observation module constructs a servo motor state observation equation based on the theoretical parameters of the servo motor as a reference disturbance observer. The servo motor state vector is input into the reference disturbance observer, which outputs the observed state and disturbance value of the servo motor. The observation residual data is calculated based on the observed state and the servo motor state vector.
[0108] The disturbance prediction module shown constructs a multi-scale temporal feature tensor based on the observed residual data and the servo motor state vector, and then constructs a CNN-Transformer network. The multi-scale temporal feature tensor is input into the CNN-Transformer network to predict the future disturbance of the servo motor.
[0109] The adaptive fusion module adaptively fuses the perturbation results predicted by the CNN-Transformer network with the perturbation results output by the benchmark perturbation observer. The weights of the adaptive fusion are dynamically adjusted based on the prediction confidence and historical data of the benchmark perturbation observer, and the fusion result is used as the perturbation compensation for the servo motor in the future period.
[0110] The safety constraint module uses a constraint filter and amplitude limiter based on Lyapunov stability theory to provide safety constraints for disturbance compensation.
[0111] The disturbance suppression module inputs the disturbance compensation after safety constraints into the servo motor control system to suppress disturbances in the servo motor in future time periods. It continuously optimizes the CNN-Transformer network through an online incremental learning mechanism to continuously suppress disturbances.
[0112] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the displayed or discussed mutual couplings or direct couplings or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0113] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments under the guidance of the present invention without departing from the spirit and scope of the claims. All of these variations are within the protection scope of the present invention.
Claims
1. A servo motor intelligent control method, characterized in that, include: Collect servo motor operating status data, including position, speed, current and acceleration data, and construct servo motor state vector; Based on the theoretical parameters of the servo motor, a servo motor state observation equation is constructed as a reference disturbance observer. The servo motor state vector is input into the reference disturbance observer, and the reference disturbance observer outputs the observed state and disturbance value of the servo motor. The observation residual data is calculated based on the observed state and the servo motor state vector. A multi-scale temporal feature tensor is constructed based on the observed residual data and the servo motor state vector. A CNN-Transformer network is then built, and the multi-scale temporal feature tensor is input into the CNN-Transformer network to predict the future perturbation of the servo motor. The perturbation results predicted by the CNN-Transformer network are adaptively fused with the perturbation results output by the benchmark perturbation observer. The weights of the adaptive fusion are dynamically adjusted based on the prediction confidence and historical data of the benchmark perturbation observer. The fusion result is used as the perturbation compensation for the servo motor in the future period. A constraint filter and amplitude limiter based on Lyapunov stability theory provide safety constraints for disturbance compensation. The disturbance compensation after safety constraints is input into the servo motor control system to suppress disturbances in the servo motor in future time periods. The CNN-Transformer network is continuously optimized through an online incremental learning mechanism to continuously suppress disturbances.
2. The intelligent control method for a servo motor according to claim 1, characterized in that, The acquisition of servo motor operating status data includes: acquiring servo motor position data using an encoder, obtaining servo motor speed data by performing first-order differential on the position data, acquiring servo motor current data from the three-phase current of the servo motor using a Hall current sensor, converting the servo motor current data into direct-axis current and quadrature-axis current through Clarke and Park transformations, and obtaining servo motor acceleration data by performing first-order differential on the speed data.
3. The intelligent control method for a servo motor according to claim 2, characterized in that, Based on the theoretical parameters of the servo motor, a state-space model of the servo motor is established, which is constructed according to the dynamic equation of the servo motor. The continuous-time state equation of the servo motor is constructed based on the dynamic equation of the servo motor. The continuous-time state equation is then discretized, and the zero-order hold method is used to convert the continuous-time state equation into a discrete-time state equation suitable for digital control. Based on the discrete-time state equation, an extended state observer is designed. The extended state observer estimates the non-measurable disturbance as an extended state and defines the combination of state variables and disturbance terms as the extended state vector.
4. The intelligent control method for a servo motor according to claim 3, characterized in that, The observation equations of the benchmark perturbation observer are designed. The benchmark perturbation observer is constructed based on the extended state observer. The observation equation structure of the benchmark perturbation observer includes the estimated value of the extended state, the output measurement value, and the observer gain matrix. The observer gain matrix is determined using a pole placement method, which places the observer's poles within a specific region to ensure its convergence properties. The position and velocity components in the servo motor state vector are used as the measurement output input reference disturbance observer, and the current component is used as the control input reference disturbance observer. The reference disturbance observer outputs the observed state of the servo motor, which includes position estimation and velocity estimation, and simultaneously outputs the disturbance estimation value, which is used as the total disturbance currently experienced by the servo motor. Calculate the observation residual data, which is the difference between the measured value and the output value of the reference disturbance observer based on the observation state. The residual vector contains position residual and velocity residual, which are used to reflect the error of the reference disturbance observer and the influence of unmodeled dynamics.
5. The intelligent control method for a servo motor according to claim 4, characterized in that, When constructing a multi-scale temporal feature tensor, the obtained residual data and servo motor state vector are processed by temporal windowing, and multi-time scale windows of different lengths are set. For each time scale, a corresponding feature matrix is constructed, and the feature matrix at each scale is enhanced by frequency domain transformation, including: extracting frequency domain features using discrete cosine transform, and concatenating the time domain feature matrix and the frequency domain feature matrix along the feature dimension to form an enhanced feature matrix; Unify the temporal dimension between feature matrices of different scales, and stack the enhanced feature matrices of multiple scales to form a multi-scale temporal feature tensor; A CNN-Transformer network is constructed to predict the perturbation of a servo motor. Multi-scale temporal feature tensors are input into the CNN-Transformer network to predict the future perturbation of the servo motor.
6. The intelligent control method for a servo motor according to claim 5, characterized in that, Adaptively fuse the perturbation results predicted by the CNN-Transformer network with the perturbation results output by the baseline perturbation observer; An adaptive weight dynamic adjustment mechanism is designed, which integrates the weights of the CNN-Transformer network prediction results and the weights of the baseline perturbation observer output results, with the two weights satisfying the normalization constraint. The weight calculation formula is determined based on the prediction confidence of the CNN-Transformer network, the reliability of the baseline perturbation observer, and the preset basic weight factors. The adaptive fusion result of the perturbation predicted by the CNN-Transformer network and the perturbation output by the baseline perturbation observer is used as the perturbation compensation for the servo motor in the future time period.
7. The intelligent control method for a servo motor according to claim 6, characterized in that, The confidence score of the prediction perturbation of the CNN-Transformer network is calculated based on the statistical characteristics of the prediction variance of the output layer of the CNN-Transformer network and the historical prediction error. Evaluate the historical performance of the benchmark perturbation observer, establish a sliding window buffer to store the observer output and the corresponding actual perturbation value within a certain period, and calculate the moving average absolute error of the benchmark perturbation observer. The reliability of the observer is defined using a negative exponential function based on the moving average absolute error.
8. The intelligent control method for a servo motor according to claim 7, characterized in that, A constraint mechanism is constructed based on Lyapunov stability theory to perform security constraint processing on the fused disturbance compensation signal; Establish the closed-loop Lyapunov function. For the servo motor closed-loop control system with added disturbance compensation, design the disturbance compensation constraints, including designing the constraint filter and amplitude limiter. The constraint filter is used to limit and smooth specific frequency components of disturbance compensation, and the amplitude limiter sets the upper and lower limits of the compensation signal according to the physical limitations of the servo motor and the output capability of the controller.
9. The intelligent control method for a servo motor according to claim 8, characterized in that, Design a feedforward injection mechanism for disturbance compensation, and add the disturbance compensation signal after safety constraints as a feedforward compensation term into the control loop of the servo motor; The corrected controller output is the sum of the feedback controller output, the original feedforward control term, and the disturbance compensation term, wherein the disturbance compensation term is injected with the opposite value to offset the predicted future disturbance effects; We construct an online incremental learning data management mechanism and an incremental learning update strategy for the CNN-Transformer network to continuously perform adaptive perturbation suppression on the servo motor.
10. A servo motor intelligent control system, used to implement the servo motor intelligent control method according to any one of claims 1 to 9, characterized in that, include: The system includes a data acquisition module, a benchmark observation module, a disturbance prediction module, an adaptive fusion module, a security constraint module, and a disturbance suppression module. The data acquisition module is used to collect servo motor operating status data, including position, speed, current and acceleration data, and construct a servo motor state vector. The reference observation module constructs a servo motor state observation equation as a reference disturbance observer based on the theoretical parameters of the servo motor. The servo motor state vector is input into the reference disturbance observer, and the reference disturbance observer outputs the observed state and disturbance value of the servo motor. The observation residual data is calculated based on the observed state and the servo motor state vector. The disturbance prediction module shown constructs a multi-scale temporal feature tensor based on the observed residual data and the servo motor state vector, and then constructs a CNN-Transformer network. The multi-scale temporal feature tensor is input into the CNN-Transformer network to predict the future disturbance of the servo motor. The adaptive fusion module adaptively fuses the perturbation results predicted by the CNN-Transformer network with the perturbation results output by the benchmark perturbation observer. The weights of the adaptive fusion are dynamically adjusted according to the prediction confidence and the historical data of the benchmark perturbation observer, and the fusion result is used as the perturbation compensation for the servo motor in the future period. The safety constraint module uses a constraint filter and amplitude limiter based on Lyapunov stability theory to provide safety constraints for disturbance compensation. The disturbance suppression module inputs the disturbance compensation after safety constraints into the servo motor control system to suppress disturbances in the servo motor in future time periods. It continuously optimizes the CNN-Transformer network through an online incremental learning mechanism to continuously suppress disturbances.
Citation Information
Patent Citations
Nonlinear control method for motor system
CN116054671A
Active-disturbance-rejection control optimization system and method for stepping motor servo system
CN120320643A