Hall sensor angle automatic compensation circuit and method for brushless direct current motor

By designing a Hall sensor angle automatic compensation circuit for brushless DC motors, the problem of insufficient compensation real-time and accuracy in the prior art is solved, and more efficient and stable motor performance is achieved.

CN119834656APending Publication Date: 2025-04-15TIANJIN MEGA HUNT ELECTRONICS TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411894839.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

The Hall sensor angle compensation technology of existing brushless DC motors has shortcomings in real-time and accuracy, especially when motor speed changes, it is difficult to maintain efficient performance.

Method used

An automatic angle compensation circuit for Hall sensors for brushless DC motors is designed, including an angle compensation pre-processing module, an angle conversion module and a compensation point generation module. By measuring the angle deviation of the Hall sensor in real time and automatically correcting it, the compensation angle is dynamically adjusted to adapt to the motor speed changes.

Benefits of technology

It significantly improves the commutation accuracy and motor efficiency of brushless DC motors, reduces the problems of jitter and slow acceleration during motor operation, and improves overall performance and response speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119834656A_ABST
    Figure CN119834656A_ABST
Patent Text Reader

Abstract

The invention discloses a brushless direct current motor-oriented Hall sensor angle automatic compensation circuit and method. The compensation circuit comprises an angle compensation pre-stage processing module, an angle conversion module and a compensation reversing point generation module, and accurate control and angle compensation of Hall sensor signals are achieved. According to the invention, by actually measuring the angle deviation of the Hall sensor and automatically correcting the angle deviation, the commutation precision and the motor efficiency of the brushless direct current motor are remarkably improved, and the problems of jitter and slow acceleration in the operation of the motor are effectively reduced. Compared with the traditional software estimation, the compensation method realized by using the digital circuit not only improves the real-time performance and accuracy of compensation, but also reduces the dependence on the software efficiency and the working frequency of the microcontroller.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a Hall sensor angle automatic compensation circuit for a brushless DC motor and also relates to a corresponding Hall sensor angle automatic compensation method, belonging to the technical field of motor control. Background Art

[0002] In the fields of electric vehicles, Hall sensors are used to detect the rotor position of brushless DC motors (Brushless Direct Current) to achieve precise motor control. Figure 1 As shown, the Hall sensor is installed in the stator part of the motor to detect the position of the rotor magnetic pole. Figure 1 The three Hall sensors (H1, H2, H3) are shown in the figure, which are connected to the decoder circuit, which is responsible for processing the sensor signal and outputting the corresponding phase signal (φA, φB, φC). These phase signals are then used to control the three-phase winding of the motor to achieve precise control of the motor rotor position. Therefore, the output signal of the Hall sensor determines how the motor controller adjusts the current to maintain the synchronous operation of the motor, thereby achieving efficient and precise motor control.

[0003] Angle compensation technology can correct the position detection error caused by the installation angle deviation of the Hall sensor, improve the accuracy of motor control, and directly affect the acceleration performance and driving smoothness of electric vehicles. Accurate rotor position detection is crucial to the efficiency and performance of the motor. Angle compensation technology ensures that the motor can maintain optimal performance under different operating conditions, reduce motor torque fluctuations and efficiency reduction caused by inaccurate position detection, and reduce abnormal wear and failure risks during motor operation, thereby improving the reliability and service life of the motor.

[0004] The existing six-phase commutation technology solution for brushless DC motors must ensure that all three Hall sensors are normal, so that the motor can commutate normally in six directions and operate normally. If one Hall sensor is damaged, the motor may stop instantly. For example, if an electric vehicle damages the motor during driving, a sudden motor stop may also cause a traffic accident. For this reason, in the Chinese invention patent with patent number ZL 202010009152.3, a deviation identification and compensation method for Hall sensors under different installation methods is disclosed. The method adopts constant voltage-frequency ratio control and increases the output voltage to improve the output torque, so that the permanent magnet synchronous motor can rotate stably at low frequency; obtain the values ​​of the three back electromotive forces of the permanent magnet synchronous motor and the rising or falling edge signals of the three Hall sensors, and record the peak value of each back electromotive force; when the rising or falling edge signal of any Hall sensor is captured, record the back electromotive force value of the corresponding phase and the level state of the three Hall sensors, and calculate the installation deviation angle according to the recorded back electromotive force value and the peak value of the back electromotive force of the corresponding phase; further, judge the angle distribution form of the Hall sensor; and compensate for the rotor position angle estimation of the permanent magnet synchronous motor during normal operation by adjusting the absolute position. However, the above technical solution has high requirements on the efficiency of the algorithm, resulting in poor real-time compensation. Summary of the invention

[0005] The primary technical problem to be solved by the present invention is to provide a Hall sensor angle automatic compensation circuit for a brushless DC motor.

[0006] Another technical problem to be solved by the present invention is to provide a method for automatic compensation of the angle of a Hall sensor of a brushless DC motor.

[0007] In order to achieve the above technical objectives, the present invention adopts the following technical solutions:

[0008] According to a first aspect of an embodiment of the present invention, there is provided a Hall sensor angle automatic compensation circuit for a brushless DC motor, comprising an angle compensation pre-processing module, an angle conversion module and a compensation commutation point generating module; wherein:

[0009] The angle compensation pre-processing module includes a timer, a three-frequency module, an AND gate and a counting and recording module, which are used to measure the deviation angle of the Hall sensor relative to the physical commutation point; when the Hall sensor detects a change in the rotor magnetic field position, a physical commutation point signal is generated, which is input into the timer and the three-frequency module respectively, and the output signal of the timer is input into the AND gate together with the physical commutation point signal, and the output signal of the AND gate is used to control whether to shield the physical commutation point of the Hall sensor;

[0010] The counting and recording module includes a counter and a storage counter, which are used to record the cycle time of the Hall sensor signal and save the angle compensation value; wherein the output end of the three-frequency division module is connected to the counter, and the output end of the counter is connected to the storage counter; the output end of the storage counter is connected to the angle conversion module;

