Motor zero position learning method and related device

By controlling the motor to rotate multiple times at a unit electrical angle in a brushless DC motor, the actual rotation angle value and angle error value of the magnetic pole are obtained, and the problem of large zero positioning error is solved, achieving more accurate zero position determination and more stable motor operation.

CN119766002AActive Publication Date: 2025-04-04BYD CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411050779.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2025-04-04
Estimated Expiration
2044-07-31

AI Technical Summary

Technical Problem

In some brushless DC motors, due to the complex structure and difficulty in installing Hall components, the motor has large zero positioning errors, which in turn affects the motor's commutation matching and stability under large loads.

Method used

By controlling the motor to rotate multiple times at a unit electrical angle, the actual rotation angle value and angle error value of each magnetic pole during rotation are obtained, the step number corresponding to the minimum angle error value is determined, and the motor zero position is accurately determined.

Benefits of technology

When the motor structure is not conducive to the installation of Hall components, the motor zero position can be accurately determined, and positioning errors can be reduced, and the motor burns under large loads can be avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119766002A_ABST
    Figure CN119766002A_ABST
Patent Text Reader

Abstract

The invention provides a motor zero position learning method and a related device, and the method comprises the steps: controlling a motor to rotate for multiple times from an initial mechanical angle at a unit electrical angle, completing a first circle of rotation, enabling each rotation to correspond to a step number, and obtaining first rotation data; the first rotation data comprises a plurality of actual rotation angle values and first angle error values corresponding to each magnetic pole in the plurality of magnetic poles in multiple rotation, a first step number corresponding to a to-be-measured magnetic pole is obtained, and the to-be-measured magnetic pole is the magnetic pole corresponding to the minimum first angle error value in the first rotation data; and obtaining a motor zero position result according to the optimal step number and the target step number. Therefore, the zero position of the motor can be determined more accurately under the condition that the structure of the motor is not beneficial to installation of the Hall element, the zero position positioning error of the motor is reduced, motor connection methods do not need to be distinguished, and zero position determination is more convenient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of motors, and in particular to a motor zero position learning method and related devices. Background Art

[0002] The application scope of brushless direct current (BLDC) motors has spread to all fields of the national economy and people's daily lives. When the motor is working, it is necessary to obtain the position of the motor rotor. At present, the position of the motor rotor is mainly obtained through Hall elements. Hall elements and controllers are installed at specific positions on the stator to cooperate with each other to control the normal commutation of the motor.

[0003] However, there are many types of brushless motors with different structures. Due to the different structures of the motors, it is very difficult to install the Hall element in some cases. A slight mechanical angle deviation in the position of the Hall element will lead to a very large electrical angle error, that is, a large error in the motor zero position, which will cause the motor's commutation to advance or lag. In this case, the motor speed and torque output will not match, and under heavy load, the motor and control will burn out.

[0004] The current solutions include two-phase (three-phase) power-on positioning method, variable inductance detection positioning method, etc., but they still lead to the problem of zero-position positioning failure and large errors. Summary of the invention

[0005] The embodiments of the present application provide a motor zero position learning method and related devices, which can more accurately determine the motor zero position when the structure of the motor is not conducive to the installation of Hall elements.

[0006] In a first aspect, an embodiment of the present application provides a motor zero-position learning method, wherein the motor has multiple magnetic poles, and the method includes:

[0007] Control the motor to rotate multiple times at a unit electrical angle, so that the motor starts from an initial mechanical angle and completes a first rotation, each rotation corresponds to a step number, and the unit electrical angle corresponds to a control strategy of the motor;

[0008] Acquire first rotation data, the first rotation data comprising a plurality of first actual rotation angle values ​​and a plurality of first angle error values ​​corresponding to each of the plurality of magnetic poles in the plurality of rotations, the first angle error value being obtained by performing error calculation based on the actual rotation angle value;

[0009] Obtaining the first step number corresponding to the magnetic pole to be measured, wherein the first step number is the step number corresponding to the smallest first angle error value among multiple first angle error values ​​in the first rotation data, and the magnetic pole to be measured is the magnetic pole with the smallest first angle error in the rotation numbered as the first step number;

[0010] The motor zero position result is obtained according to the optimal step number and the target step number, wherein the optimal step number includes the first step number, and the target step number is the step number corresponding to the preset zero position.

[0011] In a second aspect, an embodiment of the present application provides a motor zero-position learning device, wherein the motor has a plurality of magnetic poles, and the device comprises:

[0012] A control module, used for controlling the motor to rotate multiple times in a unit electrical angle, so that the motor starts from an initial mechanical angle and completes a first rotation, each rotation corresponds to a step number, and the unit electrical angle corresponds to a control strategy of the motor;

[0013] A first acquisition module is used to acquire first rotation data, wherein the first rotation data includes a plurality of first actual rotation angle values ​​and a plurality of first angle error values ​​corresponding to each magnetic pole in the plurality of rotations, wherein the first angle error value is obtained by performing error calculation based on the actual rotation angle value;

[0014] A second acquisition module is used to obtain the first step number corresponding to the magnetic pole to be measured, wherein the first step number is the step number corresponding to the smallest first angle error value among multiple first angle error values ​​in the first rotation data, and the magnetic pole to be measured is the magnetic pole with the smallest first angle error in the rotation numbered as the first step number;

[0015] A determination module is used to obtain a motor zero position result according to an optimal step number and a target step number, wherein the optimal step number includes a first step number, and the target step number is a step number corresponding to a preset zero position.

[0016] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the program includes instructions for executing some or all of the steps described in the first aspect of the embodiment of the present application.

[0017] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes some or all of the steps described in the first aspect.

[0018] In a fifth aspect, an embodiment of the present application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute some or all of the steps described in the first aspect of the embodiment of the present application. The computer program product may be a software installation package.

[0019] By implementing the embodiment of the present application, the motor is controlled to rotate multiple times in a unit electrical angle, so that the motor starts from an initial mechanical angle and completes the first rotation, each rotation corresponds to a step number, and the unit electrical angle corresponds to the control strategy of the motor, and the first rotation data is obtained, the first rotation data includes multiple first actual rotation angle values ​​and multiple first angle error values ​​corresponding to each magnetic pole in the multiple rotations, the first angle error value is obtained by error calculation based on the actual rotation angle value, and the first step number corresponding to the magnetic pole to be measured is obtained, wherein the first step number is the step number corresponding to the smallest first angle error value among the multiple first angle error values ​​in the first rotation data, and the magnetic pole to be measured is the magnetic pole with the smallest first angle error in the rotation numbered as the first step number, and the motor zero position result is obtained according to the optimal step number and the target step number, the optimal step number includes the first step number, and the target step number is the step number corresponding to the preset zero position. In this way, when the structure of the motor is not conducive to the installation of the Hall element, the zero position of the motor can be determined more accurately, the zero position positioning error of the motor can be reduced, and there is no need to distinguish the motor connection method, making the zero position determination more convenient. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the background technology, the drawings required for use in the embodiments of the present invention or the background technology will be described below.

