A high-precision control method and system for an in-wheel motor based on encoder error adaptive correction
Patent Information
- Application Number
- CN202611276738.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-21
- Publication Date
- 2026-10-20
AI Technical Summary
[0004]本发明的目的在于克服现有技术的不足,适应现实需要,提供一种基于编码器误差自适应校正的轮毂电机高精度控制方法及系统,以解决当前部分控制方法主要针对控制算法本身进行优化,例如改进滑模控制趋近律以降低系统抖振,但未充分考虑编码器测量误差对控制结果的影响,而且,部分方案虽然采用编码器误差补偿方式,但通常仅针对编码器出厂时的固定分度误差进行一次性标定补偿,难以适应车辆运行过程中由于振动、电磁干扰、温度变化以及器件老化等因素产生的随机误差和慢变误差,此外,现有控制算法多采用固定参数控制方式,在低速运行、高速响应以及负载突变等不同工况下难以兼顾控制精度与动态性能,同时多轮毂电机系统中不同电机之间存在个体差异,容易造成转速及转矩输出不一致,影响整车运行稳定性,在电机启停、加减速以及负载切换过程中,传统阶跃式控制指令还容易造成转矩突变和电流冲击,增加系统损耗并降低运行可靠性的技术问题
[0038]1.本发明通过建立编码器固定分度误差矩阵,并结合运行过程中的随机误差动态辨识与补偿,可以有效降低编码器硬件偏差、振动干扰、电磁干扰及温度漂移等因素造成的测量误差,提高轮毂电机转速检测与位置反馈精度,改善低速运行时的爬行现象,转速测量误差可由传统的±5r/min降至±1r/min以内,低速爬行现象得到明显抑制,位置闭环控制精度大幅提升。
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This invention relates to the field of permanent magnet hub motor drive control, specifically to a high-precision control method and system for hub motors based on encoder error adaptive correction. Background Technology
[0002] In-wheel motors integrate power, transmission, and braking systems within the wheel rim, eliminating intermediate transmission components such as drive shafts and differentials. They feature a compact structure, rapid power response, and independent controllable power for each wheel, making them a crucial actuator in distributed electric drive systems. Currently, in-wheel motors are widely used in automated guided vehicles, wheeled mobile robots, and low-speed unmanned vehicles. During operation, encoders typically acquire rotor position and speed information, which is then combined with control algorithms such as PID control and sliding mode variable structure control to achieve motor speed regulation, closed-loop position control, and operational stability control, meeting the vehicle's driving, steering, and anti-skid control requirements.
[0003] Existing hub motor control schemes still have certain shortcomings in practical applications. Some control methods mainly optimize the control algorithm itself, such as improving the sliding mode control reaching law to reduce system chattering, but they do not fully consider the impact of encoder measurement errors on the control results. Moreover, although some schemes use encoder error compensation, they usually only perform one-time calibration compensation for the fixed indexing error of the encoder at the factory, which is difficult to adapt to random and slowly varying errors caused by factors such as vibration, electromagnetic interference, temperature changes, and component aging during vehicle operation. In addition, existing control algorithms mostly use fixed parameter control methods, which make it difficult to balance control accuracy and dynamic performance under different operating conditions such as low-speed operation, high-speed response, and sudden load changes. At the same time, there are individual differences between different motors in multi-hub motor systems, which can easily cause inconsistencies in speed and torque output, affecting the stability of the vehicle operation. During motor start-stop, acceleration, deceleration, and load switching, traditional step control commands are also prone to torque surges and current surges, increasing system losses and reducing operational reliability. Therefore, new technical solutions are needed to address these issues. Summary of the Invention
[0004] The purpose of this invention is to overcome the shortcomings of existing technologies, adapt to practical needs, and provide a high-precision control method and system for hub motors based on encoder error adaptive correction. This addresses the problems of current control methods that primarily optimize the control algorithm itself, such as improving the sliding mode control reaching law to reduce system chattering, but do not fully consider the impact of encoder measurement errors on the control results. Furthermore, while some solutions employ encoder error compensation, they typically only perform a one-time calibration compensation for the fixed indexing error of the encoder at the factory, making it difficult to adapt to random and slowly varying errors caused by factors such as vibration, electromagnetic interference, temperature changes, and component aging during vehicle operation. In addition, existing control algorithms often use fixed parameter control methods, making it difficult to balance control accuracy and dynamic performance under different operating conditions such as low-speed operation, high-speed response, and sudden load changes. Moreover, individual differences exist between different motors in multi-hub motor systems, easily causing inconsistent speed and torque output, affecting the overall vehicle stability. During motor start-up, acceleration, deceleration, and load switching, traditional step control commands are also prone to causing sudden torque changes and current surges, increasing system losses and reducing operational reliability.
[0005] To achieve the objectives of this invention, the technical solution adopted is as follows: A high-precision control method for a hub motor based on encoder error adaptive correction is designed, comprising the following steps:
[0006] S1. System initialization and encoder fixed error calibration: After the hub motor is powered on, the system completes self-test, controls the motor to rotate at a constant speed under no-load for one revolution, collects the actual output pulse number of the encoder at preset angle intervals, compares it with the theoretical pulse number of the corresponding angle to obtain the fixed error offset of each angle interval, constructs the encoder fixed indexing error matrix and stores it.
[0007] S2. Real-time operation data acquisition: During vehicle operation, the encoder raw pulse signal, rotor position, actual speed, bus current, load current and vehicle operating condition signal of each wheel hub motor are acquired in real time.
[0008] S3, Dual-dimensional encoder error correction: Based on the current rotor angle, the fixed indexing error matrix is retrieved to perform static compensation for inherent errors in the original pulse data; at the same time, random pulse errors during operation are identified through the sliding window variance algorithm, and dynamic compensation coefficients are generated to perform secondary correction on the pulse data, outputting the corrected accurate speed and position data;
[0009] S4. Segmented fuzzy adaptive sliding mode control: The current operating condition range is divided according to the corrected speed and load data. The approach law parameters and PID correction parameters of the sliding mode control are dynamically adjusted through fuzzy inference rules, and the torque control command is output.
[0010] S5. Multi-motor differentiated collaborative control: For each hub motor, an independent error compensation model is used to output adapted control commands and make dynamic fine adjustments based on the speed deviation of multiple wheels to ensure the consistency of speed and torque output of each motor.
[0011] S6. Smooth transition processing of operating conditions: The torque control command is gradually interpolated and output to the motor driver after constraining the torque change rate threshold.
[0012] S7. Closed-loop feedback and error iteration: Real-time acquisition of motor operation feedback data forms closed-loop control, and the fixed indexing error matrix is updated according to a preset cycle to complete the full life cycle adaptive correction.
[0013] Preferably, in step S1, the preset angle interval is 1°, and the fixed division error matrix is represented as E(θ)=[ , ],in Let be the deviation between the actual pulse count and the theoretical pulse count for the i-th angle interval; the formula for calculating the pulse count after static correction is:
[0014]
[0015] in This represents the original number of acquired pulses. This represents the number of pulses after static correction.
[0016] Preferably, in step S3, the specific method for identifying random pulse errors is as follows: taking N consecutive frames of pulse sampling data to form a sliding window, and calculating the variance of the rotational speed data within the window. When the variance exceeds a preset threshold, random interference error is identified, and a corresponding dynamic compensation coefficient k is generated based on the variance magnitude. The final output corrected rotational speed value is:
[0017]
[0018] in The rotational speed is calculated after static correction, and the value of k ranges from [0.8, 1.2].
[0019] Preferably, the length N of the sliding window is 20 frames, the sampling period is 1ms, and the total window duration is 20ms.
[0020] Preferably, in step S4, the operating condition range includes:
[0021] In the low-speed steady-state range, with a speed of 0~300 r / min, the control strategy is to increase the steady-state error correction weight, weaken the dynamic response speed, and suppress low-speed pulse jitter.
[0022] In the medium-speed normal range, with a speed of 300~1000 r / min, the control strategy is to use conventional control parameters to balance steady-state accuracy and dynamic response.
[0023] In the high-speed dynamic range, with a speed >1000 r / min, the control strategy is to accelerate the convergence speed of the sliding mode approaching law and suppress overshoot and high-frequency oscillation.
[0024] During the load change interval, the current change rate is >2A / 10ms. The control strategy is to increase the anti-interference weight and quickly compensate for the speed drop caused by load disturbance.
[0025] Preferably, the fuzzy inference rule uses the speed deviation, the rate of change of speed deviation, and the rate of change of load current as input variables, and the sliding mode approach law coefficient and the PID integral correction coefficient as output variables. After fuzzification by the membership function, the rule inference is performed to complete the online dynamic adjustment of the control parameters.
[0026] Preferably, in step S5, the specific method of multi-motor differentiated collaborative control is as follows: taking the target speed issued by the vehicle controller as the benchmark, the deviation between the actual speed of each wheel hub motor and the benchmark value is calculated in real time; when the speed deviation of a single motor exceeds a preset threshold, the control command is finely adjusted based on the motor's independent error compensation model to control the consistency deviation of the multi-wheel speed within 2 r / min.
[0027] Preferably, in step S6, the gradual interpolation process adopts a linear interpolation method, and the torque change rate threshold is set to 10% / 10ms of the rated torque.
[0028] Preferably, in step S7, the update cycle of the fixed indexing error matrix is 24 hours, and the data is collected under the stable working condition of the vehicle traveling at a constant speed without load during the update.
[0029] A high-precision control system for a hub motor based on encoder error adaptive correction is also provided, including:
[0030] The signal acquisition module is electrically connected to the wheel hub motor encoder, current sampling unit, and vehicle speed detection unit. It is used to acquire encoder pulse signals, motor operating parameters, and vehicle operating condition signals, and to perform signal preprocessing and filtering.
[0031] The encoder error correction module has a built-in fixed error storage unit and a random error calculation unit, which are used to perform static compensation for fixed indexing error and dynamic correction for random error, and output accurate speed and position data. The encoder error correction module supports independent configuration of error matrix for each hub motor to realize differentiated error compensation for a single motor.
[0032] The operating condition identification module is used to determine the current operating condition range based on the corrected speed and current data, and output the operating condition identification signal.
[0033] The fuzzy adaptive sliding mode control module is used to dynamically adjust control parameters and output torque control commands based on the identification signals and motor feedback data according to the operating conditions.
[0034] The multi-motor collaborative control module is used to store the independent error models of each hub motor, compare the operating parameters of multiple wheels and fine-tune the control commands to ensure the consistency of multi-motor output;
[0035] The smooth output module is used to perform gradual interpolation processing on the torque control command, constrain the torque change rate, and then output it to the motor driver.
[0036] The storage and iterative update module is used to store the error matrix and control parameters, and update the fixed-gradient error matrix according to a preset period.
[0037] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0038] 1. This invention establishes a fixed indexing error matrix for the encoder and combines it with dynamic identification and compensation of random errors during operation. This effectively reduces measurement errors caused by factors such as encoder hardware deviation, vibration interference, electromagnetic interference, and temperature drift, improves the accuracy of hub motor speed detection and position feedback, and alleviates the crawling phenomenon during low-speed operation. The speed measurement error can be reduced from the traditional ±5r / min to within ±1r / min, the low-speed crawling phenomenon is significantly suppressed, and the position closed-loop control accuracy is greatly improved.
[0039] 2. This invention employs a segmented fuzzy adaptive sliding mode control method to dynamically adjust control parameters according to different speed ranges and load changes, enabling the hub motor to balance low-speed operation stability and high-speed response capability, quickly suppress speed fluctuations under sudden load changes, and improve the system's anti-interference capability.
[0040] 3. This invention establishes an independent error compensation model for each hub motor and performs differentiated collaborative control based on the operating status of each motor. This reduces the speed deviation between multiple motors caused by encoder errors and individual differences. The speed consistency error of the four-wheel drive system can be controlled within 2 r / min, improving the speed consistency of the multi-wheel drive system and enhancing the straight-line stability and steering control accuracy of the vehicle.
[0041] 4. This invention gradually processes the torque commands during start-up, acceleration / deceleration, and load switching, limiting the rate of torque change and avoiding current and mechanical shocks caused by sudden changes in control commands. This reduces motor heating and component losses. Meanwhile, the error matrix supports periodic iterative updates, which can adapt to component aging and temperature drift, improving the long-term reliability of the system.
[0042] 5. This invention achieves error compensation and performance improvement through control algorithm and software strategy optimization, without the need to replace the high-precision encoder hardware. It improves the control accuracy of the hub motor with a small increase in control cost, and has good engineering application value. Attached Figure Description
[0043] Figure 1 This is a schematic diagram of the overall process of the high-precision control method for hub motors of the present invention;
[0044] Figure 2 This is a block diagram illustrating the principle of encoder two-dimensional error correction in this invention.
[0045] Figure 3 This is a logic block diagram of the piecewise fuzzy adaptive sliding mode control of the present invention;
[0046] Figure 4 This is a block diagram of the architecture of the high-precision control system for the hub motor of the present invention. Detailed Implementation
[0047] The present invention will be further described below with reference to the accompanying drawings and embodiments:
[0048] A high-precision control method for hub motors based on encoder error adaptive correction, see [link to relevant documentation]. Figures 1 to 4 This includes the following steps:
[0049] S1. System initialization and encoder fixed error calibration: After the hub motor is powered on, the system completes self-test, controls the motor to rotate at a constant speed under no-load for one revolution, collects the actual output pulse number of the encoder at preset angle intervals, compares it with the theoretical pulse number of the corresponding angle to obtain the fixed error offset of each angle interval, constructs the encoder fixed indexing error matrix and stores it.
[0050] S2. Real-time operation data acquisition: During vehicle operation, the encoder raw pulse signal, rotor position, actual speed, bus current, load current and vehicle operating condition signal of each wheel hub motor are acquired in real time.
[0051] S3, Dual-dimensional encoder error correction: Based on the current rotor angle, a fixed indexing error matrix is retrieved to perform static compensation for inherent errors in the original pulse data; at the same time, random pulse errors during operation are identified through a sliding window variance algorithm, and dynamic compensation coefficients are generated to perform secondary correction on the pulse data, outputting accurate speed and position data after correction;
[0052] S4. Segmented fuzzy adaptive sliding mode control: The current operating condition range is divided according to the corrected speed and load data. The approach law parameters and PID correction parameters of the sliding mode control are dynamically adjusted through fuzzy inference rules, and the torque control command is output.
[0053] S5. Multi-motor differentiated collaborative control: For each hub motor, an independent error compensation model is used to output adapted control commands and make dynamic fine adjustments based on the speed deviation of multiple wheels to ensure the consistency of speed and torque output of each motor.
[0054] S6. Smooth transition processing of operating conditions: The torque control command is gradually interpolated and output to the motor driver after constraining the torque change rate threshold.
[0055] S7. Closed-loop feedback and error iteration: Real-time acquisition of motor operation feedback data forms closed-loop control, and the fixed indexing error matrix is updated according to a preset cycle to complete the full life cycle adaptive correction.
[0056] Specifically, in step S1, the preset angle interval is 1°, and the fixed graduation error matrix is represented as E(θ)=[ , ],in Let be the deviation between the actual pulse count and the theoretical pulse count for the i-th angle interval; the formula for calculating the pulse count after static correction is:
[0057]
[0058] in This represents the original number of acquired pulses. This represents the number of pulses after static correction.
[0059] More specifically, in step S3, the random pulse error identification method is as follows: take N consecutive frames of pulse sampling data to form a sliding window, and calculate the variance of the rotational speed data within the window. When the variance exceeds a preset threshold, random interference error is identified, and a corresponding dynamic compensation coefficient k is generated based on the variance magnitude. The final output corrected rotational speed value is:
[0060]
[0061] in The rotational speed is calculated after static correction, and the value of k ranges from [0.8, 1.2].
[0062] Furthermore, the length N of the sliding window is 20 frames, the sampling period is 1ms, and the total window duration is 20ms.
[0063] Furthermore, in step S4, the operating condition range includes:
[0064] In the low-speed steady-state range, with a speed of 0~300 r / min, the control strategy is to increase the steady-state error correction weight, weaken the dynamic response speed, and suppress low-speed pulse jitter.
[0065] In the medium-speed normal range, with a speed of 300~1000 r / min, the control strategy is to use conventional control parameters to balance steady-state accuracy and dynamic response.
[0066] In the high-speed dynamic range, with a speed >1000 r / min, the control strategy is to accelerate the convergence speed of the sliding mode approaching law and suppress overshoot and high-frequency oscillation.
[0067] During the load change interval, the current change rate is >2A / 10ms. The control strategy is to increase the anti-interference weight and quickly compensate for the speed drop caused by load disturbance.
[0068] It is worth noting that the fuzzy inference rule takes the speed deviation, the rate of change of speed deviation, and the rate of change of load current as input variables, and the sliding mode approach law coefficient and the PID integral correction coefficient as output variables. After fuzzification by the membership function, the rule inference is performed to complete the online dynamic adjustment of the control parameters.
[0069] It is worth noting that in step S5, the specific method of multi-motor differentiated collaborative control is as follows: taking the target speed issued by the vehicle controller as the benchmark, the deviation between the actual speed of each wheel hub motor and the benchmark value is calculated in real time; when the speed deviation of a single motor exceeds the preset threshold, the control command is finely adjusted based on the motor's independent error compensation model to control the consistency deviation of the multi-wheel speed within 2 r / min.
[0070] It is worth mentioning that in step S6, the gradual interpolation process adopts a linear interpolation method, and the torque change rate threshold is set to 10% / 10ms of the rated torque.
[0071] It is worth emphasizing that in step S7, the update cycle of the fixed indexing error matrix is 24 hours, and the data is collected under the stable working condition of the vehicle traveling at a constant speed without load during the update.
[0072] A high-precision control system for a hub motor based on encoder error adaptive correction is also provided, including:
[0073] The signal acquisition module is electrically connected to the wheel hub motor encoder, current sampling unit, and vehicle speed detection unit. It is used to acquire encoder pulse signals, motor operating parameters, and vehicle operating condition signals, and to perform signal preprocessing and filtering.
[0074] The encoder error correction module has a built-in fixed error storage unit and a random error calculation unit, which are used to perform static compensation for fixed indexing error and dynamic correction for random error, and output accurate speed and position data. The encoder error correction module supports independent configuration of error matrix for each hub motor to achieve differentiated error compensation for a single motor.
[0075] The operating condition identification module is used to determine the current operating condition range based on the corrected speed and current data, and output the operating condition identification signal.
[0076] The fuzzy adaptive sliding mode control module is used to dynamically adjust control parameters and output torque control commands based on the identification signals and motor feedback data according to the operating conditions.
[0077] The multi-motor collaborative control module is used to store the independent error models of each hub motor, compare the operating parameters of multiple wheels and fine-tune the control commands to ensure the consistency of multi-motor output;
[0078] The smooth output module is used to perform gradual interpolation processing on the torque control command, constrain the torque change rate, and then output it to the motor driver.
[0079] The storage and iterative update module is used to store the error matrix and control parameters, and update the fixed-gradient error matrix according to a preset period.
[0080] Example 1
[0081] This embodiment provides a high-precision control method for hub motors based on encoder error adaptive correction, which is applied to the hub motor control system of a four-wheeled independent drive mobile robot. The system includes four sets of hub motors, each set of hub motors is equipped with a 17-bit magnetic encoder, and the controller executes encoder error correction, working condition identification and adaptive control algorithms to achieve high-precision operation of the hub motors.
[0082] The specific implementation process is as follows:
[0083] S1. System initialization and encoder fixed error calibration
[0084] After the equipment is powered on, the control system completes the detection of driver parameters and the initialization of encoder signals. It controls four sets of hub motors to rotate at a rated speed of 60 r / min under no-load uniform speed, so that the hub motor rotor completes 360° rotation sampling. The controller collects encoder output pulse data at 1° angle intervals, compares the actual number of collected pulses with the theoretical number of pulses, calculates the fixed indexing error offset corresponding to each angle interval, establishes independent encoder error matrices for the four sets of hub motors, and stores them in the controller's Flash storage unit to realize single motor hardware error modeling.
[0085] S2, Operational Status Data Acquisition
[0086] After the mobile robot enters the running state, the controller uses 1ms as the sampling period to collect the encoder pulse signal, rotor position, actual speed, bus current and load current of the four sets of hub motors in real time. At the same time, it acquires the vehicle running status information. The collected signals are processed by first-order low-pass digital filtering to remove high-frequency electromagnetic interference signals, and the processed data is sent to the error correction module.
[0087] S3, Encoder Dual-Dimensional Error Correction
[0088] The controller calls the corresponding fixed error matrix based on the current rotor angle of the hub motor to perform static error compensation on the encoder's original pulse data, in order to correct encoder assembly deviation and magnet consistency error. At the same time, a sliding window with a length of 20 frames is used to analyze the continuously sampled data. The window time is 20ms. By calculating the variance of the speed data within the window, it is determined whether there is random pulse error. When random error caused by road vibration, load change or electromagnetic interference is detected, a dynamic compensation coefficient is generated based on the calculated variance value. The speed and position data after static compensation are then corrected a second time. After testing, the hub motor speed measurement error was reduced from ±5r / min under the traditional control method to within ±1r / min.
[0089] S4, Segmented Fuzzy Adaptive Sliding Mode Control
[0090] The controller determines the current operating condition based on the corrected speed data. It uses a fuzzy adaptive sliding mode control module to match optimal control parameters according to different operating conditions. When the hub motor speed is between 0 and 300 r / min, it is determined to be a low-speed steady-state condition, and the steady-state error correction weight is increased to reduce low-speed pulse fluctuations. When the speed is between 300 and 1000 r / min, conventional control parameters are used to achieve stable operation. When the speed exceeds 1000 r / min, the sliding mode control response speed is increased to suppress overshoot and oscillation during high-speed operation. When the load current change rate is detected to exceed 2A / 10ms, the system determines it to be a load abrupt change condition, and quickly adjusts the torque output by increasing the disturbance rejection control weight to reduce the speed drop caused by load changes.
[0091] S5, Multi-motor Cooperative Control
[0092] To address the individual differences among the hub motors in the four-wheel independent drive structure, the control system calls the error compensation model of the corresponding motor and compares the actual speed and torque output of the four hub motors in real time. When the deviation between the actual speed of a single hub motor and the target speed exceeds 2 r / min, the torque control command of that motor is finely adjusted to keep the consistency error of the four-wheel speed within 2 r / min, thereby improving the stability of the mobile robot's straight-line driving.
[0093] S6, Smooth Transition Control
[0094] During the start-up, stopping, acceleration, and deceleration of the mobile robot, the controller uses a linear gradual interpolation method to adjust the torque control command and limits the torque change rate to 10% / 10ms of the rated torque to avoid current surges caused by sudden changes in control commands. During the experiment, the motor ran without significant jerking, and the peak surge current was reduced by about 30%.
[0095] S7, Error Matrix Iterative Update
[0096] During system operation, an error matrix update program is automatically executed every 24 hours. Encoder data is re-acquired under the condition of vehicle unloaded and uniform linear operation, and the offset in the error matrix is corrected according to the acquisition results to adapt to temperature changes and error drift caused by long-term operation of the device, so as to maintain the long-term stability of the control accuracy of the hub motor.
[0097] Through the above embodiments, the present invention improves the accuracy of encoder feedback data by combining fixed error calibration with dynamic error correction. In addition, by combining segmented fuzzy adaptive sliding mode control, multi-motor cooperative control and smooth transition control, the hub motor maintains high control accuracy and operational stability under low speed, high speed and load variation conditions.
[0098] In addition, all components designed in this invention are general standard parts or components known to those skilled in the art. Their structure and principle can be known to those skilled in the art through technical manuals or conventional experimental methods. Those skilled in the art can fully implement them, so there is no need to elaborate. The content protected by this invention does not involve improvements to the internal structure and method.
Claims
1. A high-precision control method for a hub motor based on encoder error adaptive correction, characterized in that, Includes the following steps: S1. System initialization and encoder fixed error calibration: After the hub motor is powered on, the system completes self-test, controls the motor to rotate at a constant speed under no-load for one revolution, collects the actual output pulse number of the encoder at preset angle intervals, compares it with the theoretical pulse number of the corresponding angle to obtain the fixed error offset of each angle interval, constructs the encoder fixed indexing error matrix and stores it. S2. Real-time operation data acquisition: During vehicle operation, the encoder raw pulse signal, rotor position, actual speed, bus current, load current and vehicle operating condition signal of each wheel hub motor are acquired in real time. S3, Dual-dimensional encoder error correction: Based on the current rotor angle, the fixed indexing error matrix is retrieved to perform static compensation for inherent errors in the original pulse data; at the same time, random pulse errors during operation are identified through the sliding window variance algorithm, and dynamic compensation coefficients are generated to perform secondary correction on the pulse data, outputting the corrected accurate speed and position data; S4. Segmented fuzzy adaptive sliding mode control: The current operating condition range is divided according to the corrected speed and load data. The approach law parameters and PID correction parameters of the sliding mode control are dynamically adjusted through fuzzy inference rules, and the torque control command is output. S5. Multi-motor differentiated collaborative control: For each hub motor, an independent error compensation model is used to output adapted control commands and make dynamic fine adjustments based on the speed deviation of multiple wheels to ensure the consistency of speed and torque output of each motor. S6. Smooth transition processing of operating conditions: The torque control command is gradually interpolated and output to the motor driver after constraining the torque change rate threshold. S7. Closed-loop feedback and error iteration: Real-time acquisition of motor operation feedback data forms closed-loop control, and the fixed indexing error matrix is updated according to a preset cycle to complete the full life cycle adaptive correction.
2. The high-precision control method for hub motors based on encoder error adaptive correction according to claim 1, characterized in that, In step S1, the preset angle interval is 1°, and the fixed graduation error matrix is represented as E(θ)=[ , ],in Let be the deviation between the actual pulse count and the theoretical pulse count for the i-th angle interval; the formula for calculating the pulse count after static correction is: in This represents the original number of acquired pulses. This represents the number of pulses after static correction.
3. The high-precision control method for hub motors based on encoder error adaptive correction according to claim 1, characterized in that, In step S3, the specific method for identifying random pulse errors is as follows: take N consecutive frames of pulse sampling data to form a sliding window, and calculate the variance of the rotational speed data within the window. ; When the variance exceeds a preset threshold, random interference error is identified, and a corresponding dynamic compensation coefficient k is generated based on the variance magnitude; the final output corrected rotational speed value is: in The rotational speed is calculated after static correction, and the value of k ranges from [0.8, 1.2].
4. The high-precision control method for hub motors based on encoder error adaptive correction according to claim 3, characterized in that, The length N of the sliding window is 20 frames, the sampling period is 1ms, and the total window duration is 20ms.
5. The high-precision control method for hub motors based on encoder error adaptive correction according to claim 1, characterized in that, In step S4, the operating condition range includes: In the low-speed steady-state range, with a speed of 0~300 r / min, the control strategy is to increase the steady-state error correction weight, weaken the dynamic response speed, and suppress low-speed pulse jitter. In the medium-speed normal range, with a speed of 300~1000 r / min, the control strategy is to use conventional control parameters to balance steady-state accuracy and dynamic response. In the high-speed dynamic range, with a speed >1000 r / min, the control strategy is to accelerate the convergence speed of the sliding mode approaching law and suppress overshoot and high-frequency oscillation. During the load change interval, the current change rate is >2A / 10ms. The control strategy is to increase the anti-interference weight and quickly compensate for the speed drop caused by load disturbance.
6. The high-precision control method for hub motors based on encoder error adaptive correction according to claim 5, characterized in that, The fuzzy inference rule takes speed deviation, speed deviation change rate, and load current change rate as input variables, and sliding mode approach law coefficient and PID integral correction coefficient as output variables. After fuzzification by the membership function, the rule inference is performed to complete the online dynamic adjustment of control parameters.
7. The high-precision control method for hub motors based on encoder error adaptive correction according to claim 1, characterized in that, In step S5, the specific method of multi-motor differentiated collaborative control is as follows: taking the target speed issued by the vehicle controller as the benchmark, the deviation between the actual speed of each wheel hub motor and the benchmark value is calculated in real time; when the speed deviation of a single motor exceeds the preset threshold, the control command is finely adjusted based on the motor's independent error compensation model to control the consistency deviation of the multi-wheel speed within 2 r / min.
8. The high-precision control method for hub motors based on encoder error adaptive correction according to claim 1, characterized in that, In step S6, the gradual interpolation process uses linear interpolation, and the torque change rate threshold is set to 10% / 10ms of the rated torque.
9. The high-precision control method for hub motors based on encoder error adaptive correction according to claim 1, characterized in that, In step S7, the update cycle of the fixed indexing error matrix is 24 hours, and data is collected under stable operating conditions of the vehicle traveling at a constant speed without load during the update.
10. A high-precision control system for a hub motor based on encoder error adaptive correction, applicable to the control method described in any one of claims 1 to 9, characterized in that, include: The signal acquisition module is electrically connected to the wheel hub motor encoder, current sampling unit, and vehicle speed detection unit. It is used to acquire encoder pulse signals, motor operating parameters, and vehicle operating condition signals, and to perform signal preprocessing and filtering. The encoder error correction module has a built-in fixed error storage unit and a random error calculation unit, which are used to perform static compensation for fixed indexing error and dynamic correction for random error, and output accurate speed and position data. The encoder error correction module supports independent configuration of error matrix for each hub motor to realize differentiated error compensation for a single motor. The operating condition identification module is used to determine the current operating condition range based on the corrected speed and current data, and output the operating condition identification signal. The fuzzy adaptive sliding mode control module is used to dynamically adjust control parameters and output torque control commands based on the identification signals and motor feedback data according to the operating conditions. The multi-motor collaborative control module is used to store the independent error models of each hub motor, compare the operating parameters of multiple wheels and fine-tune the control commands to ensure the consistency of multi-motor output; The smooth output module is used to perform gradual interpolation processing on the torque control command, constrain the torque change rate, and then output it to the motor driver. The storage and iterative update module is used to store the error matrix and control parameters, and update the fixed-gradient error matrix according to a preset period.