Efficient brushless motor cogging tension compensation method
By using an encoder and PID controller inside the brushless motor to calculate the motor voltage value, the problem of cogging tension during low-speed operation of the brushless motor is solved, achieving efficient and low-cost cogging tension compensation, and improving the motor's operating stability and control accuracy.
Patent Information
- Application Number
- CN202511073948.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-01
- Publication Date
- 2025-10-31
AI Technical Summary
Existing brushless motors, when running at low speeds, generate cogging tension due to the interaction between the stator slots and the rotor permanent magnets, resulting in torque fluctuations, unstable speeds, vibrations, and noise. This affects the positioning accuracy and lifespan of the equipment. Furthermore, existing compensation technologies are costly or complex to design, making it difficult to meet the requirements of high-precision application scenarios.
The encoder records the motor's rotational position and electrical angular velocity, calculates the motor voltage value and stores the compensation data, and uses a PID controller and simple algorithm to achieve cogging tension compensation inside the motor, avoiding external equipment and simplifying hardware requirements.
It improves the smoothness and control precision of brushless motors at low speeds, reduces hardware costs and computational load, and reduces torque fluctuations and vibrations, making it suitable for high-precision equipment.
Smart Images

Figure CN120880237A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of brushless motor technology, specifically to a highly efficient method for compensating for cogging tension in brushless motors. Background Technology
[0002] Brushless motors generate periodic cogging tension due to the interaction between the stator slots and the rotor permanent magnets, which causes many problems in low-speed operation scenarios: leading to torque fluctuations, affecting the positioning accuracy of equipment such as gimbals, for example, drone gimbals are prone to shaking when tracking at low speeds; causing unstable rotation speed, resulting in shaky footage from professional shooting equipment; and causing vibration and noise, interfering with the performance of precision instruments and shortening their lifespan, etc.
[0003] Existing compensation technologies have limitations: in control algorithms, model-based methods rely on precise modeling, and the application costs of intelligent algorithms and advanced controllers are relatively high; although motors can suppress cogging effects through internal stator lamination optimization and rotor magnet pole misalignment optimization, the design is complex and has limited adaptability. At the same time, most motors are not equipped with compensation functions due to cost, scenario requirements, and technical complexity, making it difficult to meet the requirements of high-precision, high-performance applications for stable operation. Summary of the Invention
[0004] The purpose of this invention is to provide an efficient method for compensating cogging tension in brushless motors, which eliminates the need for external compensation equipment, reduces costs, and features a simple algorithm with low hardware requirements. This solves the problem that existing motor cogging tension compensation algorithms rely on precise modeling and use advanced controllers at high costs.
[0005] To achieve the above objectives, the present invention provides the following technical solution: a highly efficient method for compensating for cogging tension in a brushless motor, comprising the following steps:
[0006] S1. Perform compensation initialization on the motor and set the target electric angular velocity of the motor;
[0007] S2. Record the initial position information of the motor when it rotates by the encoder. Based on the initial position data output by the encoder, compare it with the real-time position data of the motor to determine whether the positive compensation calculation of more than one mechanical angle cycle has been completed, and whether the reverse compensation calculation of more than one mechanical angle cycle has been completed.
[0008] S3. The encoder data is also used to calculate the electrical angle of the motor. The electrical angular velocity of the current motor is calculated based on the difference between the electrical angle of the previous moment and the current moment. Based on the current electrical angular velocity and the target motor speed, the PID controller is used to calculate the target voltage value required to make the motor rotate at the target electrical angular velocity.
[0009] S4. Using encoder data as an index, record the motor voltage required to compensate for cogging tension under the lowest operating conditions of the motor.
[0010] S5. Using the direction of motor rotation as an index, record the supplementary voltage when the motor rotates forward and in reverse respectively;
[0011] S6. Store the recorded compensation data in the memory for use in tooth cogging tension compensation control;
[0012] S7. Initialize the control circuit parameters and control algorithm related to motor control;
[0013] S8. Based on the read motor direction and encoder raw data, the compensation data read from the memory and the motor rotation status, the voltage value that needs to be compensated under the current motor status is determined by searching the compensation data table pre-established in the memory.
[0014] S9. Output the compensated voltage obtained by table lookup and compensation calculation to the motor.
[0015] 2. The efficient brushless motor cogging tension compensation method according to claim 1, characterized in that: in step S1, the compensation initialization includes the initialization of the motor peripherals, the initialization of compensation parameters, and the initialization of PID parameters, and the motor control is performed by initializing the system peripherals.
[0016] 3. The efficient brushless motor cogging tension compensation method according to claim 1, characterized in that: in step S1, the target electrical angular velocity includes the forward rotation target electrical angular velocity when the motor rotates forward and the reverse rotation target electrical angular velocity when the motor rotates in reverse, and the target electrical angular velocity is set as the minimum electrical angular velocity required by the motor control system.
[0017] 4. The efficient brushless motor cogging tension compensation method according to claim 2, characterized in that: the peripheral initialization includes the initialization of control circuit parameters related to motor control and the initialization of control algorithm.
[0018] 5. The efficient brushless motor cogging tension compensation method according to claim 1, characterized in that: in step S2, the encoder reads the current position of the motor in real time to determine whether the motor has completed a complete mechanical angle cycle rotation. If it has not been completed, the calculation of the compensation result in step S3 continues. If it has been completed, the rotation direction is changed and the next complete mechanical angle cycle rotation calculation is performed.
[0019] 6. The efficient brushless motor cogging tension compensation method according to claim 1, characterized in that: in step S4, there are 1024 compensation data records of the motor in the lowest operating state, indexed by the encoder data.
[0020] 7. The efficient brushless motor cogging tension compensation method according to claim 1, characterized in that: in step S5, the compensation data recorded by the memory includes motor forward rotation compensation data and motor reverse rotation compensation data, and the motor forward rotation compensation data and motor reverse rotation compensation data are stored separately.
[0021] 8. The efficient brushless motor cogging tension compensation method according to claim 1, characterized in that: when performing step S6, it is necessary to determine whether compensation data exists. If there is no compensation data, return to step S1 to recalculate the compensation data until compensation data is available before proceeding to step S8.
[0022] Preferably, in step S1, the compensation initialization includes the initialization of the motor's peripherals, the initialization of compensation parameters, and the initialization of PID parameters, and the motor is controlled by initializing the system peripherals.
[0023] Preferably, in step S1, the target electrical angular velocity includes the forward target electrical angular velocity when the motor rotates forward and the reverse target electrical angular velocity when the motor rotates in reverse, and the target electrical angular velocity is set as the minimum electrical angular velocity required by the motor control system.
[0024] Preferably, the peripheral initialization includes initializing the control circuit parameters related to motor control and initializing the control algorithm.
[0025] Preferably, in step S2, the encoder reads the current position of the motor in real time to determine whether the motor has completed a complete mechanical angle cycle rotation. If it has not been completed, the calculation of the compensation result in step S3 continues. If it has been completed, the rotation direction is changed and the calculation of the next complete mechanical angle cycle rotation is performed.
[0026] Preferably, in step S4, there are 1024 compensation data records for the motor's lowest operating state, indexed by the encoder data.
[0027] Preferably, in step S5, the compensation data recorded in the memory includes motor forward rotation compensation data and motor reverse rotation compensation data, and the motor forward rotation compensation data and motor reverse rotation compensation data are stored separately.
[0028] Preferably, when performing step S6, it is necessary to determine whether the compensation data exists. If there is no compensation data, return to step S1 to recalculate the compensation data until compensation data is available before proceeding to step S8.
[0029] Compared with the prior art, the beneficial effects of the present invention are:
[0030] 1. This invention requires no external equipment: Through a cogging tension calibration method, it relies entirely on the motor's own control system and internal sensors, such as the motor's built-in encoder, to acquire data. Compensation is achieved through optimized algorithms and control logic. The entire compensation process can be completed within the motor control system, eliminating the need for expensive and complex external equipment.
[0031] 2. The algorithm of this invention has low computational load: By selecting key parameters and utilizing simple and efficient mathematical operations, the cogging force compensation value can be calculated quickly and accurately. Compared with other complex algorithms, such as the real-time calculation and compensation method of PID current, its computational load is greatly reduced, and it can be easily handled by processors with ordinary performance. While ensuring the compensation effect, it can improve the real-time performance and operating efficiency of the system.
[0032] 3. This invention has low hardware requirements: Since it does not require detecting the motor current, it eliminates the need for high-speed analog-to-digital converters, current acquisition circuits, and current amplification circuits, simplifying the hardware design. Furthermore, the elimination of complex external devices reduces the need for corresponding data interfaces and circuit designs, giving hardware designers greater flexibility in selecting hardware components.
[0033] 4. This invention can reduce the motor control dead zone: By accurately calculating and compensating for cogging tension, it reduces the interference of cogging tension on the motor control signal. This allows the motor to respond to control commands more accurately even within the original control dead zone range, reducing the range of the control dead zone, improving the motor's response sensitivity and control accuracy to control signals, and thus improving the overall operating performance of the motor.
[0034] 5. This invention enables smoother motor torque fluctuations: By accurately calculating compensation values and adjusting the motor's control voltage or current in a timely manner, torque fluctuations are suppressed. During motor operation, this results in a more uniform and smooth torque output, reducing vibration and noise caused by torque fluctuations, and improving the stability and reliability of motor operation. It is particularly suitable for precision equipment and applications requiring high operational stability. Attached Figure Description
[0035] Figure 1 This is a flowchart illustrating the calculation and storage of motor compensation data according to the present invention;
[0036] Figure 2 This is a flowchart of the motor compensation data output of the present invention. Detailed Implementation
[0037] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0038] Please see Figure 1-2 This invention provides an efficient method for compensating for cogging tension in brushless motors, comprising the following steps:
[0039] S1. Initialize the motor for compensation and set the target electrical angular velocity. The target electrical angular velocity is set to the minimum electrical angular velocity required by the motor control system. The minimum operating state refers to the state in which the motor operates at the minimum electrical angular velocity required by the system. In this state, the influence of cogging tension is relatively more significant, making it easier to accurately capture the motor voltage data required for cogging tension compensation. By recording compensation data in this state, a reliable benchmark can be provided for subsequent compensation under different operating states, ensuring accurate and effective compensation even in scenarios sensitive to cogging tension, such as low speeds.
[0040] S2. The encoder records the initial position information of the motor during rotation. Based on the initial position data output by the encoder, it is compared with the real-time position data of the motor to determine the state of the compensation process. The encoder position data is acquired in real time. The current electric angular velocity of the motor is calculated based on the difference in electric angle between the previous moment and the current moment. The encoder on the motor records the initial position information during rotation. This data is transmitted to the motor control system. The control system performs logical calculations through internal timing functions and data processing. Based on the position information output by the encoder at different times, it determines the change in motor position within a certain time interval. The change in position is combined with the corresponding time interval. By calculating the ratio of the change in position to the time interval, the electric angular velocity of the motor is obtained. Based on the current electric angular velocity and the target motor speed, the PID controller calculates the target voltage value required for the motor to rotate at the target electric angular velocity.
[0041] S3. Using encoder data as an index, that is, recording the position of the motor in real time through the encoder, using this position data as a unique identifier, and recording the motor voltage required to compensate for the cogging tension under the lowest operating state of the motor.
[0042] S4. Store the recorded compensation data in the FLASH memory for cogging tension compensation control. First, calculate and store the compensation data for the forward rotation of the motor according to steps S1 to S4. After completion, reverse the motor and calculate and store the compensation data for the reverse rotation. When all storage is completed, the entire motor cogging tension compensation value calculation process ends.
[0043] S5. Read the compensation data from the memory and initialize the control circuit parameters and control algorithm related to motor control, so that the motor control circuit and control logic are in the preset initial working state, ensuring that the motor control circuit outputs signals according to the design requirements and the control algorithm can correctly process encoder data, compensation data and other information.
[0044] S6. Based on the read encoder raw data, the compensation data read from the memory and the rotation status of the motor, the compensation data table pre-built in the memory is searched. Each data in the table is indexed by the encoder position information and corresponds to the compensation voltage value at that position. The voltage value that needs to be compensated under the current motor status is determined.
[0045] S7. The compensated voltage, obtained through table lookup and compensation calculation, is output to the motor through the drive circuit in the motor control system.
[0046] In step S1, the compensation initialization includes the initialization of the motor's peripherals, the initialization of compensation parameters, and the initialization of PID parameters, and the data of the initialization of peripherals, compensation parameters, and PID parameters are stored through the initialization storage module.
[0047] Compensation parameters are reference data related to cogging tension compensation, such as the storage address of compensation data, indexing rules, and mechanical angle period division. Initializing these parameters can unify the processing standards of compensation data, ensure that the control system follows consistent logic when recording, storing, and reading compensation data, and avoid compensation data matching errors caused by parameter confusion.
[0048] The PID controller is used to calculate the target voltage value based on the deviation between the current electrical angular velocity and the target electrical angular velocity. Initializing the PID parameters is to set control parameters that are suitable for the current motor characteristics and operating scenario, so as to ensure that the PID controller can accurately respond to the speed deviation and output the target voltage.
[0049] In step S1, the target electrical angular velocity includes the forward target electrical angular velocity when the motor rotates forward and the reverse target electrical angular velocity when the motor rotates in reverse. The target electrical angular velocity is set as the minimum electrical angular velocity required by the motor control system.
[0050] Peripheral initialization includes initializing the control circuit parameters related to motor control and initializing the control algorithm. Peripheral initialization involves configuring and activating the parameters of hardware such as timers, ADCs, encoder interfaces, and GPIOs according to motor control requirements. This ensures that the hardware components and basic algorithms of the motor control system are in a preset initial working state, capable of accurately receiving encoder data and outputting control signals. This provides stable hardware support for subsequent processes such as position detection, speed calculation, and voltage output, preventing data acquisition errors or control command failures due to abnormal peripheral states.
[0051] In step S2, the encoder reads the current position of the motor in real time, and the motor control system determines whether the motor has completed a complete mechanical angle cycle rotation. If it has not completed, the calculation of the compensation result in step S3 continues. If it has completed, the rotation direction is changed and the next complete mechanical angle cycle rotation calculation is performed.
[0052] When the motor starts rotating, the encoder records the initial position information, which serves as the reference point for determining the cycle. During motor rotation, the encoder continuously outputs the current position information, and the control system compares the real-time read current position with the initial position to calculate the position change. When the position change reaches one complete mechanical angle cycle of the motor, i.e., the motor rotates 360°, it is determined that one mechanical angle cycle has been completed. If a cycle is determined to be completed, the system enters the compensation data recording and storage stage; otherwise, it continues to execute the current electrical angular velocity calculation, target voltage calculation, and other processes until the cycle condition is met.
[0053] In step S3, 1024 compensation data points are recorded under the lowest operating state of the motor, indexed by the encoder data. During the process of the motor completing a complete mechanical angle cycle rotation, compensation data is continuously recorded, and finally a compensation dataset containing 1024 data points is formed to ensure that the cogging tension compensation requirements of the motor are covered throughout the entire cycle.
[0054] In step S4, the compensation data recorded in the memory includes motor forward rotation compensation data and motor reverse rotation compensation data, which are stored separately. Due to the asymmetry of the motor structure, such as the stator tooth distribution and the magnetization direction of the rotor magnets, the period and amplitude of the tooth tension may differ during forward and reverse rotation, resulting in different compensation voltage requirements. Separate storage ensures that the compensation data is accurately matched with the rotation direction.
[0055] The direction of rotation of a motor may change dynamically during operation, such as switching from forward to reverse. Storing the compensation data for forward and reverse rotation separately allows the control system to directly read the compensation value from the corresponding data area by judging the current rotation state, reducing the complexity of data retrieval and improving the compensation response speed.
[0056] The motor's FLASH memory is divided into two independent data areas, designated as the "forward rotation compensation data area" and the "reverse rotation compensation data area." For example, forward rotation compensation data is stored in the area from the starting address (e.g., 0x0000) to the corresponding length; reverse rotation compensation data is stored in another independent address (e.g., 0x1000) to the corresponding length, with physical partitioning achieved through address offset.
[0057] When performing step S5, considering the possibility of memory failure or data corruption, it is necessary to determine whether the compensation data exists to ensure that the subsequent cogging force compensation control can be based on valid data, and to avoid compensation failure or abnormal motor control due to lack of compensation data. If there is no compensation data, return to step S1 to recalculate the compensation data until compensation data is available before proceeding to step S6.
[0058] To verify the effectiveness of this method, an actual motor rotation experiment was conducted. Using the same motor and hardware conditions, the motor could complete one rotation smoothly and stably only when the voltage was set to 2.747% of the bus voltage without cogging tension compensation. When the voltage was lower than 2.747% of the bus voltage, the motor exhibited an inconsistent rotational speed due to the cogging tension. When the motor used cogging tension compensation, setting the voltage to 0.153% of the bus voltage allowed the motor to complete one rotation smoothly and stably. Compensating for the motor's cogging tension not only made the low-speed operation of the motor smoother and reduced control oscillations, but also reduced the motor's dead zone by 94.43%, demonstrating significant effectiveness.
[0059] The tooth cogging tension compensation method of the present invention has a significant effect on improving the motor control dead zone and optimizing the influence of tooth cogging tension on the smoothness when the motor is running at low speed, thus providing excellent operating conditions for the application of motors in precision instruments.
[0060] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A highly efficient method for compensating for cogging tension in a brushless motor, characterized in that, Includes the following steps: S1. Perform compensation initialization on the motor and set the target electric angular velocity of the motor; S2. Record the initial position information of the motor when it rotates by the encoder. Based on the initial position data output by the encoder, compare it with the real-time position data of the motor to determine whether the positive compensation calculation of more than one mechanical angle cycle has been completed, and whether the reverse compensation calculation of more than one mechanical angle cycle has been completed. S3. The encoder data is also used to calculate the electrical angle of the motor. The electrical angular velocity of the current motor is calculated based on the difference between the electrical angle of the previous moment and the current moment. Based on the current electrical angular velocity and the target motor speed, the PID controller is used to calculate the target voltage value required to make the motor rotate at the target electrical angular velocity. S4. Using encoder data as an index, record the motor voltage required to compensate for cogging tension under the lowest operating conditions of the motor. S5. Using the direction of motor rotation as an index, record the supplementary voltage when the motor rotates forward and in reverse respectively; S6. Store the recorded compensation data in the memory for use in tooth cogging tension compensation control; S7. Initialize the control circuit parameters and control algorithm related to motor control; S8. Based on the read motor direction and encoder raw data, the compensation data read from the memory and the motor rotation status, the voltage value that needs to be compensated under the current motor status is determined by searching the compensation data table pre-established in the memory. S9. Output the compensated voltage obtained by table lookup and compensation calculation to the motor.
2. The efficient brushless motor cogging tension compensation method according to claim 1, characterized in that: In step S1, the compensation initialization includes the initialization of the motor's peripherals, the initialization of compensation parameters, and the initialization of PID parameters, and motor control is performed by initializing the system peripherals.
3. The efficient brushless motor cogging tension compensation method according to claim 1, characterized in that: In step S1, the target electrical angular velocity includes the forward target electrical angular velocity when the motor rotates forward and the reverse target electrical angular velocity when the motor rotates in reverse. The target electrical angular velocity is set as the minimum electrical angular velocity required by the motor control system.
4. The efficient brushless motor cogging tension compensation method according to claim 2, characterized in that: The peripheral initialization includes initializing the control circuit parameters related to motor control and initializing the control algorithm.
5. The efficient brushless motor cogging tension compensation method according to claim 1, characterized in that: In step S2, the encoder reads the current position of the motor in real time to determine whether the motor has completed a complete mechanical angle cycle rotation. If it has not been completed, the calculation of the compensation result in step S3 continues. If it has been completed, the rotation direction is changed and the calculation of the next complete mechanical angle cycle rotation is performed.
6. The efficient brushless motor cogging tension compensation method according to claim 1, characterized in that: In step S4, there are 1024 compensation data records for the motor's lowest operating state, indexed by the encoder data.
7. The efficient brushless motor cogging tension compensation method according to claim 1, characterized in that: In step S5, the compensation data recorded in the memory includes motor forward rotation compensation data and motor reverse rotation compensation data, which are stored separately.
8. The efficient brushless motor cogging tension compensation method according to claim 1, characterized in that: When performing step S6, it is necessary to determine whether the compensation data exists. If there is no compensation data, return to step S1 to recalculate the compensation data until compensation data is available before proceeding to step S8.
Citation Information
Cited By
Bus encoder small-memory large-scale compensation table difference compensation scheme and algorithm thereof
CN121412139A