[0021] Figure 1 It is a system architecture diagram of a motor zero position learning method provided in an embodiment of the present application;

[0022] Figure 2 It is a flow chart of a motor zero position learning method provided in an embodiment of the present application;

[0023] Figure 3 Schematic diagram of a motor zero position learning method provided in an embodiment of the present application;

[0024] Figure 4 is a flow chart of another motor zero position learning method provided in an embodiment of the present application;

[0025] Figure 5 is a flow chart of another motor zero position learning method provided in an embodiment of the present application;

[0026] Figure 6 It is a structural schematic diagram of a motor zero position learning device provided in an embodiment of the present application;

[0027] Figure 7 It is a structural schematic diagram of an electronic device proposed in an embodiment of the present application. DETAILED DESCRIPTION

[0028] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0029] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or electronic device that includes a series of steps or units is not limited to the listed steps or units, but in an optional example also includes steps or units that are not listed, or in an optional example also includes other steps or units inherent to these processes, methods, products, or electronic devices.

[0030] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0031] See also Figure 1 , Figure 1 is a system architecture diagram of a motor zero position learning method provided in an embodiment of the present application, such as Figure 1As shown, the motor zero-position learning architecture includes: a motor stator 110 , a motor rotor 120 , a programmable element 130 , a magnetic ring 140 , and a Hall sensor 150 .

[0032] The motor stator 110 is a component of the motor, and many windings are wound inside the stator 110 . These windings are connected to an external AC power source, and the entire motor stator 110 is fixed.

[0033] The motor rotor 120 is a component of the motor. The motor rotor 120 has a plurality of pairs of magnetic poles, and each pair of magnetic poles has an N pole and an S pole.

[0034] The magnetic ring 140 may be a pair of magnetic rings with an N pole and an S pole, and the magnetic ring 140 may be used to sense the initial mechanical angle of the motor. The magnetic ring 140 may be connected to the programmable element 130, and the initial mechanical angle of the motor sensed by the magnetic ring 140 may be acquired by the programmable element 130.

[0035] The programmable element 130 may be a programmable chip or other programmable electronic device, which is not limited here. The programmable element 130 may be used to perform zero-position learning of the motor, and the programmable element 130 has a built-in zero-position learning program.

[0036] The Hall sensor 150 is used to record the position of the rotor when the motor is running and detect the commutation position of the motor. For a three-phase brushless DC motor, three Hall sensors can detect six commutation positions.

[0037] See also Figure 2 , Figure 2 is a flow chart of a motor zero position learning method provided in an embodiment of the present application, such as Figure 2 As shown, the method comprises the following steps:

[0038] S210, controlling the motor to rotate multiple times at a unit electrical angle, so that the motor starts from an initial mechanical angle and completes the first rotation, each rotation corresponds to a step number, and the unit electrical angle corresponds to the control strategy of the motor.

[0039] During the rotation process, the motor remains continuously powered but not commutated.

[0040] Among them, first obtain the initial mechanical angle, and then the program in the programmable element controls the motor to rotate multiple times at a fixed electrical angle. The number of rotations of the multiple rotations is related to the unit electrical angle, and the number is equal to the number of unit electrical angles in 360 degrees. The above-mentioned fixed electrical angle is the unit electrical angle. The unit electrical angle does not refer to 1 degree of electrical angle, but is related to the control strategy of the motor. The control strategy of the above-mentioned motor can be a square wave control strategy. Based on the square wave control strategy, the unit electrical angle is obtained. The motor rotates multiple times at the unit electrical angle to complete a mechanical angle rotation. Each rotation will correspond to a step number, and the step number is used for the subsequent learning process. The above-mentioned square wave control strategy can adopt a fixed duty cycle of 25% and a fixed commutation power-on time of 1 second.

[0041] The process of obtaining the initial mechanical angle may be: powering the motor to start running, then monitoring the signal of the magnetic ring, using appropriate circuits or equipment to monitor the output signal of the magnetic ring, these signals may be pulses or digital signals, etc., indicating the position of the rotor, the specific method is not limited here; then according to the signal of the magnetic ring, determine the initial position of the rotor, which can be achieved through a specific algorithm or logic; finally calculate the initial mechanical angle, once the initial position is determined, the initial mechanical angle can be calculated based on the number of pole pairs of the motor and the installation position of the Hall sensor. The specific method of obtaining the initial mechanical angle may be other methods, which are not limited here.

[0042] Each magnetic pole has a magnetic pole number, such as magnetic pole 1, magnetic pole 2, etc. The step numbering starts from magnetic pole 1, and multiple sets of data are obtained after each unit electrical angle of magnetic pole 1, and the multiple sets of data are numbered from small to large. The step numbering of magnetic pole 2 continues the step numbering of magnetic pole 1.

[0043] Among them, see Figure 3 , Figure 3 A schematic diagram of a motor zero position learning method provided in an embodiment of the present application, such as Figure 3 As shown, assuming that the dotted line represents the initial mechanical angle of the motor, the motor starts from the initial mechanical angle and completes the first rotation from Figure 3 The (a) state rotates clockwise or counterclockwise, and finally completes the target 360-degree mechanical angle, from (a) to (b) and then to (c). Among them, the (c) state is the position after completing one mechanical angle rotation, which can be the 360 ​​degrees completed in theory, but in fact, the (c) state may be different from the (a) state, and the angle may have an error.

[0044] In a possible embodiment, the motor is a brushless DC motor, and the control strategy of the motor is a six-step square wave control strategy.

[0045] For example, if the motor is a motor with 6 MOS tubes powered on in pairs, and the Hall sensor is installed at 120 degrees and has 14 electrodes, that is, 7 pairs of poles, then the square wave control strategy is adopted, and the calculation results are That is, the unit electrical angle is 360 / 6 = 60. When the motor rotates one mechanical angle, multiple sets of data for each pair of electrodes are obtained, each set of data has a step number, and finally complete data with step numbers from 0 to 41 are obtained.