[0011] The output end of the angle conversion module is connected to the compensation reversing point generation module, which is used to convert the angle compensation value into an angle count value; in the compensation reversing point generation module, a reversing signal for dynamically adjusting the compensation angle is generated.

[0012] Preferably, the timer receives a reset signal, an angle compensation enable signal, a physical commutation point signal of the Hall sensor and a clock signal, and outputs an estimated value of the Hall sensor signal.

[0013] Preferably, the three-frequency division module receives a reset signal, an angle compensation enable signal, a Hall counter clear signal and a clock signal, and outputs a three-frequency division pulse signal to obtain a 60° electrical angle interval between state changes of two adjacent Hall sensors.

[0014] Preferably, the counter receives a reset signal, an angle compensation enable signal, a Hall counter clear signal and a three-frequency pulse signal, and outputs a count value; the storage counter receives a reset signal, an angle compensation enable signal, a Hall save signal and the count value, and outputs a saved count value.

[0015] Preferably, the angle conversion module receives the output signal of the storage counter and the pre-configured APS signal and COO signal, and calculates the angle count value that needs to be compensated.

[0016] Preferably, the compensation reversing point generating module comprises a multiplexer and a reversing control circuit; wherein the multiplexer outputs a signal for reversing control according to the selection of the COO signal; and the reversing control circuit receives the output of the multiplexer to generate the reversing signal.

[0017] According to a second aspect of an embodiment of the present invention, a method for automatic compensation of a Hall sensor angle for a brushless DC motor is provided, which is implemented based on the above-mentioned automatic compensation circuit of the Hall sensor angle and includes the following steps:

[0018] When the Hall sensor detects a change in the rotor magnetic field position, it generates a physical commutation point signal;

[0019] When the timer receives a physical commutation point signal, it starts to estimate the 180° electrical angle. The physical commutation point signal is input to the frequency divider, so that the frequency divider starts counting. The three-frequency module is used to divide the Hall sensor signal and output it to the counter to obtain the 60° electrical cycle time of the Hall sensor.

[0020] The counter outputs a signal to a storage counter, and the storage counter outputs a count value corresponding to a 60° electrical cycle time of the Hall sensor;

[0021] The count value is input into the angle conversion module, and the angle count value to be compensated is calculated according to the pre-configured values ​​of the APS signal and the COO signal;

[0022] The deviation counter counts the 180° electrical cycle time, and the output of the deviation counter is compared with the preset compensation angle count value, and a commutation pulse signal is generated when the two match;

[0023] The multiplexer selects the corresponding commutation pulse signal according to the value of the COO signal, and uses OR logic to output the commutation signal for dynamically adjusting the compensation angle;

[0024] When the next physical commutation point signal arrives, it indicates that the 180° electrical angle estimation has been completed, and the commutation of the brushless DC motor is controlled according to the commutation signal.

[0025] Preferably, the physical reversing point signal is obtained through the following sub-steps:

[0026] Perform state detection on the Hall sensor and use a lookup table or logic circuit to decode the current position of the rotor according to the output state of the Hall sensor;

[0027] According to the decoded position information, determine when commutation is required to maintain continuous rotation of the motor;

[0028] The physical commutation point signal is generated when a commutation point is detected; wherein the commutation point occurs at a boundary where the rotor transitions from one state to another state.

[0029] Preferably, the multiplexer selects the corresponding commutation pulse signal according to the value of the COO signal; if the highest bit of the COO signal is 1, it means that the ideal physical commutation point is ahead of the actual physical commutation point, and the commutation point needs to be adjusted in the lagging direction; if the highest bit of the COO signal is 0, it means that the ideal physical commutation point lags behind the actual physical commutation point, and the commutation point needs to be adjusted in the leading direction.

[0030] Compared with the prior art, the present invention significantly improves the commutation accuracy and motor efficiency of the brushless DC motor by actually measuring the angle deviation of the Hall sensor and automatically correcting it, and effectively reduces the jitter and slow acceleration problems during motor operation. Compared with traditional software estimation, the compensation method implemented by digital circuit not only improves the real-time and accuracy of compensation, but also reduces the dependence on software efficiency and microcontroller operating frequency. In addition, the present invention can adapt to changes in motor speed and calculate the accurate compensation angle in real time to ensure that efficient motor performance can be maintained even during variable speed operation. The flexibility of circuit design allows for separate compensation of the commutation point time of any Hall output, and by optimizing the circuit implementation, resource consumption is reduced and the overall efficiency and response speed of the electronic control system are improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 This is a schematic diagram of the installation of Hall sensors every 120° in a brushless DC motor;

[0032] Figure 2 This is a schematic diagram of the relationship between the U reverse electromotive force and the Hall sensor signal when the motor rotates clockwise;

[0033] Figure 3 This is a schematic diagram of the relationship between the U reverse electromotive force and the Hall sensor signal when the motor rotates counterclockwise;

[0034] Figure 4 This is a schematic diagram of the signal relationship when three Hall sensors are installed at ideal positions when the motor rotates clockwise;

[0035] Figure 5A It is a schematic diagram for comparing the signal relationship of the ideal position relative to the right deviation (hysteresis) of the actual circuit;

[0036] Figure 5B It is a schematic diagram for comparing the signal relationship of the ideal position relative to the left deviation (advance) of the actual circuit;

[0037] Figure 6 This is a schematic diagram of the circuit principle of the angle compensation pre-stage processing module in an embodiment of the present invention;

[0038] Figure 7 for Figure 6 Schematic diagram of the circuit principle of the timer in FIG.

[0039] Figure 8 The figure is a schematic diagram of the circuit principles of the angle conversion module and the compensation reversing point generation module in an embodiment of the present invention. DETAILED DESCRIPTION

