Joint motor control method and system based on angle sensor, medium and product

By employing a dual-layer compensation mechanism and time series analysis, combined with a temperature error mapping table and dynamically adjusting the compensation buffer capacity, the problems of response delay and accuracy loss in the joint motor control system are solved, achieving high-precision and high-efficiency motor control.

CN120880265APending Publication Date: 2025-10-31KUNSHAN HENGJU ELECTRONIC CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202510841917.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-23
Publication Date
2025-10-31

AI Technical Summary

Technical Problem

Existing joint motor control systems suffer from response delays and accuracy losses due to complex compensation algorithms, making it difficult to achieve a balance between real-time performance and accuracy, especially when the temperature changes rapidly.

Method used

A dual-layer compensation mechanism is adopted, combining a temperature error mapping table and time series analysis. Real-time angle compensation is performed through rapid compensation parameters, and accurate compensation is performed by accumulating data in the background. The capacity of the compensation buffer is dynamically adjusted, and the data processing strategy is optimized.

Benefits of technology

This approach achieves improved control accuracy while ensuring real-time performance, resolves the conflict between compensation accuracy and response delay, and optimizes the system's control performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120880265A_ABST
    Figure CN120880265A_ABST
Patent Text Reader

Abstract

The invention discloses a joint motor control method and system based on an angle sensor, a medium and a product, and relates to the field of general control or adjustment systems.The method comprises the steps that real-time angle data and temperature data of the angle sensor are collected, and a real-time data packet is generated; determining a rapid compensation parameter corresponding to the temperature value, performing preliminary compensation on the angle value to obtain a preliminary compensation angle value, and generating a motor control parameter to control a joint motor to operate; storing a plurality of continuous real-time data packets into a compensation cache region; when the number of the data packets in the compensation cache region reaches a preset number threshold value, temperature change features and angle drift features are extracted, and accurate compensation parameters are calculated; and performing secondary compensation on the preliminary compensation angle value based on the accurate compensation parameter to obtain an accurate compensation angle value, and updating the motor control parameter based on the accurate compensation angle value. According to the invention, response delay caused by a compensation algorithm can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the general field of control or regulation systems, and more particularly to joint motor control methods, systems, media, and products based on angle sensors. Background Technology

[0002] Articulated motors are increasingly used in fields such as industrial automation, robotics, and medical devices. As a core actuator in robots and automated equipment, the control performance of articulated motors directly affects the overall performance of the equipment. With the development of intelligent manufacturing, the production process places higher demands on the control of articulated motors, requiring not only real-time control but also precise control.

[0003] In related technologies, joint motor control systems typically employ a single processing flow scheme. This scheme sends data collected by an angle sensor to a processing unit, which then performs a series of fixed calculation steps, including signal filtering, parameter calculation, and control quantity generation, ultimately outputting a control signal. In practical applications, to improve control accuracy, the processing unit executes complex compensation algorithms and optimization calculations.

[0004] However, in actual operation, complex compensation algorithms consume a lot of computing resources, leading to increased system response delays. Summary of the Invention

[0005] This application provides a joint motor control method, system, medium, and product based on an angle sensor, for reducing response delay caused by compensation algorithms.

[0006] In a first aspect, this application provides a joint motor control method based on an angle sensor, applied to a motor control system. The method includes: acquiring real-time angle and temperature data from an angle sensor to generate a real-time data packet containing angle values, temperature values, and timestamps; querying a preset temperature error mapping table to determine a fast compensation parameter for the corresponding temperature value; performing preliminary compensation on the angle value based on the fast compensation parameter to obtain a preliminary compensated angle value, and generating motor control parameters based on the preliminary compensated angle value to control the joint motor operation; storing multiple real-time data packets acquired over several consecutive cycles into a compensation buffer; when the number of data packets in the compensation buffer reaches a preset threshold, performing time-series analysis on the data in the compensation buffer to extract temperature change characteristics and angle drift characteristics; calculating precise compensation parameters based on the temperature change characteristics and angle drift characteristics; performing secondary compensation on the preliminary compensated angle value based on the precise compensation parameter to obtain a precise compensated angle value, and updating the motor control parameters based on the precise compensated angle value.

[0007] In the above embodiments, the motor control system performs real-time angle compensation through rapid compensation parameters, ensuring the timeliness of control; at the same time, it accumulates data in the background and performs time series analysis, extracts temperature and angle features, and then performs precise compensation, achieving a balance between compensation accuracy and response speed; thus ensuring the real-time nature of control and being able to improve control accuracy in a timely manner through precise compensation.

[0008] In conjunction with some embodiments of the first aspect, in some embodiments, after calculating the precise compensation parameters based on temperature change characteristics and angle drift characteristics, the method further includes: calculating the parameter deviation value between the precise compensation parameters and the fast compensation parameters; when the parameter deviation value exceeds a preset deviation threshold, updating the fast compensation parameters for the corresponding temperature range in the temperature error mapping table based on the historical compensation parameters in the compensation buffer.

[0009] In the above embodiments, the motor control system dynamically monitors the deviation between the precise compensation parameters and the rapid compensation parameters. When the deviation exceeds the threshold, the temperature error mapping table is automatically updated, so that the rapid compensation parameters can be continuously optimized as the system runs, thereby improving the accuracy of the initial compensation.

[0010] In conjunction with some embodiments of the first aspect, in some embodiments, after performing secondary compensation on the preliminary compensation angle value based on the precise compensation parameters to obtain the precise compensation angle value, and updating the motor control parameters based on the precise compensation angle value, the method further includes: calculating the real-time angle difference between the precise compensation angle value and the preliminary compensation angle value; and reducing the data capacity of the compensation buffer when the real-time angle difference is greater than the compensation adjustment threshold.

[0011] In the above embodiments, the motor control system monitors the difference between the precise compensation angle value and the preliminary compensation angle value in real time. When the difference is too large, it dynamically adjusts the capacity of the compensation buffer area, which not only ensures the accuracy of compensation, but also avoids the delay caused by too much historical data to the system response, thereby improving the real-time performance of the system.

[0012] In conjunction with some embodiments of the first aspect, in some embodiments, the step of reducing the data capacity of the compensation buffer when the real-time angle difference is greater than the compensation adjustment threshold specifically includes: calculating the rate of change of the real-time angle difference when the real-time angle difference is greater than the compensation adjustment threshold; determining the target response period for secondary compensation based on the rate of change; and adjusting the data capacity of the compensation buffer to the number of data packets within one target response period.

[0013] In the above embodiments, the motor control system dynamically adjusts the capacity of the compensation buffer based on the rate of change of the angle difference to match the target response period. This ensures sufficient data for feature extraction while avoiding the computational burden caused by redundant data, thus optimizing the compensation efficiency.

[0014] In conjunction with some embodiments of the first aspect, in some embodiments, the step of calculating the accurate compensation parameters based on temperature change characteristics and angle drift characteristics specifically includes: performing time-series decomposition on the temperature change characteristics to obtain temperature trend components and temperature periodic components; determining the contribution weight of temperature change to angle drift based on the rate of change of the temperature trend components; performing frequency domain analysis on the angle drift characteristics to extract the frequency and amplitude characteristics of the angle drift; performing weighted fusion of the contribution weight, frequency characteristics, and amplitude characteristics to obtain a compensation feature vector; and calculating the accurate compensation parameters based on a preset compensation model and the compensation feature vector.

[0015] In the above embodiments, the motor control system decomposes the temperature change characteristics into trend and periodic components, combines them with the frequency domain characteristics of angle drift, and obtains the compensation feature vector through weighted fusion, which improves the accuracy of the compensation model and makes precise compensation more reliable.

[0016] In conjunction with some embodiments of the first aspect, in some embodiments, before the step of acquiring real-time angle data and temperature data from the angle sensor and generating a real-time data packet containing angle value, temperature value, and timestamp, the method further includes: acquiring the sampling frequency and temperature response time of the angle sensor; calculating the sampling period of the angle data and the effective sampling interval of the temperature data; determining the timestamp granularity of the data packet based on the sampling period and the effective sampling interval; and adjusting the data storage interval of the compensation buffer based on the timestamp granularity.