[0046] For example, if the motor is a three-way powered motor with 6 MOS tubes, and the Hall sensor is installed at 30 degrees and has 14 electrodes, that is, 7 pairs of poles, then the square wave control strategy is adopted, and the calculation results are That is, the unit electrical angle is 360 / 6 = 60. When the motor rotates one mechanical angle, multiple sets of data for each pair of electrodes are obtained, each set of data has a step number, and finally complete data with step numbers from 0 to 41 are obtained.

[0047] S220, obtaining first rotation data, the first rotation data including a plurality of first actual rotation angle values ​​and a plurality of first angle error values ​​corresponding to each magnetic pole in multiple rotations among a plurality of magnetic poles, the first angle error value being obtained by performing error calculation based on the actual rotation angle value.

[0048] Among them, the first rotation data is multiple sets of data for each pair of electrodes obtained when the motor rotates one mechanical angle. Each set of data may include the first actual rotation angle value and multiple first angle error values ​​corresponding to each rotation, and may also include other data, such as the standard rotation angle value. The above standard rotation angle value is the standard angle value that each magnetic pole should rotate corresponding to in multiple rotations, which can also be understood as the target rotation angle value. The above first actual rotation angle value is the electrical angle value of each pair of electrodes generated by the first rotation at each unit electrical angle rotation. In actual applications, it may have a certain error with the standard rotation angle value. The first angle error value is the calculated error value obtained by calculating the error between the first actual rotation angle value and the standard rotation angle value, that is, the above error calculation.

[0049] In a possible embodiment, multiple first actual rotation angle values ​​and multiple first angle error values ​​of each rotation step of the magnetic pole are recorded, including: recording the first actual rotation angle value of the magnetic pole after the motor rotates one unit electrical angle step each time, and recording the step number; performing a difference calculation between the first actual rotation angle value corresponding to the step number m+1 and the actual rotation angle value corresponding to the step number m to obtain a longitudinal error value; performing an error calculation based on the longitudinal error value and the standard rotation angle value to obtain a first angle error value.

[0050] The error calculation process may be: subtract the actual rotation angle value of the step number m+1 and the actual rotation angle value of the step number n of the same magnetic pole with 360 degrees as the carry to obtain the longitudinal error value of the m+1 step, and then add the actual angle error value of the m+1 step to 60 degrees to obtain the first angle error value. The above m is a positive integer greater than or equal to 1.

[0051] For example, if the actual rotation angle value of step number 1 of magnetic pole 1 is 309.1, and the actual rotation angle value of step number 0 is 7.8 degrees, the longitudinal error is (309.1-360)-7.8=-58.7, and -58.7+60=1.3, and 1.3 is the first angle error value of step number 1. If the actual rotation angle value of step number 2 of magnetic pole 1 is 253.5, and the actual rotation angle value of step number 1 is 309.1 degrees, the longitudinal error is 253.5-309.1=-55.6, and -55.6+60=4.4, and 4.4 is the first angle error value of step number 2. If the actual rotation angle value of the step number 3 of the magnetic pole 1 is 195.7, and the actual rotation angle value of the step number 2 is 253.5 degrees, then the longitudinal error is 195.7-253.5=-57.8, and then -57.8+60=2.2, and 2.2 is the first angle error value of the step number 3.

[0052] S230, obtaining the first step number corresponding to the magnetic pole to be measured, wherein the first step number is the step number corresponding to the smallest first angle error value among multiple first angle error values ​​in the first rotation data, and the magnetic pole to be measured is the magnetic pole with the smallest first angle error in the rotation numbered as the first step number.

[0053] Among them, all the first angle error values ​​of the complete first rotation data are traversed to obtain the minimum first angle error value, and then the first step number corresponding to the minimum first angle error value is obtained, and this first step number is considered to be the first step number, and the magnetic pole corresponding to this step of rotation is considered to be the magnetic pole to be measured.

[0054] For example, if after traversal, the smallest first angle error value among all 42 data is 0.1, the first step number corresponding to this first angle error value 0.1 is numbered 39, and the corresponding magnetic pole is pole 7, then the magnetic pole to be measured is considered to be pole 7, and the first step number is numbered 39.

[0055] S240, obtaining a motor zero position result according to an optimal step number and a target step number, wherein the optimal step number includes a first step number, and the target step number is a step number corresponding to a preset zero position.

[0056] For example, the motor starts from an initial mechanical angle, completes the first rotation, and reaches the preset zero position after rotating three times. At this time, the target step number of the motor is 3.

[0057] In a possible embodiment, the optimal step number also includes a second step number, and obtaining a motor zero position result according to the optimal step number and the target step number also includes: 411, rotating the motor from an initial mechanical angle to a first actual rotation angle value corresponding to the first step number, the actual rotation angle value being an angle value of the actual rotation of the magnetic pole to be measured during the process from the first rotation to the step number being the first step number;

[0058] After obtaining the first step number corresponding to the magnetic pole to be measured and the magnetic pole to be measured, the electrode is rotated to the actual rotation angle value corresponding to the first step number, and then subsequent operations are performed on this basis.

[0059] Wherein, a square wave control strategy is adopted during rotation. Specifically, the fixed duty cycle of the square wave control strategy may be 25%, and the fixed commutation power-on time may be 1 second.

[0060] 421. Repeat the control of the motor to rotate multiple times in unit electrical angle, so that the motor starts from the actual rotation angle value corresponding to the first step number and completes the second rotation.

[0061] During the rotation process, the motor is continuously powered but not commutated. A square wave control strategy is used during rotation. Specifically, the fixed duty cycle of the square wave control strategy may be 25%, and the fixed commutation power-on time may be 1 second.

[0062] The second mechanical angle is rotated starting from the actual rotation angle value corresponding to the first step number, and the operation of the first rotation is repeated. Similarly, each rotation corresponds to a step number.

[0063] Herein, repeatedly controlling the motor to rotate multiple times at a unit electrical angle may refer to repeating once, twice, or more than twice, such as three times or four times, which is not limited here.

[0064] 431. Obtain second rotation data, the second rotation data comprising a plurality of second actual rotation angle values ​​and a plurality of second angle error values ​​corresponding to each of a plurality of magnetic poles in a plurality of rotations, the second angle error value being obtained by performing error calculation based on the second actual rotation angle value.

