Servo motor multi-cycle prediction compensation method based on M3 kernel
By employing short-cycle and long-cycle prediction models with differentiated accuracy in parallel processing of disturbances in servo motor control, and combining confidence dynamic evaluation and weighted fusion, the computational bottleneck of multi-cycle prediction compensation on resource-constrained platforms is solved, achieving efficient servo motor control and improving the system's dynamic response speed and tracking accuracy.
Patent Information
- Application Number
- CN202511150057.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-18
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2045-08-18
AI Technical Summary
Existing servo motor control solutions struggle to achieve efficient multi-cycle prediction compensation on resource-constrained platforms such as the M3 kernel, resulting in high computational complexity, decreased prediction accuracy, and difficulty in adapting to dynamic system changes and additional errors introduced by model mismatch.
Disturbances are processed in parallel using short-cycle and long-cycle prediction models with differentiated accuracy. By acquiring real-time operating parameters, short-cycle and long-cycle prediction compensation amounts are generated. Dynamic weights are calculated by combining instantaneous confidence and trend confidence, thereby realizing multi-timescale prediction compensation for servo motors.
It significantly improves the dynamic response speed and tracking accuracy of the servo system, enabling it to quickly respond to sudden disturbances and accurately capture the trend of slowly changing disturbances, thereby enhancing the system's adaptability and robustness and ensuring efficient prediction compensation on the resource-constrained M3 core.
Smart Images