[0017] In the above embodiments, the motor control system determines the optimal data acquisition strategy based on the sampling characteristics of the sensors, and the reasonable timestamp granularity and storage interval improve the efficiency and quality of data acquisition.

[0018] In conjunction with some embodiments of the first aspect, in some embodiments, after determining the timestamp granularity of the data packet based on the sampling period and the effective sampling interval, the method further includes: performing time alignment on the real-time data packet based on the timestamp granularity, and calculating the angle change and temperature change between adjacent timestamps; when the angle change exceeds a preset angle threshold or the temperature change exceeds a preset temperature threshold, marking the data packet within the corresponding time period as a key data packet; integrating the key data packet and a preset number of adjacent data packets before and after the key data packet into a data segment, and storing the data segment in the priority storage area of ​​the compensation buffer.

[0019] In the above embodiments, the motor control system ensures that important data is processed in a timely manner by identifying key data packets and establishing a priority storage mechanism, which not only guarantees the integrity of key data but also improves the system's processing efficiency.

[0020] In a second aspect, embodiments of this application provide a motor control system, which includes: one or more processors and a memory; the memory is coupled to the one or more processors, and the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the motor control system to perform the method described in the first aspect and any possible implementation thereof.

[0021] Thirdly, embodiments of this application provide a computer program product containing instructions that, when the computer program product is run on a motor control system, cause the motor control system to perform the method described in the first aspect and any possible implementation thereof.

[0022] Fourthly, embodiments of this application provide a computer-readable storage medium including instructions that, when executed on a motor control system, cause the motor control system to perform the method described in the first aspect and any possible implementation thereof.

[0023] Understandably, the motor control system provided in the second aspect, the computer program product provided in the third aspect, and the computer storage medium provided in the fourth aspect are all used to execute the methods provided in the embodiments of this application. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods, and will not be repeated here.

[0024] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages: 1. By adopting a dual-layer compensation mechanism and introducing a temperature error mapping table for rapid compensation, and simultaneously achieving accurate compensation in the background through time series analysis, the system can achieve high-precision control while ensuring real-time performance. This effectively resolves the contradiction between compensation accuracy and response delay in related technologies, thereby achieving overall optimization of control performance.

[0025] 2. Due to the adoption of an adaptive adjustment mechanism based on real-time angle difference, the system can automatically optimize data processing strategies according to actual operating conditions by dynamically monitoring the difference between the precise compensation angle value and the preliminary compensation angle value and adjusting the compensation buffer capacity accordingly. This effectively solves the problem of response delay or accuracy loss caused by fixed data buffer capacity in related technologies, thereby achieving dynamic optimization of compensation performance.

[0026] 3. By adopting a data acquisition optimization scheme based on sensor characteristics, the optimal timestamp granularity and storage interval are determined by analyzing the sampling frequency and temperature response time. Therefore, the system can guarantee the acquisition quality at the data source, effectively solving the problems of data redundancy and processing delay caused by blind acquisition in related technologies, thereby improving the efficiency of data acquisition and processing. Attached Figure Description

[0027] Figure 1 This is a flowchart illustrating a joint motor control method based on an angle sensor in an embodiment of this application. Figure 2 This is another flowchart illustrating the joint motor control method based on an angle sensor in this application embodiment; Figure 3 This is a schematic diagram of the physical device structure of a motor control system in an embodiment of this application. Detailed Implementation

[0028] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification of this application, the singular expressions “a,” “an,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this application refers to any or all possible combinations including one or more of the listed items.

[0029] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.

[0030] To facilitate understanding, the application scenarios of the embodiments of this application are described below.

[0031] On an industrial robot production line, collaborative robots need to perform high-precision assembly tasks. The angle sensors of the robot's joint motors are severely affected by ambient temperature, especially after 8 hours of continuous operation, when the workshop temperature rises from 20°C in the morning to 35°C in the afternoon, causing significant drift in angle measurements. For example, when assembling mobile phone glass panels, the originally set assembly accuracy of 0.1mm is difficult to maintain, resulting in quality problems such as missing parts and misalignments. Traditional periodic calibration methods require downtime for adjustments, severely impacting production efficiency.

[0032] In related technologies, temperature drift compensation for angle sensors can be achieved by using a fixed calibration table method and a simple linear compensation strategy. However, this method requires extensive offline calibration work, cannot adapt to changes in sensor characteristics over time, and exhibits poor compensation performance when temperatures change rapidly. The following describes a scenario using an angle sensor-based joint motor control method from related technologies.

[0033] A factory uses a lookup table compensation method to handle angular errors caused by temperature. Engineers calibrate at different temperature points during installation, establishing a temperature-error correspondence table. During operation, the compensation value is obtained by looking up the table based on the current temperature. However, in summer, with frequent start-stop cycles of the air conditioning system, the temperature fluctuates rapidly (changing by 3°C within 5 minutes), while the calibration table's temperature interval is 5°C, causing discontinuous compensation. Simultaneously, due to sensor aging, the original calibration data gradually becomes invalid, and the compensation accuracy significantly decreases after three months. When the temperature changes rapidly, due to the sensor's thermal inertia, there is a delay between the actual and measured temperatures, causing the compensation parameters to lag and affecting the control effect.

[0034] The joint motor control method based on an angle sensor described in this application achieves accurate compensation for angle measurements through real-time data acquisition and a dual-layer compensation mechanism. This not only allows for rapid response to temperature changes but also enables continuous optimization of the compensation effect through historical data analysis, effectively solving the problems of low compensation accuracy and poor adaptability of traditional methods. The following describes scenarios where the joint motor control method based on an angle sensor from this application is used.

[0035] A precision instrument manufacturer has achieved significant results by applying the adaptive compensation method of this solution to an optical lens assembly robot. The system collects angle and temperature data in real time, ensuring basic accuracy through rapid compensation while accumulating historical data for in-depth analysis. When a rapid temperature rise (2℃ / minute) is detected, the system predicts the temperature change trend and adjusts the compensation parameters in advance. By analyzing temperature change characteristics and angle drift characteristics, the system can accurately model the effects of temperature and achieve precise compensation. Even under conditions of drastic temperature fluctuations, assembly accuracy remains within ±0.02mm, improving product yield.

[0036] As can be seen, the joint motor control method based on angle sensors in this application embodiment can not only achieve rapid compensation, but also effectively solve the angle drift problem caused by dynamic temperature changes, thereby achieving high-precision and high-reliability motor control.

[0037] To facilitate understanding, the method provided in this implementation will be described in detail below, using the above scenario as an example. Please refer to [link / reference]. Figure 1 This is a flowchart illustrating a joint motor control method based on an angle sensor in an embodiment of this application.

[0038] S101. Collect real-time angle data and temperature data from the angle sensor, and generate a real-time data packet containing angle value, temperature value and timestamp.

[0039] Among them, the angle sensor refers to the sensor device used to detect the rotation angle of the joint motor, including but not limited to Hall sensors, encoders, etc.; real-time angle data refers to the angle position information measured by the angle sensor at each sampling moment; temperature data refers to the temperature value of the sensor's working environment, which can come from an integrated or external temperature sensor; timestamp is used to mark the precise time of data acquisition; real-time data packet refers to the data structure formed by packaging the acquired angle value, temperature value and corresponding timestamp.

[0040] After startup, the motor control system needs to continuously acquire information on the motion status and operating environment of the joint motor to achieve precise control. Specifically, the motor control system first determines the sampling frequency of the angle sensor (e.g., 1000Hz), and then periodically collects angle data at this frequency; simultaneously, it collects temperature data at a relatively low frequency (e.g., 100Hz) because temperature changes relatively slowly. For each set of collected data, the motor control system generates a timestamp with microsecond-level precision according to the system clock, and organizes the three into a unified data packet format for easy subsequent processing and analysis.

[0041] In some embodiments, the data acquisition and packaging process can be implemented in several ways: Optionally, the motor control system can use an interrupt-driven approach for data acquisition, setting two timer interrupts with different priorities. The high-priority interrupt is responsible for angle acquisition, and the low-priority interrupt is responsible for temperature acquisition. After the data is acquired, it is transferred to the system memory via DMA, and then the processor generates a timestamp and packages it. Optionally, the motor control system can also use a polling approach, reading data by checking the data readiness flag in the main loop, and packaging the data after reading. It is understood that other data acquisition methods can also be used, such as using FPGA for data preprocessing, etc., which are not limited here.