[0065] Among them, the second rotation data is a plurality of sets of data for each pair of electrodes obtained when the motor starts to rotate one mechanical angle at the actual rotation angle value corresponding to the first step number. Each set of data may include the actual rotation angle value corresponding to each rotation and the second angle error value, and may also include other data, such as the second standard rotation angle value. The second standard rotation angle value is the standard angle value that each magnetic pole should rotate in multiple rotations, which can also be understood as the second target rotation angle value. The second actual rotation angle value is the electrical angle value that each pair of electrodes actually rotates at each unit electrical angle rotation. In actual applications, it may have a certain error with the second standard rotation angle value. The second angle error value is the calculated error value obtained by calculating the error between the second actual rotation angle value and the second standard rotation angle value, that is, the above error calculation.

[0066] 441. Obtain a second step number corresponding to the magnetic pole to be measured, where the second step number is the step number corresponding to the smallest angle error value among multiple angle error values ​​corresponding to the magnetic pole to be measured.

[0067] After the rotation, all angle error values ​​generated during the second rotation are obtained, and then the angle error values ​​corresponding to the measured magnetic poles are compared to obtain the smallest error value as the second angle error value, and the step number corresponding to the second angle error value is the second step number.

[0068] In a possible embodiment, multiple actual rotation angle values ​​and second angle error values ​​of each rotation step of the magnetic pole are recorded, including: recording the second actual rotation angle value of the magnetic pole after the motor rotates one unit electrical angle step each time, and recording the step number; performing a difference calculation between the second actual rotation angle value corresponding to the step number m+1 and the second actual rotation angle value corresponding to the step number m to obtain a second longitudinal error value; performing an error calculation based on the second longitudinal error value and the second standard rotation angle value to obtain a second angle error value.

[0069] Among them, the error calculation process can be: subtract the actual rotation angle value of the step number m+1 and the actual rotation angle value of the step number n of the same magnetic pole with 360 degrees as the carry to obtain the longitudinal error value of the m+1 step, and then add the actual angle error value of the m+1 step to 60 degrees to obtain the first angle error value.

[0070] Among them, all the second angle error values ​​of the complete second rotation data are traversed to obtain the minimum second angle error value, and then the step number corresponding to the minimum second angle error value is obtained, and this step number is regarded as the first step number, and the magnetic pole corresponding to this step of rotation is regarded as the magnetic pole to be measured.

[0071] 451. Obtain the motor zero position result according to the second step number and the target step number.

[0072] The second step number obtained in the second rotation is used as the optimal step number, and the optimal step number is the step number that can be used for the next operation.

[0073] The target step number is a preset target step number of the motor, that is, the motor zero position needs to be determined by calculation based on the target step number and the calculated optimal step number.

[0074] In a possible embodiment, if step S240 is repeated 2 times or more, the optimal step number also includes a third step number, and the motor zero position result is obtained according to the optimal step number and the target step number, and the method includes:

[0075] 412. Rotate the motor from an initial mechanical angle to a first actual rotation angle value corresponding to the first step number, wherein the actual rotation angle value is an angle value of the magnetic pole to be measured that is actually rotated during the process from the first rotation to the step number being the first step number.

[0076] After obtaining the first step number corresponding to the magnetic pole to be measured and the magnetic pole to be measured, the electrode is rotated to the actual rotation angle value corresponding to the first step number, and then subsequent operations are performed on this basis.

[0077] Wherein, a square wave control strategy is adopted during rotation. Specifically, the fixed duty cycle of the square wave control strategy may be 25%, and the fixed commutation power-on time may be 1 second.

[0078] 422. Repeatedly control the motor to rotate multiple times in unit electrical angle, so that the motor starts from the actual rotation angle value corresponding to the first step number and completes n rotations, where n is an integer greater than or equal to 1.

[0079] During the rotation process, the motor is continuously powered but not commutated. A square wave control strategy is used during rotation. Specifically, the fixed duty cycle of the square wave control strategy may be 25%, and the fixed commutation power-on time may be 1 second.

[0080] Among them, m rotations are completed starting from the actual rotation angle value corresponding to the first step number, and the operation of the first rotation is repeated for each rotation. Similarly, each rotation corresponds to a step number.

[0081] The motor is repeatedly controlled to complete n rotations in a unit electrical angle, which may be one week or more, such as three weeks, four weeks, or five weeks, which is not limited here.

[0082] 432. Obtain third rotation data, where the third rotation data includes a plurality of third actual rotation angle values ​​and a plurality of third angle error values ​​corresponding to each of the plurality of magnetic poles in a plurality of rotations.

[0083] Among them, the third rotation data is a plurality of sets of data for each pair of electrodes obtained when the motor starts to rotate one mechanical angle at the actual rotation angle value corresponding to the first step number. Each set of data may include the actual rotation angle value corresponding to each rotation and the second angle error value, and may also include other data, such as the third standard rotation angle value. The third standard rotation angle value is the standard angle value that each magnetic pole should rotate in multiple rotations, which can also be understood as the third target rotation angle value. The third actual rotation angle value is the electrical angle value that each pair of electrodes actually rotates at each unit electrical angle rotation. In actual applications, it may have a certain error with the third standard rotation angle value. The third angle error value is the calculated error value obtained by calculating the error between the third actual rotation angle value and the third standard rotation angle value, that is, the above error calculation.

[0084] 442. Calculate the offset value generated by one rotation of the magnetic pole to be measured in n rotations, wherein the offset value is obtained according to the third rotation data, and obtain the rotation group to be measured according to the minimum offset value.

[0085] Among them, the offset value is calculated based on the third rotation data of the magnetic pole to be measured per week. For example, the offset value of each rotation can be calculated based on the actual rotation angle value and the standard value generated by the magnetic pole to be measured to obtain multiple lateral error values, and then the variance is calculated based on the multiple lateral error values ​​to obtain the lateral variance, and the lateral variance is used as the offset value.

[0086] For example, after the magnetic pole 1 rotates one circle, 6 actual rotation angle values ​​are obtained. The 6 actual rotation angle values ​​are respectively subtracted from the standard values ​​to obtain 6 lateral error values. The variance of the above 6 lateral error values ​​is calculated to obtain the lateral variance, which is used as the offset value.

[0087] 452. Obtain a third step number, where the third step number is the step number corresponding to the smallest third angle error value among multiple third angle error values ​​in the rotation group to be measured.

[0088] Among them, after the rotation, all the angle error values ​​generated by the measured rotating group during the nth rotation are obtained, and then the angle error values ​​corresponding to the measured magnetic poles in the measured rotating group are compared to obtain the smallest error value as the third angle error value, and the step number corresponding to the third angle error value is the third step number.

[0089] 462. Obtain the motor zero position result according to the third step number and the target step number.