Figure CN120855973A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial automation control technology, and in particular to a multi-cycle predictive compensation method for servo motors based on the M3 kernel. Background Technology
[0002] Currently, servo motors are core actuators in industrial automation equipment, and the accuracy of their position and speed control, as well as their dynamic response speed, are crucial. In microcontroller-based embedded servo drive systems, efficient control algorithms are needed to cope with the effects of load disturbances, parameter changes, and other factors in order to achieve precise tracking.
[0003] Existing servo motor control schemes often employ proportional-integral-derivative (PID) control combined with feedforward compensation. To improve performance, some schemes introduce predictive control concepts, such as compensating based on predicting future short-cycle states using a motor model, or predicting disturbance trends using historical data. These schemes either focus on predictions at a single time scale or face challenges in computationally complexity and real-time execution on resource-constrained microcontrollers when attempting to combine multi-cycle predictions. Some schemes attempt to combine different prediction results, but these typically use fixed weights or simple rules, lacking dynamic evaluation and adaptive adjustment mechanisms for the reliability of the prediction results themselves.
[0004] Current technologies face the following limitations when applied to resource-constrained platforms such as the M3 kernel: achieving sufficiently deep multi-period high-precision prediction often exceeds the processor's real-time computing capabilities, leading to extended control cycles or decreased prediction accuracy; simply superimposing prediction results from different periods or using fixed-weight fusion is difficult to adapt to dynamic changes in the system and differences in the real-time reliability of different prediction models, and is prone to introducing additional errors or lags when operating conditions change abruptly or models mismatch; existing methods struggle to efficiently and synergistically leverage the dual advantages of short-period rapid response and long-period trend suppression under limited hardware resource constraints. Summary of the Invention
[0005] To address the aforementioned issues, this invention provides a multi-cycle prediction compensation method for servo motors based on the M3 kernel. It employs parallel processing of disturbances by constructing short-cycle and long-cycle prediction models with differentiated accuracy. This method can efficiently achieve collaborative optimization of multi-timescale prediction compensation on the resource-constrained M3 kernel platform, significantly improving the dynamic response speed and tracking accuracy of the servo system.
[0006] The above objectives can be achieved through the following approach:
[0007] A multi-cycle predictive compensation method for servo motors based on the M3 kernel includes: acquiring real-time operating parameters of the servo motor and compensating for rapid millisecond-level changes in the real-time operation of the servo motor to generate short-cycle predictive compensation amounts; generating long-cycle predictive compensation amounts by analyzing the long-cycle operating patterns of the servo motor; generating instantaneous confidence scores based on the real-time operating parameters and the short-cycle predictive compensation amounts, and generating trend confidence scores by combining the long-cycle predictive compensation amounts; calculating dynamic weights based on the instantaneous confidence scores and the trend confidence scores; fusing the short-cycle predictive compensation amounts and the long-cycle predictive compensation amounts based on the dynamic weights to generate a final compensation command; and superimposing the final compensation command onto the output of the servo motor control loop.
[0008] Optionally, generating the short-cycle predicted compensation amount includes: obtaining the current loop feedback value, speed loop feedback value, and position command change rate of the servo motor to obtain real-time operating parameters; constructing a simplified motor equation to characterize the short-cycle predicted compensation amount parameters using preset weighting coefficients and a first input feature; extracting features from the real-time operating parameters to generate a first input feature; and calculating the short-cycle predicted compensation amount with a speed feedforward component for a preset first cycle using the weighting coefficients, the first input feature, and the simplified motor equation.
[0009] Optionally, generating the long-cycle predicted compensation amount includes: constructing a regression equation to characterize the predicted position deviation trend parameters using the second input features, sliding window size parameters, position deviation sequence parameters, and time series parameters; obtaining the current sliding window size parameters, position deviation sequence parameters, and time series parameters, and calculating the servo motor load inertia change parameters and friction trend prediction values as the second input features; calculating the predicted position deviation trend using the second input features, the sliding window size parameters, the position deviation sequence parameters, the time series parameters, and the regression equation; and performing linear calculations based on the predicted position deviation trend to generate a long-cycle predicted compensation amount for a preset second cycle; wherein the first cycle is shorter than the second cycle.
[0010] Optionally, generating instantaneous confidence includes: reading the estimated value of the velocity feedforward component and obtaining the actual position value within the current cycle through the encoder interface; comparing the deviation between the estimated value of the velocity feedforward component and the actual position value to obtain the deviation magnitude; performing joint analysis based on the deviation magnitude and the rate of change to generate an instantaneous matching degree index; and performing interval mapping on the instantaneous matching degree index to generate instantaneous confidence.
[0011] Optionally, the generation of trend confidence includes: the cumulative error of the long-cycle prediction compensation amount within the previous multiple control cycles; obtaining the acceleration value, determining whether the acceleration value is within the effective range, and generating an acceleration state validity flag; and generating trend confidence by combining the cumulative error and the acceleration state validity flag.
[0012] Optionally, the calculation of dynamic weights includes: acquiring position command signals issued by the motor, and calculating system dynamic indicators based on the position command signals; calculating short-cycle weights when the instantaneous confidence level is higher than a preset first threshold and the system dynamic indicators are lower than a preset dynamic threshold; calculating long-cycle weights when the instantaneous confidence level is lower than a preset second threshold and the trend confidence level is higher than a preset third threshold; and normalizing the short-cycle weights and the long-cycle weights to generate dynamic weights.
[0013] Optionally, the method further includes: calculating the moment of inertia by combining the weighting coefficient, the current loop feedback value, and the speed loop feedback value; when the instantaneous confidence level is detected to be continuously decreasing and the trend confidence level is simultaneously increasing, correcting the preset friction-temperature mapping table and the moment of inertia to obtain the corrected mapping table and parameters; and updating the simplified motor equation and the regression equation according to the corrected mapping table and parameters.
[0014] Optionally, generating the final compensation instruction includes: decomposing the long-cycle predicted compensation amount into a current-cycle component along the time axis; and using the dynamic weight to perform a weighted summation of the short-cycle predicted compensation amount and the current-cycle component to generate the final compensation instruction.
[0015] Optionally, the step of superimposing the final compensation command onto the output of the servo motor control loop includes: synchronizing and superimposing the final compensation command with the original output command of the servo motor control loop in real time to obtain the superimposed command; and performing amplitude limiting processing on the superimposed command through a digital signal processor and outputting it to the output of the servo motor control loop.
[0016] Based on the same inventive concept, this invention also provides a multi-cycle predictive compensation system for servo motors based on the M3 kernel. The system includes: a short-cycle prediction module for acquiring real-time operating parameters of the servo motor and compensating for rapid millisecond-level changes in the servo motor's real-time operation to generate a short-cycle predictive compensation amount; a long-cycle prediction module for generating a long-cycle predictive compensation amount by analyzing the long-cycle operating patterns of the servo motor; a confidence calculation module for generating an instantaneous confidence level based on the real-time operating parameters and the short-cycle predictive compensation amount, and calculating a trend confidence level by combining the long-cycle predictive compensation amount; a weight calculation module for calculating dynamic weights based on the instantaneous confidence level and the trend confidence level; a dynamic compensation module for fusing the short-cycle predictive compensation amount and the long-cycle predictive compensation amount based on the dynamic weights to generate a final compensation instruction; and an instruction execution module for superimposing the final compensation instruction onto the output of the servo motor control loop.
[0017] Compared with the prior art, the present invention has the following advantages:
[0018] 1. The beneficial effects provided by this invention are that, by innovatively integrating dual prediction models, dynamic confidence assessment, and a weighted fusion mechanism, efficient and accurate multi-cycle prediction compensation for servo motors is achieved on the resource-constrained M3 core. Simultaneously, it effectively overcomes the bottleneck of simultaneously achieving high-precision short-cycle prediction and effective long-cycle trend prediction on the M3 core with limited computing power and memory resources. Through decoupled execution of the differentiated prediction model, processor resources are fully utilized, significantly expanding the time dimension of prediction compensation while ensuring real-time performance, thus resolving the contradiction between prediction depth and computing resources.
[0019] 2. This invention significantly improves the overall control performance of servo systems under complex and variable operating conditions. The short-cycle prediction model responds quickly to sudden disturbances, effectively suppressing overshoot and response lag; the long-cycle prediction model accurately captures the trend of slowly changing disturbances, continuously improving steady-state tracking accuracy; the synergistic effect of the two models enables the system to possess both speed and stability.
[0020] 3. This invention achieves intelligent optimization of the compensation strategy by introducing an adaptive confidence assessment mechanism based on real-time operating parameters and historical model performance, combined with the dynamic state of the system. Dynamic weight allocation ensures that the system can automatically adjust its dependence on short-cycle rapid response and long-cycle trend suppression when the reliability of model prediction changes, greatly enhancing the system's adaptability and robustness and avoiding compensation inaccuracies.
[0021] 4. The overall design of this invention closely matches the hardware characteristics of the M3 core. Through task parallelism, interrupt priority optimization, and algorithm lightweighting, it ensures that all prediction, evaluation, and fusion processes are completed efficiently within a single strict control cycle, providing a reliable guarantee for achieving high-performance servo control on low-cost, resource-constrained embedded platforms.
[0022] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures pointed out in the description, claims and drawings. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0024] Figure 1 This is a flowchart illustrating a multi-cycle prediction compensation method for servo motors based on the M3 kernel, according to an embodiment of the present invention.
[0025] Figure 2 This is a comparison chart of the short-cycle prediction compensation effect of an embodiment of the present invention.
[0026] Figure 3 This is a long-term trend prediction chart according to an embodiment of the present invention.
[0027] Figure 4 This is a confidence dynamic evaluation graph according to an embodiment of the present invention.
[0028] Figure 5 This is an adaptive weight allocation diagram according to an embodiment of the present invention.
[0029] Figure 6 This is a schematic diagram of the structure of a servo motor multi-cycle prediction compensation system based on the M3 kernel according to an embodiment of the present invention. Detailed Implementation
[0030] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0031] Reference Figure 1 One embodiment of the present invention proposes a multi-cycle prediction compensation method for servo motors based on the M3 kernel. It adopts a method of constructing short-cycle and long-cycle prediction models with differentiated accuracy to process disturbances in parallel. It can efficiently achieve collaborative optimization of multi-time-scale prediction compensation on the resource-constrained M3 kernel platform, and significantly improve the dynamic response speed and tracking accuracy of the servo system.
[0032] The method described in this embodiment specifically includes:
[0033] The system acquires the real-time operating parameters of the servo motor and compensates for the rapid changes in the servo motor at the millisecond level during real-time operation, generating short-cycle predictive compensation amounts.
[0034] By analyzing the long-cycle operation pattern of the servo motor, a long-cycle predictive compensation amount is generated.
[0035] Instantaneous confidence is generated by analyzing and calculating the real-time operating parameters and the short-cycle prediction compensation amount, and trend confidence is generated by calculating the long-cycle prediction compensation amount.
[0036] Calculate the dynamic weights based on the instantaneous confidence level and the trend confidence level;
[0037] The short-cycle prediction compensation amount and the long-cycle prediction compensation amount are fused based on the dynamic weight to generate the final compensation instruction.
[0038] The final compensation command is superimposed on the output of the servo motor control loop.
[0039] Specifically, this method first acquires the real-time operating parameters of the servo motor, including current, speed, or position signals, which are updated at millisecond-level frequencies. For the rapidly changing real-time operating state of the servo motor, short-cycle predictive compensation is generated through high-frequency sampling and filtering to offset instantaneous disturbances. Simultaneously, by analyzing historical data from long-term servo motor operation, periodic or trend characteristics are extracted to generate long-cycle predictive compensation to correct slow-varying errors. Next, instantaneous confidence is calculated based on the matching degree between the real-time operating parameters and the short-cycle predictive compensation, reflecting the reliability of the short-cycle compensation; trend confidence is calculated based on the stability of the long-cycle predictive compensation, reflecting the credibility of the long-cycle compensation. Dynamic weights are calculated based on the ratio of instantaneous confidence to trend confidence, and these dynamic weights are used to adjust the fusion ratio of the short-cycle and long-cycle predictive compensation. Finally, the short-cycle and long-cycle predictive compensation are weighted and summed according to the dynamic weights to generate a final compensation command, which is then superimposed on the output of the servo motor control loop to achieve dynamic compensation for motor operating errors. By using a dynamic weight adaptive adjustment compensation strategy, it can quickly respond to instantaneous disturbances and gradually correct long-term deviations, significantly improving the overall control accuracy and stability of the servo system.
[0040] Optionally, the generation of short-period prediction compensation includes:
[0041] Obtain the current loop feedback value, speed loop feedback value, and position command change rate of the servo motor to obtain real-time operating parameters;
[0042] Using preset weighting coefficients and first input features, a simplified motor equation is constructed to characterize the parameters of short-cycle predicted compensation.
[0043] Feature extraction is performed on the real-time operating parameters to generate the first input feature;
[0044] Using the weighting coefficients, the first input feature, and the simplified motor equation, the short-cycle prediction compensation amount with a speed feedforward component for the preset first cycle is calculated.
[0045] Specifically, firstly, the three-phase current signal is acquired in real time through the analog-to-digital converter of the M3 core, and then converted into a current loop feedback value with current components in a two-phase stationary coordinate system via Clarke transform. Simultaneously, the servo motor rotor position is obtained through the encoder interface, and the real-time angular velocity in the speed loop feedback value is calculated. Combined with the position command issued by the host computer, the rate of change of the position command is calculated. For calculating the rate of change of the position command Δr, we have:
[0046]
[0047] Where r(k) is the value of the position command signal in the current control cycle k, r(k-1) is the position command in the previous cycle, and Δt is the control cycle time. The current component, angular velocity, and rate of change of the position command are used as the first input feature set to obtain preset weighting coefficients such as torque coefficient, damping coefficient, load torque, speed feedforward proportional coefficient, and speed feedforward integral coefficient. These weighting coefficients are obtained by performing offline system identification experiments on the motor and fitting parameters such as torque coefficient and damping coefficient using the least squares method; the load torque can be calculated by loading different known loads and measuring the steady-state current; the speed feedforward proportional coefficient and speed feedforward integral coefficient are optimized and adjusted through step response testing to minimize tracking error. This feature set and related weighting coefficients are input into a preset simplified motor equation model, which includes the electromagnetic torque equation. For calculating the electromagnetic torque T... e ,have:
[0048] T e =K t ·I q ,
[0049] Among them, K t I is the torque coefficient. q Let J be the quadrature-axis current obtained through the Parker transformation. The model also includes the equations of motion for calculating the moment of inertia J:
[0050]
[0051] in, T is the net torque required for angular acceleration. l Let B be the load torque, B be the damping coefficient, and ω be the motor angular velocity. A three-step iterative calculation is performed within a single control cycle Δt: the first step calculates the current torque based on the current current and position; the second step predicts the angular velocity for the next cycle based on the motion equations. For calculating the angular velocity ω(k+1) for the next cycle, we have:
[0052]
[0053] Among them, T e (k) represents the current electromagnetic torque, T l (k) is the estimated value of the current load torque, and B·ω(k) is the damping term, which is the resistance proportional to the speed. The ratio of the discrete time step to the moment of inertia determines the acceleration response speed. The third step generates the velocity feedforward compensation amount based on the position command change rate Δr and the predicted velocity ω(k+1). The velocity feedforward compensation amount V is calculated as follows: ff ,have:
[0054] V ff =K vp ·[r(k+1)-θ(k)]+Kvi ·∫[r(k+1)-θ(k)]dt,
[0055] Among them, K vp K is the speed feedforward proportional coefficient. vi Here, r(k+1) is the speed feedforward integral coefficient, r(k+1) is the position command for the next cycle, θ(k) is the current rotor position, and ∫dt is the integral operation. The final output is the short-cycle predicted compensation for the first preset cycle, i.e., 1-2 control cycles. For calculating the short-cycle predicted compensation Comp... short ,have:
[0056] Comp short =[V ff Te comp ],
[0057] Among them, Te comp This is the compensation torque calculated based on the torque balance equation. For example... Figure 2 As shown in subgraph (a), the horizontal axis represents time, and the vertical axis represents angular velocity. The solid line represents the actual speed, reflecting the true rotational speed change of the servo motor on a millisecond-level time scale. The dashed line represents the predicted speed, which is the predicted value calculated based on the simplified motor equations for the next 1-2 control cycles. This is used for rapid response to sudden disturbances, and the accuracy of the short-cycle model is verified by comparing the differences between the two. In subgraph (b), the horizontal axis is the same as in (a), and the vertical axis represents the compensation amount of angular velocity. The curve is the compensation amount curve, representing the deviation between the predicted value and the actual value, which is directly superimposed on the output of the control loop.
[0058] For example, when the servo motor executes a step position command, the encoder provides real-time feedback that the position increases from 0° to 30° within 0.1ms, and the calculated position command change rate Δr = 300° / s. Simultaneously, the U-phase current of 1.2A and the V-phase current of 0.6A are collected, which are then transformed by Clarke to obtain 0.9A and 0.5A respectively. Combined with the rotor position of 45°, a Parker transformation yields 1.02A. Substituting these values into the simplified motor equations: with a torque coefficient Kt = 0.5N·m / A, the current torque Te = 0.51N·m is calculated; based on the moment of inertia J = 0.001kg·m... 2 The load torque T in the previous cycle l =0.3 N·m, predict the next cycle angular velocity ω(k+1) = 210 rad / s. Based on the deviation between the commanded position r(k+1) = 35° and the current position of 30°, K is used. vp =15, K vi =0.5 Generation speed feedforward V ff =15×(5°)+0.5×∫(5°)d t =75° + 2.5° = 77.5°. Final output: Comp shortIt includes a speed feedforward command of 77.5° and a compensation torque of 0.12 N·m. Through real-time current conversion and motion equation iteration, it accurately captures the dynamic response process of the motor within 1 ms to generate the compensation amount, effectively solving the overshoot problem of step response caused by sampling delay in traditional PID controllers. This allows the motor to maintain smooth acceleration under sudden command changes and eliminates the jitter caused by mechanical transmission backlash.
[0059] Optionally, the generation of long-period prediction compensation includes:
[0060] Using the second input feature, sliding window size parameter, position deviation sequence parameter, and time series parameter, a regression equation is constructed to characterize the predicted position deviation trend parameter;
[0061] Obtain the current sliding window size parameter, position deviation sequence parameter, and time series parameter, and calculate the servo motor load inertia change parameter and friction force trend prediction value as the second input feature;
[0062] Using the second input feature, the sliding window size parameter, the position deviation sequence parameter, the time series parameter, and the regression equation, the predicted position deviation trend is calculated.
[0063] Linear calculations are performed based on the predicted position deviation trend to generate a preset long-term prediction compensation amount for the second period.
[0064] The first period is shorter than the second period.
[0065] Specifically, the position command sequence and corresponding actual position feedback sequence from multiple past control cycles are continuously acquired through the M3 core direct memory access controller to obtain the sliding window size, calculate the load inertia change parameter, and calculate the normalized load inertia change parameter J. var ,have:
[0066]
[0067] Where M is the sliding window size, Δt is the time step of a single control cycle, and R... hist Given the position command sequence of the past M control cycles, θ hist The actual position feedback sequence is defined as follows: `max` represents the maximum value of the sequence within parentheses, and `min` represents the minimum value of the sequence within parentheses. The motor winding temperature and current harmonic distortion rate are recorded synchronously, and the frictional force variation trend is obtained based on a preset friction-temperature mapping table. The friction-temperature mapping table is established by controlling the motor to operate at different temperatures in a temperature control chamber and measuring its frictional torque, and then fitting the data. The predicted frictional force trend value Tf is calculated based on the combined temperature and current disturbances. trend ,have:
[0068] Tf trend =F map (Temp)+ΔTf,
[0069] Among them, F map (Temp) is a preset friction-temperature mapping table, and ΔTf is the additional frictional disturbance component caused by current harmonic distortion. J var With Tf trend The second input feature group is formed. This feature group is input into a preset trend extrapolation model. The trend extrapolation model is established by collecting position deviation sequences and time series data from the long-term operation of the servo motor, training the model using a sliding window linear regression algorithm, and fitting the parameters (slope and intercept) of the regression equation using historical data. This model uses a sliding window linear regression algorithm to establish a regression equation between position deviation and time variables, obtain time series parameters, and calculate the regression equation by combining the sliding window size parameter, position deviation sequence parameters, and time series parameters. The sliding window size is determined through offline analysis, and the position deviation sequence and time series are updated in real time by the historical data cache. Data within the window is stored in order of timestamp. The predicted position deviation trend E is calculated in the regression equation. pred ,have:
[0070]
[0071] Where 'a' represents the regression slope, reflecting the trend of the deviation over time, and 'b' represents the regression intercept, E hist T represents the positional deviation sequence. hist Let t represent the time series. A moving average filter is applied to the regression results to extract low-frequency components. Based on the mechanical equations, the long-term predicted compensation amount for the next preset second period (3-N control periods) is calculated. The calculation of the long-term predicted compensation amount Comp... long ,have:
[0072] Comp long =J var ·a+Tf trend ,
[0073] The above calculation formula yields the long-term predicted compensation amount for future cycles. For example... Figure 3 As shown, in subgraph (a), the horizontal axis represents the number of control cycles, and the vertical axis represents the instantaneous confidence level. The solid line represents the winding temperature, reflecting the temperature rise trend of the motor during long-term operation; the dashed line represents the friction trend, reflecting the friction change calculated by combining temperature mapping and current harmonics. In subgraph (b), the horizontal axis is the same as in subgraph (a), and the vertical axis represents the trend confidence level. The curve represents the long-cycle compensation amount, reflecting the future preset second cycle, i.e., compensation commands of more than 3 cycles, generated based on load inertia changes and friction trends. This can eliminate positioning drift caused by temperature rise and improve steady-state accuracy.
[0074] For example, after the servo motor runs continuously for 30 minutes, the position command and actual position difference over the past 100 cycles (1ms cycle) are collected, and the maximum-minimum position difference is calculated to be 0.15 rand. The load inertia change parameter J var =0.15 / (100×0.001) 2 ) = 1.5 kg·m 2 When the winding temperature is 65℃, the basic frictional force is found to be 0.8 N·m according to the table. A current distortion rate of 12% corresponds to a disturbance increment ΔTf = 0.1 × 12% = 0.12 N·m. The trend of the combined frictional force is Tf. trend =0.92 N·m. A linear regression of the historical positional deviation sequence yields a slope a = -0.002 rad / s. 2 After applying a moving average filter, the low-frequency deviation trend is extracted and substituted into the compensation formula Comp. long =1.5×(-0.002)+0.92=0.917N·m, outputting the long-term predicted compensation amount for the next 5 cycles. By integrating temperature-related frictional characteristics and dynamic changes in load inertia, the system accurately captures the slow-changing disturbance trend of the system on a long-term scale. The generated compensation amount effectively offsets the increased viscous friction caused by the temperature rise of mechanical components, avoiding the positioning drift problem that occurs after long-term operation of traditional control methods, and significantly improving the stability of continuous system operation.
[0075] Optionally, the generation of instantaneous confidence includes:
[0076] Read the estimated value of the velocity feedforward component and obtain the actual position value within the current cycle through the encoder interface;
[0077] The deviation is obtained by comparing the estimated value of the velocity feedforward component with the actual position value.
[0078] A joint analysis is performed based on the deviation magnitude and the rate of change to generate an instantaneous matching degree index;
[0079] The instantaneous matching degree index is range-mapped to generate instantaneous confidence.
[0080] Specifically, at the beginning of each control cycle, the estimated value of the velocity feedforward component in the generated short-cycle predictive compensation is read. After the control cycle ends, the actual position value is obtained through the encoder interface, and the actual position deviation is calculated in conjunction with the position command. The actual position deviation E is then calculated. actual ,have:
[0081] E actual =r(k)-θ actual ,
[0082] Where, θactual To obtain the actual position value via the encoder interface, the required speed feedforward is calculated using a preset position-speed conversion relationship. The position-speed conversion relationship is established by measuring the motor position signal using the encoder, differentiating it to obtain the speed value, establishing a mathematical relationship (such as a difference equation) between the position change and speed, and verifying the conversion accuracy experimentally. The deviation between the predicted speed feedforward component and the actual position value is calculated. For calculating the deviation magnitude ΔV, we have:
[0083] ΔV=|Vff pred -Vff actual |,
[0084] Among them, Vff pred Vff is the velocity feedforward estimate in the short-cycle forecast compensation. actual The actual velocity feedforward is calculated from the actual position deviation E. actual The deviation data between the short-cycle predicted speed feedforward value and the actual back-calculated value are recorded under various operating conditions. The deviation distribution range is statistically analyzed, intervals are divided, and matching degree scoring rules are defined (e.g., the smaller the deviation, the higher the matching degree), forming a deviation-matching degree mapping table. According to the preset deviation-matching degree mapping table, when the deviation amplitude is less than a threshold and the deviation change rate is less than the change rate threshold, the instantaneous matching degree index is output. This is achieved by measuring the change rate of the speed feedforward component and the actual position deviation of the servo motor under different operating conditions. After statistically analyzing these data, a critical value that can distinguish between normal response and abnormal disturbance is selected as the change rate threshold. The instantaneous matching degree index Match is then calculated. index ,have:
[0085]
[0086] Among them, V max The maximum permissible deviation is defined; when the absolute deviation or rate of change of deviation exceeds the threshold, a nonlinear index is calculated. Finally, the Match... index A linear mapping to the 0-1 interval generates an instantaneous confidence score. This is used to calculate the instantaneous confidence score C. short ,have:
[0087]
[0088] Among them, Min match Max is the preset minimum matching score. match The maximum matching degree benchmark value is set by statistically analyzing the minimum and maximum values of the instantaneous matching degree index through a large number of experiments. For example, the matching degree is the highest when running at a constant speed under no-load conditions and the lowest when a sudden load is applied. The benchmark value is set as a normalization reference.
[0089] For example, when the servo motor executes a constant speed trajectory, the short-cycle prediction output Vffpred =50 rad / s, the actual measured position deviation decreased from 0.1 rad to 0.08 rad, calculate Vff. actual =100×(0.02 / 0.001)=200rad / s. At this time, ΔV=|50-200|=150rad / s. The rate of change of this deviation is calculated to be 50000rad / s. 2 The threshold was set at 200 rad / s and the rate of change threshold was set at 60000 rad / s. 2 Since the rate of change did not exceed the threshold, a linear mapping formula was used: V was taken as... max =300rad / s, Match index =1-150 / 300=0.5; Minimum value preset match =0.3, Max match =0.9, ultimately generating C short =(0.5-0.3) / (0.9-0.3)=0.33. By using position feedback to infer actual needs and dynamically compare them with predicted values, the reliability of the short-cycle model under sudden speed changes is accurately quantified. When a sharp increase in the rate of change of deviation is detected, the confidence score is automatically reduced to avoid prediction failure caused by sudden jamming of mechanical transmission, thus providing an accurate and reliable basis for subsequent dynamic fusion.
[0090] Optionally, the generated trend confidence includes:
[0091] The cumulative error of the long-cycle prediction compensation amount within multiple control cycles prior to the retrospective analysis;
[0092] Acquire acceleration values, determine whether the acceleration values are within the valid range, and generate an acceleration state valid flag;
[0093] A trend confidence level is generated by combining the accumulated error and the effective flag of the acceleration state.
[0094] Specifically, at the end of each control cycle, the current cycle component of the long-cycle predicted compensation amount from the previous output is stored. The error sequence between the current cycle component and the actual compensation requirement over the previous multiple control cycles is accumulated, and the root mean square cumulative error (RMS) of this sequence is calculated. error ,have:
[0095]
[0096] Where K is the number of periods of cumulative error, and is used to calculate the window size of the root mean square error. This is an error sequence, recording the error between the predicted component and the actual compensation requirement within the first K control cycles, where k represents the index of the current control cycle. The current acceleration is obtained by processing the position feedback signal synchronously through a differentiator. For calculating the current acceleration, Accel... now ,have:
[0097]
[0098] in, This represents the second derivative of the position signal θ with respect to time t. It is used to determine whether the acceleration state is within the valid range; the valid flag for calculating the acceleration state is Valid. flag ,have:
[0099]
[0100] Among them, Accel min To determine the minimum acceleration threshold within the model's effective range, the acceleration fluctuation range of the servo motor in steady state was measured through an unloaded, constant-speed operation test. Considering the encoder noise level, a lower limit value slightly higher than the noise amplitude was set as Accel. min If the value is below this, the model is considered invalid; Accel max Assuming the maximum acceleration threshold within the effective range of the model, the theoretical maximum acceleration is calculated based on the motor's maximum allowable torque and moment of inertia; then, the actual achievable peak acceleration is verified through extreme acceleration experiments. max A value higher than this indicates the model is invalid. A trend confidence score is generated by combining the cumulative error and the valid acceleration state indicator. The trend confidence score C is then calculated. long ,have:
[0101] C long = [1-tanh(β·RMS)] error )]·Valid flag ,
[0102] Where β is a preset error sensitivity coefficient, which is used to analyze the impact of long-period prediction errors on system performance through simulation and actual testing, and to adjust the error sensitivity coefficient accordingly; tanh is the hyperbolic tangent function used to map the error to the 0-1 interval. Figure 4 As shown, in subgraph (a), the horizontal axis represents the number of control cycles, and the vertical axis represents temperature; this reflects the real-time reliability of the short-cycle prediction model. The higher the value, the more accurate the short-cycle model is in predicting instantaneous disturbances. When the instantaneous confidence level is lower than the threshold (e.g., 0.3), the system will reduce the weight of the model's output. Subgraph (b) has the same horizontal axis as subgraph (a), and the vertical axis represents the compensation amount; this evaluates the historical accuracy of the long-cycle prediction model and reflects the long-cycle model's ability to predict slowly changing disturbances. When the system acceleration exceeds the preset range, the trend confidence level is forcibly reset to zero.
[0103] For example, when the servo motor is in the acceleration / deceleration phase, the error sequence between the long-cycle predicted compensation amount and the actual required torque over the past 50 cycles is recorded, and the RMS is calculated. error = 0.25 N·m. The current acceleration is detected to be 800 rad / s². 2 The effective range threshold is set to 500-1500 rad / s. 2 At this point, Valid flag =1. Take the sensitivity coefficient β = 2, calculate tanh(2 × 0.25) = tanh(0.5) ≈ 0.462, and generate the trend confidence score C. long = (1-0.462)×1=0.538. By integrating historical error statistics and real-time dynamic state judgment, the reliability of the long-cycle model is intelligently evaluated during the high-speed dynamic process of the motor. When the system exceeds the preset working range of the model, the protection mechanism is automatically triggered to reduce the confidence level, effectively preventing the compensation inaccuracy problem caused by the failure of model extrapolation, and significantly improving the control robustness under complex working conditions.
[0104] Optionally, the calculation of dynamic weights includes:
[0105] The system acquires the position command signal issued by the motor and calculates the system dynamic indicators based on the position command signal.
[0106] When the instantaneous confidence level is higher than a preset first threshold and the system dynamic index is lower than a preset dynamic threshold, the short-cycle weight is calculated.
[0107] When the instantaneous confidence level is lower than a preset second threshold and the trend confidence level is higher than a preset third threshold, the long-term weight is calculated.
[0108] The short-period weights and the long-period weights are normalized to generate dynamic weights.
[0109] Specifically, the instantaneous confidence level and trend confidence level generated above, as well as the position command signal issued by the motor, are acquired in real time. The system dynamic index, Dyn, is calculated using the second-order difference of the position command signal. now ,have:
[0110]
[0111] When Dyn now When the value is less than a preset dynamic threshold, the system is determined to be in a stable state, and the state flag is set to 1. By analyzing the distribution of the second-order differential signal of the position command under typical trajectories (such as sine waves and step jumps), a critical value that can distinguish between the stable state and the dynamic state is selected as the preset dynamic threshold. For calculating the short-period basic weight W... base With long-term basic weight WLabse ,have:
[0112]
[0113] Where γ1 is the short-cycle weight adjustment gain of 0.5, γ2 is the long-cycle weight adjustment gain of 0.6, Th1 is the first threshold of 0.7, Th2 is the second threshold of 0.3, Th3 is the third threshold of 0.6, and Dyn th The preset dynamic thresholds are used. The first, second, and third thresholds are set empirically based on performance indicators such as overshoot and settling time in the system step response test, or obtained through optimization algorithms. When none of the above conditions are met, the default weight allocation W is used. Sbase =0.5, W Lbase =0.5. Normalize the basic weights to generate dynamic weight reassemblies. For calculating the dynamic weights [W]... short W long ],have:
[0114]
[0115] Among them, W short W represents the normalized short-period dynamic weights. long For normalized long-period dynamic weights, such as Figure 5 As shown, the solid line represents the short-period weights, which dominate when the instantaneous confidence level is greater than 0.7 and the system is stable; the dashed line represents the long-period weights, which dominate when the instantaneous confidence level is less than 0.3 and the trend confidence level is greater than 0.6. This figure intuitively demonstrates the intelligent fusion of multi-period predictions achieved under the resource constraints of the M3 kernel through a real-time weight allocation mechanism.
[0116] For example, when the motor encounters a sudden load disturbance, C is measured. short =0.25 (lower than Th2 = 0.3), C long =0.75 (higher than Th3=0.6), system dynamic index Dyn now =1500rad / s 3 (greater than Dyn) th =1000rad / s 3 Therefore, the status flag is set to 0. This triggers the second condition setting W. Lbase =0.7 + 0.6 × (0.75 - 0.6) = 0.79, therefore W was not triggered. Sbase Keep the default value of 0.5. Normalization yields W. short =0.5 / (0.5+0.79)≈0.39, W long=0.79 / (0.5+0.79)≈0.61. By coordinating the judgment of dual-reset reliability and real-time dynamic status, the weight allocation strategy is automatically adjusted when the reliability of model prediction deviates. When the short-cycle model fails due to sudden disturbance, the decision weight of the long-cycle model is significantly increased, which effectively solves the compensation lag problem of the traditional fixed weight scheme when the operating conditions change suddenly, so that the system can still maintain stable torque output characteristics under strong disturbances.
[0117] Optionally, the method further includes:
[0118] The moment of inertia is calculated by combining the weighting coefficient, the current loop feedback value, and the velocity loop feedback value.
[0119] When the instantaneous confidence level is detected to be continuously decreasing and the trend confidence level is simultaneously increasing, the preset friction-temperature mapping table and the moment of inertia are corrected to obtain the corrected mapping table and parameters.
[0120] The simplified motor equation and the regression equation are updated based on the revised mapping table and parameters.
[0121] Specifically, firstly, in the simplified motor equations mentioned above, the moment of inertia is calculated by combining the weighting coefficients, current loop feedback values, and speed loop feedback values. During each control cycle, the system monitors two key indicators in real time: instantaneous confidence and trend confidence. The correction trigger is determined based on the following logic: the system calculates the moving average of the instantaneous confidence over multiple consecutive cycles and compares it with the average confidence of the previous multiple cycles. If the current moving average is lower than the historical average by more than a preset decrease threshold, the instantaneous confidence is considered to have decreased significantly. By monitoring the decrease in instantaneous confidence during load changes or model mismatches over a long period, a critical percentage of significant decrease (e.g., 20%) is statistically determined and used as the trigger parameter decrease threshold. Simultaneously, the system calculates the moving average of the trend confidence. If it is higher than the historical average by more than a preset increase threshold, the trend confidence is considered to have increased significantly. The increase threshold is similar to the decrease threshold, obtained by analyzing the upward trend of the trend confidence in slowly varying disturbances (e.g., temperature rise) and statistically determining the critical percentage of significant increase. When both conditions are met simultaneously, the system sets the correction flag to 1, indicating that model parameter correction needs to be initiated. If the moving average of instantaneous confidence over the past N periods (e.g., N=50) decreases by more than threshold α1 (e.g., α1 is 20%) compared to the average of the previous window, and the moving average of trend confidence increases by more than threshold α2 (e.g., α2 is 20%), model correction is triggered. A two-level correction mechanism is employed, with the correction process divided into two levels, adjusting different model parameters respectively. The first level of correction is for adjusting the friction trend model. The system obtains the difference between the current winding temperature and the preset reference temperature and calculates the temperature difference. For calculating the temperature difference ΔT, we have:
[0122] ΔT=T current -T base ,
[0123] Among them, T current T represents the current winding temperature. base A preset reference temperature is used, typically taken as the temperature under rated motor operating conditions (e.g., 80℃). Based on the temperature difference, the frictional force offset is calculated using a temperature compensation coefficient to adjust the friction-temperature mapping table. For the frictional force offset ΔF, we have:
[0124] ΔF=K temp ·ΔT,
[0125] Among them, K temp The temperature compensation coefficient is obtained by measuring the motor friction torque at different temperatures through temperature control experiments and fitting the slope of the friction-temperature curve using the least squares method. The original friction-temperature mapping relationship is added to the offset to generate a new mapping table reflecting the effect of temperature changes on friction. The calculation of the new mapping table F... new ,have:
[0126] F new =F original +ΔF,
[0127] Among them, F original To establish the original friction-temperature mapping relationship, the frictional torque of the motor at different temperatures was measured through temperature control experiments, and the data was fitted to establish the mapping. For the second-level correction, the rotational inertia parameter was adjusted. The system calculates the inertia correction factor by comparing the load inertia change parameter with the preset inertia reference value. For calculating the inertia correction factor γ, we have:
[0128]
[0129] Among them, J base The preset inertia reference value is the motor's rotational inertia under no-load conditions. Multiplying the original rotational inertia by a correction factor yields the updated rotational inertia parameter, which is used to correct the parameters in the mechanical motion equations. The updated rotational inertia parameter J is calculated as follows: new ,have:
[0130] J new =J original ·γ,
[0131] Among them, J originalThe original moment of inertia is calculated using the formula described above, by applying a known step torque to the motor under no-load conditions and measuring the motor's angular acceleration response. The corrected mapping table and parameters are then transmitted in real-time to the simplified motor equations and regression equations, ensuring the control algorithm can perform calculations and predictions based on the latest physical characteristics. The entire correction process, from confidence level monitoring to parameter adjustment, forms a closed-loop feedback system. By dynamically monitoring changes in model confidence, the system can promptly detect deviations between the model and actual operating conditions, and adjust for friction and moment of inertia through a two-stage correction mechanism. This design not only ensures the model's real-time performance but also significantly improves its adaptability and accuracy under different operating conditions through temperature compensation and load inertia correction. The corrected parameters are directly applied to the control model, ensuring the timeliness and accuracy of the system response.
[0132] For example, when the motor switches from no-load to loaded operation, the system continuously monitors and detects that the average instantaneous confidence level drops significantly from 0.8 to 0.5, while the trend confidence level rises from 0.4 to 0.7. Once this exceeds a preset threshold, a correction mechanism is automatically triggered: First, based on a 20°C increase in winding temperature, the friction force mapping table is increased by 0.2 N·m offset using a compensation coefficient of 0.01 N·m / °C; simultaneously, based on the current load inertia of 1.2 kg·m… 2 The difference from the reference value is used to adjust the moment of inertia parameter to 1.2 times the original value. This dynamic correction strategy based on the dual reset confidence criterion achieves hierarchical and accurate calibration of the friction model and inertia parameter, effectively solving the compensation inaccuracy and oscillation problems that occur in traditional fixed parameter models after sudden load changes or long-term operation, and significantly improving the control accuracy and stability of the system under different operating conditions.
[0133] Optionally, the generation of the final compensation instruction includes:
[0134] The long-cycle prediction compensation amount is decomposed into current cycle components along the time axis;
[0135] The short-cycle predicted compensation amount and the current cycle component are weighted and summed using the dynamic weights to generate the final compensation instruction.
[0136] Specifically, the aforementioned long-cycle predicted compensation amount is obtained, which includes the torque compensation sequence for the next N control cycles. The current cycle component corresponding to the current control cycle is extracted using a time-axis decomposition algorithm. First, the slope of the compensation sequence is calculated. For calculating the slope S of the compensation sequence, we have:
[0137]
[0138] Among them, T comp(k+i) represents the long-cycle predicted torque compensation value for the (k+i)th cycle. A linear interpolation method is used to decompose and generate the current cycle component. For calculating the current cycle component T... now ,have:
[0139] T now =T comp (k+1)+S·(t'-t k ),
[0140] Where t' is the timestamp of the current moment; t k This is the start time of the current control cycle k. Simultaneously, the torque compensation term from the generated short-cycle predicted compensation is acquired, the calculated dynamic weighted reassembly is read, a weighted summation operation is performed, and a final compensation instruction with time alignment is generated. For calculating the final compensation instruction T... final ,have:
[0141] T final =W short ·Te comp +W long ·T now ,
[0142] The generated final compensation instruction has a timestamp, which includes a timestamp and a period number.
[0143] For example, when the long-cycle forecast outputs the compensation sequence for the next three cycles, the system accurately calculates the compensation component at the current moment. Combining the short-cycle compensation amount and dynamic weight allocation, the system generates a precise final compensation command with a timestamp. Precise time axis decomposition ensures strict synchronization between the long-cycle trend compensation and the current control cycle. Combined with dynamic weights, it achieves optimized coordination between rapid short-cycle response and long-cycle trend suppression, effectively solving the compensation phase lag problem caused by time mismatch in traditional multi-cycle forecasting, and significantly improving the dynamic tracking accuracy under complex disturbance conditions.
[0144] Optionally, the step of superimposing the final compensation command onto the output of the servo motor control loop includes:
[0145] The final compensation command is synchronized and superimposed with the original output command of the servo motor control loop in real time to obtain the superimposed command;
[0146] The superimposed instructions are amplitude-limited by a digital signal processor and output to the output terminal of the servo motor control loop.
[0147] Specifically, this method employs precise timing control and safety protection mechanisms in the instruction superposition stage. First, a hardware timer ensures that the final compensation instruction is strictly synchronized with the original output instruction of the servo motor control loop, with a time deviation of less than 1 microsecond. The superposition operation is implemented using an instruction superposition formula. For calculating the superimposed instruction Y, we have:
[0148] Y = V t +U t ,
[0149] Among them, V t U is the original output command for the servo motor control loop. t This is the final compensation command. The superimposed command is sent to the digital signal processor (DSP) for safety processing and then output to the output of the servo motor control loop. The processor monitors the command amplitude in real time, and the DSP monitors the Y value in real time. When Y exceeds the preset safety range, amplitude limiting processing is initiated. The safety range is established based on the motor's rated parameters and driver limitations, setting the upper and lower limits of the superimposed command. If Y is greater than the preset safety range upper limit, the preset safety range upper limit is output; if Y is less than the preset safety range lower limit, the preset safety range lower limit is output. The safety range parameter is set according to the motor's rated parameters, typically taking 90% of the motor's maximum allowable current as the preset safety range upper limit. This processing is completed within each control cycle, ensuring that the output command incorporates the compensation effect without exceeding the equipment's capacity.
[0150] For example, when a servo motor performs a high-speed positioning task, if A represents the original output command, the original output command of the control loop is 2.3A, the final compensation command is 0.4A, and the sum is 2.7A. Since this value is close to but does not exceed the set limit of 2.8A, the system directly outputs the summed command. This achieves seamless integration of compensation commands, avoids command conflicts through precise timing synchronization, and effectively prevents overload risks through the limiting protection mechanism. This allows the motor to fully utilize its performance while ensuring operational safety, significantly improving the reliability and stability of the control system.
[0151] Based on the same inventive concept, such as Figure 6 As shown, the present invention also provides a multi-cycle predictive compensation system for servo motors based on the M3 kernel, the system comprising:
[0152] The short-cycle prediction module is used to acquire the real-time operating parameters of the servo motor and compensate for the rapid changes in the servo motor at the millisecond level during real-time operation, generating short-cycle prediction compensation amounts.
[0153] The long-cycle prediction module is used to generate long-cycle prediction compensation by analyzing the long-cycle operation pattern of the servo motor.
[0154] The confidence calculation module is used to analyze and calculate the instantaneous confidence based on the real-time operating parameters and the short-cycle prediction compensation amount, and to calculate and generate the trend confidence based on the long-cycle prediction compensation amount.
[0155] The weight calculation module is used to calculate dynamic weights based on the instantaneous confidence level and the trend confidence level;
[0156] The dynamic compensation module is used to fuse the short-cycle prediction compensation amount and the long-cycle prediction compensation amount based on the dynamic weight to generate the final compensation instruction.
[0157] The instruction execution module is used to superimpose the final compensation instruction onto the output of the servo motor control loop.
[0158] It should be noted that the electrical connections between the various units described above do not necessarily represent direct or indirect connections. Any indirect connection method can be applied to the embodiments of the present invention as long as it achieves the purpose of the present invention. The above descriptions are merely exemplary embodiments of the present invention and should not be construed as limiting the scope of the present invention.
[0159] All equivalent changes and modifications made in accordance with the teachings of this invention are still within the scope of this invention. Those skilled in the art will readily conceive of other embodiments of this invention upon considering the specification and the disclosure of practical truth. This application is intended to cover any variations, uses, or adaptations of this invention that follow the general principles of this invention and include common knowledge or conventional techniques in the art not described herein.
Claims
1. A multi-cycle predictive compensation method for servo motors based on the M3 kernel, characterized in that, The method includes: The system acquires the real-time operating parameters of the servo motor and compensates for the rapid changes in the servo motor at the millisecond level during real-time operation, generating short-cycle predictive compensation amounts. By analyzing the long-cycle operation pattern of the servo motor, a long-cycle predictive compensation amount is generated. Instantaneous confidence is generated by analyzing and calculating the real-time operating parameters and the short-cycle prediction compensation amount, and trend confidence is generated by calculating the long-cycle prediction compensation amount. Calculate the dynamic weights based on the instantaneous confidence level and the trend confidence level; The short-cycle prediction compensation amount and the long-cycle prediction compensation amount are fused based on the dynamic weight to generate the final compensation instruction. The final compensation command is superimposed on the output of the servo motor control loop.
2. The multi-cycle prediction compensation method for servo motors based on the M3 kernel according to claim 1, characterized in that, The generated short-period prediction compensation includes: Obtain the current loop feedback value, speed loop feedback value, and position command change rate of the servo motor to obtain real-time operating parameters; Using preset weighting coefficients and first input features, a simplified motor equation is constructed to characterize the parameters of short-cycle predicted compensation. Feature extraction is performed on the real-time operating parameters to generate the first input feature; Using the weighting coefficients, the first input feature, and the simplified motor equation, the short-cycle prediction compensation amount with a speed feedforward component for the preset first cycle is calculated.
3. The multi-cycle prediction compensation method for servo motors based on the M3 kernel according to claim 2, characterized in that, The generated long-period prediction compensation includes: Using the second input feature, sliding window size parameter, position deviation sequence parameter, and time series parameter, a regression equation is constructed to characterize the predicted position deviation trend parameter; Obtain the current sliding window size parameter, position deviation sequence parameter, and time series parameter, and calculate the servo motor load inertia change parameter and friction force trend prediction value as the second input feature; Using the second input feature, the sliding window size parameter, the position deviation sequence parameter, the time series parameter, and the regression equation, the predicted position deviation trend is calculated. Linear calculations are performed based on the predicted position deviation trend to generate a preset long-term prediction compensation amount for the second period. The first period is shorter than the second period.
4. The multi-cycle prediction compensation method for servo motors based on the M3 kernel according to claim 2, characterized in that, The generation of instantaneous confidence includes: Read the estimated value of the velocity feedforward component and obtain the actual position value within the current cycle through the encoder interface; The deviation is obtained by comparing the estimated value of the velocity feedforward component with the actual position value. A joint analysis is performed based on the deviation magnitude and the rate of change to generate an instantaneous matching degree index; The instantaneous matching degree index is range-mapped to generate instantaneous confidence.
5. The multi-cycle prediction compensation method for servo motors based on the M3 kernel according to claim 1, characterized in that, The generated trend confidence level includes: The cumulative error of the long-cycle prediction compensation amount within multiple control cycles prior to the retrospective analysis; Acquire acceleration values, determine whether the acceleration values are within the valid range, and generate an acceleration state valid flag; A trend confidence level is generated by combining the accumulated error and the effective flag of the acceleration state.
6. The multi-cycle prediction compensation method for servo motors based on the M3 kernel according to claim 1, characterized in that, The calculation of dynamic weights includes: The system acquires the position command signal issued by the motor and calculates the system dynamic indicators based on the position command signal. When the instantaneous confidence level is higher than a preset first threshold and the system dynamic index is lower than a preset dynamic threshold, the short-cycle weight is calculated. When the instantaneous confidence level is lower than a preset second threshold and the trend confidence level is higher than a preset third threshold, the long-term weight is calculated. The short-period weights and the long-period weights are normalized to generate dynamic weights.
7. The multi-cycle prediction compensation method for servo motors based on the M3 kernel according to claim 6, characterized in that, The method further includes: The moment of inertia is calculated by combining the weighting coefficient, the current loop feedback value, and the velocity loop feedback value. When the instantaneous confidence level is detected to be continuously decreasing and the trend confidence level is simultaneously increasing, the preset friction-temperature mapping table and the moment of inertia are corrected to obtain the corrected mapping table and parameters. The simplified motor equation and the regression equation are updated based on the revised mapping table and parameters.
8. The multi-cycle prediction compensation method for servo motors based on the M3 kernel according to claim 1, characterized in that, The generation of the final compensation instruction includes: The long-cycle prediction compensation amount is decomposed into current cycle components along the time axis; The short-cycle predicted compensation amount and the current cycle component are weighted and summed using the dynamic weights to generate the final compensation instruction.
9. The multi-cycle prediction compensation method for servo motors based on the M3 kernel according to claim 1, characterized in that, The step of superimposing the final compensation command onto the output of the servo motor control loop includes: The final compensation command is synchronized and superimposed with the original output command of the servo motor control loop in real time to obtain the superimposed command; The superimposed instructions are amplitude-limited by a digital signal processor and output to the output terminal of the servo motor control loop.
10. A servo motor multi-cycle prediction compensation system based on an M3 kernel, applied to the servo motor multi-cycle prediction compensation method based on an M3 kernel as described in any one of claims 1-9, characterized in that, The system includes: The short-cycle prediction module is used to acquire the real-time operating parameters of the servo motor and compensate for the rapid changes in the servo motor at the millisecond level during real-time operation, generating short-cycle prediction compensation amounts. The long-cycle prediction module is used to generate long-cycle prediction compensation by analyzing the long-cycle operation pattern of the servo motor. The confidence calculation module is used to analyze and calculate the instantaneous confidence based on the real-time operating parameters and the short-cycle prediction compensation amount, and to calculate and generate the trend confidence based on the long-cycle prediction compensation amount. The weight calculation module is used to calculate dynamic weights based on the instantaneous confidence level and the trend confidence level; The dynamic compensation module is used to fuse the short-cycle prediction compensation amount and the long-cycle prediction compensation amount based on the dynamic weight to generate the final compensation instruction. The instruction execution module is used to superimpose the final compensation instruction onto the output of the servo motor control loop.
Citation Information
Patent Citations
Motor predictive torque control method based on nonlinear predictive error compensation
CN112928960A
Automated load torque ripple compensation using pre-control signals calculated using a cross-correlation function
DE102024207191A1
Digital servo control unit using feedforward signal
JP2010033172A
Electric power steering device
WO2018147465A1
Cited By
Bus encoder small-memory large-scale compensation table difference compensation scheme and algorithm thereof
CN121412139A
Pneumatic balance method and system based on force sense control
CN121680502A
A force feedback control based pneumatic balancing method and system
CN121680502B
Servo steering engine control method and device based on digital signal processing and medium
CN121832410A
Servo turntable low-temperature friction self-adaptive compensation method
CN121918418A