[0042] In practical applications, the problem of asynchronous sensor data acquisition may be encountered, i.e., there is a discrepancy between the sampling times of angle and temperature data. To address this, the motor control system employs a data alignment algorithm: First, an effective time window (e.g., ±5ms) is determined for each temperature data point. Then, the angle data within this window is weighted and averaged over time to generate the angle value corresponding to the temperature data time. For example, when the temperature sampling time is t, angle data within the time window [t-5ms, t+5ms] are selected, with data closer to time t having a higher weight. The corresponding angle value is obtained through weighted averaging. This method ensures data temporal consistency while avoiding errors that may arise from simple interpolation.

[0043] S102. Query the preset temperature error mapping table to determine the fast compensation parameters for the corresponding temperature value.

[0044] Among them, the temperature error mapping table represents a pre-established data structure used to store compensation parameters corresponding to different temperature ranges; the fast compensation parameters refer to the correction values ​​used for real-time angle compensation, including but not limited to offset, scaling factor, etc.; the temperature range represents a discrete temperature range used to map continuous temperature values ​​to a finite set of compensation parameters; the correspondence refers to the mapping function between the temperature range and the compensation parameters.

[0045] After acquiring real-time temperature data, the motor control system needs to quickly determine the corresponding compensation parameters for real-time correction. Specifically, the motor control system first maps the measured temperature value to a predefined temperature range, such as mapping 23.7℃ to the [20℃, 25℃] range; then it looks up the set of compensation parameters corresponding to this temperature range, including zero-point offset, sensitivity correction coefficient, etc.; if the measured temperature value is near the boundary between two temperature ranges, more accurate compensation parameters are calculated through linear interpolation to avoid control jitter caused by parameter abrupt changes.

[0046] In some embodiments, temperature error mapping can be implemented in several ways: Optionally, the motor control system can use a lookup table to evenly divide the temperature range into several intervals (e.g., every 5°C), with each interval storing a set of calibrated compensation parameters. During a query, a binary search is used to quickly locate the target interval, and then linear interpolation is performed to obtain the accurate compensation value. Optionally, the motor control system can also use a polynomial fitting method, using multiple sets of temperature-error sample points to fit the functional relationship between temperature and compensation parameters. During a query, the temperature value is directly substituted to calculate the compensation parameters. It is understood that other mapping methods, such as neural network models, can also be used, but this is not limited here.

[0047] In practical applications, rapid temperature changes may cause a lag in the tracking of compensation parameters. To address this, the motor control system employs a temperature prediction compensation algorithm: by calculating the rate of temperature change and acceleration, it predicts the temperature value at the next moment and queries the corresponding compensation parameters in advance. Specifically, it uses the most recent N temperature sampling points to perform a second-order polynomial fitting to obtain a temperature change trend function, predicts the temperature change within the next 100ms, and prepares the compensation parameters that may be needed in advance. This prediction mechanism can effectively reduce the compensation lag when temperature changes drastically.

[0048] S103. Perform preliminary compensation on the angle value based on the rapid compensation parameters to obtain the preliminary compensation angle value, and generate motor control parameters based on the preliminary compensation angle value to control the operation of the joint motor.

[0049] Among them, preliminary compensation refers to the real-time correction of the original angle value using rapid compensation parameters; the preliminary compensation angle value represents the angle data after temperature compensation; motor control parameters refer to the control quantities used to drive the joint motor, including but not limited to current, voltage, PWM duty cycle, etc.; the joint motor operating status includes dynamic characteristics such as position, speed, and acceleration.

[0050] The motor control system needs to complete angle compensation and control parameter generation within each control cycle. Specifically, the motor control system first applies the fast compensation parameters to the real-time angle value. The compensation calculation includes three stages: zero-point correction, sensitivity correction, and nonlinearity correction. Then, the compensated angle value is compared with the target angle, and the required control quantity is calculated using a PID control algorithm. Finally, the control quantity is converted into specific motor drive parameters, such as current command values ​​or PWM waveform parameters, and output to the motor drive circuit. The entire process needs to be completed within one control cycle (usually 1ms) to ensure real-time control.

[0051] In some embodiments, angle compensation and control parameter generation can be achieved in multiple ways: Optionally, the motor control system can employ a piecewise linear compensation method, dividing the angle range into multiple intervals, each using a different compensation coefficient. Compensation calculations are then quickly completed through table lookup and linear interpolation, followed by the generation of control quantities using an incremental PID algorithm. Optionally, the motor control system can also employ a neural network model, taking temperature, angle, etc., as inputs and directly outputting the compensated angle value and control parameters to achieve end-to-end control. It is understood that other control strategies, such as model predictive control, can also be used, but this is not limited here.

[0052] In practical applications, sudden load changes may lead to control parameter mismatches. To address this, the motor control system employs an adaptive control gain adjustment algorithm: by monitoring the motor's response characteristics in real time (such as tracking error, overshoot, and oscillation frequency), the PID parameters are dynamically adjusted. For example, when a large tracking error is detected, the proportional gain is appropriately increased to improve the response speed; when oscillation occurs, the derivative gain is increased to provide damping. Specifically, a mapping relationship between error characteristics and control parameters is established, and the control parameters are updated in real time according to preset adjustment rules.

[0053] S104. Store multiple real-time data packets collected in multiple consecutive cycles into the compensation buffer.

[0054] The compensation buffer represents a circular buffer data structure used to temporarily store historical data packets; multiple consecutive periods refer to a continuous time window, typically ranging from hundreds of milliseconds to several seconds; data packet storage includes operations such as data writing, buffer management, and data eviction; the buffer size represents the number of data packets that can be stored, and needs to be set reasonably according to system resources and analysis requirements.

[0055] While performing rapid compensation, the motor control system needs to accumulate sufficient historical data for subsequent accurate compensation calculations. Specifically, the motor control system writes the data packets collected in each control cycle into the compensation buffer in chronological order. When the buffer is full, the oldest data is evicted using a first-in, first-out (FIFO) strategy. Simultaneously, it maintains the time index of the data packets to facilitate quick access to data within specific time periods. Furthermore, it periodically checks the continuity of the data to ensure no data loss or duplication.

[0056] In some embodiments, data caching management can be implemented in several ways: Optionally, the motor control system can employ a dual-buffering mechanism, setting up two buffers of equal size, one for data writing and the other for data analysis. When the write buffer is full, they are swapped to ensure that data writing and analysis do not interfere with each other. Optionally, the motor control system can also employ a multi-level caching structure, with the first-level cache storing the high-frequency sampled raw data and the second-level cache storing the downsampled data for long-term feature analysis. It is understood that other caching strategies, such as distributed storage, can also be used, and are not limited here.

[0057] In practical applications, the sheer volume of data can lead to increased storage and processing pressure. To address this, the motor control system employs an adaptive data compression algorithm: dynamically adjusting the storage strategy based on data change characteristics. When data changes slowly, the sampling interval is increased or data compression is performed; when data changes rapidly, high-frequency sampling is maintained and the data is stored completely. For example, for temperature data, the storage interval can be automatically adjusted according to the rate of change: storing data every 10ms when changes are drastic, and extending this to every 100ms when changes are slow. This adaptive storage strategy ensures both the integrity of critical data and optimizes the efficiency of storage space utilization.

[0058] S105. When the number of data packets in the compensation buffer reaches a preset threshold, perform time series analysis on the data in the compensation buffer to extract temperature change features and angle drift features.

[0059] Among them, the preset quantity threshold represents the minimum number of data packets required to trigger data analysis, which is usually several hundred to several thousand samples; time series analysis refers to the statistical analysis and feature extraction of data arranged in chronological order; temperature change characteristics include characteristics such as change trends, periodic fluctuations, and abrupt change points; angle drift characteristics refer to the systematic deviation of angle measurement values ​​caused by temperature changes, including zero-point drift, gain changes, etc.