[0090] In a possible embodiment, obtaining the motor zero position result according to the optimal step number and the target step number includes: calculating the first motor zero position calculation value according to the following first formula: M=E+(AB)*C, wherein E is the actual rotation angle value corresponding to the optimal step number, M is the first motor zero position calculation value, A is the optimal step number, B is the target step number, and C is the unit electrical angle; calculating the second motor zero position calculation value according to the following second formula: D=M+N, wherein D is the second motor zero position result, and N is the chip preset zero position; and using the second motor zero position result as the motor zero position result.

[0091] The second formula may also be D=MN.

[0092] Among them, after the first motor zero position is calculated by basic operation based on the optimal step number and the preset target step number of the motor, considering that the programmable element has a volume, the calculated first motor zero position is the electrical angle relative to the coordinate position of the programmable element. It is also necessary to standardize the motor zero position obtained in the programmable element coordinate system, and the standardization is converted into the motor zero position in the programmable element coordinate system.

[0093] The conversion method may be: obtaining a chip preset zero position of the programmable element, and then calculating the calculated first motor zero position calculated value and the chip preset zero position to obtain a second motor zero position calculated value. The second motor zero position calculated value is the final motor zero position obtained by the programmable element.

[0094] It can be seen that in this embodiment, the motor is controlled to rotate multiple times in a unit electrical angle so that the motor starts from the initial mechanical angle and completes the first rotation. Each rotation corresponds to a step number. The unit electrical angle corresponds to the control strategy of the motor. The first rotation data is obtained. The first rotation data includes multiple first actual rotation angle values ​​and multiple first angle error values ​​corresponding to each magnetic pole in multiple rotations among multiple magnetic poles. The first angle error value is obtained by error calculation based on the actual rotation angle value. The first step number corresponding to the magnetic pole to be measured is obtained, wherein the first step number is the step number corresponding to the smallest first angle error value among the multiple first angle error values ​​in the first rotation data. The magnetic pole to be measured is the magnetic pole with the smallest first angle error in the rotation numbered as the first step number. The motor zero position result is obtained according to the optimal step number and the target step number. The optimal step number includes the first step number, and the target step number is the step number corresponding to the preset zero position. In this way, when the structure of the motor is not conducive to the installation of the Hall element, the motor zero position can be more accurately determined, the motor zero position positioning error is reduced, and there is no need to distinguish the motor connection method, so that the zero position determination is more convenient.

[0095] In a possible embodiment, after the motor rotates one unit electrical angle step at a time, the actual rotation angle value of the magnetic pole is recorded, and after recording the step numbering step, the method also includes: determining whether the first actual rotation angle value is within a preset angle threshold range; if the first actual rotation angle value is not within the preset angle threshold range, stopping the motor zero position learning.

[0096] Among them, the preset angle threshold range is set manually, and the preset angle threshold range can be ±70°. When the actual rotation angle value exceeds the preset angle threshold range, there may be an error in the motor magnetic ring structure or the motor rotor structure. In this case, stop the motor zero position learning.

[0097] It can be seen that in this embodiment, when it is determined that the actual rotation angle value is greater than the preset angle threshold range, the zero-position learning is stopped, which can avoid the motor zero-position learning under large error conditions, avoid the occurrence of large zero-position errors, and help reduce the zero-position error.

[0098] See also Figure 4 , Figure 4 A flow chart of another motor zero position learning method provided in an embodiment of the present application is shown as follows: Figure 4 As shown, the method includes:

[0099] S410, controlling the motor to rotate multiple times at a unit electrical angle, so that the motor starts from an initial mechanical angle and completes the first rotation, each rotation corresponds to a step number, and the unit electrical angle corresponds to the control strategy of the motor.

[0100] S420: Determine whether the first actual rotation angle value is within a preset angle threshold range.

[0101] If the first actual rotation angle value is not within the preset angle threshold range, the motor zero position learning is terminated. If the first actual rotation angle value is within the preset angle threshold range, step S430 is executed.

[0102] S430, obtaining first rotation data, the first rotation data including a plurality of first actual rotation angle values ​​and a plurality of first angle error values ​​corresponding to each magnetic pole in multiple rotations among a plurality of magnetic poles, the first angle error value being obtained by performing error calculation based on the actual rotation angle value.

[0103] S440, obtaining the first step number corresponding to the magnetic pole to be measured, wherein the first step number is the step number corresponding to the smallest first angle error value among multiple first angle error values ​​in the first rotation data.

[0104] S450, rotating the motor from the initial mechanical angle to the actual rotation angle value corresponding to the first step number.

[0105] S460, repeatedly controlling the motor to rotate multiple times in unit electrical angle N times, so that the motor starts from the actual rotation angle value corresponding to the first step number and completes N rotations, where N is a positive integer greater than or equal to 1.

[0106] S470, obtain the Nth rotation data and obtain the Nth step number corresponding to the Nth magnetic pole to be measured, the Nth rotation data includes multiple Nth actual rotation angle values ​​and multiple Nth angle error values ​​corresponding to each of the multiple magnetic poles in multiple rotations, the Nth step number is the magnetic pole corresponding to the minimum Nth angle error value in the Nth rotation data.

[0107] S480, calculating the offset value generated by one rotation of the magnetic pole to be measured in N rotations, the offset value is obtained according to the Nth rotation data, and obtaining the rotation group to be measured according to the minimum offset value.

[0108] S490, obtaining the Nth step number, and taking the Nth step number as the optimal step number, the Nth step number being the step number corresponding to the smallest Nth angle error value among multiple Nth angle error values ​​in the rotation group to be tested.

[0109] S4100, calculate the first motor zero position calculation value according to the following first formula: M=E+(AB)*C, wherein E is the actual rotation angle value corresponding to the optimal step number, M is the motor zero position calculation value, A is the optimal step number, B is the target step number, and C is the unit electrical angle; the motor zero position calculation value is used as the first motor zero position result.

[0110] S4110, calculate the second motor zero position calculation value according to the following second formula: D=M+N, where D is the second motor zero position result, and N is the chip preset zero position; use the second motor zero position result as the motor zero position result.

[0111] The specific explanation of the above steps is the same as S210 to S240 in the aforementioned embodiment, refer to the description of S210 to S240, which will not be repeated here.

