Method for compensating installation error of Hall sensor in motor and motor controller
By detecting the installation error of Hall sensor and performing angle compensation, the motor performance degradation caused by Hall sensor installation error is solved, and the stability of motor torque and speed and the symmetry of current waveform is achieved.
Patent Information
- Application Number
- CN202510458825.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-11
- Publication Date
- 2025-08-08
AI Technical Summary
There is an angular error in the installation position of the Hall sensor in the brushless DC motor, which causes the phase commutation to be lagged or advanced, affecting the motor electromagnetic torque and speed stability, and reducing motor performance.
By detecting the error between the d-axis angle and the theoretical d-axis angle when the Hall state changes, angle error compensation is performed when square wave driving is used to ensure that each phase commutation is performed at the correct angle.
The symmetry of the motor current waveform is achieved, peaks or distortions are avoided, the stability of the motor torque and speed is ensured, and the motor performance is improved.
Smart Images

Figure CN120454559A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of motor control, and in particular to a method for compensating for installation errors of a Hall effect sensor in a motor and a motor controller. Background Art
[0002] Brushless Direct Current (BLDC) motors use Hall sensors to detect rotor position for commutation. However, the Hall sensors' installation position may have angular errors, which can cause commutation timing to lag or advance, leading to fluctuations in the motor's electromagnetic torque. This results in poor speed stability and reduced motor performance. To improve motor performance, it is necessary to detect and compensate for Hall sensor installation errors. Summary of the Invention
[0003] Embodiments of the present application provide a method for compensating for installation errors of a Hall sensor in a motor and a motor controller, which can detect installation errors of the Hall sensor and compensate for the installation errors of the Hall sensor.
[0004] In a first aspect, an embodiment of the present application provides a method for compensating for Hall effect sensor installation errors in a motor, wherein the motor is a brushless direct current motor. The method comprises: starting with a d-axis angle of a first electrical angle, locking the d-axis at preset electrical angle intervals along a first direction, and detecting a Hall state after each d-axis locking until the d-axis angle changes to the first electrical angle for the Nth time, where N ≥ 1, the preset electrical angle is less than 60°, and the first direction is clockwise or counterclockwise; determining an average value of an angular error corresponding to the same Hall state based on the locked d-axis angle and the corresponding theoretical d-axis angle corresponding to each Hall state change, wherein the theoretical d-axis angle is determined based on the Hall state and a Hall phase sequence for the first direction, and the angular error is equal to the theoretical d-axis angle minus the locked d-axis angle; and controlling commutation based on the Hall state during the process of driving the motor to rotate using a square wave, and compensating for the commutation timing based on the average value of the angular error.
[0005] In one possible implementation, compensating for the commutation moment according to the average value of the angle error includes: driving the motor to rotate based on a square wave according to the Hall phase sequence, and determining the on-time of the energized sector, where the on-time is equal to the average time used for the motor to rotate one electrical cycle divided by 6; determining the compensation time corresponding to the target Hall state according to the average value of the angle error and the on-time corresponding to the target Hall state, wherein the compensation time = the average value of the angle error * the on-time / 60°, and the target Hall state is any one of six different Hall states; taking the moment when the Hall state changes to the target Hall state as the starting moment, commutating when the target time period arrives, wherein, when the first direction is counterclockwise, the target time period = the on-time + the compensation time, and when the first direction is clockwise, the target time period = the on-time - the compensation time.
[0006] In a possible implementation, the preset electrical angle=1 / 65536*360°.
[0007] In one possible implementation, starting from the d-axis angle being a first electrical angle, locking the d-axis along a first direction at preset electrical angle intervals, and detecting the Hall state output by the Hall sensor after each d-axis locking until the d-axis angle changes to the first electrical angle for the Nth time, includes: controlling the motor to run for a preset time based on the target voltage and the d-axis angle, and detecting the Hall state output by the Hall sensor after the motor runs for the preset time until the d-axis angle changes to the first electrical angle for the Nth time, the target voltage is the d-axis voltage, the q-axis voltage is 0, the initial value of the d-axis angle is the first electrical angle, and the d-axis angle steps along the first direction at the predetermined electrical angle.
[0008] In one possible implementation, controlling the motor to run for a preset time based on a first voltage and a d-axis angle includes: determining the three-phase voltage of the motor based on the target voltage, the d-axis angle, Park inverse transform, and Clarke inverse transform; and controlling the motor to run for the preset time based on the three-phase voltage.
[0009] In one possible implementation, the method further includes: starting from a d-axis angle of a second electrical angle, locking the d-axis at 60° electrical angle intervals along the first direction until the d-axis rotates at least one electrical cycle, and detecting the Hall state output by the Hall sensor after each d-axis is locked; and determining the Hall phase sequence based on the locked d-axis angle each time the Hall state changes and the correspondence between the d-axis angle and the power-on phase sequence.
[0010] In a possible implementation, the second electrical angle is 60°*k, where k∈[0,5].
[0011] In a second aspect, an embodiment of the present application provides a motor controller comprising a unit for executing each step of the method of any possible implementation manner in the first aspect.
[0012] In a third aspect, an embodiment of the present application provides a motor controller comprising a processor and a memory, wherein the memory is used to store programs or instructions. When the programs or instructions are executed by the processor, the motor controller executes the method in the first aspect or any possible implementation of the first aspect.
[0013] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed, the method in the above-mentioned first aspect or any possible implementation of the first aspect is executed.
[0014] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes computer program instructions. When the computer program instructions are executed, the method in the above-mentioned first aspect or any possible implementation of the first aspect is executed.
[0015] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0016] According to the method provided in the embodiments of the present application, by locking the d-axis, the angular error between the locked d-axis angle and the theoretical d-axis angle at the moment the Hall effect state changes can be determined. Based on this angular error, this angular error can be compensated in subsequent square-wave control, ensuring that each sector commutates at the correct angle each time it is powered on. This ensures that the motor's current waveform is symmetrical, without spikes or distortion, thereby ensuring stable torque and speed, and improving motor performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 This is a schematic diagram of the corresponding relationship between the d-axis angle and the energized sector when the BLDC motor rotates counterclockwise;
[0018] Figure 2 This is a schematic diagram of the corresponding relationship between the d-axis angle and the energized sector when the BLDC motor rotates clockwise;
[0019] Figure 3 This is a diagram of the Hall effect state changes when the motor rotates counterclockwise when three Hall effect sensors are installed 120 degrees apart.
[0020] Figure 4 This is a diagram of the Hall effect state changes when the motor rotates counterclockwise when three Hall effect sensors are installed 60° apart.
[0021] Figure 5 This is a schematic flow chart of a Hall phase sequence self-learning method provided in an embodiment of the present application;
[0022] Figure 6 This is a schematic flow chart of a Hall phase sequence self-learning method provided in an embodiment of the present application;
[0023] Figure 7 This is a schematic flow chart of a Hall phase sequence self-learning method provided in an embodiment of the present application;
[0024] Figure 8 This is a schematic flow chart of a Hall phase sequence self-learning method provided in an embodiment of the present application;
[0025] Figure 9 This is a schematic flow chart of a method for compensating for installation errors of a Hall sensor in a motor provided in an embodiment of the present application;
[0026] Figure 10 This is a process for determining the angular error corresponding to the Hall state during counterclockwise rotation provided by an embodiment of the present application;
[0027] Figure 11 This is a process for determining the angular error corresponding to the Hall state during clockwise rotation provided by an embodiment of the present application;
[0028] Figure 12 This is a schematic flow chart of a method for compensating for installation errors of a Hall sensor in a motor provided in an embodiment of the present application;
[0029] Figure 13 This is a timeline diagram of the actual switching point and the correct switching point provided in the embodiment of the present application;
[0030] Figure 14 This is a schematic flow chart of compensating for installation errors of a motor Hall sensor when the motor rotates counterclockwise, as provided in an embodiment of the present application;
[0031] Figure 15 This is a schematic flow chart of compensating for the installation error of the motor Hall sensor when the motor rotates clockwise, as provided in an embodiment of the present application;
[0032] Figure 16 is a schematic structural diagram of a motor controller provided in an embodiment of the present application;
[0033] Figure 17 This is a structural diagram of a motor controller provided in an embodiment of the present application. DETAILED DESCRIPTION
[0034] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application.
[0035] In the following description, specific details such as specific system structures and techniques are provided for purposes of illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obscuring the description of the present application with unnecessary detail.
[0036] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.
[0037] It will also be understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0038] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0039] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in yet other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized.
[0040] Square-wave drive (also known as six-step commutation or trapezoidal-wave drive) is a BLDC motor control strategy. It uses Hall sensors to detect the motor rotor position and then commutates (i.e., switches the power supply state of the motor stator) in a fixed sequence to drive the motor rotor.
[0041] When using square waves to drive a BLDC motor, six different Hall states (i.e., combinations of the output signals from the three Hall sensors) occur repeatedly. These six Hall states correspond to six different stator power states, also known as six different power sectors or power phase sequences. The correspondence between these six Hall states and the six different power phase sequences can be determined using various methods.
[0042] In the first method, the correspondence between the Hall states and the power-on phase sequence can be determined based on the motor's three-phase winding output and the installation of the three Hall sensors. However, if the BLDC motor's manufacturing diagram or the Hall sensor installation diagram within the motor are unavailable, the correspondence between the power-on phase sequence and the Hall states cannot be determined. In the second method, the BLDC motor is rotated externally and the three-phase back-EMF waveforms and the Hall states output by the Hall sensors are measured using an oscilloscope. The correspondence between the back-EMF waveforms and the Hall states can be determined by measuring the correspondence between the Hall states and the power-on phase sequence. However, if the BLDC motor cannot be rotated, an oscilloscope is not available, or the correspondence cannot be derived from the back-EMF waveforms, this method is not practical. The third method is a trial-and-error method. The correspondence between the Hall states and the power-on sectors is set in the program. The three motor stator phases are randomly connected to the three controller outputs. Six different connection methods are available. The correct connection method is determined by repeatedly trying to start the motor. However, this method requires fault protection for the motor and controller to prevent the motor from failing to start normally due to excessive current or high temperature, which may damage the controller or motor.
[0043] In summary, these methods require external hardware resources or operators to have a deep understanding and mastery of the BLDC motor's operating principles. This is to accurately measure the correspondence between the power-on phase sequence and Hall-effect states required for square-wave control. This allows the BLDC motor's three stator phases to be correctly connected to the controller's three outputs, enabling the controller to properly drive the BLDC motor. These methods undoubtedly increase the difficulty of determining the correspondence between the power-on phase sequence and Hall-effect states.
[0044] In view of this, embodiments of the present application provide a Hall phase sequence self-learning method that can automatically determine the Hall phase sequence, that is, determine the correspondence between the Hall state and the d-axis angle (that is, the electronic rotor position) and the power-on phase sequence in a BLDC motor. This method does not require any additional auxiliary tools or the operator to understand the working principle of the BLDC motor, and is simple and easy to use.
[0045] Before introducing the Hall phase sequence self-learning method provided in this application, the relevant contents of the six-step commutation method (ie, square wave drive) and the vector control method are first explained.
[0046] 1. Six-step reversing method
[0047] In a BLDC motor, the stator has three phases (A, B, C, and V) (the three phases A, B, and C are also referred to as the three phases UV and W). The A phase vector direction serves as the coordinate reference 0°, while the B and C phase vector directions are 120° and 240°, respectively. The rotor is simplified to a rotatable north and south pole. The north pole magnetic field direction is the d-axis direction, and the q-axis rotates 90° counterclockwise.
[0048] When driving a BLDC motor with a square wave, the counterclockwise drive phase sequence (i.e., the energized phase sequence) is UV→UW→VW→VU→WU→WV, while the clockwise drive phase sequence is UV→WV→WU→VU→VW→UW. Each energized phase sequence is typically referred to as an energized sector (or simply a sector). Within the same energized sector, the stator coils are continuously supplied with the same voltage, generating a composite voltage vector in the same direction. The rotor rotates counterclockwise by 60 electrical degrees under the influence of the magnetic field generated by the stator coils. The stator coils then enter the next energized sector, where the composite stator voltage vector jumps 60 electrical degrees counterclockwise or clockwise, continuing to attract the rotor to rotate by another 60 electrical degrees. The above analysis shows that the composite stator voltage vector forms a voltage vector circle that jumps every 60 electrical degrees, while the rotor magnetic field vector forms a continuous magnetic field vector circle as the rotor rotates.
[0049] The corresponding relationship between the power phase sequence and the d-axis angle when the motor rotates counterclockwise
[0050] Figure 1 The corresponding relationship between the d-axis angle and the energized sector when the BLDC motor rotates counterclockwise is shown.
[0051] Specifically, when the BLDC motor rotates counterclockwise, in the first energized sector (with the power-on phase sequence UV), the direction of the stator voltage composite vector is 330°. Because the d-axis lags the direction of the stator voltage composite vector by 120°, the d-axis angle is 210° at the initial energization of this energized sector. This means the initial angle between the d-axis angle and the direction of the stator voltage composite vector is 120°. Under the influence of the magnetic field generated by the stator coils, the rotor rotates counterclockwise by 60° electrical degrees. This means the angle between the d-axis angle and the direction of the stator voltage composite vector changes from 120° to 60°, meaning the d-axis rotates counterclockwise from 210° to 270°. When the d-axis angle is 240°, the angle with the stator voltage composite vector is 90°, generating the maximum torque.
[0052] When the d-axis angle reaches 270°, the Hall effect sensor output changes state, indicating that the stator voltage should enter the next energized sector. At this point, the stator coil energization phase sequence is changed to UW, entering the second energized sector, with the stator voltage composite vector direction at 30°. At the initial energization of this energized sector, the d-axis angle is 270°. The rotor rotates 60° within this energized sector, bringing the d-axis angle to 330°. At a d-axis angle of 300°, the angle with the stator voltage composite vector is 90°, generating the maximum torque.
[0053] When the d-axis angle reaches 330°, the Hall effect state changes again, indicating that the stator coil enters the next energized sector. At this point, the stator coil's energized phase sequence is changed to VW, entering the third energized sector, with the stator voltage composite vector direction at 90°. At the initial energization of this energized sector, the d-axis angle is 330°. The rotor rotates 60° within this energized sector, and the d-axis angle reaches 30°. When the d-axis angle is 0°, the angle with the stator voltage composite vector is 90°, generating the maximum torque.
[0054] When the d-axis angle reaches 30°, the Hall effect state changes again, indicating that the stator coil has entered the next energized sector. At this point, the stator coil's energized phase sequence is changed to VU, entering the fourth energized sector, with the direction of the stator voltage composite vector at 150°. At the initial energization of this energized sector, the d-axis angle is 30°. The rotor rotates 60° within this energized sector, and the d-axis angle reaches 90°. At a 60° d-axis angle, the angle with the stator voltage composite vector is 90°, generating the maximum torque.
[0055] When the d-axis angle reaches 90°, the Hall effect state changes again, indicating that the stator coil is entering the next energized sector. At this point, the stator coil's energized phase sequence is changed to WU, entering the fifth energized sector, with the stator voltage composite vector direction at 210°. At the initial energization of this sector, the d-axis angle is 90°. The rotor rotates 60° within this energized sector, and the d-axis angle reaches 150°. When the d-axis angle is 120°, the angle with the stator voltage composite vector is 90°, generating the maximum torque.
[0056] When the d-axis angle reaches 150°, the Hall effect state changes again, indicating that the stator coil has entered the next energized sector. At this point, the stator coil's energized phase sequence is changed to WV, entering the sixth energized sector. The direction of the stator voltage composite vector is 270°. At the initial energization of this energized sector, the d-axis angle is 150°. The rotor rotates 60° within this energized sector, and the d-axis angle reaches 210°. At 180°, the d-axis angle forms a 90° angle with the stator voltage composite vector, generating maximum torque.
[0057] When the d-axis angle reaches 210°, the Hall state changes again, indicating that the stator coil enters the next energized sector. This is the next cycle, re-entering the first energized sector, indicating that the rotor has rotated 360° electrical angle.
[0058] The corresponding relationship between the power phase sequence and the d-axis angle when the motor rotates clockwise
[0059] Figure 2 The corresponding relationship between the d-axis angle and the energized sector when the BLDC motor rotates clockwise is shown.
[0060] Specifically, when the BLDC motor rotates clockwise, the angle of the stator voltage composite vector in the sixth energized sector (with a phase sequence of WV) is 270°. Because the d-axis angle lags the stator voltage composite vector angle by 120°, the d-axis angle is 30° at the initial energization of this energized sector. This means the initial angle between the d-axis angle and the stator voltage composite vector angle is 120°. Under the influence of the magnetic field generated by the stator coils, the rotor rotates 60° clockwise. This means the angle between the d-axis angle and the stator voltage composite vector angle changes from 120° to 60°, meaning the d-axis rotates clockwise from 30° to 330°. When the d-axis angle is 0°, the angle between it and the stator voltage composite vector is 90°, generating the maximum torque.
[0061] When the d-axis angle reaches 330°, the Hall effect sensor output changes state, indicating that the stator voltage should enter the next energized sector. At this point, the stator coil energization phase sequence is changed to WU, entering the fifth energized sector, with a resulting stator voltage vector angle of 210°. At the initial energization of this energized sector, the d-axis angle is 330°. The rotor rotates 60° within this energized sector, bringing the d-axis angle to 270°. At a d-axis angle of 300°, the angle with the resulting stator voltage vector is 90°, generating the maximum torque.
[0062] When the d-axis angle reaches 270°, the Hall effect state changes again, indicating that the stator coil enters the next energized sector. At this point, the stator coil's energized phase sequence is changed to VU, entering the fourth energized sector, with the stator voltage composite vector angle at 150°. At the initial energization of this energized sector, the d-axis angle is 270°. The rotor rotates 60° within this energized sector, bringing the d-axis angle to 210°. At a d-axis angle of 240°, the angle with the stator voltage composite vector is 90°, generating the maximum torque.
[0063] When the d-axis angle reaches 210°, the Hall effect state changes again, indicating that the stator coil enters the next energized sector. At this point, the stator coil's energized phase sequence is changed to VW, entering the third energized sector, with the stator voltage composite vector angle at 90°. At the initial energization of this energized sector, the d-axis angle is 210°. The rotor rotates 60° within this energized sector, bringing the d-axis angle to 150°. When the d-axis angle reaches 180°, the angle with the stator voltage composite vector is 90°, generating the maximum torque.
[0064] When the d-axis angle reaches 150°, the Hall effect state changes again, indicating that the stator coil enters the next energized sector. At this point, the stator coil's energized phase sequence is changed to UW, entering the second energized sector, with a stator voltage composite vector angle of 30°. At the initial energization of this energized sector, the d-axis angle is 150°. The rotor rotates 60° within this sector, and the d-axis angle reaches 90°. When the d-axis angle is 120°, the angle with the stator voltage composite vector is 90°, generating the maximum torque.
[0065] When the d-axis angle reaches 90°, the Hall effect state changes again, indicating that the stator coil enters the next energized sector. At this point, the stator coil's energized phase sequence is changed to UV, entering the first energized sector, with the stator voltage composite vector angle at 330°. At the initial energization of this energized sector, the d-axis angle is 90°. The rotor rotates 60° in this sector, and the d-axis angle decreases to 30°. When the d-axis angle is 60°, the angle with the stator voltage composite vector is 90°, generating the maximum torque.
[0066] When the d-axis angle reaches 30°, the Hall state changes again, indicating that the stator coil enters the next energized sector. This is when the next cycle begins, re-entering the sixth energized sector, indicating that the rotor has rotated 360° electrical degrees.
[0067] Hall state changes
[0068] The three-phase BLDC motor has three Hall sensors H1, H2, and H3, which are installed in the slot centers or tooth centers of the three phases A, B, and C respectively. The three Hall sensors can be installed at intervals of 120° or 60° electrical angle.
[0069] When the three Hall sensors are installed 120 degrees apart and the motor rotates counterclockwise, the Hall state changes as follows: Figure 3 See Figure 3, the Hall state changes once every 60° electrical angle, and the Hall state change pattern is: 5→4→6→2→3→1→5→4→6→2→3→1... When the motor rotates clockwise, the Hall state change pattern is: 2→6→4→5→1→3→2→6→4→5→→1→3→2...
[0070] When the three-phase Hall sensors are installed at 60° electrical angles apart and the motor rotates clockwise, the Hall state changes as follows: Figure 4 See Figure 4 The Hall state changes every 60° electrical angle, and the Hall state change pattern is: 7→6→4→0→1→3→7→6→4→0→1→3→7→… When the motor rotates clockwise, the Hall state change pattern is: 0→4→6→7→3→1→0→4→6→7→3→1→0→…
[0071] 2. Vector Control Method
[0072] The vector control system uses three coordinate systems, namely the abc coordinate system, the α-β coordinate system, and the dq coordinate system. The abc coordinate system corresponds to the motor stator, the dq coordinate system corresponds to the motor rotor, and the α-β coordinate system serves as the intermediate conversion coordinate system between the abc coordinate system and the dq coordinate system.
[0073] 1) ABC coordinate system
[0074] The direction of the magnetic field generated by the A-phase stator when a positive current flows is defined as the positive direction of the a-axis, with the a-axis being the 0° coordinate system. The direction of the magnetic field generated by the B-phase stator when a positive current flows is defined as the positive direction of the b-axis, and the direction of the magnetic field generated by the C-phase stator when a positive current flows is defined as the positive direction of the c-axis. The a-axis rotated 120° counterclockwise is the b-axis, and the b-axis rotated 120° counterclockwise is the c-axis.
[0075] 2)α-β coordinate system
[0076] The α-axis coincides with the a-axis, and the β-axis is 90° counterclockwise along the a-axis.
[0077] 3) dq coordinate system
[0078] The d-axis is the direction of the rotor's north-pole magnetic field, and the q-axis is a 90° counterclockwise rotation from the d-axis. The angle θ between the d-axis and the a-axis is the rotor position angle, or the angle measured counterclockwise from the a-axis to the d-axis. When the dq coordinate system rotates, the counterclockwise direction is positive. That is, when the d-axis rotates counterclockwise, the position angle θ increases, and when the d-axis rotates clockwise, the position angle θ decreases. Hereinafter, θ is sometimes referred to as the d-axis angle.
[0079] The process of transforming from the abc coordinate system to the α-β coordinate system is called the Clarke transform, and the reverse is the inverse Clarke transform. The process of transforming from the α-β coordinate system to the dq coordinate system is called the Park transform, and the reverse is the inverse Park transform.
[0080] Clarke transformation converts the abc axis current into the α-β axis current:
[0081]
[0082] Because I a +I b +I c =0, the Clarke transform can be simplified to:
[0083]
[0084] Park transform, converting the α-β axis current into the dq axis current:
[0085]
[0086] Park inverse transform, converting the dq axis voltage into α-β axis voltage:
[0087]
[0088] Clarke inverse transform, transforming the α-β axis voltage into the abc axis voltage:
[0089]
[0090] In the above formula, I a , I b , I c are the a-axis current, b-axis current and c-axis current respectively; I α and I β are α-axis current and β-axis current respectively; V α and V β are the α-axis voltage and the β-axis voltage respectively; θ is the d-axis angle; V d and V q are d-axis voltage and q-axis voltage respectively; V a 、V b and V c They are the a-axis voltage, b-axis voltage and c-axis voltage respectively.
[0091] The basic principle of vector control is: in the motor control system, the three-phase AC current I a , I b , I c Decoupled into I by coordinate transformation d , I qDC current, and then through various current control strategies, such as d-axis current zero control, maximum torque current ratio control, weak magnetic control, etc., the required V of the control motor is obtained. d , V q , then V d , V q The three-phase control voltage V is obtained by Clarke inverse transformation and Park inverse transformation a , V b , V c The three-phase voltage V obtained by transformation a , V b , V c , using Space Vector Pulse Width Modulation (SVPWM) technology to control the three-phase voltage output, thereby controlling the motor operation.
[0092] The Hall phase sequence self-learning method provided in this application is described below.
[0093] The method provided in the present application can be executed by a motor controller and is applicable to BLDC motors with Hall sensors distributed at 120° intervals and Hall sensors distributed at 60° intervals.
[0094] In the embodiments of the present application, the three phase sequences of the motor controller can be arbitrarily connected to the three phase sequences of the motor, and the three Hall signal feedback ports of the motor controller can be arbitrarily connected to the output terminals of the three Hall sensors installed in the motor. For ease of understanding and description, this application uses the UVW phase sequence of the motor controller as a reference, and stipulates that the motor phase line connected to the U phase of the motor controller is defined as the motor U phase, the motor phase line connected to the V phase of the motor controller is defined as the V phase, and the motor phase line connected to the W phase of the motor controller is defined as the W phase.
[0095] Based on the above description of the six-step commutation method, it can be seen that when the motor rotor rotates to a certain d-axis angle, the corresponding Hall state can be detected, and the d-axis angle corresponds to the power-on phase sequence, so the Hall phase sequence can be determined. For example, when the d-axis angle is 210° electrical angle, the corresponding Hall state is 4. Since the power-on phase sequence corresponding to the 210° electrical angle is UV power-on, it can be determined that the 210° electrical angle, UV power-on and Hall state 4 correspond. The method for controlling a motor provided in this application can determine the Hall phase sequence based on this principle. The method is described in detail below.
[0096] Figure 5 5 is a schematic flow chart of a Hall phase sequence self-learning method provided in an embodiment of the present application. The method 500 may include S510 and S520, and each step is described below.
[0097] S510 , starting from the d-axis angle being a second electrical angle, locking the d-axis at 60° electrical angle intervals along the first direction until the d-axis rotates at least one electrical cycle, and detecting the Hall state after each d-axis locking.
[0098] The first direction is clockwise or counterclockwise.
[0099] Specifically, the d-axis can be initially locked to angle 1 (i.e., the second angle), and the Hall state output by the Hall sensor at this time is detected. If the first direction is counterclockwise, the next locking is then started in the direction of increasing the d-axis angle, that is, the d-axis angle increases by 60° to become angle 2, and the Hall state at this time is obtained. Similarly, the d-axis angle increases by 60° electrical angles, thereby locking the d-axis to angle 3, angle 4, angle 5, and angle 6 in sequence, and detecting the Hall state output by the Hall sensor after each locking of the d-axis. If the first direction is clockwise, the next locking is then started in the direction of decreasing the d-axis angle, that is, the d-axis angle decreases by 60° to become angle 2, and detecting the Hall state output by the Hall sensor at this time. Similarly, the d-axis angle decreases by 60° electrical angles in sequence, thereby locking the d-axis to angle 3, angle 4, angle 5, and angle 6 in sequence, and detecting the Hall state output by the Hall sensor after each locking of the d-axis.
[0100] Exemplarily, the second electrical angle may be 60°*k electrical angle, where k∈[0,5].
[0101] For example, when the first direction is counterclockwise, the second electrical angle may be 240°, that is, angles 1 to 6 may be 240°, 300°, 0°, 60°, 120°, and 180°, respectively. It should be understood that the angles in the embodiments of the present application are all electrical angles.
[0102] For another example, when the first direction is clockwise, the second electrical angle may be 0°, that is, angles 1 to 6 may be 0°, 300°, 240°, 180°, 120°, and 60°, respectively.
[0103] Based on this solution, by setting the second electrical angle to the middle angle of a energized sector, the d-axis can be locked at the middle angle of each energized sector. That is, Angles 1 through 6 can be the middle angles of the six energized sectors, respectively. By locking the d-axis to the middle angle of the energized sectors, the rotor can be locked when the angle of the resultant voltage vector and the d-axis angle are 90°, achieving maximum torque.
[0104] S520 : Determine a Hall phase sequence for the first direction according to the d-axis angle locked each time the Hall state changes and the corresponding relationship between the d-axis angle and the power-on phase sequence.
[0105] For example, the correspondence between the counterclockwise Hall state and the d-axis angle obtained based on S510 is shown in Table 1. That is, when the d-axis is locked at 60° electrical angle intervals in the counterclockwise direction, when the d-axis is locked to 240°, the detected Hall state is 6; when the d-axis is locked to 300°, the detected Hall state is 2; when the d-axis is locked to 0°, the detected Hall state is 3; when the d-axis is locked to 60°, the detected Hall state is 1; when the d-axis is locked to 120°, the detected Hall state is 5; and when the d-axis is locked to 180°, the detected Hall state is 4.
[0106] Table 1
[0107]
[0108]
[0109] As described in the six-step commutation method above, the correspondence between the d-axis angle and the energized phase sequence when the motor rotates counterclockwise is shown in Table 2. It can be understood that the correspondence between the d-axis angle and the energized phase sequence is also the correspondence between the d-axis angle and the energized sector.
[0110] Table 2
[0111] d-axis angle (electrical angle) Powered sectors Power phase sequence 210°~270° First powered sector UV 270°~330° Second powered sector UW 330°~30° The third powered sector VW 30°~90° Fourth powered sector VU 90°~150° Fifth electrified sector WU 150°~210° Sixth powered sector WV
[0112] In Table 1, the d-axis angle is 240°, and the corresponding Hall state is 6. In Table 2, the d-axis angle of 240° corresponds to the first energized sector, and the corresponding energized phase sequence is UV. Therefore, it can be determined that the d-axis angle of 240° and the energized phase sequence UV correspond to Hall state 6. Similarly, based on the corresponding relationships shown in Table 1 and Table 2, the Hall phase sequence for counterclockwise rotation can be determined as shown in Table 3.
[0113] Table 3
[0114] Power phase sequence d-axis angle (electrical angle) Hall state UV 210°~270° 6 UW 270°~330° 2 VW 330°~30° 3 VU 30°~90° 1 WU 90°~150° 5 WV 150°~210° 4
[0115] After determining the Hall effect phase sequence, a square wave can be used to drive the motor. For example, if the Hall effect state changes from 2 to 3, the d-axis angle is determined to be 330°. If you want the motor to rotate counterclockwise, the power phase sequence needs to be changed to VW. If the Hall effect state changes from 3 to 1, the power phase sequence needs to be changed to VU to drive the motor to continue rotating counterclockwise.
[0116] According to the method provided in the embodiments of the present application, by locking the d-axis (i.e., the rotor) to angles spaced 60° apart, the correspondence between the d-axis angle and the Hall state can be obtained. Further, by combining the correspondence between the d-axis angle and the power-on phase sequence, the Hall phase sequence can be obtained. The above method can be automatically executed by the motor controller, that is, the motor controller can self-learn the Hall phase sequence, without the need for any other auxiliary tools, and without the operator having to understand the working principle of the BLDC motor, which is simple and easy to use.
[0117] In some embodiments, the d-axis can be locked to a specific angle (eg, angles 1 to 6 described above) based on a conventional vector control method, ie, the vector control method described above. It should be understood that conventional vector control methods are implemented based on current control.
[0118] In other embodiments, voltage vector control may be used to lock the d-axis to a specific angle.
[0119] Conventional vector control technology can decouple the three-phase current of a BLDC motor into two orthogonal d-axis and q-axis currents for separate control, but this method requires a three-phase current sampling circuit. The voltage vector control method provided in this application can use an existing BLDC motor square wave controller, without increasing hardware costs or requiring three-phase current sampling for conversion operations. This reduces the computing speed requirements of the microcontroller unit (MCU) and improves versatility and applicability.
[0120] See also Figure 6 The flowchart of the method 600 shown in FIG. 6 shows a specific process of implementing the method 500 using the voltage vector control method.
[0121] S610: Control the motor to run for a first time period based on a first voltage and a d-axis angle, and detect a Hall state output by a Hall sensor after the motor runs for the first time period until the d-axis rotates at least one electrical cycle.
[0122] The initial value of the d-axis angle is the second electrical angle, and the d-axis angle steps in 60° electrical angle along the first direction. The first voltage is the d-axis voltage V d , q-axis voltage V q is 0.
[0123] For example, S610 is described by taking the first direction as counterclockwise and the second electrical angle as 240° as an example. First, the motor can be controlled to run for a first time based on the first voltage and the d-axis angle of 240°, and the Hall state is detected after the motor runs for the first time. Then, the motor is controlled to run for a first time based on the first voltage and the d-axis angle of 300°, the first voltage and the d-axis angle of 0°, the first voltage and the d-axis angle of 60°, the first voltage and the d-axis angle of 120°, and the first voltage and the d-axis angle of 180°, in sequence, and the Hall state is detected after the motor runs for the first time.
[0124] For another example, S610 is described with the first direction being clockwise and the second electrical angle being 0°. First, the motor may be controlled to operate for a first duration based on the first voltage and a d-axis angle of 0°, and the Hall effect state may be detected after the motor has operated for the first duration. Then, the motor may be controlled to operate for a first duration based on the first voltage and a d-axis angle of 300°, the first voltage and a d-axis angle of 240°, the first voltage and a d-axis angle of 180°, the first voltage and a d-axis angle of 120°, and the first voltage and a d-axis angle of 60°, in sequence, and the Hall effect state may be detected after the motor has operated for the first duration.
[0125] The above-mentioned controlling the motor to run for the first time based on the first voltage and the d-axis angle may specifically include: determining the three-phase voltage of the motor based on the first voltage and the d-axis angle, Park inverse transform and Clarke inverse transform; and controlling the motor to run for the first time based on the three-phase voltage.
[0126] In the embodiment of the present application, the first voltage and the d-axis angle can be input into the Park inverse transformation formula to obtain V α and V β Then, V α and V β The voltage input is transformed into Clarke inverse, and V a 、V b and V c , which is the three-phase voltage of the motor. Finally, based on V a 、V b and V c ,SVPWM can be used to obtain the three-phase voltage output of the motor controller, thereby controlling the motor operation to lock the d-axis angle.
[0127] S620: Determine whether a change pattern of the Hall state corresponding to the first direction complies with a preset pattern, where the preset pattern corresponds to an installation method of the Hall sensor and the first direction.
[0128] According to the previous description, when the Hall sensors are installed at an electrical angle of 120°, when the motor rotates counterclockwise, that is, when the first direction is counterclockwise, the preset rule is: 5→4→6→2→3→1→5→4→6→2→3→1…; when the first direction is clockwise, the preset rule is: 2→6→4→5→1→3→2→6→4→5→→1→3→2→….
[0129] When the Hall sensors are installed at an electrical angle of 60° apart, when the motor rotates counterclockwise, that is, when the first direction is counterclockwise, the preset rule is: 7→6→4→0→1→3→7→6→4→0→1→3→7→…; when the first direction is clockwise, the preset rule is: 0→4→6→7→3→1→0→4→6→7→3→1→0→….
[0130] When the first duration and the first voltage are appropriate, the motor is controlled to operate for the first duration based on the first voltage and a specific d-axis angle, thereby locking the d-axis to the specified d-axis angle, thereby achieving positioning of the motor rotor. When the d-axis is locked along the first direction at 60° electrical angle intervals, the corresponding Hall effect state changes follow a predetermined pattern.
[0131] For example, assuming that the correspondence between the counterclockwise Hall state and the d-axis angle obtained based on S610 is shown in Table 1, referring to Table 1, the change pattern of the Hall state conforms to the change pattern of the Hall state when the motor rotates counterclockwise when the Hall sensors are installed at an electrical angle of 120°.
[0132] S630: When a change rule of the Hall state corresponding to the first direction conforms to a preset rule, determine a Hall phase sequence for the first direction.
[0133] If the Hall state changes in accordance with the preset pattern, it indicates that the d-axis is locked to the set d-axis angle. At this point, the Hall phase sequence for the first direction can be determined based on the correspondence between the Hall state and the d-axis angle, and the correspondence between the d-axis angle and the power-on phase sequence.
[0134] S640: When the change pattern of the Hall state corresponding to the first direction does not conform to the preset pattern, adjust the first duration and / or the first voltage, and repeat S610 until the change pattern of the Hall state conforms to the preset pattern.
[0135] If the change pattern of the Hall state does not conform to the preset pattern, it means that the d-axis is not locked to the set d-axis angle. At this time, the first time duration and / or the first voltage can be adjusted to make the change pattern of the Hall state conform to the preset pattern, that is, the d-axis is locked to the set d-axis angle.
[0136] It should be noted that the first duration and / or first voltage for initial use can be set based on experience and / or relevant motor parameters (e.g., rated voltage, rated current, etc.). For different motors, the first duration and / or first constant for ensuring that the Hall state change pattern conforms to the preset pattern may be different. In the embodiment of the present application, it is only necessary to reliably lock the motor at the set d-axis angle.
[0137] For example, assume that the correspondence between the counterclockwise Hall state and the d-axis angle obtained in S610 is shown in Table 4. Referring to Table 4, if the Hall state variation pattern does not conform to the Hall state variation pattern when the motor rotates counterclockwise when the Hall sensors are installed at 120° and 60° electrical angles apart, the first duration and / or first voltage can be adjusted until the Hall state variation pattern conforms to the Hall state variation pattern when the motor rotates counterclockwise when the Hall sensors are installed at 120° and 60° electrical angles apart. The counterclockwise Hall phase sequence can then be determined.
[0138] Table 4
[0139]
[0140] For example, Figure 7 A specific example of method 600 is shown. Figure 7 The process shown is to lock the d-axis at intervals of 60° electrical angle in the counterclockwise direction.
[0141] See also Figure 7 , V d = constant, V q =0, initially set the d-axis angle θ to 240°, delay for the first time, and detect the Hall state at this time. Then, according to the direction of increasing the d-axis angle, increase θ by 60° to 300°, and detect the Hall state at this time after delaying for the first time. Similarly, the d-axis angles are set at 0°, 60°, 120°, and 180°, respectively, and the Hall states corresponding to these d-axis angles are detected. If the change pattern of the detected Hall state conforms to rule 1 (i.e., an example of the preset rule), the counterclockwise Hall phase sequence can be determined. If the change pattern of the detected Hall state does not conform to rule 1, adjust the first time and / or V d , re-execute the above process until the detected Hall state change pattern conforms to pattern 1. It should be understood that pattern 1 is the pattern of Hall state change when the motor rotates counterclockwise when the Hall sensors are installed 120° or 60° apart in electrical angle.
[0142] For example, Figure 8 A specific example of method 600 is shown. Figure 8 The process shown is to lock the d-axis at intervals of 60° electrical angle in the clockwise direction.
[0143] See also Figure 8 , V d = constant, V q =0, initially set the d-axis angle θ to 0°, delay for the first time, and detect the Hall state at this time. Then, in the direction of decreasing d-axis angle, reduce θ by 60° to 300°, delay for the first time, and detect the Hall state at this time. Similarly, the d-axis angles are set at 240°, 180°, 120°, and 60°, respectively, and the Hall states corresponding to these d-axis angles are detected. If the change pattern of the detected Hall state conforms to Rule 2 (i.e., an example of the preset rule), the Hall phase sequence can be determined. If the change pattern of the detected Hall state does not conform to Rule 2, adjust the first time and / or V d , re-execute the above process until the detected Hall state change pattern conforms to Pattern 2. It should be understood that Pattern 2 is the pattern of Hall state change when the motor rotates clockwise when the Hall sensors are installed 120° or 60° apart.
[0144] In some embodiments, after obtaining the counterclockwise and clockwise Hall phase sequences, the two Hall phase sequences can also be verified. If the sum of the counterclockwise and clockwise Hall states for the same powered sector is 7, it means that the determined Hall phase sequence is correct and can be applied in the actual square wave control of the BLDC motor. For example, for the same powered sector, the counterclockwise Hall state is Si and the clockwise Hall state is TSi, then if S1+TS1=7, S2+TS2=7, S3+TS3=7, S4+TS4=7, S5+TS5=7, S6+TS6=7, it can be determined that the Hall phase sequence obtained by the above method is correct. Otherwise, there may be problems such as damage to the Hall sensor.
[0145] It should be understood that when rotating clockwise and counterclockwise, at the same d-axis angle, that is, at the same Hall effect state value, the energized sectors are exactly opposite. For example, if UV is energized in the counterclockwise direction, then VU is energized in the clockwise direction. Therefore, with the same energized sector, the sum of the Hall effect state values in clockwise and counterclockwise rotation equals 7.
[0146] In summary, according to the Hall phase sequence self-learning method of the embodiment of the present application, by locking the d-axis at 60° electrical angle intervals for at least one electrical cycle, the corresponding relationship between the d-axis angle and the Hall state can be obtained. Further combining the corresponding relationship between the d-axis angle and the power-on phase sequence, the Hall phase sequence when the motor rotates counterclockwise and clockwise can be obtained. In this method, the BLDC motor controller can self-learn the Hall phase sequence without the need for any other auxiliary tools and without any additional costs.
[0147] The square-wave drive of a BLDC motor relies on Hall sensors to detect the position of the motor rotor. Therefore, issues with the Hall sensor's installation accuracy can affect the precision of square-wave control. Specifically, angular errors in the Hall sensor's installation position can cause commutation timing to lag or advance, leading to fluctuations in the motor's electromagnetic torque, poor motor speed stability, and reduced motor performance.
[0148] Hall effect sensors are installed inside motors, and their angular errors are generally difficult to measure directly. To optimize motor performance, continuous adjustments and testing of the motor's control angles are typically required during commissioning. However, this adjustment cannot optimize the control angles for each of the six Hall effect states individually; it can only optimize the entire system. This results in a relatively rough adjustment and fails to achieve precise control.
[0149] In view of this, an embodiment of the present application provides a method for compensating for the installation error of a Hall sensor in a motor, aiming to solve the problem of low control accuracy caused by the installation angle deviation of the Hall sensor.
[0150] Figure 9 1 is a schematic flow chart of a method for compensating for installation errors of a Hall sensor in a motor provided by an embodiment of the present application. The method 900 may include steps S910 to S930, and each step is described below.
[0151] S910 , starting from the d-axis angle being a first electrical angle, locking the d-axis along a first direction at preset electrical angle intervals, and detecting a Hall state after each d-axis locking, until the d-axis angle becomes the first electrical angle for the Nth time.
[0152] Wherein, N≥1, the preset electrical angle is less than 60°, and the first direction is clockwise or counterclockwise.
[0153] Specifically, the d-axis can be first locked to a first electrical angle, and then the d-axis can be locked by a preset electrical angle in a clockwise or counterclockwise direction until the d-axis rotates N times. After each d-axis lock, the Hall state output by the Hall sensor is detected.
[0154] Exemplarily, the preset electrical angle=1 / 65536*360°.
[0155] The d-axis angle can be represented using a 16-bit unsigned binary number. Using normalization, 65536 can represent 360°, and a 16-bit unsigned binary number with a value range of 0 to 65535 represents an angle of 0° to 359.787°. When the d-axis angle reaches its maximum value of 65535, the 16-bit unsigned binary number representing the d-axis angle is incremented by 1, returning it to 0. This means that after reaching the maximum angle of 359.787°, the d-axis angle returns to 0° when the value increases further, which exactly matches the change pattern of the circular angle. The resolution is 1 / 65536*360°≈0.00549°. Therefore, the preset electrical angle can be set to 1 / 65536*360°.
[0156] By setting the preset angle to 1 / 65536*360°, you can improve the accuracy of the control angle. When rotating counterclockwise, the d-axis angle value increases by 1, which means the actual angle increases by 0.00549°. When rotating clockwise, the d-axis angle value decreases by 1, which means the actual angle decreases by 0.00549°.
[0157] In some embodiments, S910 may specifically include: controlling the motor to run for a preset time based on the target voltage and d-axis angle, and detecting the Hall state output by the Hall sensor after the motor runs for the preset time until the d-axis angle becomes the first electrical angle for the Nth time.
[0158] The target voltage is the d-axis voltage, the q-axis voltage is 0, the initial value of the d-axis angle is a first electrical angle, and the d-axis angle steps along a first direction at a predetermined electrical angle.
[0159] Exemplarily, controlling the motor to run for a preset time based on the target voltage and d-axis angle includes: determining the three-phase voltage of the motor based on the target voltage, d-axis angle, Park inverse transform and Clarke inverse transform; and controlling the motor to run for a preset time based on the three-phase voltage.
[0160] For example, the preset duration is 50 us.
[0161] The above solution uses voltage vector control to lock the d-axis to a specific angle. For details about voltage vector control, please refer to the previous description of method 600 and will not be repeated here. It should be understood that the target voltage can be the first voltage in method 600 that ensures that the Hall effect state changes according to a predetermined pattern.
[0162] S920 , determining an average value of angle errors corresponding to the same Hall state according to the locked d-axis angle corresponding to each Hall state change and the corresponding theoretical d-axis angle.
[0163] The theoretical d-axis angle is determined according to the Hall state and the Hall phase sequence for the first direction, and the angle error is equal to the theoretical d-axis angle minus the locked d-axis angle.
[0164] S920 is explained using the Hall phase sequence shown in Table 3 above as an example. Table 3 shows that when the Hall state changes to 6, the corresponding theoretical d-axis angle is 210°; when the Hall state changes to 2, the corresponding theoretical d-axis angle is 270°; when the Hall state changes to 3, the corresponding theoretical d-axis angle is 330°; when the Hall state changes to 1, the corresponding theoretical d-axis angle is 30°; when the Hall state changes to 5, the corresponding theoretical d-axis angle is 90°; and when the Hall state changes to 4, the corresponding theoretical d-axis angle is 150°.
[0165] Assuming N=3, if S910 determines that each time the Hall state changes to 6, the corresponding locked d-axis angle (also called the actual d-axis angle) is 210.00549°, 209.99451°, and 210.01098°, then the three angle errors corresponding to Hall state 6 can be determined to be: 210°-210.00549°, 210°-209.99451°, and 210°-210.01098°, respectively. Therefore, the average value of the angle error corresponding to Hall state 6 is 0.00549°.
[0166] It should be understood that, when N=1, the average value of the angular errors corresponding to the same Hall state is the angular error corresponding to the Hall state.
[0167] In some embodiments, before S910, the method 900 may further include:
[0168] S901: Determine a Hall phase sequence for a first direction.
[0169] Regarding how to determine the Hall phase sequence for the first direction, reference may be made to the above method 500 or method 600, which will not be repeated here.
[0170] S930 , in the process of driving the motor to rotate using a square wave, controlling commutation based on the Hall state, and compensating the commutation timing according to an average value of the angle error.
[0171] If the Hall sensor is installed in the correct position, each time the Hall state changes, the next Hall state change will come after the conduction time E. However, in actual applications, there is generally a position error in the installation of the Hall sensor, which causes an advance or lag in the commutation of the energized sector. According to the method provided in the embodiment of the present application, by locking the d-axis, the angle error between the corresponding locked d-axis angle and the theoretical d-axis angle at the moment of the Hall state change can be determined; based on the above angle error, this angle error can be compensated in the subsequent square wave control to achieve the correct angle for each energized sector. Thereby, the symmetry of the current waveform of the motor can be ensured, without generating spikes or distortion, thereby ensuring that the torque and speed of the motor can be kept stable, thereby improving the performance of the motor.
[0172] For example, Figure 10 The figure shows the process of determining the angular error corresponding to the Hall state when rotating counterclockwise. Figure 10 The flow of determining the angular error corresponding to each Hall state during clockwise rotation is shown.
[0173] See also Figure 10 , based on V d = constant, V q =0, the initial value of the d-axis angle θ is 180°, the motor is controlled to run for 50us, and the Hall state at this time is detected and recorded as S6. Then, the d-axis angle is increased by 0.00549° every 50us, and the Hall state is detected. When the Hall state changes to S1, the current d-axis angle and the theoretical d-axis angle corresponding to the Hall state S1 are determined, and the theoretical d-axis angle corresponding to the Hall state S1 is subtracted from the current d-axis angle to obtain the error angle R1 corresponding to the Hall state S1. Then, the d-axis angle is increased by 0.00549° every 50us, and the Hall state is detected. When the Hall state changes to S2, the current d-axis angle and the theoretical d-axis angle corresponding to the Hall state S2 are determined, and the theoretical d-axis angle corresponding to the Hall state S2 is subtracted from the current d-axis angle to obtain the error angle R2 corresponding to the Hall state S2. Similar operations are then performed until the error angle R6 corresponding to the Hall state S6 is obtained.
[0174] It should be understood that Figure 10 In the process shown, the change rule of the Hall state conforms to the preset rule described above. Taking the Hall phase sequence as shown in Table 3 above as an example, Figure 10 The S6, S1, S2, S3, S4, and S5 are 4, 6, 2, 3, 1, and 5 respectively. The theoretical d-axis angles corresponding to the Hall states 6, 2, 3, 1, 5, and 4 are 210°, 270°, 330°, 30°, 90°, and 150° respectively.
[0175] Figure 10The process shown can be executed N times, so that N Ri can be obtained for each Hall state. By averaging the N Ri, the average value of the angle error corresponding to each Hall state can be obtained.
[0176] See also Figure 11 , based on V d = constant, V q =0, the initial value of the d-axis angle θ is 0°, the motor is controlled to run for 50us, and the Hall state at this time is detected and recorded as TS1. Next, the d-axis angle is reduced by 0.00549° every 50us, and the Hall state is detected. When the Hall state changes to TS6, the current d-axis angle and the theoretical d-axis angle corresponding to Hall state TS6 are determined. The current d-axis angle is subtracted from the theoretical d-axis angle corresponding to Hall state TS6 to obtain the error angle TR6. Next, the d-axis angle is reduced by 0.00549° every 50us, and the Hall state is detected. When the Hall state changes to TS5, the current d-axis angle and the theoretical d-axis angle corresponding to Hall state TS5 are determined. The current d-axis angle is subtracted from the theoretical d-axis angle corresponding to Hall state TS5 to obtain the error angle TR5. Similar operations are then performed until the error angle TR1 is obtained.
[0177] Figure 11 The process shown can be executed N times, so that N TRi can be obtained for each sector. By averaging the N TRi, the average value of the angle error corresponding to each Hall state can be obtained.
[0178] In some embodiments, see Figure 12 As shown in the flowchart, S930 may include S931 to S933.
[0179] S931: Drive the motor to rotate based on the square wave according to the Hall phase sequence, and determine the conduction time (denoted as: E) of the energized sector.
[0180] The on-time E is equal to the average time taken for the motor to rotate one electrical cycle divided by 6.
[0181] Specifically, the motor can be driven to rotate in a first direction for M electrical cycles based on a square wave according to the Hall phase sequence, and the on-time of each energized sector during the motor rotation process can be determined. The on-time E is determined based on the on-time of each energized sector during the M cycles, where M ≥ 1.
[0182] Taking the Hall effect phase sequence shown in Table 3 as an example, the energized phase sequence UV corresponds to the first energized sector. During motor rotation in the first direction, the time from the Hall effect state changing to 6 to the Hall effect state changing to 2 is the on-time of the first energized sector. Using a similar method, the sum of the on-times of the six energized sectors during one electrical cycle of the motor can be determined. By controlling the motor to rotate for M electrical cycles, the average time it takes for the electronic motor to rotate one electrical cycle can be calculated. This average time, divided by 6, is the on-time E.
[0183] S932 , determining a compensation time corresponding to the target Hall state according to an average value of the angle error and the on-time corresponding to the target Hall state.
[0184] Wherein, compensation time = average value of angle error * conduction time / 60°, and the target Hall state is any one of six different Hall states.
[0185] It should be understood that when 65536 is used to represent a 360-degree angle value, the 60° in the above compensation time formula is represented by 60° / 360°*65536=10923 in actual applications.
[0186] It should also be understood that in S932 , the compensation time corresponding to each Hall state may be determined.
[0187] In the embodiment of the present application, during counterclockwise rotation, since the d-axis angle increases, a positive compensation time indicates that the Hall state change is advanced, and a negative compensation time indicates that the Hall state change is delayed. During clockwise rotation, since the d-axis angle decreases, a positive compensation time indicates that the Hall state change is delayed, and a negative compensation time indicates that the Hall state change is advanced.
[0188] S933, taking the moment when the Hall state changes to the target Hall state as the starting moment, and performing phase switching when the target time period arrives.
[0189] Wherein, when the first direction is counterclockwise, the target time period=on time+compensation time; when the first direction is clockwise, the target time period=on time-compensation time.
[0190] For ease of understanding, the compensation time corresponding to the Hall state when the first direction is counterclockwise is recorded as: The compensation time corresponding to the Hall state when the first direction is clockwise is recorded as: The target time period is recorded as T. The moment when the Hall state changes is called the actual commutation point, and the theoretical commutation moment is called the correct commutation point.
[0191] During counterclockwise rotation, since the angle value increases, when the actual commutation point lags behind the correct commutation point, it is negative, T < E; when the actual commutation point is ahead of the correct commutation point, it is positive, T > E. During clockwise rotation, since the angle value decreases, when the actual commutation point lags behind the correct commutation point, it is positive, T < E; when the actual commutation point is ahead of the correct commutation point, it is negative, T > E.
[0192] Exemplarily, Figure 13 a time axis schematic diagram of the actual commutation point and the correct commutation point for counterclockwise rotation is shown. Refer to Figure 13 , after delaying the target time period T from the previous actual commutation point, the correct commutation point for this time can be obtained.
[0193] For example, assuming that the Hall phase sequence corresponding to counterclockwise is as shown in Table 3, if there is no error in the installation of the Hall sensor, when the Hall signal value becomes 2, the energization phase sequence should be UW. However, in practice, based on S910 to S930, the compensation time corresponding to the Hall signal value of 6 is Then starting from when the Hall signal value becomes 6, after the duration, the energization phase sequence is changed to UW, rather than changing the energization phase sequence to UW when the Hall state becomes 2.
[0194] Based on Figure 12 the method for compensating the installation error of the Hall sensor in the motor shown, the compensation time corresponding to each Hall state can be determined according to the angular error between the locked d-axis angle and the theoretical d-axis angle and the conduction time of the energization sector; furthermore, the installation error of the Hall sensor can be compensated in the subsequent square wave control according to the above compensation time, so that commutation is achieved at the correct angle for each energization sector. Thus, the current waveform of the motor can be ensured to be symmetrical, without generating spikes or distortions, and further ensuring that the torque and speed of the motor can be kept stable, improving the performance of the motor.
[0195] Exemplarily, Figure 14 a schematic flowchart of compensating the installation error of the Hall sensor of the motor during counterclockwise rotation based on the process shown in S931 to S933 is shown. Now assume that the Hall phase sequence is as shown in Table 3 above, and the following Figure 14 steps shown are described.
[0196] S1401, start the motor counterclockwise.
[0197] S1402, detecting the Hall state S0 output by the Hall sensor, and changing the power-on phase sequence to Z0.
[0198] It should be understood that the Hall state S0 corresponds to the power-on phase sequence Z0. For example, if the Hall state S0 is 6, then the power-on phase sequence Z0 is UV.
[0199] S1403, detecting whether the Hall state has changed.
[0200] If the Hall state changes, execute S1404, otherwise continue to execute S1403. For example, if the Hall state S changes from 6 to 2, execute S1404, otherwise continue to execute S1403.
[0201] S1404: According to the Hall state S, the power-on phase sequence is changed to Z.
[0202] For example, if the Hall state S is 2, the power-on phase sequence is changed to UW.
[0203] S1405, determining whether the motor rotates for one electrical cycle.
[0204] If the motor rotates for one electrical cycle, S1406 may be executed, otherwise S1403 may be executed.
[0205] For example, if the Hall state S is 2 when S1404 is executed for the first time, then if the Hall state S in S1404 changes to 2 again, it means that the motor rotates for one electrical cycle.
[0206] S1406, determining the on-time E.
[0207] Wherein, E = the time taken by the motor to rotate in one electrical cycle / 6. For example, the time taken by the motor from the Hall state S changing to 2 to the Hall state S changing to 2 again is the time taken by the motor to rotate in one electrical cycle.
[0208] After executing S1406, S1407 is executed next.
[0209] S1407 , determining the target time period T corresponding to the Hall state S according to the average value of the angle error and the on-time E corresponding to the Hall state S, and executing the delay procedure 1 and S1408 .
[0210] The average value of the angular error corresponding to the Hall state S can be determined based on the method described above.
[0211] Delay program 1 is as follows: delay the target time period T, and when the target time period T arrives, change the power phase sequence to Z1 next , and release delay program 1.
[0212] For example, if the motor rotates one electrical cycle when the Hall state changes to 2, then in S1407, the target time period T corresponding to the Hall state 2 can be determined, and then after delaying the target time period T corresponding to the Hall state 2, the power-on phase sequence is changed to VW.
[0213] S1408, detecting whether the Hall state S has changed.
[0214] If the Hall state S changes, execute S1409 , otherwise continue to execute S1408 .
[0215] For example, if the target time period T corresponding to the Hall state 2 is determined in S1407 , then if a change in the Hall state S is detected in S1408 , the Hall state S will change to 3 .
[0216] S1409, determine whether delay program 1 is occupied.
[0217] If the delay program 1 is not occupied, S1410 may be executed, otherwise S1411 may be executed.
[0218] S1410 , determining the target time period T corresponding to the Hall state S according to the average value of the angle error and the on-time E corresponding to the Hall state S, and executing the delay procedure 1 and S1408 .
[0219] Continuing with the example in S1408, in S1410, the target time period T corresponding to the Hall state 3 is determined. Then, the delay procedure 1 is executed, that is, starting from the Hall state changing to 3, after the target time period T corresponding to the Hall state 3 is delayed, the energized sector is changed to VU.
[0220] In S1410 , when S1408 is executed, if the Hall state S changes, the Hall state S will change from 3 to 1 at this time.
[0221] S1411 , determining the target time period T corresponding to the Hall state S according to the average value of the angle error and the on-time E corresponding to the Hall state S, and executing the delay procedure 2 and S1408 .
[0222] Delay program 2 is as follows: delay the target time period T, and when the target time period T arrives, change the power phase sequence to Z2 next , and release delay program 2.
[0223] Continuing with the example in S1408, in S1411, the target time period T corresponding to Hall state 3 is determined. Then, delay procedure 2 is executed, that is, starting from the Hall state changing to 3, after delaying the target time period T corresponding to Hall state 3, the energized sector is changed to VU.
[0224] In S1411 , when S1408 is executed, if the Hall state S changes, the Hall state S will change from 3 to 1 at this time.
[0225] It should be understood that, based on the example described above, in S1408 , the order of changes in the Hall state S is: 3→1→5→4→6→2→3.
[0226] Since the actual commutation point has both leading and lagging characteristics, it is possible that the next actual commutation point has arrived before the previous correct commutation point has arrived. Figure 14 In the process shown, by setting two delay programs, the interference problem caused by the need to execute the delay program again before the delay program is completed can be avoided.
[0227] For example, Figure 15 A schematic flowchart of compensating for installation errors of the motor Hall sensor when the motor rotates clockwise based on the process shown in S931 to S933 is shown.
[0228] S1501, start the motor clockwise;
[0229] S1502, detecting the Hall state TS0 output by the Hall sensor, and changing the power-on phase sequence to Z0.
[0230] It should be understood that the Hall state TS0 corresponds to the power-on phase sequence Z0.
[0231] S1503, detecting whether the Hall state has changed.
[0232] If the Hall state changes, execute S1504, otherwise continue to execute S1503. For example, if the Hall state S changes from 6 to 2, execute S1504, otherwise continue to execute S1503.
[0233] S1504: Change the power-on phase sequence to Z according to the Hall state TS.
[0234] S1505, determining whether the motor rotates for one electrical cycle.
[0235] If the motor rotates for one electrical cycle, S1506 may be executed, otherwise S1503 may be executed.
[0236] S1506, determine the on-time E.
[0237] Wherein, E = the time taken by the motor to rotate for one electrical cycle / 6. For example, the time taken by the motor from the Hall state TS changing to 2 to the Hall state TS changing to 2 again is the time taken by the motor to rotate for one electrical cycle.
[0238] After executing S1506, execute S1507.
[0239] S1507 , determining the target time period T corresponding to the Hall state TS according to the average value of the angle error corresponding to the Hall state TS and the on-time E, and executing the delay procedure 1 and S1508 .
[0240] The average value of the angular error corresponding to the Hall state TS can be determined based on the method described above.
[0241] Delay program 1 is as follows: delay the target time period T, and when the target time period T arrives, change the power phase sequence to Z1 next , and release delay program 1.
[0242] S1508, detecting whether the Hall state TS changes.
[0243] If the Hall state TS changes, execute S1509 , otherwise continue to execute S1508 .
[0244] S1509, determine whether delay program 1 is occupied.
[0245] If the delay program 1 is not occupied, S1510 can be executed, otherwise S1511 is executed.
[0246] S1510 , determining a target time period T corresponding to the Hall state TS according to the average value of the angle error corresponding to the Hall state TS and the on-time E, and executing the delay procedure 1 and S1508 .
[0247] S1511 , determining the target time period T corresponding to the Hall state TS according to the average value of the angle error corresponding to the Hall state TS and the on-time E, and executing the delay procedure 2 and S1508 .
[0248] Delay program 2 is as follows: delay the target time period T, and when the target time period T arrives, change the power phase sequence to Z2 next , and release delay program 2.
[0249] Figure 15 The process shown is similar to Figure 14 The process shown is similar, please refer to the above for details. Figure 14 Description of the process shown.
[0250] The above describes the method of the embodiment of the present application in detail. The following describes the device embodiment of the present application. It should be understood that the device in the embodiment of the present application can execute the aforementioned method embodiment, that is, the specific working process of the various products below can refer to the corresponding process in the aforementioned method embodiment.
[0251] Figure 16FIG1 is a schematic structural diagram of a motor controller provided in an embodiment of the present application. The motor controller 1600 may include a processing unit 1610 .
[0252] The processing unit 1610 is used to: start from when the d-axis angle is a first electrical angle, lock the d-axis along the first direction at preset electrical angle intervals, and detect the Hall state after each d-axis is locked until the d-axis angle changes to the first electrical angle for the Nth time, N≥1, the preset electrical angle is less than 60°, and the first direction is clockwise or counterclockwise; determine the average value of the angle error corresponding to the same Hall state based on the locked d-axis angle and the corresponding theoretical d-axis angle corresponding to each Hall state change, the theoretical d-axis angle is determined based on the Hall state and the Hall phase sequence for the first direction, and the angle error is equal to the theoretical d-axis angle minus the locked d-axis angle; in the process of using a square wave to drive the motor to rotate, control the commutation based on the Hall state, and compensate for the commutation moment based on the average value of the angle error.
[0253] Optionally, the processing unit 1610 is specifically used to: drive the motor to rotate based on the square wave according to the Hall phase sequence, and determine the conduction time of the energized sector, wherein the conduction time is equal to the average time used for the motor to rotate one electrical cycle divided by 6; determine the compensation time corresponding to the target Hall state according to the average value of the angle error corresponding to the target Hall state and the conduction time, wherein the compensation time = the average value of the angle error * the conduction time / 60°, and the target Hall state is any one of six different Hall states; take the moment when the Hall state changes to the target Hall state as the starting moment, and perform phase switching when the target time period arrives, wherein, when the first direction is counterclockwise, the target time period = the conduction time + the compensation time, and when the first direction is clockwise, the target time period = the conduction time - the compensation time.
[0254] Optionally, the preset electrical angle = 1 / 65536*360°.
[0255] Optionally, the processing unit 1610 is specifically used to: control the motor to run for a preset time based on the target voltage and the d-axis angle, and detect the Hall state output by the Hall sensor after the motor runs for the preset time, until the d-axis angle becomes the first electrical angle for the Nth time, the target voltage is the d-axis voltage, the q-axis voltage is 0, the initial value of the d-axis angle is the first electrical angle, and the d-axis angle steps along the first direction at the predetermined electrical angle.
[0256] Optionally, the processing unit 1610 is specifically used to: determine the three-phase voltage of the motor based on the target voltage, the d-axis angle, Park inverse transform and Clarke inverse transform; and control the motor to run for the preset time based on the three-phase voltage.
[0257] Optionally, the processing unit 1610 is also used to: start from the d-axis angle being a second electrical angle, lock the d-axis at 60° electrical angle intervals along the first direction until the d-axis rotates at least one electrical cycle, and detect the Hall state output by the Hall sensor after each d-axis is locked; determine the Hall phase sequence based on the locked d-axis angle each time the Hall state changes and the correspondence between the d-axis angle and the power-on phase sequence.
[0258] Optionally, the second electrical angle is 60°*k, k∈[0,5].
[0259] It should be noted that the motor controller 1600 is implemented in the form of a functional unit. The term "unit" here can be implemented in the form of software and / or hardware, and is not specifically limited to this.
[0260] For example, a "unit" may be a software program, a hardware circuit, or a combination of the two that implements the aforementioned functionality. The hardware circuit may include an application specific integrated circuit (ASIC), an electronic circuit, a processor (e.g., a shared processor, a dedicated processor, or a group processor) and memory for executing one or more software or firmware programs, combined logic circuits, and / or other suitable components that support the described functionality.
[0261] Therefore, the units of each example described in the embodiments of this application can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0262] Figure 17 1 is a schematic diagram of the structure of a motor controller 1700 provided in an embodiment of the present application. Figure 17 As shown, the motor controller 1700 includes: at least one processor 1701 ( Figure 17 Only one processor is shown), a memory 1702, and a computer program 1703 stored in the memory 1702 and executable on the at least one processor 1701, wherein the processor 1701 implements the steps of any of the above method embodiments when executing the computer program 1703.
[0263] Those skilled in the art will understand that Figure 17 This is merely an example of the motor controller 1700 and does not constitute a limitation on the motor controller 1700 . The motor controller 1700 may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the motor controller 1700 may also include input and output devices, network access devices, etc.
[0264] The processor 1701 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor may be a microprocessor or any conventional processor.
[0265] In some embodiments, the memory 1702 may be an internal storage unit of the motor controller 1700, such as a hard disk or memory of the motor controller 1700. In other embodiments, the memory 1702 may also be an external storage device of the motor controller 1700, such as a plug-in hard disk, a smart memory card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the motor controller 1700. Furthermore, the memory 1702 may also include both an internal storage unit of the motor controller 1700 and an external storage device. The memory 1702 is used to store an operating system, an application program, a boot loader, data, and other programs, such as the program code of the computer program. The memory 1702 may also be used to temporarily store data that has been output or is about to be output.
[0266] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of this application. Their specific functions and technical effects can be found in the method embodiment section and will not be repeated here.
[0267] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0268] An embodiment of the present application also provides a motor controller, which includes: a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that the motor controller implements any of the above method embodiments.
[0269] An embodiment of the present application further provides an electronic device, which includes a motor controller and a BLDC motor, and the motor controller is used to implement any of the above method embodiments.
[0270] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any of the above method embodiments can be implemented.
[0271] An embodiment of the present application provides a computer program product, which can implement any of the above method embodiments when the computer program product is running.
[0272] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the process of the above-mentioned method embodiment by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, it can implement the steps of each of the above-mentioned method embodiments. The computer program includes computer program code, which can be in source code form, object code form, executable file, or some intermediate form. The computer-readable medium can at least include: any entity or device capable of carrying computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal, and software distribution medium. For example, a USB flash drive, mobile hard drive, magnetic disk, or optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals or telecommunication signals.
[0273] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0274] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0275] In the embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely schematic. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0276] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0277] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.
Claims
1. A method for compensating for installation errors of a Hall sensor in a motor, wherein the motor is a brushless DC motor, characterized in that: include: Starting from when the d-axis angle is a first electrical angle, locking the d-axis at preset electrical angle intervals along a first direction, and detecting the Hall state after each d-axis locking, until the d-axis angle becomes the first electrical angle for the Nth time, N ≥ 1, the preset electrical angle is less than 60°, and the first direction is clockwise or counterclockwise; determining an average value of an angular error corresponding to the same Hall state based on a locked d-axis angle and a corresponding theoretical d-axis angle corresponding to each Hall state change, wherein the theoretical d-axis angle is determined based on the Hall state and a Hall phase sequence for the first direction, and the angular error is equal to the theoretical d-axis angle minus the locked d-axis angle; In the process of driving the motor to rotate by adopting a square wave, commutation is controlled based on the Hall state, and the commutation timing is compensated according to the average value of the angle error.
2. The method according to claim 1, wherein The compensating the commutation moment according to the average value of the angle error includes: Drive the motor to rotate using a square wave according to the Hall phase sequence, and determine the on-time of the energized sector, where the on-time is equal to the average time taken by the motor to rotate one electrical cycle divided by 6; Determining a compensation time corresponding to the target Hall state according to an average value of the angle error and the on-time corresponding to the target Hall state, wherein the compensation time = the average value of the angle error * the on-time / 60°, and the target Hall state is any one of six different Hall states; The moment when the Hall state changes to the target Hall state is used as the starting moment, and phase switching is performed when the target time period is reached. When the first direction is counterclockwise, the target time period = the on-time + the compensation time; when the first direction is clockwise, the target time period = the on-time - the compensation time.
3. The method according to claim 1 or 2, wherein: The preset electrical angle=1 / 65536*360°.
4. The method according to any one of claims 1 to 3, wherein The method includes: starting from the d-axis angle being a first electrical angle, locking the d-axis at preset electrical angle intervals along a first direction, and detecting a Hall state output by a Hall sensor after each d-axis locking, until the d-axis angle becomes the first electrical angle for the Nth time. The motor is controlled to run for a preset time based on the target voltage and the d-axis angle, and the Hall state output by the Hall sensor is detected after the motor runs for the preset time until the d-axis angle becomes the first electrical angle for the Nth time, the target voltage is the d-axis voltage, the q-axis voltage is 0, the initial value of the d-axis angle is the first electrical angle, and the d-axis angle steps along the first direction by the predetermined electrical angle.
5. The method according to claim 4, wherein The controlling the motor to operate for a preset time period based on the first voltage and the d-axis angle includes: determining a three-phase voltage of the motor based on the target voltage, the d-axis angle, an inverse Park transform, and an inverse Clarke transform; Based on the three-phase voltage, the motor is controlled to run for the preset time period.
6. The method according to any one of claims 1 to 5, wherein The method further comprises: Starting from the d-axis angle being a second electrical angle, locking the d-axis at 60° electrical angle intervals along the first direction until the d-axis rotates at least one electrical cycle, and detecting a Hall state output by the Hall sensor after each d-axis locking; The Hall phase sequence is determined according to the d-axis angle locked each time the Hall state changes and the corresponding relationship between the d-axis angle and the power-on phase sequence.
7. The method according to claim 6, wherein The second electrical angle is 60°*k, where k∈[0,5].
8. A motor controller, characterized in that: The motor controller comprises a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that the motor controller executes the method according to any one of claims 1 to 7.
9. An electronic device, characterized in that: The method comprises a motor controller and a brushless DC motor, wherein the motor controller is configured to execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed, the method according to any one of claims 1 to 7 is executed.
Citation Information
Patent Citations
Vector control position estimation compensation method based on Hall position sensor
CN110380653A
Hall commutation prediction compensation method and system, storage medium, equipment and terminal
CN117559848A
BLDC (brushless direct current) rotor angle acquisition method and system for automatically compensating Hall sector error, medium and equipment
CN118677299A
Methods and apparatus for three-phase motor control with error compensation
US20180278185A1
Cited By
Three-phase Hall self-learning method for vector control of brushless motor of high-speed chip mounter
CN121124641A
A three-phase hall self-learning method for vector control of a high-speed chip mounter brushless motor
CN121124641B