[0060] The motor control system needs to conduct in-depth analysis of the impact of temperature changes on angle measurement based on accumulated historical data. Specifically, the motor control system first checks the number of data packets in the compensation buffer, and begins analysis and processing after reaching a threshold; then, it performs trend decomposition on the temperature data sequence to separate long-term trends, periodic fluctuations, and random disturbances; simultaneously, it performs baseline drift analysis on the angle data to identify systematic deviations related to temperature; finally, it performs correlation analysis between temperature change characteristics and angle drift characteristics to establish a mapping relationship between the two.

[0061] In some embodiments, time series analysis can be implemented in various ways: Optionally, the motor control system can use wavelet transform to decompose temperature and angle data into multiple scales, extracting the variation features at different time scales, and then reconstructing the main variation patterns; alternatively, the motor control system can also use an autoregressive moving average model to establish a time series model of the data, reflecting the variation features of the data through model parameters. It is understood that other analysis methods, such as deep learning time series models, can also be used, but this is not limited here.

[0062] S106. Based on temperature change characteristics and angle drift characteristics, accurate compensation parameters are calculated.

[0063] Among them, the precise compensation parameter represents the high-precision compensation value obtained after in-depth analysis, including static compensation and dynamic compensation components; feature fusion refers to the comprehensive consideration of multi-dimensional features such as temperature change and angle drift; the calculation process includes steps such as feature normalization, weight allocation, and parameter optimization; the compensation accuracy is usually required to be better than that of the fast compensation parameter.

[0064] The motor control system needs to calculate more accurate compensation parameters based on the extracted features. Specifically, the motor control system first decomposes the temperature change features, calculating the influence weights of the trend, periodic, and random terms of temperature change respectively; then it analyzes the frequency distribution and amplitude characteristics of angle drift features to establish a temperature-angle response model; next, it optimizes the compensation parameters by comprehensively considering the contribution of each feature through a multi-feature fusion algorithm; finally, it confirms the effectiveness of the compensation parameters through cross-validation to ensure the stability of the compensation effect.

[0065] In some embodiments, accurate compensation parameters can be calculated in several ways: Optionally, the motor control system can employ recursive least squares to update the parameters of the temperature-angle response model in real time. The model includes linear and nonlinear terms, and the parameters are optimized by minimizing the prediction error. Optionally, the motor control system can also employ a parameter estimation method based on Kalman filtering, treating the compensation parameters as state variables and continuously correcting the parameter estimates using observed temperature and angle values. It is understood that other parameter optimization methods, such as genetic algorithms, can also be used, but this is not limited here.

[0066] In practical applications, the slow convergence speed of compensation parameter calculation may be encountered. To address this, the motor control system employs an adaptive learning rate strategy: dynamically adjusting the optimization step size based on changes in the parameter estimation error. When the error is large, a larger learning rate is used to quickly adjust the parameters; when the error is small, the learning rate is reduced to improve stability. Specifically, a learning rate adjustment function based on the error gradient is designed, and a momentum term is introduced to accelerate convergence. This adaptive optimization strategy ensures both the speed of parameter convergence and avoids parameter oscillations.

[0067] S107. Perform secondary compensation on the initial compensation angle value based on the precise compensation parameters to obtain the precise compensation angle value, and update the motor control parameters based on the precise compensation angle value.

[0068] Secondary compensation refers to further correction based on the initial compensation; the precise compensation angle value refers to the final angle value obtained after two compensations; control parameter updates include real-time parameter adjustments and control strategy optimization; the update process needs to ensure the stability and continuity of control.

[0069] Motor control systems need to smoothly apply precise compensation parameters to the control process. Specifically, the motor control system first compares the precise compensation parameters with the currently used rapid compensation parameters and calculates the parameter differences; then, it designs a gradual transition strategy to allow the compensation parameters to smoothly transition from the current value to the target value; next, it recalculates the angle value based on the new compensation parameters and adjusts the motor control parameters accordingly; finally, it monitors the control effect to ensure that the update of the compensation parameters does not lead to control instability.

[0070] In some embodiments, the smooth update of compensation parameters can be achieved in several ways: Optionally, the motor control system can use an exponential moving average method to allow new compensation parameters to gradually replace old parameters, and the smoothing coefficient can be dynamically adjusted according to the magnitude of the parameter differences; Optionally, the motor control system can also use a predictive control strategy to calculate in advance the changes in control quantity that may be caused by parameter updates and design the optimal transition trajectory. It is understood that other update strategies, such as fuzzy control, can also be used, and are not limited here.

[0071] In practical applications, control jitter may occur due to updates to compensation parameters. To address this, the motor control system employs a layered smoothing strategy: different update rates are used for compensation parameters of different frequency components. For low-frequency compensation components, a larger smoothing time constant is used to ensure smooth updates; for high-frequency compensation components, a smaller smoothing time constant is used to ensure rapid response. For example, the compensation parameters are decomposed into baseline drift compensation and dynamic fluctuation compensation. Baseline drift compensation uses a smoothing time on the order of 10 seconds, while dynamic fluctuation compensation uses a smoothing time on the order of 100 milliseconds. This layered strategy ensures both control stability and responsiveness to rapid changes.

[0072] The following provides a more detailed description of the process of the method provided in this implementation. Please refer to [link / reference]. Figure 2 This is another flowchart illustrating the joint motor control method based on an angle sensor in this application.

[0073] S201. Obtain the sampling frequency and temperature response time of the angle sensor, and calculate the sampling period of the angle data and the effective sampling interval of the temperature data.

[0074] Among them, sampling frequency represents the number of data acquisitions per unit time by the angle sensor, usually measured in Hertz (Hz); temperature response time refers to the time required for the temperature sensor to stabilize its output after detecting a temperature change, used to characterize the dynamic characteristics of the sensor; sampling period represents the time interval between two adjacent angle data acquisitions, which is equal to the reciprocal of the sampling frequency; effective sampling interval refers to the temperature data acquisition interval determined after considering the temperature response time, which needs to be greater than the temperature response time to ensure data reliability; data acquisition accuracy represents the quantization resolution of the sensor.

[0075] During the initialization phase, the motor control system needs to determine the basic parameters for data acquisition. Specifically, the motor control system first reads the specifications of the angle sensor to obtain its maximum sampling frequency (e.g., 2000Hz) and data bit depth (e.g., 12 bits); then, it tests the step response characteristics of the temperature sensor, recording the time from the input step change to the output reaching steady state (e.g., 50ms); next, based on control requirements and hardware capabilities, it sets the actual angle sampling frequency (e.g., 1000Hz) and calculates the sampling period (1ms); finally, based on the temperature response time, it determines the effective sampling interval for temperature data (e.g., 100ms), which needs to ensure sufficient time for the sensor to reach steady state between two adjacent temperature samples.

[0076] In some embodiments, sampling parameters can be determined in several ways: Optionally, the motor control system can determine the optimal sampling parameters through an adaptive sampling mechanism. First, the system is run at a low sampling rate and control performance indicators are recorded. Then, the sampling rate is gradually increased until the performance improvement is no longer significant. Finally, the sampling rate is set at an inflection point, and the temperature sampling interval is determined by analyzing the rise time and settling time of the temperature response curve. Optionally, the motor control system can also adopt a sampling strategy based on signal bandwidth. By measuring the spectral characteristics of the angle and temperature signals, the minimum required sampling rate is determined according to the Nyquist sampling theorem, with sufficient margin. The temperature sampling interval is then determined based on the highest frequency component of the temperature signal. It is understood that other parameter determination methods can also be used, such as automatic parameter adjustment based on control performance optimization, etc., which are not limited here.

[0077] In practical applications, the problem of dynamic changes in temperature response time caused by drastic fluctuations in ambient temperature may be encountered. To address this, the motor control system employs an adaptive response time estimation algorithm: dynamically adjusting sampling parameters by monitoring the changing characteristics of the temperature signal in real time. Specifically, a sliding time window is used to calculate the rise time and settling time of the temperature signal, constructing a temperature-response time mapping model. When a drastic temperature change is detected, the sampling interval is appropriately increased to ensure data reliability; when the temperature change is gradual, the sampling interval can be appropriately decreased to increase the data update frequency. For example, a sampling interval of 100ms is used under standard operating temperatures, but when the temperature changes rapidly (the rate of change exceeds 1℃ / s), the sampling interval is increased to 200ms to ensure that the temperature data sampled each time is stable and reliable.