[0040] The technical content of the present invention is described in detail below with reference to the accompanying drawings and specific embodiments.

[0041] The technical concept in the embodiment of the present invention is to automatically compensate the angle deviation of the Hall sensor in the brushless DC motor through a digital circuit to improve the working efficiency and operation stability of the motor. The compensation circuit can measure and correct the deviation of the Hall sensor relative to the physical commutation point in real time and accurately, reduce the dependence on the efficiency of the algorithm, and have the dynamic compensation capability to adapt to the change of motor speed. In addition, each phase of the Hall sensor is independently provided with an angle conversion module and a compensation commutation point generation module, which enhances the flexibility of the design, and reduces resource consumption by optimizing the circuit, ensuring that the motor can achieve precise commutation control at different speeds, thereby reducing jitter and slow acceleration problems and improving overall performance.

[0042] To facilitate the following description, the main signals are described as follows:

[0043] clk: clock signal.

[0044] rst_n: reset signal, low level is valid.

[0045] coe: Angle compensation enable signal, high level is valid, low level resets all registers in the module.

[0046] hall_change_phy: physical commutation point signal. This is a pulse signal that is generated when the external Hall sensor has an edge transition.

[0047] APS: A 2-bit wide signal used to select the accuracy of the Hall sensor angle compensation;

[0048] 2'b00:60° / 128=0.46875°

[0049] 2'b01:60° / 64=0.9375°

[0050] 2'b10:60° / 32=1.875°

[0051] 2'b11:60° / 16=3.75°

[0052] COO is a 4-bit wide signal, which refers to the signal for selecting the positive and negative offset and angle compensation value of compensation.

[0053] The highest bit (COO[3]) is used to select the positive or negative offset of the compensation:

[0054] COO[3]=1 indicates that the ideal physical commutation point is shifted to the left (ahead) of the actual physical commutation point.

[0055] COO[3]=0 means that the ideal physical commutation point is shifted to the right (lags behind) the actual physical commutation point.

[0056] The remaining bits of COO (COO[2:0]) are used to select the angle compensation value, which can offset the APS value by 1 to 8 times.

[0057] For example, if APS selects 2'b10 and COO[2:0] selects 3'd7, then the offset angle = 1.875°*8 = 15°

[0058] First, the embodiment of the present invention measures the back electromotive force of the motor to actually evaluate the deviation angle of the Hall sensor relative to the physical commutation point. By actually measuring the Hall angle deviation and automatically correcting it, a more appropriate commutation angle can be obtained, thereby improving the commutation accuracy of the brushless DC motor.

[0059] For the convenience of discussion, assume that the current N pole is facing the U phase coil at 0 electrical angle, and Hall sensor A is installed in the U phase coil and the first clockwise slot next to it. Define the clockwise rotation of the rotor as positive rotation. When the permanent magnet faces the winding, the back electromotive force (which changes with time according to the cosine law) crosses zero, and the back electromotive force conforms to the increase in reverse and decrease in positive. When the rotor rotates clockwise, the corresponding relationship between the U back electromotive force and the output signal of Hall sensor A is as follows: Figure 2 As shown. Figure 2 As can be seen from the figure, the rising edge of the output signal of the Hall sensor is 30° ahead of the zero crossing point of the back electromotive force (the physical switching point of the Hall sensor A is the electrical angle position 30° ahead of the zero crossing point of the U back electromotive force). When the rotor rotates counterclockwise, the corresponding relationship between the U back electromotive force and the output signal of the Hall sensor A is as follows: Figure 3 As shown, the physical commutation point of Hall sensor A is the position where the opposite potential of U crosses zero and lags 30° electrical angle.