[0112] It can be seen that in this embodiment, the motor is controlled to rotate multiple times in a unit electrical angle so that the motor starts from the initial mechanical angle and completes the first rotation. Each rotation corresponds to a step number. The unit electrical angle corresponds to the control strategy of the motor. The first rotation data is obtained. The first rotation data includes multiple first actual rotation angle values ​​and multiple first angle error values ​​corresponding to each magnetic pole in multiple rotations among multiple magnetic poles. The first angle error value is obtained by error calculation based on the actual rotation angle value. The first step number corresponding to the magnetic pole to be measured is obtained, wherein the first step number is the step number corresponding to the smallest first angle error value among the multiple first angle error values ​​in the first rotation data. The magnetic pole to be measured is the magnetic pole with the smallest first angle error in the rotation numbered as the first step number. The motor zero position result is obtained according to the optimal step number and the target step number. The optimal step number includes the first step number, and the target step number is the step number corresponding to the preset zero position. In this way, when the structure of the motor is not conducive to the installation of the Hall element, the motor zero position can be more accurately determined, the motor zero position positioning error is reduced, and there is no need to distinguish the motor connection method, so that the zero position determination is more convenient.

[0113] In one possible embodiment, see Figure 5 , Figure 5 A flow chart of another motor zero position learning method provided in an embodiment of the present application is shown as follows: Figure 5 As shown in the figure, if the installation position of the Hall sensor of the motor is 30 degrees, the motor has 6 MOS tubes and two of them are powered, then:

[0114] S510, controlling the motor to rotate multiple times at a unit electrical angle, so that the motor starts from an initial mechanical angle and completes the first rotation, each rotation corresponds to a step number, and the unit electrical angle corresponds to the control strategy of the motor.

[0115] S520: Determine whether the first actual rotation angle value is within a preset angle threshold range.

[0116] If the first actual rotation angle value is not within the preset angle threshold range, the motor zero position learning is terminated. If the first actual rotation angle value is within the preset angle threshold range, step S530 is executed.

[0117] S530, obtaining first rotation data, the first rotation data including a plurality of first actual rotation angle values ​​and a plurality of first angle error values ​​corresponding to each magnetic pole in multiple rotations among the plurality of magnetic poles, the first angle error value being obtained by performing error calculation based on the actual rotation angle value.

[0118] S540, obtaining the first step number corresponding to the magnetic pole to be measured, wherein the first step number is the step number corresponding to the smallest first angle error value among multiple first angle error values ​​in the first rotation data.

[0119] S550, rotating the motor from the initial mechanical angle to the actual rotation angle value corresponding to the first step number.

[0120] S560, repeatedly controlling the motor to rotate multiple times in unit electrical angle N times, so that the motor starts from the actual rotation angle value corresponding to the first step number and completes N rotations, where N is a positive integer greater than or equal to 1.

[0121] S570, obtain the Nth rotation data and obtain the Nth step number corresponding to the Nth magnetic pole to be measured, the Nth rotation data includes multiple Nth actual rotation angle values ​​and multiple Nth angle error values ​​corresponding to each magnetic pole in multiple rotations, the Nth step number is the magnetic pole corresponding to the minimum Nth angle error value in the Nth rotation data.

[0122] S580, calculating the offset value generated by one rotation of the magnetic pole to be measured in N rotations, the offset value is obtained according to the Nth rotation data, and obtaining the rotation group to be measured according to the minimum offset value.

[0123] S590, obtain the Nth step number, and use the Nth step number as the optimal step number, the Nth step number is the step number corresponding to the smallest Nth angle error value among multiple Nth angle error values ​​in the rotation group to be tested. S5100, calculate the first motor zero position calculation value according to the following first formula: M=E+(AB)*C, where M is the motor zero position calculation value, E is the actual rotation angle value corresponding to the optimal step number, A is the optimal step number, B is the target step number, and C is the unit electrical angle; use the motor zero position calculation value as the first motor zero position result.

[0124] S5110, calculate the second motor zero position calculation value according to the following second formula: D=M+N, where D is the second motor zero position result, and N is the chip preset zero position.

[0125] S5120, calculate the third motor zero position calculation value according to the following third formula: F=D±30, where F is the third motor zero position calculation value, and use the third motor zero position result as the motor zero position result.

[0126] Among them, the above Figure 5 The specific explanation of steps S510 to S5110 in the embodiment is the same as that in the above Figure 4 The specific explanations of the steps in the embodiments are the same, see Figure 4 The detailed explanation of the steps in the embodiments will not be repeated here.

[0127] It can be seen that in this embodiment, the motor zero position output method of the previous embodiment is increased by plus or minus 30 degrees, and the motor zero position output scheme is extended to other motor Hall sensor installation angles. In this way, when the structure of the motor is not conducive to the installation of the Hall element, the motor zero position can be more accurately determined, the motor zero position positioning error is reduced, and there is no need to distinguish the motor connection method, making the zero position determination more convenient, adding other angle value calculation methods, and the application scenario is more extensive.

[0128] See also Figure 6 , Figure 6 Schematic diagram of the structure of a motor zero position learning device proposed in the embodiment of the present application. Figure 6 As shown, the motor zero position learning device 600 includes: a control module 610, a first acquisition module 620, a second acquisition module 630, and a determination module 640, wherein:

[0129] The control module 610 is used to control the motor to rotate multiple times in a unit electrical angle, so that the motor starts from an initial mechanical angle and completes the first rotation, each rotation corresponds to a step number, and the unit electrical angle corresponds to the control strategy of the motor;

[0130] The first acquisition module 620 is used to acquire first rotation data, which includes a plurality of first actual rotation angle values ​​and a plurality of first angle error values ​​corresponding to each of a plurality of magnetic poles in a plurality of rotations, wherein the first angle error value is obtained by performing error calculation based on the actual rotation angle value.

[0131] The second acquisition module 630 is used to obtain the first step number corresponding to the magnetic pole to be measured, wherein the first step number is the step number corresponding to the smallest first angle error value among multiple first angle error values ​​in the first rotation data, and the magnetic pole to be measured is the magnetic pole with the smallest first angle error in the rotation numbered as the first step number.

[0132] The determination module 640 is used to obtain the motor zero position result according to the optimal step number and the target step number, the optimal step number includes the first step number, and the target step number is the step number corresponding to the preset zero position.

[0133] In a possible implementation, the first acquisition module 620 is specifically used to acquire the first rotation data:

[0134] After the motor rotates one electrical degree step at a time, the actual rotation angle of the magnetic pole is recorded, and the step number is recorded;

[0135] The first actual rotation angle value corresponding to the step number m+1 and the actual rotation angle value corresponding to the step number m are calculated to obtain a longitudinal error value;

[0136] An error calculation is performed based on the longitudinal error value and the standard rotation angle value to obtain a first angle error value.