[0078] S202. Determine the timestamp granularity of the data packet based on the sampling period and the effective sampling interval.

[0079] Among them, timestamp granularity represents the smallest unit of resolution of timestamps in a data packet, used to quantify the accuracy of time information; sampling period refers to the time interval of angle data acquisition, which determines the minimum requirement for timestamps; effective sampling interval represents the acquisition period of temperature data, affecting the storage efficiency of timestamps; quantization error refers to the approximate error generated when converting continuous time into discrete timestamps; and time synchronization accuracy represents the degree of time alignment between different data sources.

[0080] After determining the sampling parameters, the motor control system needs to set a suitable timestamp format. Specifically, the motor control system first analyzes the numerical characteristics of the angle sampling period (e.g., 1ms) and temperature sampling interval (e.g., 100ms) to determine the numerical range of the time data; then, considering the system clock resolution (e.g., 0.1μs) and storage space limitations, it selects a suitable time representation format; next, it designs the bit field allocation of the timestamp, including seconds, milliseconds, and microseconds, to ensure accurate representation of all sampling moments; finally, it verifies whether the timestamp representation range meets the system's maximum running time requirement.

[0081] In some embodiments, the timestamp granularity can be determined in several ways: Optionally, the motor control system can adopt a dynamic timestamp strategy, using high-precision timestamps (microsecond level) for angle data to record complete time information; using relative timestamps for temperature data, only recording the time difference relative to a reference time, reducing storage space through differential encoding; finally, a timestamp decoding algorithm is designed to restore complete time information during data processing; Optionally, the motor control system can also adopt a hierarchical timestamp structure, designing a two-level structure of a base time layer and an offset time layer. The base layer records a longer time scale (e.g., seconds), and the offset layer records a finer time scale (e.g., microsecond level), obtaining a complete timestamp by combining the information from the two layers. It is understood that other timestamp design schemes can also be used, such as event-triggered adaptive timestamps, etc., which are not limited here.

[0082] In practical applications, timestamp discrepancies caused by time asynchrony among multiple sensors may occur. To address this, the motor control system employs a time synchronization compensation algorithm: establishing a system-level time base and calibrating the time of all data sources. Specifically, a unified time base is first provided using a high-precision timer, and then the time delay characteristics of each sensor are measured to establish a delay compensation model. For example, if a 5ms inherent delay is detected in the temperature sensor, this delay value is automatically compensated when generating the timestamp. Furthermore, the system periodically performs time synchronization calibration by sending synchronization signals to measure and update the delay compensation values, ensuring time consistency during long-term operation.

[0083] In some embodiments, the motor control system integrates key data to avoid frequent compensation. Specifically, the motor control system aligns real-time data packets based on timestamp granularity and calculates the angle and temperature changes between adjacent timestamps. When the angle change exceeds a preset angle threshold or the temperature change exceeds a preset temperature threshold, the data packets within the corresponding time period are marked as key data packets. The key data packets and a preset number of adjacent data packets before and after the key data packets are integrated into data segments, and the data segments are stored in the priority storage area of ​​the compensation buffer.

[0084] Among them, time alignment refers to the process of standardizing different data packets according to timestamps; angle change refers to the difference in angle values ​​between adjacent moments; temperature change refers to the range of temperature value changes between adjacent moments; critical data packet refers to a data record containing important state change information; data segment refers to a continuous data sequence centered on the critical data packet; and priority storage area refers to a specific space in the compensation buffer used to store important data.

[0085] The motor control system needs to identify and store data that significantly impacts compensation calculations. Specifically, the motor control system first performs time standardization on all data packets based on timestamp granularity to ensure data temporal consistency. Then, it calculates the angle and temperature differences between each pair of adjacent data packets and compares them with preset change thresholds (e.g., 0.5 degrees for angle and 1°C for temperature). Next, data packets exceeding the thresholds are marked as critical data packets, and a preset number of data packets (e.g., 50 before and 50 after) are expanded forward and backward from these critical data packets to form complete data segments. Finally, these data segments are written to the priority storage area of ​​the compensation buffer to ensure that these important data are retained first when storage space is insufficient.

[0086] In some embodiments, the identification and storage of key data can be achieved in multiple ways: Optionally, the motor control system can employ a multi-level change detection strategy. First, at the macro level, statistical characteristics within a sliding window are calculated to identify time intervals that may contain significant changes. Then, at the micro level, the location of change points is precisely determined to define the specific range of key data packets. Finally, data segments are prioritized according to the importance of the changes to guide storage management. Optionally, the motor control system can also employ pattern recognition methods, automatically identifying data segments containing typical change patterns through a pre-trained classifier to achieve intelligent data filtering. It is understood that other data identification methods can also be used, such as importance assessment based on information entropy, etc., which are not limited here.

[0087] In practical applications, inaccurate identification of key data may lead to the loss of important information. To address this, the motor control system employs an adaptive threshold adjustment strategy: dynamically evaluating the system state and adjusting the judgment criteria. Specifically, a data importance assessment model is constructed: first, a baseline distribution of normal changes is established based on historical data statistics; then, the deviation of the current change from the baseline is calculated; finally, the judgment threshold is dynamically adjusted based on the degree of deviation. For example, during stable system operation, a larger judgment threshold (e.g., 3 times the baseline standard deviation) is used to avoid over-labeling; when the system enters the dynamic adjustment phase, the threshold is lowered (e.g., 2 times the baseline standard deviation) to improve sensitivity. Simultaneously, the system periodically evaluates the distribution characteristics of key data. If abnormal key data density is detected in certain time periods (e.g., exceeding 30%), a threshold optimization process is automatically triggered to recalculate a more reasonable judgment criterion. This adaptive mechanism ensures the accuracy and completeness of key data identification.

[0088] S203. Adjust the data storage interval of the compensation cache based on timestamp granularity.

[0089] Among them, the compensation buffer represents the memory space structure used to store historical data, including data storage, management and access mechanisms; the data storage interval refers to the time interval between adjacent data packets in the buffer; the storage density represents the number of data packets stored per unit time; the caching strategy refers to the rules for storing, reading and evicting data; and the data alignment represents the matching relationship of different types of data in the time dimension.

[0090] The motor control system needs to optimize the data storage structure based on a defined timestamp granularity. Specifically, the motor control system first calculates the minimum storage interval corresponding to the timestamp granularity (e.g., 1ms); then, based on memory capacity and data analysis requirements, it designs a multi-level storage structure, including a high-frequency data area (storing raw angle data), a mid-frequency data area (storing downsampled composite data), and a low-frequency data area (storing statistical feature data); next, it formulates data downsampling and aggregation rules, using different time intervals in different storage areas; finally, it implements an automatic hierarchical storage and management mechanism for data packets to ensure the complete preservation of critical data.

[0091] In some embodiments, the storage interval can be adjusted in several ways: Optionally, the motor control system can adopt an adaptive storage strategy. First, it analyzes the data change characteristics and calculates the information entropy at different time scales. Then, based on the information entropy, it designs a variable sampling rate storage scheme, increasing the storage density when the data changes drastically and decreasing the storage density when the data is stable. Finally, it dynamically evaluates the storage effect through a sliding window and adjusts the storage parameters as needed. Optionally, the motor control system can also adopt a segmented compression storage method. First, it segments the data by time, calculates the feature vector for each segment, then merges the data segments based on feature similarity, and finally applies different storage intervals to the merged data segments. It is understood that other storage optimization methods can also be used, such as dynamic storage based on importance sampling, etc., which are not limited here.

[0092] S204. Collect real-time angle data and temperature data from the angle sensor, and generate a real-time data packet containing angle value, temperature value and timestamp.

[0093] Referring to step S101, the motor control system will generate a real-time data packet.

[0094] S205. Query the preset temperature error mapping table to determine the fast compensation parameters for the corresponding temperature value.

[0095] Referring to step S102, the motor control system will determine the rapid compensation parameters.

[0096] S206. Perform preliminary compensation on the angle value based on the rapid compensation parameters to obtain the preliminary compensation angle value, and generate motor control parameters based on the preliminary compensation angle value to control the operation of the joint motor.

[0097] Referring to step S103, the motor control system will perform preliminary compensation.