[0060] However, Figure 4 The signal relationship diagram shown is the case when the Hall sensor is correctly installed in the ideal position, and the physical phase change point between the two phases is 60° apart. In actual working conditions, the installation position of the Hall sensor is usually deviated from the ideal position (such as Figure 5A and Figure 5B As shown in the figure, in the embodiment of the present invention, a specific angle deviation (for example, a deviation of ±30°) can be supported, that is, the phase difference time of the point cycle between the two phases. During the operation of the motor, after using the back electromotive force measurement, if an angle deviation occurs, it is necessary to compensate the output physical commutation point time of any Hall sensor separately.

[0061] like Figure 5AAs shown, when the actual Hall waveform is offset to the left relative to the ideal position, the first 180° of channel A can be used for estimation. Since the compensation angle has been configured before angle compensation, the estimated time of the first 180° can be used for angle conversion. Since the angle between the two physical commutation points of the same phase is 180°, a timer is used to count the time between the two edges, and the angular velocity w=Δθ / Δt can be obtained. Since the angle deviation is configured externally, the time deviation, that is, the position of the timer count, can be inferred. After the current 180-degree estimation is completed, the current physical commutation point begins to shield the commutation point, and the angle compensation counter starts to start. When the counter value and the deviation angle matching value are equal, a compensated commutation point is generated. Subsequent commutation points are estimated based on the first 180° time. When the motor changes speed, it can follow the motor speed well to calculate the accurate angle for compensation, and all subsequent physical commutation points are shielded until the angle compensation enable signal coe is turned off.

[0062] like Figure 5B As shown in the figure, when the actual signal is offset to the left relative to the ideal signal, the situation is different from when it is offset to the right, and the compensation scheme also needs to be adjusted. The early commutation is a bit due to the deviation of the physical commutation point of A, which causes the commutation between A and B to be too close. Due to the inaccurate physical commutation point of A, the software output PWM control cannot achieve the maximum efficiency of the motor. In this case, the compensation algorithm is similar to the right offset. First, use the first 180° of A for time statistics. Since it is a left offset, the ideal commutation point is already wrong, so the 180° commutation physical commutation point is not shielded. The subsequent 180° commutation position is estimated through the first 180° commutation point. This position needs to be based on the previous 180° commutation time minus the angle deviation to get the ideal commutation point, that is, T real =T 180° -T offset Similarly, after every 180° electrical cycle, the angular velocity needs to be updated to ensure that when the motor changes speed, the angle compensation can be estimated to follow the change in motor speed and obtain a more accurate angle.

[0063] In order to automatically correct the angle deviation of the Hall sensor to achieve more accurate commutation control, the embodiment of the present invention first provides a Hall sensor angle automatic compensation circuit for a brushless DC motor (hereinafter referred to as a compensation circuit). The compensation circuit includes an angle compensation pre-stage processing module ( Figure 6 and Figure 7 As shown) and the angle conversion module and the compensation commutation point generation module ( Figure 8 The compensation angle can be adjusted dynamically according to the change of motor speed to ensure that the commutation point is accurate at different speeds. By accurately controlling the commutation point, the jitter and slow acceleration problems in the operation of the motor can be reduced, and the working efficiency and stability of the motor can be improved.

[0064] It should be noted that, since the input of the Hall sensor has three phases A, B, and C, each phase of the Hall sensor has a set of independently set angle conversion modules and compensation commutation point generation modules, so that the commutation points of any one channel can be compensated separately, which improves the flexibility of circuit design. For the convenience of understanding, only one channel is used to illustrate the structure and working principle of the angle conversion module and the compensation commutation point generation module, and the structure and principle of the other two channels are similar. In addition, this embodiment only takes three Hall sensors as an example (i.e., N=3) for explanation, but this does not constitute a limitation of the present invention. In special cases, N (N>3) Hall sensors can also be used. In this case, it is only necessary to replace 60° in the following text with 180 / N degrees.

[0065] like Figure 6 As shown, the angle compensation pre-processing module includes a timer, a three-frequency module, and a counting and recording module. Among them, the timer (hall_est sequential logic module) receives rst_n (reset signal), coe (angle compensation enable signal), hall_change_phy (physical commutation point signal of the Hall sensor) and clk (clock signal), and outputs the hall_est signal. The hall_est signal represents the estimated value of the Hall sensor signal.

[0066] The physical commutation point signal of the Hall sensor is the original Hall sensor output, which is used to detect the position of the motor rotor. As we all know, in a brushless DC motor, the combined output of three Hall sensors is usually used to determine the precise position of the rotor, thereby generating a hall_change_phy signal, which represents the physical commutation point. Each Hall sensor can output two states: high or low, so the three sensors can be combined into eight different states, each corresponding to a specific position of the rotor in the stator winding. The value of the hall_change_phy signal is obtained by the following steps: The state of the three Hall sensors (Hall sensor A, Hall sensor B, and Hall sensor C) is detected to determine the current state of the rotor. Each state combination corresponds to a specific angle of the rotor relative to the stator winding. According to the output state of the Hall sensor, a lookup table or logic circuit is used to decode the current position of the rotor. Based on the decoded position information, it is determined when commutation is required to maintain continuous rotation of the motor. The commutation point usually occurs at the boundary where the rotor transitions from one state to another (this pulse signal is generated when the Hall sensor has an edge jump). When the commutation point is detected, the hall_change_phy signal is generated. This signal is a pulse signal used to trigger the electronic commutation logic to change the direction of the current in the stator winding.

[0067] Figure 7The specific structure of the timer is shown, and its input signals are rst_n, coe, hall_change_phy and clk. In the timer, the coe signal is used as the D input of the D flip-flop hall_est_reg. The hall_change_phy signal is inverted by the NOT gate rtlc_13 and input to the AND gate rtlc_16 for processing together with the coe signal. Its output is input to the EN (enable) terminal of the D flip-flop through the NOT gate rtlc_121. The rst_n signal is used as the input of the NOT gate rtlc_18 to control the enable signal input of the D flip-flop. At the same time, the rtlc_N0 signal and the inverted signal of the rst_n signal control the CLR (clear) input of the D flip-flop. The CP (clock) input of the D flip-flop is connected to the clk signal, and the Q output is used as the hall_est signal for subsequent logic. Through such a design, the D flip-flop is used to record and output the signal state, so as to facilitate the subsequent modules to realize the estimation and processing of the Hall sensor signal.

[0068] When the hall_change_phy signal comes for the first time, the hall_est_reg register is set to 1; when the hall_change_phy signal comes again, it indicates that the channel has an electrical angle of 180° (reference Figure 5A and Figure 5B ) has been estimated and subsequent automatic compensation operations can be performed.

[0069] Since the estimation circuit selects one of the Hall sensors to record the 180° electrical cycle time, and the physical commutation point between the two phases is 60°, it is necessary to divide the 180° electrical cycle time by three to obtain the interval time of the 60° physical commutation point between the two phases. Here, a three-way frequency division module (cnt_auto_div3) is particularly used. The three-way frequency division module receives rst_n, coe, hall_cnt_clr (Hall counter clear signal) and clk, and outputs the cnt_auto_div3_pulse signal as the three-way frequency division pulse of the Hall sensor signal for subsequent counting and angle estimation. The function of this module is to divide the frequency of the Hall sensor signal by three, thereby avoiding the use of traditional division units, reducing the consumption of computing resources and increasing the computing speed to meet the needs of real-time compensation.

[0070] The counting and recording module includes a counter (cnt_auto) and a storage counter (cnt_save0). The counter (cnt_auto) receives rst_n, coe, hall_cnt_clr and cnt_auto_div3_pulse signals, and outputs a cnt_auto signal to record the cycle time of the Hall sensor signal. The counter uses cnt_auto_div3_pulse for counting, and the cnt_auto signal it outputs represents the count value before the two edges, that is, the time value of the 60° electrical angle commutation point corresponding to the current Hall sensor is recorded.

[0071] The storage counter (cnt_save0) receives rst_n, coe, hall_save (Hall save signal) and cnt_auto signal, and outputs cnt_auto_save signal. The cnt_auto_save signal is used to save the value of the cnt_auto signal (i.e., the time value of the 60° electrical angle commutation point corresponding to the current Hall sensor) for angle compensation.

[0072] The masking logic module (hall_change_mask) has hall_change_mask_pre and clock signals as inputs and outputs the hall_change_mask signal. hall_change_mask_pre is a physical commutation point masking signal, which indicates the value of the hall_change_mask signal for the first 180°. When the compensation function is turned on and the effective compensation point is estimated, the physical commutation point is masked, otherwise the appearance of two physical commutation points in a 60° commutation cycle will cause abnormal motor drive. These signals are processed by logic gates (such as rtlc_138) to mask or allow the physical commutation points of the Hall sensor. The hall_change_mask_pre is generated in the hall_est2 module (not shown in the figure), and then processed by logic gates to generate hall_change_mask. The rtlc_N0 terminal of the masking logic module is connected to the rtlc_N0 terminal of the timer to achieve synchronous operation.

[0073] The AND gate (rtlc_138) receives hall_est and hall_change_phy as inputs and outputs the hall_change_mask_pre signal. When hall_change_phy arrives for the first time, hall_est is set to 1. When the hall_change_phy signal is high, the AND gate (rtlc_138) outputs 1; when the hall_change_phy signal is low, the AND gate rtlc_138 outputs 0. Through this control method, when coe is zero, the hall_est value is always 0, indicating that the automatic compensation is turned off. When the external physical commutation point hall_chang_phy inputs any value, it outputs 0. After passing through the logic gate circuits such as rtlc_183, rtlc_186, rtlc_172, and rtlc_179, it becomes 1. Therefore, any hall_change_phy physical commutation point can be output at hall_change. When coe is 1, the physical commutation point can be masked from the second or third point according to whether coo[3] is leading or lagging compensation.

[0074] like Figure 8 As shown, the angle conversion module and the compensation commutation point generation module include a deviation counter, a comparison angle module, an angle comparison circuit, a multiplexer and a commutation control circuit. The cnt_auto_save signal (the time value of the 60° electrical angle commutation point corresponding to the current Hall sensor) output from cnt_auto_save0 enters adders rtlc_144 and rtlc_145. The outputs of the APS signal and the COO signal pass through the multiplexer rtlc_172, and the sel signal of the selector determines whether the output is cout of rtlc_144 or cout of rtlc_145. This output is then compared with the output value of the deviation counter cnt_base in comparators rtlc_176 and rtlc_175 to determine whether the preset commutation condition is reached. The output of the comparator is processed by the NAND gate rtlc_179 and enters the multiplexer rtlc_177, whose sel signal determines whether to select the output of the comparator or the constant 1. Finally, the output of the multiplexer rtlc_177 generates the final commutation signal hall_change through the NAND gate rtlc_181. At the same time, the cnt_auto_save signal is processed by the NAND gates rtlc_183 and rtlc_186 to control the save operation of the counter. The entire circuit achieves precise control and angle compensation of the Hall sensor signal through the coordinated work of these logic components and modules.

[0075] Based on the above-mentioned Hall sensor angle automatic compensation circuit for brushless DC motors, an embodiment of the present invention further provides a Hall sensor angle automatic compensation method for brushless DC motors, which at least includes the following steps:

[0076] The reset signal rst_n is used to reset the timer, the three-frequency division module, the counter, the storage counter and the deviation counter.

[0077] When the Hall sensor detects a change in the rotor magnetic field position, an edge jump (rising edge or falling edge) occurs. The hall_change_phy signal generated when the edge jump occurs is input to the timer (the angle compensation enable signal coe is valid).

[0078] When the hall_change_phy signal arrives for the first time, the timer sets the hall_est_reg register (to 1). This indicates the start of the 180° electrical angle estimation. At the same time, the hall_change_phy signal is also input to the hall_cnt_ctr end of the divider (the angle compensation enable signal coe is valid), so that the divider starts counting. The three-frequency module (cnt_auto_div3) used in this embodiment divides the Hall sensor signal and outputs the cnt_auto_div3_pulse signal to the counter to obtain a 60° electrical cycle time for one Hall sensor. The counter outputs the cnt_auto signal to the storage counter. The storage counter outputs the count value M corresponding to the 60° electrical cycle time of a phase Hall sensor.

[0079] The count value M is input to the cnt_auto_abs terminal of the angle conversion module, and is used to calculate the angle count value to be compensated according to the pre-configured values ​​of the APS terminal and the COO terminal. In this embodiment, the angle conversion module is used to convert the angle compensation value into an angle count value (with a count unit of a counter), and the conversion from the angle value to the count value is realized, so as to be compared with the output value of the deviation counter cnt_base in the comparator.

[0080] Specifically, the APS end of the angle conversion module is pre-configured with an angle accuracy value. The angle accuracy value is a fractional value of the 60° angle, that is, a certain multiple (in binary) of the angle accuracy value is 60°. As mentioned above, the angle accuracy value can be 1 / 4, 1 / 8, 1 / 16...1 / 128 of 60°, etc. The APS value determines the minimum unit angle (accuracy) of the angle compensation. For example, if the APS value is 2'b00, the minimum unit angle is 60° / 128=0.46875°.

[0081] The COO value determines the total angle and offset direction that need to be compensated. The COO value multiplied by the APS value can get the actual angle that needs to be compensated. As mentioned above, the COO value is 4 bits, of which the first 3 bits indicate how many APS values ​​are offset (that is, how many times the compensation angle is the minimum unit angle); the last bit indicates the offset direction (1 means leading, 0 means lagging).

[0082] In order to convert the compensation angle into counting units, the angle value needs to be multiplied by a proportional factor, which depends on the clock frequency of the counter and the angular velocity of the motor. When the actual Hall waveform is offset to the left relative to the ideal position, the first 180° of channel A can be used for estimation. Since the angle between the two physical commutation points (two adjacent edges of the same phase) is 180°, after three-way frequency division, Δθ = 60° (such as Figure 4 As shown), by counting the clock count Δt between two adjacent edges (as the corresponding 60° electrical cycle time) under the control of the three-way frequency divider, the angular velocity w = Δθ / Δt can be obtained.

[0083] By using the angle compensation pre-processing module provided in the embodiment of the present invention, the value of Δt (based on the first 180° electrical cycle time) can be pre-counted. Specifically, when the hall_change_phy signal is generated on the rising edge of a phase Hall sensor signal, the timer starts timing and outputs a high-level hall_est signal to the AND gate rtlc_138. In addition, the hall_change_phy signal is at a high level at this time and is also input to the AND gate rtlc_138. Therefore, the AND gate rtlc138 inputs 1 to the hall_save terminal of the storage counter, so that the storage counter saves the count value from the cnt_auto terminal and inputs it to the cnt_auto_abs terminal of the angle conversion module as cnt_save0. At this time, the count value cnt_save0 is Δt (the count value corresponding to the 60° electrical cycle time). Therefore, cnt_save0+cnt_save0+cnt_save0 is the electrical cycle time T corresponding to 180°. 180° The count value of .

[0084] The angular velocity w is 60° divided by the value of cnt_save0. Based on the angular velocity, the compensation angle (compensation angle experience value) at the ideal position can be converted into a multiple of the minimum unit angle. Figure 4 As shown), the values ​​of the APS signal and the COO signal can be manually pre-configured.

[0085] Afterwards, the coe signal is set to 0, so that each register is reset and angle compensation is performed at the current 180°.

[0086] Next, the situation during angle compensation will be described. As mentioned above, the cnt_save0 value obtained based on the statistics of the first 180° is input to the cnt_auto_abs terminal of the angle conversion module. Since the values ​​of COO and APS have been pre-configured (corresponding to the compensation angle experience value), the angle conversion module obtains the ideal position offset value based on cnt_save0 through a shift operation (for example, if the value of APS is configured as 2'b00, the cnt_save0 value needs to be divided by 128, which can be achieved by right-shifting it by 7 bits) and outputs the angle_offset signal. In addition, the cnt_save0 value is input to adders rtlc144 and rtlc145 to obtain the value of cnt_save0+cnt_save0+cnt_save0, which is input to the subtractor rtlc146. The subtractor rtlc146 subtracts the angle_offset signal from the value of cnt_save0+cnt_save0+cnt_save0 to input the difference (cnt_save0+cnt_save0+cnt_save0-angle_offset) to the comparator rtlc175. Moreover, the angle_offset signal is simultaneously input to the comparator rtlc176. Here, by using shift operations and adders to replace complex multiplication and division circuits, resource consumption is reduced, and the economy and efficiency of the compensation circuit are improved.

[0087] The clk, rst_n, and coe terminals of the deviation counter cnt_base are connected to the corresponding ports of the timer respectively. The cnt_base_clr terminal of the deviation counter cnt_base is input with the hall_change_phy signal. Among them, cnt_base_clr is designed to be valid at low level, so when the rising edge of the hall_change_phy signal arrives, coe is enabled, and when the cnt_base_clr terminal receives the hall_change_phy jump to low level, the counter will be reset; when hall_change_phy is high, the counter works normally. In this way, the counting of 180° electrical cycle time by the deviation counter is realized.

[0088] The output value of the deviation counter cnt_base outputs 180° electrical cycle time to comparators rtlc175 and rtlc176. In comparator rtlc176, the angle_offset signal is compared with the output value of the deviation counter cnt_base. When the two match, a commutation pulse signal is generated to the 0 end of the multiplexer rtlc177. In comparator rtlc175, the difference (cnt_save0+cnt_save0+cnt_save0-angle_offset) is compared with the output value of the deviation counter cnt_base. When the two match, a commutation pulse signal is generated to the 1 end of the multiplexer rtlc177.

[0089] When the highest bit of the COO signal (COO[3], i.e., the value of the 4th bit of the COO signal) is 1, this indicates that the ideal physical commutation point is offset to the left relative to the actual physical commutation point, i.e., the signal of the Hall sensor is ahead of the ideal position. In order to compensate for this advance, the commutation point needs to be adjusted in the lagging direction. In this case, the "difference" is the sum of the count values ​​(cnt_save0) of three consecutive 60° electrical cycle times minus the pre-calculated angle compensation value (angle_offset). This difference is then compared with the output value of the deviation counter cnt_base to determine whether the ideal position physical commutation point position when advanced has been reached.

[0090] When COO[3] is 0, it means that the ideal physical commutation point is to the right of the actual physical commutation point, that is, the signal of the Hall sensor lags behind the ideal position. In order to compensate for this lag, the commutation point needs to be adjusted in the leading direction. In this case, the "difference" is actually the pre-calculated angle compensation value (angle_offset) itself, which is compared with the output value of the deviation counter cnt_base to determine whether the ideal physical commutation point position at the lag is reached.

[0091] The sel terminal of the multiplexer rtlc177 receives the COO signal and selects the output according to the value of COO[3]. If COO[3] is 1, the commutation pulse signal whose difference (cnt_save0+cnt_save0+cnt_save0-angle_offset) is equal to the cnt_base value is selected; if COO[3] is 0, the commutation pulse signal whose angle_offset value is equal to the cnt_base value is selected. The output of the multiplexer rtlc177 is then connected to the OR gate rtlc181, which combines the commutation point generated by the automatic compensation and the physical commutation point through OR logic to generate the final commutation signal hall_change.

[0092] When the hall_change_phy signal comes again, it means that the 180° electrical angle of the three Hall sensors has been estimated. At this time, the hall_change signal is used to control the commutation of the motor to ensure that the motor commutates at the right time to compensate for the angle deviation of the Hall sensor and improve the accuracy and efficiency of motor control.

[0093] In one embodiment of the present invention, the control of the shielding signal depends on the following three conditions:

[0094] Condition 1: When coe is 0, it means that the automatic compensation is turned off, and the shielding signal is 0, it means that it is not shielded, and all physical commutation points are used.

[0095] Condition 2: When coe is 1 and compensation is advanced, COO[3]=1, the first physical commutation point needs to be retained, and the second physical commutation point is advanced to shield the signal. When there are two physical commutation points, the motor has rotated 180° electrical angle, and the second physical commutation point can be replaced with the estimated physical commutation point, so the second physical commutation point can be discarded.

[0096] Condition three: When coe is 1 and the compensation is lagging, COO[3]=0, and the first and second physical switching points need to be retained. Since the second physical switching point is lagging, the physical signal cannot be shielded (retain the second physical switching point).

[0097] The following is a detailed description of the control logic of the shielding signal:

[0098] Condition 1: Shielding signal control when automatic compensation is turned off

[0099] When coe (angle compensation enable signal) is 0, it means that the automatic compensation function is turned off. In this case, the mask signal is also 0, which means that no signal is masked, so all physical commutation points are used. At the circuit level, the output of the hall_change_mask D flip-flop is fixed to 0. Since one of the inputs of the NAND gate rtlc_186 is coe, when coe is 0, the output of rtlc_186 is also 0. In this way, regardless of the sel signal of the multiplexer rtlc_172, its output is always 0. This 0 signal is inverted by the non-gate rtlc_179 to become 1, and then input to the AND gate rtlc_180. Therefore, no matter what the input of the physical commutation point hall_change_phy is, the output of rtlc_180 can reflect the state of hall_change_phy.

[0100] Condition 2: Shielding signal control when compensation is advanced

[0101] When coe is 1 and the compensation is advanced (COO[3]=1), the first physical switching point needs to be retained, while the second physical switching point needs to be masked because it is advanced. In this case, the multiplexer rtlc_172 will select the signal hall_change_mask_pre of the previous stage of the hall_change_mask D flip-flop, which is provided by the OR gate rtlc_183. The in1 input of rtlc_183 is the hall_est signal, which becomes 1 after recording a physical sampling point; in2 is the output of hall_change_mask, and when the second physical sampling point arrives, the hall_change_mask output is 0. Therefore, the output of the rtlc_183 OR gate circuit is 1. After being processed by the NAND gate rtlc_186, since coe is 1, the output of rtlc_186 is also 1. Then, this signal is selected for channel 0 input through the rtlc_172 multiplexer, the output of rtlc_172 is 1, and it becomes 0 after being inverted by the rtlc_179 NOT gate. Therefore, no matter what value is input to the rtlc_180 AND gate in1 (hall_change_phy), the output of the rtlc_180 AND gate is 0, thereby shielding the second physical switching point and subsequent physical switching points.

[0102] Condition 3: Shielding signal control when compensation is delayed

[0103] When coe is 1 and the compensation is hysteresis (COO[3] = 0), the first and second physical switching points need to be retained. Therefore, when the second physical switching point appears, the output of the hall_change_mask D flip-flop is fixed to 1. The multiplexer rtlc_172 selects the input of channel 1, that is, the signal hall_change_mask is output to the NOT gate rtlc_179. After being inverted by rtlc_179, it becomes 0, and then this 0 signal is input to the AND gate rtlc_180. In this way, all physical switching points hall_change_phy and 0 output 0 after the AND gate operation, thereby shielding the physical switching points after the second physical switching point.

[0104] The above three conditions ensure that the shielding signal can be correctly controlled under different compensation states to ensure accurate commutation of the motor.

[0105] In the prior art, for the angle compensation of the Hall sensor of the brushless DC motor, different calculation formulas need to be used according to different intervals, which usually involves 6 different intervals. The calculation formulas for each interval are inconsistent, resulting in a complicated calculation process. In contrast, the present invention adopts a single-channel estimation method, which is independent of the interval, greatly simplifying the calculation process of angle compensation. This method estimates the angle deviation through the 180° electrical cycle time of a Hall sensor signal, without the need to apply different calculation formulas according to different intervals, thereby reducing the complexity of the algorithm and improving the real-time performance of the compensation.

[0106] On the other hand, in the prior art, the angular velocity ω of 60° electrical angle between the two phases is usually used for estimation, but when there is a deviation between the two phases, this estimation method will produce a large error. In addition, if an attempt is made to use the measured value between the two phases for compensation calculation, although the accuracy can be improved, the calculation process will become more complicated. The present invention uses the constant 180° electrical cycle time of the same Hall sensor to estimate the angle deviation, which reduces the generation of errors and avoids substitution errors, making the calculation process simpler and easier to implement in engineering. The present invention significantly improves the commutation accuracy and motor efficiency of the brushless DC motor by actually measuring the angle deviation of the Hall sensor and automatically correcting it.

[0107] Compared with the traditional software estimation method, the present invention adopts digital hardware circuit to realize angle compensation, which has obvious advantages in real time, especially in the application of high speed motor. The digital hardware circuit can quickly respond to the change of motor rotor position and realize real-time compensation, which is very important for high speed motor.

[0108] Compared with the prior art, the present invention significantly improves the commutation accuracy and motor efficiency of the brushless DC motor by actually measuring the angle deviation of the Hall sensor and automatically correcting it, and effectively reduces the jitter and slow acceleration problems during motor operation. Compared with traditional software estimation, the compensation method implemented by digital circuit not only improves the real-time and accuracy of compensation, but also reduces the dependence on software efficiency and microcontroller operating frequency. In addition, the present invention can adapt to changes in motor speed and calculate the accurate compensation angle in real time to ensure that efficient motor performance can be maintained even during variable speed operation. The flexibility of circuit design allows for separate compensation of the commutation point time of any Hall output, and by optimizing the circuit implementation, resource consumption is reduced and the overall efficiency and response speed of the electronic control system are improved.

[0109] It should be noted that the above-mentioned multiple embodiments are only examples, and the technical solutions of the various embodiments can be combined, and the order of the steps can be changed, all within the protection scope of the present invention.

[0110] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0111] The above is a detailed description of the Hall sensor angle automatic compensation circuit and method for brushless DC motors provided by the present invention. For those skilled in the art, any obvious changes made to it without departing from the essence of the present invention will constitute an infringement of the patent right of the present invention and will bear corresponding legal responsibilities.

Claims

1. A Hall sensor angle automatic compensation circuit for a brushless DC motor, characterized in that It includes an angle compensation pre-processing module, an angle conversion module and a compensation reversing point generation module; wherein, The angle compensation pre-processing module includes a timer, a three-frequency module, an AND gate and a counting and recording module, which are used to measure the deviation angle of the Hall sensor relative to the physical commutation point; when the Hall sensor detects a change in the rotor magnetic field position, a physical commutation point signal is generated, which is input into the timer and the three-frequency module respectively, and the output signal of the timer is input into the AND gate together with the physical commutation point signal, and the output signal of the AND gate is used to control whether to shield the physical commutation point of the Hall sensor; The counting and recording module includes a counter and a storage counter, which are used to record the cycle time of the Hall sensor signal and save the angle compensation value; wherein the output end of the three-frequency division module is connected to the counter, and the output end of the counter is connected to the storage counter; the output end of the storage counter is connected to the angle conversion module; The output end of the angle conversion module is connected to the compensation reversing point generation module, which is used to convert the angle compensation value into an angle count value; in the compensation reversing point generation module, a reversing signal for dynamically adjusting the compensation angle is generated.

2. The Hall sensor angle automatic compensation circuit as claimed in claim 1, characterized in that: The timer receives a reset signal, an angle compensation enable signal, a physical commutation point signal of the Hall sensor and a clock signal, and outputs an estimated value of the Hall sensor signal.

3. The Hall sensor angle automatic compensation circuit as claimed in claim 1, characterized in that: The three-frequency division module receives a reset signal, an angle compensation enable signal, a Hall counter clear signal and a clock signal, and outputs a three-frequency division pulse signal to obtain a 60° electrical angle interval between state changes of two adjacent Hall sensors.

4. The Hall sensor angle automatic compensation circuit as claimed in claim 1, characterized in that: The counter receives a reset signal, an angle compensation enable signal, a Hall counter clear signal and a three-frequency pulse signal, and outputs a count value; the storage counter receives a reset signal, an angle compensation enable signal, a Hall save signal and the count value, and outputs a saved count value.

5. The Hall sensor angle automatic compensation circuit as claimed in claim 1, characterized in that: The angle conversion module receives the output signal of the storage counter and the pre-configured APS signal and COO signal, and calculates the angle count value that needs to be compensated.

6. The Hall sensor angle automatic compensation circuit as claimed in claim 1, characterized in that: The compensation commutation point generation module includes a multiplexer and a commutation control circuit; wherein the multiplexer outputs a signal for commutation control according to the selection of the COO signal; and the commutation control circuit receives the output of the multiplexer and generates the commutation signal.

7. The Hall sensor angle automatic compensation circuit according to any one of claims 1 to 6, characterized in that: Each phase Hall sensor is independently provided with the angle conversion module and the compensation commutation point generation module.

8. A method for automatic compensation of the angle of a Hall sensor for a brushless DC motor, implemented based on the automatic compensation circuit of the Hall sensor according to any one of claims 1 to 7, characterized in that The steps include: When the Hall sensor detects a change in the rotor magnetic field position, it generates a physical commutation point signal; When the timer receives a physical commutation point signal, it starts to estimate the 180° electrical angle. The physical commutation point signal is input to the frequency divider, so that the frequency divider starts counting. The three-frequency module is used to divide the Hall sensor signal and output it to the counter to obtain the 60° electrical cycle time of the Hall sensor. The counter outputs a signal to a storage counter, and the storage counter outputs a count value corresponding to a 60° electrical cycle time of the Hall sensor; The count value is input into the angle conversion module, and the angle count value to be compensated is calculated according to the pre-configured values ​​of the APS signal and the COO signal; The deviation counter counts the 180° electrical cycle time, and the output of the deviation counter is compared with the preset compensation angle count value, and a commutation pulse signal is generated when the two match; The multiplexer selects the corresponding commutation pulse signal according to the value of the COO signal, and uses OR logic to output the commutation signal for dynamically adjusting the compensation angle; When the next physical commutation point signal arrives, it indicates that the 180° electrical angle estimation has been completed, and the commutation of the brushless DC motor is controlled according to the commutation signal.

9. The Hall sensor angle automatic compensation method as claimed in claim 8, characterized in that The physical reversing point signal is obtained by the following sub-steps: Perform state detection on the Hall sensor and use a lookup table or logic circuit to decode the current position of the rotor according to the output state of the Hall sensor; According to the decoded position information, determine when commutation is required to maintain continuous rotation of the motor; The physical commutation point signal is generated when a commutation point is detected; wherein the commutation point occurs at a boundary where the rotor transitions from one state to another state.

10. The Hall sensor angle automatic compensation method according to claim 8, characterized in that: The multiplexer selects the corresponding commutation pulse signal according to the value of the COO signal; wherein, if the highest bit of the COO signal is 1, it indicates that the ideal physical commutation point is ahead of the actual physical commutation point, and the commutation point needs to be adjusted in the lagging direction; if the highest bit of the COO signal is 0, it indicates that the ideal physical commutation point lags behind the actual physical commutation point, and the commutation point needs to be adjusted in the leading direction.

Citation Information

Patent Citations

  • Deviation identification and compensation methods for Hall sensors under different installation methods

    CN111146980B