[0137] In a possible implementation, the second determination module 640 is specifically used to obtain the motor zero position result according to the optimal step number and the target step number:

[0138] The motor is rotated from the initial mechanical angle to the first actual rotation angle value corresponding to the first step number, the actual rotation angle value is the angle value of the actual rotation of the magnetic pole to be measured during the process from the first rotation to the step number being the first step number;

[0139] Repeatedly control the motor to rotate multiple times in unit electrical angle, so that the motor starts from the actual rotation angle value corresponding to the first step number and completes the second rotation;

[0140] Acquire second rotation data, the second rotation data comprising a plurality of second actual rotation angle values ​​and a plurality of second angle error values ​​corresponding to each of the plurality of magnetic poles in a plurality of rotations, the second angle error value being obtained by performing error calculation based on the second actual rotation angle value;

[0141] Obtaining a second step number corresponding to the magnetic pole to be measured, where the second step number is the step number corresponding to the smallest angle error value among multiple angle error values ​​corresponding to the magnetic pole to be measured in the second rotation data;

[0142] In a possible implementation, the second determination module 640 is further configured to obtain the motor zero position result according to the first step number and the target step number:

[0143] The motor is rotated from the initial mechanical angle to the first actual rotation angle value corresponding to the first step number, the actual rotation angle value is the angle value of the actual rotation of the magnetic pole to be measured during the process from the first rotation to the step number being the first step number;

[0144] Repeatedly control the motor to rotate multiple times in unit electrical angle, so that the motor starts from the actual rotation angle value corresponding to the first step number and completes n rotations, where n is an integer greater than or equal to 1;

[0145] Acquire third rotation data, the third rotation data comprising a plurality of third actual rotation angle values ​​and a plurality of third angle error values ​​corresponding to each of the plurality of magnetic poles in a plurality of rotations;

[0146] Calculate the offset value generated by one rotation of the magnetic pole to be measured in n rotations, the offset value is obtained according to the third rotation data, and obtain the rotation group to be measured according to the minimum offset value;

[0147] Obtaining a third step number, where the third step number is the step number corresponding to the smallest third angle error value among multiple third angle error values ​​in the rotation group to be measured;

[0148] The motor zero position result is obtained according to the third step number and the target step number.

[0149] In a possible implementation, the second determination module 640 is further configured to obtain the motor zero position result according to the optimal step number and the target step number, wherein the target step number is the step number corresponding to the preset zero position:

[0150] The motor zero position calculation value is calculated according to the following first formula: M=A+(AB)*C, where M is the motor zero position calculation value, A is the optimal step number, B is the target step number, and C is the unit electrical angle;

[0151] The calculated motor zero position value is used as the motor zero position result.

[0152] In a possible implementation, the determination module 640 is further used to obtain the motor zero position result according to the optimal step number and the target step number, wherein the target step number is the step number corresponding to the preset zero position:

[0153] The first motor zero position calculation value is calculated according to the following first formula: M=E+(AB)*C, wherein M is the first motor zero position calculation value, E is the actual rotation angle value corresponding to the optimal step number, A is the optimal step number, B is the target step number, and C is the unit electrical angle;

[0154] The second motor zero position calculation value is calculated according to the following second formula: D=M+N, where D is the second motor zero position result, and N is the chip preset zero position;

[0155] The second motor zero position result is used as the motor zero position result.

[0156] It is worth noting that the specific functional implementation of the motor zero position learning device 600 is shown in the above Figure 2 The description of the motor zero position learning method shown in the figure, for example, the control module 610 is used to implement the relevant content of executing S210. The various units or modules in the motor zero position learning device 600 can be respectively or completely combined into one or several other units or modules to constitute, or some (some) of the units or modules can also be divided into multiple smaller units or modules in function to constitute, which can achieve the same operation without affecting the realization of the technical effect of the embodiment of the present invention. The above-mentioned units or modules are divided based on logical functions. In practical applications, the function of one unit (or module) is realized by multiple units (or modules), or the function of multiple units (or modules) is realized by one unit (or module).

[0157] See also Figure 7 , Figure 7 is a schematic diagram of the structure of an electronic device proposed in an embodiment of the present application, such as Figure 7 As shown, the electronic device 700 includes a processor 710 , a memory 720 , a communication interface 730 , and one or more programs 721 . The one or more programs 721 are stored in the memory 720 and are configured to be executed by the processor 710 .

[0158] The processor 710, the memory 720, and the communication interface 730 are connected to each other and perform communication work with each other;

[0159] The memory 720 may be a volatile memory such as a dynamic random access memory DRAM, or a non-volatile memory such as a mechanical hard disk. The memory 720 is used to store a set of executable program codes, and the processor 710 is used to call one or more programs 721 stored in the memory 720, and may execute part or all of the steps of any motor zero position learning method recorded in the above motor zero position learning method embodiment.

[0160] Among them, the electronic device 700 may include smart phones (such as Android phones, iOS phones, Windows Phone phones, etc.), tablet computers, PDAs, driving recorders, vehicle-mounted electronic devices, servers, laptops, mobile Internet electronic devices (MID, Mobile Internet Devices) or wearable electronic devices (such as smart watches, Bluetooth headsets), etc. The above are only examples and not exhaustive, including but not limited to the above electronic devices.

[0161] An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the steps of any method described in the above method embodiments, and the above computer includes an electronic device.

[0162] The embodiment of the present application also provides a computer program product, the computer program product includes a non-transitory computer-readable storage medium storing a computer program, the computer program is operable to cause a computer to execute some or all of the steps of any method described in the method embodiment. The computer program product may be a software installation package, and the computer includes an electronic device.

[0163] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0164] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0165] In the several embodiments provided in the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the above-mentioned units, which is only a logical function division. There may be other division methods in actual implementation, 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 through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

[0166] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0167] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0168] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a memory, including a number of instructions to enable a computer electronic device (which can be a personal computer, electronic device or network electronic device, etc.) to perform all or part of the steps of the above-mentioned methods of each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.

[0169] A person skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable memory, and the memory can include: a flash drive, a read-only memory (English: Read-Only Memory, abbreviated as: ROM), a random access memory (English: Random Access Memory, abbreviated as: RAM), a magnetic disk or an optical disk, etc.