[0098] S207. Store multiple real-time data packets collected in multiple consecutive cycles into the compensation buffer.

[0099] Referring to step S104, the motor control system will collect multiple real-time data packets and store them in the compensation buffer.

[0100] S208. When the number of data packets in the compensation buffer reaches a preset threshold, perform time series analysis on the data in the compensation buffer to extract temperature change features and angle drift features.

[0101] Referring to step S105, the motor control system will extract temperature change features and angle drift features.

[0102] S209. Based on temperature change characteristics and angle drift characteristics, accurate compensation parameters are calculated.

[0103] Referring to step S106, the motor control system will calculate the precise compensation parameters.

[0104] In some embodiments, the motor control system will perform rapid compensation updates in a timely manner. That is, the motor control system will calculate the parameter deviation value between the precise compensation parameter and the rapid compensation parameter; when the parameter deviation value exceeds the preset deviation threshold, the rapid compensation parameter of the corresponding temperature range in the temperature error mapping table will be updated based on the historical compensation parameters in the compensation buffer.

[0105] Among them, the parameter deviation value represents the numerical difference between the precise compensation parameter and the fast compensation parameter; the preset deviation threshold refers to the judgment criterion for triggering the update of the mapping table; the historical compensation parameter refers to the past compensation data stored in the compensation cache; the temperature range represents the discrete temperature range in the temperature error mapping table; the update strategy refers to the modification rules and update methods of the mapping table parameters; and the fast compensation parameter includes compensation amounts such as zero-point correction value and sensitivity correction coefficient.

[0106] The motor control system needs to dynamically optimize the temperature compensation strategy based on real-time operating results. Specifically, the motor control system first calculates the vector difference between the precise compensation parameter and the fast compensation parameter in each control cycle to obtain the deviation vector in the multi-dimensional parameter space; then, it calculates the weighted norm of the deviation vector and compares it with a preset update threshold (e.g., 5% of the nominal value); when the deviation continues to exceed the threshold, it extracts the most recent N sets (e.g., N=100) of historical compensation data from the compensation buffer, performs statistical analysis and feature extraction; then, based on the extracted features, it updates the fast compensation parameters for the corresponding temperature range using the recursive least squares method; finally, it ensures the continuity of parameters between adjacent temperature ranges through a smooth transition function.

[0107] In some embodiments, the dynamic updating of the mapping table can be achieved in several ways: Optionally, the motor control system can adopt an adaptive learning strategy. First, a time series model of the parameter deviation is established to analyze the trend and periodic characteristics of the deviation. Then, based on the characteristic analysis results, the learning rate and update period for parameter updates are designed. Finally, the fast compensation parameters are optimized using the gradient descent method to gradually approach the accurate compensation parameters. Optionally, the motor control system can also adopt a hierarchical optimization method, decomposing the compensation parameters into a basic compensation layer and a fine-tuning compensation layer. When a parameter deviation is detected, the fine-tuning layer parameters are updated first to ensure the speed and stability of the system response. It is understood that other optimization methods can also be used, such as parameter tuning based on reinforcement learning, etc., which are not limited here.

[0108] In practical applications, system oscillations caused by parameter updates may occur. To address this, the motor control system employs a progressive parameter update strategy: ensuring the reliability of the update process through multi-stage verification. Specifically, a protection mechanism for parameter updates is designed: first, the maximum allowable step size for parameter updates is calculated, and a safety boundary is determined based on system stability analysis; then, the update amount is decomposed into multiple small steps for progressive adjustment, and the system response is observed after each adjustment; if a sudden increase in control error (e.g., exceeding twice the normal value) or output oscillation (e.g., a sudden change in frequency components) is detected, the system immediately reverts to the previous stable state. For example, when the compensation parameter for a certain temperature range needs to be adjusted by 10%, the system will divide the adjustment amount evenly into 5 executions, adjusting 2% each time, and monitoring the system performance for at least 100 control cycles after each adjustment to ensure the smoothness of the adjustment process.

[0109] In some embodiments, the motor control system performs precise compensation based on a preset compensation model. Specifically, the motor control system performs time-series decomposition of temperature change characteristics to obtain temperature trend components and temperature periodic components; determines the contribution weight of temperature change to angle drift based on the rate of change of the temperature trend components; performs frequency domain analysis on the angle drift characteristics to extract the frequency and amplitude characteristics of the angle drift; performs weighted fusion of the contribution weight, frequency characteristics, and amplitude characteristics to obtain a compensation feature vector; and calculates precise compensation parameters based on the preset compensation model and the compensation feature vector.

[0110] Among them, time-series decomposition represents the mathematical processing of separating temperature change signals into different characteristic components; temperature trend component refers to the long-term trend of temperature change; temperature periodic component represents the periodic fluctuation characteristics of temperature change; contribution weight is a quantitative indicator of the degree of influence of temperature change on angle drift; frequency domain analysis represents the mathematical method of studying angle drift characteristics in the frequency domain; compensation eigenvector refers to the multidimensional characteristic quantity used to calculate accurate compensation parameters; compensation model represents the mapping relationship from eigenvector to compensation parameters.

[0111] The motor control system requires in-depth analysis of the correlation between temperature changes and angle drift. Specifically, the motor control system first performs empirical mode decomposition on the temperature data, separating it into multiple intrinsic mode functions reflecting characteristics at different time scales; then, it obtains the long-term temperature change trend through a trend extraction algorithm and calculates the first derivative of the trend as a rate of change index; next, it uses fast Fourier transform to perform spectral analysis on the angle drift data, extracting the amplitude and phase information of the main frequency components; then, it designs an adaptive weighting function based on the temperature change rate to quantify the degree of influence of temperature changes on each frequency component; finally, it combines all features into a feature vector, inputs it into a pre-trained compensation model, and calculates the accurate compensation parameters.

[0112] It should be noted that the preset compensation model is trained by collecting a large number of temperature-angle sample pairs. The input includes multi-dimensional feature vectors such as temperature trend components, temperature periodic components, and frequency and amplitude features of angle drift. The output is a set of compensation parameters. The least squares method is used to optimize the model parameters, minimizing the mean square error between the predicted compensation value and the actual required compensation value. The temperature change prediction model uses temperature sequences within a sliding time window as training data, constructs an LSTM neural network structure, and outputs the predicted temperature value within the next 100ms. The prediction error is minimized through backpropagation. The response time prediction model is trained based on historical compensation process data. The input includes features such as angle difference and rate of change, and the output is the shortest time required to achieve the target accuracy. Cross-validation is used to optimize the model's generalization performance. The data importance assessment model is trained using key data samples annotated by experts. The input is the statistical features of the data segment, and the output is the importance score. A weighted loss function is used to balance the recognition accuracy of different types of data.

[0113] The pre-defined compensation model employs a multilayer perceptron structure, comprising three functional modules: feature extraction, nonlinear mapping, and parameter prediction. The temperature change prediction model uses gated recurrent units to process temporal features and introduces an attention mechanism to highlight the impact of key time points. The response time prediction model combines convolutional neural networks and recurrent neural networks to capture local and global features of angle changes. The data importance assessment model uses a gradient boosting tree structure to improve classification accuracy through feature combination. All models include regularization layers to prevent overfitting and use batch normalization to improve training stability. In real-time operation, the pre-defined compensation model receives the latest feature vectors each control cycle and quickly calculates compensation parameters; the temperature change prediction model predicts temperature change trends based on the most recent N temperature sampling points to adjust the compensation strategy in advance; the response time prediction model dynamically adjusts the buffer capacity based on angle difference change characteristics to optimize system response speed; and the data importance assessment model analyzes the data stream in real time, marks key data segments, and guides storage management. The prediction results of each model are combined through weighted fusion to ensure the accuracy and reliability of compensation control. The system also periodically evaluates model performance and triggers online fine-tuning or offline retraining when necessary to maintain the model's prediction accuracy.

[0114] In practical applications, the computationally intensive feature extraction process may lead to insufficient real-time performance. To address this, the motor control system employs a hierarchical computation strategy: optimizing computational resource allocation through feature importance assessment. Specifically, a three-level feature extraction framework is constructed: the first level uses simplified algorithms to quickly extract basic features; the second level computes complete features over a longer time scale; and the third level performs detailed analysis for critical events. For example, under normal operating conditions, the system primarily relies on temperature trends and first-order angle features for compensation, resulting in a relatively low computational load. Only when drastic temperature changes (rate of change exceeding 2°C / minute) or abnormal angle drift (drift rate exceeding 0.5° / minute) are detected is the complete feature extraction process activated, including computationally intensive operations such as wavelet analysis and spectral analysis. This hierarchical computation mechanism ensures the accuracy of feature extraction while significantly improving the system's real-time response capability.

[0115] S210. Perform secondary compensation on the initial compensation angle value based on the precise compensation parameters to obtain the precise compensation angle value, and update the motor control parameters based on the precise compensation angle value.

[0116] Referring to step S107, the motor control system will perform precise compensation.

[0117] S211. Calculate the real-time angle difference between the precise compensation angle value and the preliminary compensation angle value.

[0118] Among them, the real-time angle difference represents the numerical deviation between the two-level compensation results; the calculation period refers to the time interval for calculating the difference; the statistical characteristics of the difference include statistical quantities such as mean, standard deviation and extreme values; the difference trend represents the change law of angle deviation over time; and the threshold judgment condition refers to the difference standard that triggers the system response.

[0119] The motor control system needs to monitor the difference between the two levels of compensation effects in real time. Specifically, the motor control system first synchronously acquires the precise compensation angle value and the preliminary compensation angle value in each control cycle; then it calculates the algebraic difference between the two and performs unit conversion and dimension unification; next, it performs sliding window analysis on the difference over multiple consecutive cycles to calculate short-term and long-term statistical characteristics; finally, it compares the calculation results with preset evaluation indicators to determine the stability of the compensation effect.

[0120] In some embodiments, the angle difference can be calculated and analyzed in various ways: Optionally, the motor control system can employ a multi-scale difference analysis method. First, the instantaneous difference is calculated at the microscale to establish a high-frequency difference sequence; then, the trend characteristics at the mesoscale are obtained through window averaging; finally, cumulative statistics are used to construct macroscale performance indicators, forming a complete difference evaluation system. Optionally, the motor control system can also employ an adaptive weight analysis strategy, dynamically adjusting the weight coefficients of the difference calculation according to the severity of the angle change, focusing on the instantaneous difference during the rapid motion phase and emphasizing the evaluation of long-term drift during the steady-state phase. It is understood that other analysis methods, such as difference evaluation based on spectrum analysis, can also be used, and are not limited here.

[0121] In practical applications, noise interference may cause inaccurate judgments in difference calculations. To address this, the motor control system employs a robust difference evaluation algorithm: improving calculation reliability through multiple filtering and statistical testing. Specifically, a three-stage data processing flow is designed: the first stage uses median filtering to remove occasional outliers; the second stage applies low-pass filtering to extract key trend features; and the third stage uses an exponentially weighted moving average to calculate stable differences. For example, when the system detects a sudden increase in the variance of the difference sequence (more than three times the normal value), it automatically extends the average window width and increases the tolerance range for outlier judgment, ensuring the stability of the difference calculation. This multi-layered protection mechanism effectively avoids the impact of noise interference on difference judgments.

[0122] S212. When the real-time angle difference is greater than the compensation adjustment threshold, reduce the data capacity of the compensation buffer.

[0123] Among them, the compensation adjustment threshold represents the difference judgment standard that triggers the adjustment of the buffer capacity; the data capacity refers to the number of data packets that the compensation buffer can store; the capacity adjustment strategy includes the adjustment step size, adjustment frequency and boundary conditions; the data cleaning mechanism refers to the data filtering and deletion rules when reducing capacity; and the system response time represents the time interval from exceeding the threshold to completing the adjustment.

[0124] The motor control system needs to dynamically optimize storage resources based on the compensation effect. Specifically, the motor control system first compares the real-time angle difference with a preset adjustment threshold (e.g., 0.1 degrees); when the difference exceeds the threshold for several consecutive cycles, the cache capacity adjustment process is triggered; then, a new capacity target value is calculated according to a predetermined shrinkage ratio (e.g., a 20% reduction); next, data cleaning is performed, prioritizing the retention of the latest data and key feature point data; finally, the storage structure is reorganized to ensure data continuity and integrity.

[0125] In some embodiments, dynamic adjustment of cache capacity can be achieved in several ways: Optionally, the motor control system can adopt a gradual capacity adjustment strategy, first assessing the importance distribution of the current data and establishing a data retention priority ranking; then, gradually reducing the capacity in batches, evaluating system performance after each reduction; finally, gradually reaching the target capacity value while ensuring compensation effectiveness; Optionally, the motor control system can also adopt an adaptive partitioning management method, dividing the cache area into a core data area and an extended data area. When capacity needs to be reduced, low-priority data in the extended area is cleared first, maintaining the stability of the core area. It is understood that other capacity adjustment methods can also be used, such as dynamic storage management based on data compression, etc., which are not limited here.

[0126] In practical applications, the instability of compensation effects after capacity adjustment may be encountered. To address this, the motor control system employs a safety rollback mechanism: performance monitoring ensures the reliability of the adjustment process. Specifically, a multi-level capacity adjustment scheme is established: the first level is a temporary adjustment, observing the system response over a short period (e.g., 10 seconds); the second level is interim verification, evaluating the compensation effect over a longer period (e.g., 1 minute); and the third level is a permanent adjustment, fixing the new capacity settings after confirmation of stability. For example, when the system performs a capacity reduction operation, it simultaneously records the data and configuration parameters before the adjustment. If a decrease in compensation accuracy is detected during verification (error increase exceeding 50%), the system immediately reverts to the pre-adjustment state and records the reason for the adjustment failure in the log. This adjustment strategy with a protective mechanism ensures that the system maintains stable control performance while optimizing storage efficiency.

[0127] In some embodiments, the motor control system will perform a precise compensation strategy adjustment. That is, when the real-time angle difference is greater than the compensation adjustment threshold, the motor control system will calculate the rate of change of the real-time angle difference; based on the rate of change, determine the target response period for secondary compensation; and adjust the data capacity of the compensation buffer to the number of data packets within a target response period.

[0128] Among them, the rate of change indicates how fast the real-time angle difference changes over time; the target response period refers to the shortest time interval required to complete the secondary compensation; the data capacity adjustment indicates the dynamic optimization of the compensation buffer storage space; the number of data packets refers to the total amount of data collected within the target response period; the compensation adjustment threshold indicates the criterion for judging the angle difference that triggers the system response; and the angle difference characteristics include characteristic parameters such as amplitude, frequency, and phase.

[0129] The motor control system needs to optimize the compensation response speed based on the dynamic characteristics of the angle difference. Specifically, the motor control system first calculates the real-time angle difference at multiple consecutive sampling points and uses the central difference method to calculate its first derivative to obtain the rate of change. Then, based on the magnitude of the rate of change, it estimates the shortest time required to achieve the desired compensation accuracy using a response time prediction model. Next, this time is defined as the target response period, and the number of data packets required within this period is calculated based on the data sampling frequency. Finally, the capacity of the compensation buffer is dynamically adjusted based on the calculation results to precisely match the data requirements of the target response period.

[0130] In some embodiments, response optimization can be achieved in several ways: Optionally, the motor control system can adopt an adaptive response optimization strategy. First, a dynamic model of the angle difference is established to analyze its variation characteristics and stability. Then, a nonlinear mapping function is designed based on the variation characteristics to map the rate of change to the optimal response period. Finally, the parameters of the mapping function are continuously optimized through a feedback correction mechanism. Optionally, the motor control system can also adopt a predictive control method, using historical data to train a predictive model, estimate the response time required for compensation in advance, and dynamically adjust the buffer capacity accordingly. It is understood that other optimization methods can also be used, such as adaptive adjustment based on fuzzy control, etc., which are not limited here.