[0170] The embodiments of the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of ​​the present application. At the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A motor zero position learning method, characterized in that: The motor has a plurality of magnetic poles, and the method comprises: Control the motor to rotate multiple times at a unit electrical angle, so that the motor starts from an initial mechanical angle and completes a first rotation, each rotation corresponds to a step number, and the unit electrical angle corresponds to a control strategy of the motor; Acquire first rotation data, the first rotation data comprising a plurality of first actual rotation angle values ​​and a plurality of first angle error values ​​corresponding to each of the plurality of magnetic poles in the plurality of rotations, the first angle error value being obtained by performing error calculation based on the actual rotation angle value; Obtaining the first step number corresponding to the magnetic pole to be measured, wherein the first step number is the step number corresponding to the smallest first angle error value among multiple first angle error values ​​in the first rotation data, and the magnetic pole to be measured is the magnetic pole with the smallest first angle error in the rotation numbered as the first step number; The motor zero position result is obtained according to the optimal step number and the target step number, wherein the optimal step number includes the first step number, and the target step number is the step number corresponding to the preset zero position.

2. The method according to claim 1, characterized in that The optimal step number also includes a second step number, and the motor zero position result is obtained according to the optimal step number and the target step number, and further includes: The motor is rotated from an initial mechanical angle to a first actual rotation angle value corresponding to the first step number, wherein the actual rotation angle value is the angle value of the actual rotation of the magnetic pole to be measured during the process from the first rotation to the step number being the first step number; Repeatingly controlling the motor to rotate multiple times in unit electrical angle, so that the motor starts from the actual rotation angle value corresponding to the first step number and completes the second rotation; Acquire second rotation data, the second rotation data comprising a plurality of second actual rotation angle values ​​and a plurality of second angle error values ​​corresponding to each of the plurality of magnetic poles in the plurality of rotations, the second angle error value being obtained by performing error calculation based on the second actual rotation angle value; Obtaining a second step number corresponding to the first magnetic pole to be measured, wherein the second step number is the step number corresponding to the smallest angle error value among multiple angle error values ​​corresponding to the magnetic pole to be measured in the second rotation data; A motor zero position result is obtained according to the second step number and the target step number.

3. The method according to claim 1, characterized in that The obtaining of the first rotation data comprises: After the motor rotates one step of the unit electrical angle, the first actual rotation angle value of the magnetic pole is recorded, and the step number is recorded; Performing a difference calculation on the first actual rotation angle value corresponding to the step number m+1 and the actual rotation angle value corresponding to the step number m to obtain a longitudinal error value; An error calculation is performed according to the longitudinal error value and the first standard rotation angle value to obtain a first angle error value.

4. The method according to claim 1, characterized in that: The optimal step number also includes a third step number, and the motor zero position result is obtained according to the optimal step number and the target step number, including: The motor is rotated from an initial mechanical angle to a first actual rotation angle value corresponding to the first step number, wherein the actual rotation angle value is the angle value of the actual rotation of the magnetic pole to be measured during the process from the first rotation to the step number being the first step number; Repeatingly controlling the motor to rotate multiple times in unit electrical angle, so that the motor starts from the actual rotation angle value corresponding to the first step number and completes n rotations, where n is an integer greater than or equal to 1; Acquire third rotation data, wherein the third rotation data includes a plurality of third actual rotation angle values ​​and a plurality of third angle error values ​​corresponding to each magnetic pole of the plurality of magnetic poles in the plurality of rotations; Calculating the offset value generated by one rotation of the magnetic pole to be measured in n rotations, wherein the offset value is obtained according to the third rotation data, and obtaining the rotation group to be measured according to the minimum offset value; Obtaining a third step number, wherein the third step number is the step number corresponding to the smallest third angle error value among a plurality of third angle error values ​​in the rotation group to be measured; The motor zero position result is obtained according to the third step number and the target step number.

5. The method according to claim 2 or 4, characterized in that: The motor zero position result obtained according to the optimal step number and the target step number includes: The first motor zero position calculation value is calculated according to the following first formula: M=E+(AB)*C, wherein M is the first motor zero position calculation value, E is the actual rotation angle value corresponding to the optimal step number, A is the optimal step number, B is the target step number, and C is the unit electrical angle; The second motor zero position calculation value is calculated according to the following second formula: D=M+N, where D is the second motor zero position result, and N is the chip preset zero position; The second motor zero position result is used as the motor zero position result.

6. The method according to claim 3, characterized in that After recording the actual rotation angle value of the magnetic pole after each rotation of the motor by the unit electrical angle, and recording the step number step, the method further includes: Determining whether the first actual rotation angle value is within a preset angle threshold range; If the first actual rotation angle value is not within the preset angle threshold range, the motor zero position learning is stopped.

7. The method according to claim 1, characterized in that The motor is a brushless DC motor, and the control strategy of the motor is a six-step square wave control strategy.

8. A motor zero position learning device, characterized in that: The motor has a plurality of magnetic poles, and the device comprises: A control module, used for controlling the motor to rotate multiple times in a unit electrical angle, so that the motor starts from an initial mechanical angle and completes a first rotation, each rotation corresponds to a step number, and the unit electrical angle corresponds to a control strategy of the motor; A first acquisition module is used to acquire first rotation data, wherein the first rotation data includes a plurality of first actual rotation angle values ​​and a plurality of first angle error values ​​corresponding to each magnetic pole in the plurality of rotations, wherein the first angle error value is obtained by performing error calculation based on the actual rotation angle value; A second acquisition module is used to obtain the first step number corresponding to the magnetic pole to be measured, wherein the first step number is the step number corresponding to the smallest first angle error value among multiple first angle error values ​​in the first rotation data, and the magnetic pole to be measured is the magnetic pole with the smallest first angle error in the rotation numbered as the first step number; A determination module is used to obtain a motor zero position result according to an optimal step number and a target step number, wherein the optimal step number includes a first step number, and the target step number is a step number corresponding to a preset zero position.

9. A computer-readable storage medium, characterized in that: A motor zero-position learning program is stored, including execution instructions. When a processor of an electronic device executes the execution instructions, the processor executes the method as claimed in any one of claims 1 to 7.

10. An electronic device, characterized in that: It comprises a processor and a memory storing execution instructions, wherein the memory stores one or more programs; when the processor executes the execution instructions stored in the memory, the processor executes the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Motor zero position detection method and system

    CN109962648A

  • Zero position learning method and device of motor

    CN116915118A

  • Motor control device, method of estimating initial position of magnetic pole of rotor, and image forming apparatus

    US20200266745A1

  • Position estimation method, position estimation device, unmanned transport vehicle, and sewing device

    US20240088808A1

  • Position estimation method, motor control device, and motor system

    WO2020031938A1