[0131] In practical applications, inaccurate response period estimation may lead to unstable compensation results. To address this, the motor control system employs a multi-model fusion strategy: improving estimation accuracy by integrating multiple prediction models. Specifically, a two-layer structure is constructed, comprising a fast response model and a precise response model: the fast response model uses simplified linear prediction for initial response period estimation; the precise response model considers the system's nonlinear characteristics and accurately predicts the required time using a state observer. For example, when the rate of change of the detected angle difference exceeds 0.1 degrees / second, the system first uses the fast model to provide a rough estimate, and then simultaneously runs the precise model in the background for correction. If the difference between the two models' predictions exceeds 20%, an exception handling mechanism is triggered, temporarily maintaining the current cache capacity until a more reliable prediction result is obtained.

[0132] In this embodiment, an innovative dual-layer compensation architecture integrating fast and precise compensation is proposed, combined with technologies such as real-time data acquisition, time series analysis, and adaptive parameter adjustment. This allows for continuous optimization of the compensation effect while ensuring the system's real-time response capability. By establishing a mapping relationship between temperature change characteristics and angle drift, the system can accurately predict and compensate for temperature effects, effectively solving problems such as low compensation accuracy, lag response, and poor adaptability in traditional methods. Simultaneously, the adoption of dynamic data management and feature extraction strategies achieves efficient utilization of computing resources, ensuring reliable operation of the compensation algorithm in real industrial environments. The system also possesses self-learning and optimization capabilities, continuously improving the compensation effect based on historical data, thereby achieving high-precision and high-reliability operation of the motor control system in complex temperature environments.

[0133] The motor control system in the embodiments of this invention is described below from the perspective of hardware processing. Please refer to [link / reference]. Figure 3 This is a schematic diagram of the physical device structure of a motor control system in an embodiment of this application.

[0134] It should be noted that, Figure 3 The structure of the motor control system shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0135] like Figure 3 As shown, the motor control system includes a CPU 301, which can perform various appropriate actions and processes according to a program stored in ROM 302 or a program loaded into RAM 303 from storage section 308, such as executing the methods described in the above embodiments. RAM 303 also stores various programs and data required for system operation. The CPU 301, ROM 302, and RAM 303 are interconnected via bus 304. I / O interface 305 is also connected to bus 304.

[0136] The following components are connected to I / O interface 305: input section 306 including audio input devices, push-button switches, etc.; output section 307 including liquid crystal display (LCD) and audio output devices, indicator lights, etc.; storage section 308 including hard disks, etc.; and communication section 309 including network interface cards such as LAN (Local Area Network) cards, modems, etc. Communication section 309 performs communication processing via a network such as the Internet. Drive 310 is also connected to I / O interface 305 as needed. Removable media 311, such as disks, optical disks, magneto-optical disks, semiconductor memories, etc., are installed on drive 310 as needed so that computer programs read from them can be installed into storage section 308 as needed.

[0137] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing computer programs for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 309, and / or installed from removable medium 311. When the computer program is executed by CPU 301, it performs the various functions defined in the present invention.

[0138] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. Each block in a flowchart or block diagram may represent a module, program segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those shown in the drawings.

[0139] Specifically, the motor control system of this embodiment includes a processor and a memory. The memory stores a computer program. When the computer program is executed by the processor, it implements the joint motor control method based on the angle sensor provided in the above embodiment.

[0140] In another aspect, the present invention also provides a computer-readable storage medium, which may be included in the motor control system described in the above embodiments; or it may exist independently and not assembled into the motor control system. The storage medium carries one or more computer programs that, when executed by a processor of the motor control system, cause the motor control system to implement the angle sensor-based joint motor control method provided in the above embodiments.

[0141] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

[0142] As used in the above embodiments, depending on the context, the term "when..." can be interpreted as meaning "if...", "after...", "in response to determining...", or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if (the stated condition or event) is interpreted as meaning "if determining...", "in response to determining...", "when (the stated condition or event) is detected", or "in response to detecting (the stated condition or event)".

Claims

1. A joint motor control method based on an angle sensor, characterized in that, Applied to a motor control system, the method includes: Collect real-time angle and temperature data from the angle sensor and generate a real-time data packet containing angle value, temperature value and timestamp; Query the preset temperature error mapping table to determine the fast compensation parameters corresponding to the temperature value; The angle value is initially compensated based on the fast compensation parameters to obtain an initial compensation angle value, and motor control parameters are generated based on the initial compensation angle value to control the operation of the joint motor. Multiple real-time data packets collected over several consecutive periods are stored in the compensation buffer. When the number of data packets in the compensation buffer reaches a preset threshold, time series analysis is performed on the data in the compensation buffer to extract temperature change features and angle drift features. Based on the temperature change characteristics and the angle drift characteristics, accurate compensation parameters are calculated. The initial compensation angle value is compensated a second time based on the precise compensation parameters to obtain the precise compensation angle value, and the motor control parameters are updated based on the precise compensation angle value.

2. The method according to claim 1, characterized in that, After the step of calculating the accurate compensation parameters based on the temperature change characteristics and the angle drift characteristics, the method further includes: Calculate the parameter deviation between the precise compensation parameter and the rapid compensation parameter; When the parameter deviation value exceeds the preset deviation threshold, the fast compensation parameter for the corresponding temperature range in the temperature error mapping table is updated based on the historical compensation parameters in the compensation buffer.

3. The method according to claim 1, characterized in that, After the steps of performing secondary compensation on the initial compensation angle value based on the precise compensation parameters to obtain the precise compensation angle value, and updating the motor control parameters based on the precise compensation angle value, the method further includes: Calculate the real-time angle difference between the precise compensation angle value and the preliminary compensation angle value; When the real-time angle difference exceeds the compensation adjustment threshold, the data capacity of the compensation buffer is reduced.

4. The method according to claim 3, characterized in that, The step of reducing the data capacity of the compensation buffer when the real-time angle difference is greater than the compensation adjustment threshold specifically includes: When the real-time angle difference is greater than the compensation adjustment threshold, the rate of change of the real-time angle difference is calculated. Based on the rate of change, the target response period for secondary compensation is determined; The data capacity of the compensation buffer is adjusted to the number of data packets within one target response cycle.

5. The method according to claim 1, characterized in that, The step of calculating the accurate compensation parameters based on the temperature change characteristics and the angle drift characteristics specifically includes: The temperature change characteristics are decomposed over time to obtain temperature trend components and temperature periodic components. Based on the rate of change of the temperature trend component, the contribution weight of temperature change to angle drift is determined. Frequency domain analysis is performed on the angle drift characteristics to extract the frequency and amplitude characteristics of the angle drift; The contribution weights, frequency features, and amplitude features are weighted and fused to obtain a compensation feature vector; Based on the preset compensation model and the compensation feature vector, the accurate compensation parameters are calculated.

6. The method according to claim 1, characterized in that, Before the step of acquiring real-time angle data and temperature data from the angle sensor and generating a real-time data packet containing angle values, temperature values, and timestamps, the method further includes: Obtain the sampling frequency and temperature response time of the angle sensor, and calculate the sampling period of the angle data and the effective sampling interval of the temperature data; The timestamp granularity of the data packet is determined based on the sampling period and the effective sampling interval; The data storage interval of the compensation cache is adjusted based on the timestamp granularity.

7. The method according to claim 6, characterized in that, After the step of determining the timestamp granularity of the data packet based on the sampling period and the effective sampling interval, the method further includes: Based on the timestamp granularity, the real-time data packets are time-aligned, and the angular and temperature changes between adjacent timestamps are calculated. When the angle change exceeds a preset angle threshold or the temperature change exceeds a preset temperature threshold, the data packets within the corresponding time period are marked as critical data packets. The key data packet and a preset number of adjacent data packets before and after the key data packet are integrated into a data fragment, and the data fragment is stored in the priority storage area of ​​the compensation buffer.

8. A motor control system, characterized in that, The motor control system includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the motor control system to perform the method as described in any one of claims 1-7.

9. A computer-readable storage medium comprising instructions, characterized in that, When the instruction is executed on the motor control system, the motor control system performs the method as described in any one of claims 1-7.

10. A computer program product, characterized in that, When the computer program product is run on the motor control system, it causes the motor control system to perform the method as described in any one of claims 1-7.

Citation Information

Cited By

  • Neurology medicine delivery parameter adjusting method and system

    CN121177609A

  • A method and system for adjusting neurological drug delivery parameters

    CN121177609B

  • Injection molding energy consumption optimization control method based on digital twinning

    CN121433116A