Motor zero learning method and related apparatus
By controlling the motor to rotate multiple times in unit electrical angle, obtaining the actual rotation angle and error value of the magnetic pole, and determining the minimum error step number, the problem of large zero-position positioning error of the brushless DC motor is solved, and accurate positioning of the motor zero position and operational reliability are achieved.
Patent Information
- Application Number
- CN202411050779.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2044-07-31
AI Technical Summary
When the structure of a brushless DC motor is not conducive to the installation of Hall elements, it will lead to large zero-position positioning errors of the motor, affecting the motor commutation and torque output, and may even cause the motor to burn out.
By controlling the motor to rotate multiple times in unit electrical angle, the actual rotation angle value and angle error value of each magnetic pole are obtained, the step number corresponding to the minimum error value is determined, and the motor zero position is accurately determined using the optimal step number and the target step number.
In the case that it is not conducive to installing Hall elements, the motor zero position can be accurately determined, positioning errors can be reduced, motor failures can be avoided, and motor operation reliability can be improved.
Smart Images

Figure CN119766002B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of electric machines, in particular to an electric machine zero position learning method and related device. BACKGROUND
[0002] The application range of brushless direct current (BLDC) electric machines has spread to various fields of the national economy and people's daily life. When the electric machine is working, it is necessary to obtain the position of the electric machine rotor. At present, the position of the electric machine 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 electric machine.
[0003] However, there are many types of brushless electric machines, and their structures are different. Due to the different structures of the electric machines, it is very difficult to install Hall elements in some cases. A slight mechanical angle deviation of the position of the Hall elements will cause a very large electrical angle error, that is, it will cause a large error of the zero position of the electric machine, thereby causing the commutation of the electric machine to be advanced or delayed. In this case, the electric machine speed and torque output will not match. In the case of a large load, the electric machine and the control may be burned out.
[0004] The current solutions include two-phase (three-phase) energization positioning method and variable inductance detection positioning method, but they still cause the problems of zero position positioning failure and large error. SUMMARY
[0005] The electric machine zero position learning method and related device provided by the embodiments of the present application can more accurately determine the zero position of the electric machine when the structure of the electric machine is not conducive to the installation of Hall elements.
[0006] In a first aspect, the embodiments of the present application provide an electric machine zero position learning method, the electric machine having a plurality of magnetic poles, and the method comprising:
[0007] controlling the electric machine to rotate multiple times at a unit electrical angle, so that the electric machine starts from an initial mechanical angle and completes a first rotation, each rotation corresponding to a step number, the unit electrical angle corresponding to a control strategy of the electric machine;
[0008] 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 of each magnetic pole in the plurality of magnetic poles corresponding to the multiple rotations, the first angle error values being obtained by error calculation according to the actual rotation angle values;
[0009] acquire a first step number corresponding to a to-be-tested magnetic pole, wherein the first step number is a step number corresponding to a smallest first angle error value in the first rotation data, and the to-be-tested magnetic pole is a magnetic pole with the smallest first angle error in the rotation numbered by the first step number;
[0010] obtain a motor zero position result according to an optimal step number and a target step number, wherein the optimal step number includes the first step number, and the target step number is a step number corresponding to a preset zero position.
[0011] In a second aspect, an embodiment of the present application provides a motor zero position learning device, the motor having a plurality of magnetic poles, and the device comprising:
[0012] a control module configured to control the motor to rotate for a plurality of times at a unit electric angle, so that the motor starts from an initial mechanical angle and completes a first rotation, each rotation corresponding to a step number, and the unit electric angle corresponds to a control strategy of the motor;
[0013] a first acquisition module configured to acquire first rotation data, the first rotation data including a plurality of first actual rotation angle values and a plurality of first angle error values of each magnetic pole in the plurality of magnetic poles in the plurality of rotations, the first angle error values being obtained by error calculation according to the actual rotation angle values;
[0014] a second acquisition module configured to acquire a first step number corresponding to a to-be-tested magnetic pole, wherein the first step number is a step number corresponding to a smallest first angle error value in the first rotation data, and the to-be-tested magnetic pole is a magnetic pole with the smallest first angle error in the rotation numbered by the first step number;
[0015] a determination module configured to obtain a motor zero position result according to an optimal step number and a target step number, wherein the optimal step number includes the 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 programs include instructions for executing part or all of the steps described in the first aspect of the present application.
[0017] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium having stored thereon a computer program. The computer storage medium stores a computer program including program instructions, which, when executed by a processor, cause the processor to perform 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. The above 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 perform some or all of the steps described in the first aspect of the embodiments of the present application. The computer program product can be a software installation package.
[0019] By implementing the embodiments of the present application, the motor is controlled to rotate multiple times at a unit electric angle, so that the motor starts from an initial mechanical angle and completes a first rotation. Each rotation corresponds to a step number. The unit electric angle corresponds to a control strategy of the motor. First rotation data is obtained. The first rotation data includes a plurality of first actual rotation angle values and a plurality of first angle error values of each magnetic pole in the plurality of magnetic poles in the multiple rotations. The first angle error values are obtained by error calculation according to the actual rotation angle values. A first step number corresponding to a to-be-detected magnetic pole is obtained. The first step number is the step number corresponding to the smallest first angle error value in the plurality of first angle error values in the first rotation data. The to-be-detected magnetic pole is the magnetic pole with the smallest first angle error in the rotation numbered as the first step number. A motor zero position result is obtained according to an optimal step number and a target step number. The optimal step number includes the first step number. The target step number is a step number corresponding to a preset zero position. In this way, the motor zero position can be determined more accurately in the case that the structure of the motor is not conducive to the installation of a Hall element, the motor zero position positioning error is reduced, and the motor connection method does not need to be distinguished, so that the zero position determination is more convenient. BRIEF DESCRIPTION OF DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background art, the drawings needed to be used in the embodiments of the present application or the background art will be described below.
[0021] Figure 1 is a system architecture diagram of a motor zero position learning method provided by an embodiment of the present application;
[0022] Figure 2 is a flowchart of a motor zero position learning method provided by an embodiment of the present application;
[0023] Figure 3 is a scene diagram of a motor zero position learning method provided by an embodiment of the present application;
[0024] Figure 4 is a flow diagram of another motor zero position learning method provided by an embodiment of the present application;
[0025] Figure 5 is a flow diagram of another motor zero position learning method provided by an embodiment of the present application;
[0026] Figure 6 is a structural diagram of a motor zero position learning device provided by an embodiment of the present application;
[0027] Figure 7 is a structural diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0028] In order to enable persons skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by persons skilled in the art without creative work fall within the scope of protection of the present application.
[0029] The terms "first", "second", and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish different objects, and are not used to describe a specific order. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. 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 not listed, or in an optional example, also includes other steps or units inherent to the process, method, product, or electronic device.
[0030] In this document, reference to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the application. The appearance of the phrase in various places in the specification does not necessarily all refer to the same embodiment, nor does it necessarily refer to a particular alternative embodiment. It will be explicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0031] Please refer to Figure 1 , Figure 1 is a system architecture diagram of a motor zero position learning method provided by an embodiment of the present application, as shown in 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 the inside of the stator 110 is wound with a plurality of windings, which are connected to an external AC power supply, and the entire motor stator 110 is fixed.
[0033] The motor rotor 120 is a component of the motor, and the motor rotor 120 has a plurality of pairs of magnetic poles, each pair of magnetic poles having an N pole and an S pole.
[0034] The magnetic ring 140 can be a pair of magnetic rings with N and S poles, and the magnetic ring 140 can be used to sense the initial mechanical angle of the motor. The magnetic ring 140 can have a connection relationship with the programmable element 130, and the initial mechanical angle of the motor sensed by the magnetic ring 140 can be obtained by the programmable element 130.
[0035] The programmable element 130 can be a programmable chip or other programmable electronic device, and the like, which is not limited here. The programmable element 130 can be used for motor zero position learning, and the programmable element 130 is built-in with a zero position learning program.
[0036] The Hall sensor 150 is used to record the position of the rotor when the motor is running, detect the commutation position of the motor, and for a three-phase brushless DC motor, three Hall sensors can detect six commutation positions.
[0037] Please refer to Figure 2 , Figure 2 is a flowchart of a motor zero position learning method provided by the embodiment of the application, as Figure 2 shown, the method comprises the following steps:
[0038] S210, control the motor to rotate for multiple times at a unit electrical angle, so that the motor starts from the initial mechanical angle and completes a 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, the motor is kept in a continuous energization but non-reversing state.
[0040] Wherein, first, the initial mechanical angle is acquired, and then the motor in the programmable element is controlled by program to rotate for a fixed electrical angle for multiple times, the number of times of rotation for multiple times is related to the unit electrical angle, and the number of times is equal to the number of unit electrical angles in 360 degrees. The fixed electrical angle is the unit electrical angle, and the unit electrical angle does not refer to 1 degree electrical angle, but is related to the control strategy of the motor. The control strategy of the motor can be a square wave control strategy, and the unit electrical angle is obtained based on the square wave control strategy. The motor rotates for multiple times at the unit electrical angle to complete the rotation of a mechanical angle of 360 degrees. Each rotation corresponds to a step number, and the step number is used for subsequent learning process. The square wave control strategy can adopt a fixed duty cycle of 25% and a fixed commutation energizing time of 1 second.
[0041] Wherein, the process of acquiring the initial mechanical angle can be: powering on the motor to start running, then monitoring the signal of the magnetic ring, using appropriate circuits or devices to monitor the output signal of the magnetic ring, which can be pulses, digital signals, etc., indicating the position of the rotor, and the specific method is not limited here; then determining the initial position of the rotor according to the signal of the magnetic ring, which can be achieved through a specific algorithm or logic; finally, calculating the initial mechanical angle. Once the initial position is determined, the initial mechanical angle can be calculated according to the number of pole pairs of the motor and the installation position of the Hall sensor. The specific method of acquiring the initial mechanical angle can be other methods, which are not limited here.
[0042] Wherein, each magnetic pole has a magnetic pole number, such as magnetic pole 1, magnetic pole 2, etc. The step number starts from magnetic pole 1, and then 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 respectively. The step number of magnetic pole 2 continues to be numbered in sequence with the step number of magnetic pole 1.
[0043] Wherein, please refer to Figure 3 , Figure 3 A scene diagram of a motor zero position learning method provided by the embodiment is shown in Figure 3 , assuming that the dashed line represents the initial mechanical angle of the motor, and the motor starts from the initial mechanical angle and completes the first rotation, which can be from Figure 3 (a) state to rotate clockwise or counterclockwise, and finally walk through the target mechanical angle of 360 degrees from (a) to (b) to (c). Wherein, the (c) state is the position after completing a mechanical angle rotation, which can be theoretically 360 degrees, and actually the (c) state can be different from the (a) state, and the angle has an error.
[0044] In a possible embodiment, the motor is a brushless direct current motor, and the control strategy of the motor is a six-step square wave control strategy.
[0045] For example, if the motor is a two-by-two energized motor with 6 MOS tubes, the installation position of the Hall sensor is 120 degrees, and the motor has 14-pole electrodes, that is, 7 pairs of poles, and the square wave control strategy is adopted, the following is obtained by calculation That is, the unit electric angle is 360 / 6 = 60. When the motor rotates one mechanical angle, a plurality of groups of data of each pair of electrodes are obtained, each group of data has a step number, and finally complete data from 0 to 41 of the step number is obtained.
[0046] For example, if the motor is a three-by-three energized motor with 6 MOS tubes, the installation position of the Hall sensor is 30 degrees, and the motor has 14-pole electrodes, that is, 7 pairs of poles, and the square wave control strategy is adopted, the following is obtained by calculation That is, the unit electric angle is 360 / 6 = 60. When the motor rotates one mechanical angle, a plurality of groups of data of each pair of electrodes are obtained, each group of data has a step number, and finally complete data from 0 to 41 of the step number is obtained.
[0047] S220, obtaining first rotation data, the first rotation data including a plurality of magnetic poles, each magnetic pole corresponding to a plurality of first actual rotation angle values and a plurality of first angle error values in a plurality of rotations, the first angle error value being obtained by error calculation according to the actual rotation angle value.
[0048] The first rotation data is a plurality of groups of data of each pair of electrodes obtained when the motor rotates one mechanical angle, each group of data can include a first actual rotation angle value corresponding to each rotation and a plurality of first angle error values, and can also include other data, such as a standard rotation angle value. The above-mentioned standard rotation angle value is a standard angle value that each magnetic pole should rotate in a plurality of rotations, which can also be understood as a target rotation angle value. The above-mentioned first actual rotation angle value is an electric angle value actually rotated by each pair of electrodes in each unit electric angle rotation generated by the first rotation. In actual application, it can have a certain error with the standard rotation angle value. The first angle error value is a calculated error value obtained by error calculation according to the first actual rotation angle value and the standard rotation angle value, that is, the above-mentioned error calculation.
[0049] In one possible embodiment, recording a plurality of first actual rotation angle values and a plurality of first angle error values of each step rotation of the magnetic pole includes: recording the first actual rotation angle value of the magnetic pole after the motor rotates one unit electric angle, and recording the step number; calculating the difference 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; and performing error calculation according to the longitudinal error value and the standard rotation angle value to obtain the first angle error value.
[0050] The error calculation process can be: the actual rotation angle value of the same magnetic pole, the step number m+1 is subtracted from the actual rotation angle value of the step number n with 360 degrees as the increment, the longitudinal error value of m+1 steps is obtained, then the actual angle error value of m+1 steps is added to 60 degrees, and the first angle error value is obtained. Wherein, the above-mentioned m is a positive integer greater than or equal to 1.
[0051] For example, if the actual rotation angle value of the step number 1 of the magnetic pole 1 is 309.1, and the actual rotation angle value of the step number 0 is 7.8 degrees, the longitudinal error is (309.1-360)-7.8=-58.7, and then-58.7+60=1.3, which is the first angle error value of the step number 1. If the actual rotation angle value of the step number 2 of the magnetic pole 1 is 253.5, and the actual rotation angle value of the step number 1 is 309.1 degrees, the longitudinal error is 253.5-309.1=-55.6, and then-55.6+60=4.4, which is the first angle error value of the 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, the longitudinal error is 195.7-253.5=-57.8, and then-57.8+60=2.2, which is the first angle error value of the step number 3.
[0052] S230, obtaining the first step number corresponding to the to-be-measured magnetic pole, wherein the first step number is the step number corresponding to the smallest first angle error value in the first angle error value in the first rotation data, and the to-be-measured magnetic pole is the magnetic pole with the smallest first angle error in the rotation numbered as the first step number.
[0053] Wherein, all the first angle error values of the complete first rotation data are traversed to obtain the smallest first angle error value, and then the first step number corresponding to the smallest first angle error value is obtained, which is considered as the first step number, and the magnetic pole corresponding to the step is considered as the to-be-measured magnetic pole.
[0054] For example, if the smallest first angle error value of all 42 data is 0.1 after traversal, the first step number corresponding to the first angle error value 0.1 is 39, and the corresponding magnetic pole is magnetic pole 7, then the to-be-measured magnetic pole is magnetic pole 7, and the first step number is 39.
[0055] S240, obtaining the motor zero 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.
[0056] For example, the motor starts from an initial mechanical angle, and during the process of completing the first rotation, the motor reaches the preset zero position after rotating 3 times, and the target step number of the motor is 3 at this time.
[0057] In a possible embodiment, the optimal step number further comprises a second step number, the motor zero position result is obtained according to the optimal step number and the target step number, and the motor is further rotated from the initial mechanical angle to a first actual rotation angle value corresponding to the first step number, and the actual rotation angle value is an angle value actually rotated by the measured magnetic pole during the process of rotating from the first rotation to the step number being the first step number.
[0058] In the embodiment, the electrode is rotated to the actual rotation angle value corresponding to the first step number after the first step number corresponding to the measured magnetic pole and the measured magnetic pole are obtained, and then subsequent operations are performed on this basis.
[0059] In the embodiment, a square wave control strategy is used during the rotation, and specifically, the fixed duty ratio of the square wave control strategy can be 25%, and the fixed commutation energization time can be 1 second.
[0060] 421、repeatedly control the motor to rotate multiple times at a unit electric angle, so that the motor completes the second rotation starting from the actual rotation angle value corresponding to the first step number.
[0061] In the embodiment, the motor remains in a continuous energization but non-commutation state during the rotation. In the embodiment, a square wave control strategy is used during the rotation, and specifically, the fixed duty ratio of the square wave control strategy can be 25%, and the fixed commutation energization time can be 1 second.
[0062] In the embodiment, the motor is rotated by a second mechanical angle starting from the actual rotation angle value corresponding to the first step number, and the operation of the first rotation is repeated, and each rotation corresponds to a step number.
[0063] In the embodiment, repeatedly controlling the motor to rotate multiple times at a unit electric angle can mean repeating once, twice, or more than twice, such as three times or four times, which is not limited herein.
[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 magnetic pole in the plurality of magnetic poles in the multiple rotations, the second angle error values being obtained by error calculation according to the second actual rotation angle values.
[0065] The second rotation data is a plurality of groups of data of each pair of electrodes obtained when the motor starts to rotate a mechanical angle of 360 degrees at the actual rotation angle value corresponding to the first step number, each group of data can include the actual rotation angle value and the second angle error value corresponding to each rotation, and can also include other data such as the second standard rotation angle value. The above-mentioned second standard rotation angle value is the standard angle value corresponding to each magnetic pole in a plurality of rotations, which can also be understood as a second target rotation angle value. The above-mentioned second actual rotation angle value is the electrical angle value actually rotated by each pair of electrodes in each unit electrical angle rotation. In actual application, it may have a certain error with the second standard rotation angle value. The second angle error value is a 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-mentioned error calculation.
[0066] 441、Obtain the second step number corresponding to the to-be-tested magnetic pole. The second step number is the step number corresponding to the smallest angle error value in the plurality of angle error values corresponding to the to-be-tested magnetic pole.
[0067] Wherein, after rotation, all angle error values generated in the second rotation are obtained, and then the angle error values corresponding to the to-be-tested magnetic pole are compared in size to obtain the smallest error value as the second angle error value. The step number corresponding to the second angle error value is the second step number.
[0068] In a possible embodiment, recording a plurality of actual rotation angle values and second angle error values of each step of the magnetic pole includes: recording the second actual rotation angle value of the magnetic pole after the motor rotates one unit electrical angle, and recording the step number; calculating the difference 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 the second longitudinal error value; and calculating the error according to the second longitudinal error value and the second standard rotation angle value to obtain the second angle error value.
[0069] Wherein, the error calculation process can be: the actual rotation angle value of the same magnetic pole with step number m+1 and the actual rotation angle value with step number n are subtracted with 360 degrees as the carry to obtain the longitudinal error value of m+1 steps, and then the actual angle error value of m+1 steps is added by 60 degrees. The obtained is the first angle error value.
[0070] Wherein, all second angle error values of the complete second rotation data are traversed to obtain the smallest second angle error value, and then the step number corresponding to the smallest second angle error value is obtained. This step number is considered as the first step number, and the magnetic pole corresponding to this step rotation is considered as the to-be-tested magnetic pole.
[0071] 451、According to the second step number and the target step number, obtain the motor zero result.
[0072] The second step number obtained in the second rotation is numbered as the optimal step number, and the optimal step number is a step number that can be used for the next operation.
[0073] The target step number is a target step number preset by the motor, and the motor zero position is determined based on the target step number and the calculated optimal step number.
[0074] In a possible embodiment, if the S240 step is repeated 2 or more times, the optimal step number further includes a third step number, and the motor zero position is obtained according to the optimal step number and the target step number. The method comprises:
[0075] 412, rotating the motor from the initial mechanical angle to a first actual rotation angle value corresponding to the first step number, and the actual rotation angle value is the angle value actually rotated by the measured magnetic pole from the first rotation to the step number being the first step number.
[0076] The magnetic pole is rotated to the actual rotation angle value corresponding to the first step number, and then subsequent operations are performed on this basis.
[0077] The square wave control strategy is used during rotation, and specifically, the fixed duty ratio of the square wave control strategy can be 25%, and the fixed commutation energization time can be 1 second.
[0078] 422, repeatedly controlling the motor to rotate by a unit electrical angle to complete n rotations starting from the actual rotation angle value corresponding to the first step number, wherein n is an integer greater than or equal to 1.
[0079] During rotation, the motor remains in a continuous energization but non-commutation state. The square wave control strategy is used during rotation, and specifically, the fixed duty ratio of the square wave control strategy can be 25%, and the fixed commutation energization time can be 1 second.
[0080] The motor is rotated from the actual rotation angle value corresponding to the first step number to complete m rotations, and the operation of the first rotation is repeated every rotation, and each rotation corresponds to a step number.
[0081] The motor is controlled to complete n rotations by a unit electrical angle, which can be one rotation or more, such as three rotations, four rotations, five rotations, without limitation.
[0082] 432, obtaining third rotation data, the third rotation data including a plurality of third actual rotation angle values and a plurality of third angle error values corresponding to each magnetic pole in the plurality of magnetic poles in the plurality of rotations.
[0083] The third rotation data is a plurality of groups of data of each pair of electrodes obtained when the motor starts to rotate a mechanical angle of one revolution at the actual rotation angle value corresponding to the first step number, each group of data can include the actual rotation angle value and the second angle error value corresponding to each rotation, and can also include other data such as the third standard rotation angle value. The third standard rotation angle value is the standard angle value corresponding to each magnetic pole in a plurality of rotations, which can also be understood as the third target rotation angle value. The third actual rotation angle value is the electrical angle value actually rotated by each pair of electrodes in each unit electrical angle rotation. In actual application, it can have a certain error with the third standard rotation angle value. The third angle error value is a 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 error calculation.
[0084] 442, calculate the offset value generated by each week rotation of the to-be-tested magnetic pole in n revolutions, the offset value is obtained according to the third rotation data, and the to-be-tested rotation group is obtained according to the smallest offset value.
[0085] The offset value is calculated according to the third rotation data of the to-be-tested magnetic pole every week. For example, the offset value of each week rotation can be calculated by calculating a plurality of lateral error values according to the actual rotation angle value and the standard value generated by the to-be-tested magnetic pole, and then calculating the lateral variance according to the plurality of lateral error values. The lateral variance is used as the offset value.
[0086] For example, after the magnetic pole 1 rotates one revolution, 6 actual rotation angle values are obtained. The 6 actual rotation angle values are respectively subtracted from the standard value to obtain 6 lateral error values. The lateral variance is obtained by calculating the variance of the 6 lateral error values. The lateral variance is used as the offset value.
[0087] 452, obtain the third step number, which is the step number corresponding to the smallest third angle error value in the plurality of third angle error values in the to-be-tested rotation group.
[0088] After rotation, all angle error values generated by the to-be-tested rotation group in the n th rotation are obtained. Then, the angle error values corresponding to the to-be-tested magnetic pole in the to-be-tested rotation group are compared in size to obtain the smallest error value as the third angle error value. The step number corresponding to the third angle error value is the third step number.
[0089] 462, obtain the motor zero 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 a first motor zero position calculation value according to a first formula: M=E+(A-B)*C, where E is an 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 a unit electric angle; calculating a second motor zero position calculation value according to a second formula: D=M+N, where D is the second motor zero position result, and N is a chip preset zero position; and taking the second motor zero position result as the motor zero position result.
[0091] The second formula calculation can also be D=M-N.
[0092] In the first motor zero position calculation based on the optimal step number and the target step number preset by the motor, the calculated first motor zero position is an electric angle relative to the coordinate position of the programmable element, considering the volume of the programmable element. The obtained motor zero position in the programmable element coordinate system also needs to be standardized, and the standardization is to convert the motor zero position in the programmable element coordinate system.
[0093] The conversion method can be: obtaining a chip preset zero position of the programmable element, and then calculating the first motor zero position calculation value obtained and the chip preset zero position to obtain a second motor zero position calculation value. The second motor zero position calculation value is the final motor zero position obtained by the programmable element.
[0094] It can be seen that in the embodiment, the motor is controlled to rotate multiple times at a unit electric angle, so that the motor starts from an initial mechanical angle and completes a first rotation, each rotation corresponds to a step number, the unit electric angle corresponds to a control strategy of the motor, first rotation data is obtained, the first rotation data includes a plurality of first actual rotation angle values and a plurality of first angle error values of each magnetic pole in the plurality of magnetic poles in the multiple rotations, the first angle error value is obtained by error calculation according to the actual rotation angle value, and a first step number corresponding to a to-be-measured magnetic pole is obtained, where the first step number is a step number corresponding to a smallest first angle error value in the plurality of first angle error values in the first rotation data, the to-be-measured magnetic pole is a magnetic pole with the smallest first angle error in the rotation numbered the first step number, a motor zero position result is obtained according to an optimal step number and a target step number, the optimal step number includes the first step number, and the target step number is a step number corresponding to a preset zero position. In this way, the motor zero position can be determined more accurately in the case that the structure of the motor is not conducive to the installation of the Hall element, the motor zero position positioning error is reduced, and the motor connection method does not need to be distinguished, so that the zero position determination is more convenient.
[0095] In a possible embodiment, after recording the actual rotation angle value of the magnetic pole after each step unit electrical angle of the motor, and recording the step number, the method further comprises: 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] The preset angle threshold range is artificially set, and the preset angle threshold range can be ±70°. When the actual rotation angle value exceeds the preset angle threshold range, the motor magnetic ring structure or the motor rotor structure may be incorrect, and in this case, the motor zero position learning is stopped.
[0097] It can be seen that, in the 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, so that the motor zero position learning in the case of large error is avoided, the case of large zero position error is avoided, and the zero position error is reduced.
[0098] Please refer to Figure 4 , Figure 4 Another motor zero position learning method provided in the embodiment of the application is shown in a flowchart as shown in Figure 4 , the method comprises:
[0099] S410, the motor is controlled to rotate for multiple times at a unit electrical angle, so that the motor completes a first rotation from an initial mechanical angle, and each rotation corresponds to a step number, and the unit electrical angle corresponds to a control strategy of the motor.
[0100] S420, determining 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 ended. If the first actual rotation angle value is within the preset angle threshold range, S430 is executed.
[0102] S430, obtaining 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 magnetic pole in the multiple rotations, and the first angle error value being obtained by error calculation according to the actual rotation angle value.
[0103] S440, obtaining a first step number corresponding to the to-be-measured magnetic pole, wherein the first step number is a step number corresponding to the smallest first angle error value in the plurality of first angle error values in the first rotation data.
[0104] S450, rotating the motor from the initial mechanical angle to an actual rotation angle value corresponding to the first step number.
[0105] S460, the motor is controlled to rotate for multiple times by a unit electric angle, so that the motor completes N rotations starting from the actual rotation angle value corresponding to the first step number, where N is a positive integer greater than or equal to 1.
[0106] S470, the Nth rotation data is obtained, and the Nth step number corresponding to the Nth to-be-detected magnetic pole is obtained, the Nth rotation data includes multiple Nth actual rotation angle values and multiple Nth angle error values of each magnetic pole in the multiple rotations, and the Nth step number is the magnetic pole corresponding to the minimum Nth angle error value in the Nth rotation data.
[0107] S480, the offset value generated by each rotation of the to-be-detected magnetic pole in N rotations is calculated, the offset value is obtained according to the Nth rotation data, and the to-be-detected rotation group is obtained according to the minimum offset value.
[0108] S490, the Nth step number is obtained, the Nth step number is taken as the optimal step number, and the Nth step number is the step number corresponding to the minimum Nth angle error value in the multiple Nth angle error values in the to-be-detected rotation group.
[0109] S4100, a first motor zero calculation value is calculated according to a first formula: M = E + (A-B) * C, where E is an actual rotation angle value corresponding to an optimal step number, M is a motor zero calculation value, A is an optimal step number, B is a target step number, and C is a unit electric angle; and the motor zero calculation value is taken as a first motor zero result.
[0110] S4110, a second motor zero calculation value is calculated according to a second formula: D = M + N, where D is a second motor zero result, and N is a chip preset zero; and the second motor zero result is taken as a motor zero result.
[0111] The specific explanations of the above steps are the same as those of S210 to S240 in the foregoing embodiments, and refer to the descriptions of S210 to S240, which will not be repeated here.
[0112] It can be seen that in the embodiment, the motor is controlled to rotate multiple times at a unit electric angle, so that the motor starts from an initial mechanical angle and completes a first rotation, each rotation corresponds to a step number, the unit electric angle corresponds to a control strategy of the motor, first rotation data is obtained, the first rotation data includes multiple first actual rotation angle values and multiple first angle error values of each magnetic pole in multiple rotations, the first angle error values are obtained by error calculation according to the actual rotation angle values, and a first step number corresponding to a to-be-measured magnetic pole is obtained, wherein the first step number is a step number corresponding to a smallest first angle error value in the multiple first angle error values in the first rotation data, the to-be-measured magnetic pole is a magnetic pole with the smallest first angle error in the rotation numbered the first step number, a motor zero position result is obtained according to an optimal step number and a target step number, the optimal step number includes the first step number, and the target step number is a step number corresponding to a preset zero position. In this way, the motor zero position can be determined more accurately in the case that the structure of the motor is not conducive to the installation of the Hall element, the motor zero position positioning error is reduced, and the motor connection method does not need to be distinguished, so that the zero position determination is more convenient.
[0113] In a possible embodiment, referring to Figure 5 , Figure 5 Another motor zero position learning method provided by the embodiment of the application is shown in a flowchart as Figure 5 shown, if the installation position of the Hall sensor of the motor is 30 degrees, the motor has 6 MOS tubes and the MOS tubes are powered on in pairs, then:
[0114] S510, the motor is controlled to rotate multiple times at a unit electric 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 electric angle corresponds to a control strategy of the motor.
[0115] S520, it is judged 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 ended. If the first actual rotation angle value is within the preset angle threshold range, the step S530 is executed.
[0117] S530, first rotation data is obtained, the first rotation data includes multiple first actual rotation angle values and multiple first angle error values of each magnetic pole in multiple rotations, and the first angle error values are obtained by error calculation according to the actual rotation angle values.
[0118] S540, a first step number corresponding to a to-be-measured magnetic pole is obtained, wherein the first step number is a step number corresponding to a smallest first angle error value in the multiple first angle error values in the first rotation data.
[0119] S550, rotate the motor from the initial mechanical angle to the actual rotation angle value corresponding to the first step number.
[0120] S560, repeat N times to control the motor to rotate by a unit electric angle, so that the motor completes N rotations starting from the actual rotation angle value corresponding to the first step number, wherein 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 a plurality of Nth actual rotation angle values and a plurality of Nth angle error values corresponding to each magnetic pole in the plurality of magnetic poles in the plurality of rotations, and the Nth step number is the magnetic pole corresponding to the smallest Nth angle error value in the Nth rotation data.
[0122] S580, calculate the offset value generated by each rotation of the magnetic pole to be measured in N rotations, the offset value is obtained according to the Nth rotation data, and the measured rotation group is obtained according to the smallest offset value.
[0123] S590, obtain the Nth step number, take the Nth step number as the optimal step number, and the Nth step number is the step number corresponding to the smallest Nth angle error value in the plurality of Nth angle error values in the measured rotation group. S5100, calculate the first motor zero calculation value according to the following first formula: M = E + (A-B) * C, wherein M is the motor zero 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 electric angle; and the motor zero calculation value is taken as the first motor zero result.
[0124] S5110, calculate the second motor zero calculation value according to the following second formula: D = M + N, wherein D is the second motor zero result, and N is the chip preset zero.
[0125] S5120, calculate the third motor zero calculation value according to the following third formula: F = D ± 30, wherein F is the third motor zero calculation value, and the third motor zero result is taken as the motor zero result.
[0126] Wherein, the above Figure 5 The specific explanation of the steps S510 to S5110 in the embodiment is the same as the specific explanation of the steps in the foregoing Figure 4 Embodiment, see the description of the specific explanation of the steps in the Figure 4 Embodiment, which will not be repeated here.
[0127] It can be seen that in the embodiment, the 30 degrees are added and subtracted on the basis of the motor zero output method of the foregoing embodiment, and the motor zero output scheme is expanded to other motor Hall sensor installation angle cases. In this way, the motor zero position can be determined more accurately in the case that the structure of the motor is not conducive to the installation of the Hall element, the motor zero positioning error is reduced, the motor connection method does not need to be distinguished, the zero position determination is more convenient, the calculation method of other angle values is increased, and the application scenarios are more extensive.
[0128] See Figure 6 , Figure 6 is a structural schematic diagram of a motor zero learning device provided by the embodiment of the present application. As shown in Figure 6 , the motor zero learning device 600 comprises 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 configured to control the motor to rotate multiple times at a unit electric angle, so that the motor completes a first rotation from an initial mechanical angle, and each rotation corresponds to a step number. The unit electric angle corresponds to the control strategy of the motor.
[0130] The first acquisition module 620 is configured to acquire first rotation data. The first rotation data comprises a plurality of first actual rotation angle values and a plurality of first angle error values of each magnetic pole in the plurality of magnetic poles in multiple rotations. The first angle error value is obtained by error calculation according to the actual rotation angle value.
[0131] The second acquisition module 630 is configured to acquire a first step number corresponding to a to-be-measured magnetic pole. The first step number is a step number corresponding to the smallest first angle error value in the plurality of first angle error values in the first rotation data. The to-be-measured magnetic pole 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 configured to obtain a motor zero result according to an optimal step number and a target step number. The optimal step number comprises the first step number. The target step number is a step number corresponding to a preset zero position.
[0133] In a possible implementation, the first acquisition module 620, in terms of acquiring the first rotation data, is specifically configured to:
[0134] record the actual rotation angle value of the magnetic pole after the motor rotates one unit electric angle, and record the step number;
[0135] perform 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;
[0136] The error is calculated according to the longitudinal error value and the standard rotation angle value, and a first angle error value is obtained.
[0137] In a possible implementation, the second determining module 640 is specifically configured to:
[0138] rotating the motor from the 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 actually rotated by the to-be-measured magnetic pole from the first rotation to the step number being the first step number;
[0139] repeatedly controlling the motor to rotate for multiple times by a unit electric angle, so that the motor starts from the actual rotation angle value corresponding to the first step number and completes a second rotation;
[0140] obtaining second rotation data, the second rotation data including multiple second actual rotation angle values corresponding to each magnetic pole in the multiple rotations and multiple second angle error values, the second angle error value being obtained by error calculation according to the second actual rotation angle value;
[0141] obtaining a second step number corresponding to the to-be-measured magnetic pole, the second step number being a step number corresponding to a smallest angle error value in the multiple angle error values corresponding to the to-be-measured magnetic pole in the second rotation data;
[0142] In a possible implementation, the second determining module 640 is specifically configured to:
[0143] rotating the motor from the 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 actually rotated by the to-be-measured magnetic pole from the first rotation to the step number being the first step number;
[0144] repeatedly controlling the motor to rotate for multiple times by a unit electric 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] obtaining third rotation data, the third rotation data including multiple third actual rotation angle values corresponding to each magnetic pole in the multiple rotations and multiple third angle error values;
[0146] calculating an offset value generated by each rotation of the to-be-measured magnetic pole in the n rotations, the offset value being obtained according to the third rotation data, and obtaining a to-be-measured rotation group according to the smallest offset value;
[0147] obtain a third step number, the third step number being a step number corresponding to a third angle error value that is the smallest among the plurality of third angle error values in the to-be-tested rotation group;
[0148] obtain a motor zero position result according to the third step number and the target step number.
[0149] In a possible implementation, the second determining module 640 is specifically configured to:
[0150] calculate the motor zero position calculation value according to a first formula: M = A + (A-B)*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 a unit electric angle;
[0151] take the motor zero position calculation value as the motor zero position result.
[0152] In a possible implementation, the determining module 640 is specifically configured to:
[0153] calculate the first motor zero position calculation value according to a first formula: M = E + (A-B)*C, where M is the first motor zero position calculation value, E is an 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 a unit electric angle;
[0154] calculate the second motor zero position calculation value according to a second formula: D = M + N, where D is the second motor zero position result, and N is a chip preset zero position;
[0155] take the second motor zero position result as the motor zero position result.
[0156] It is worth pointing out that the specific functional implementation of the motor zero position learning device 600 is described above, for example, the control module 610 is configured to implement the related content of S210. The various units or modules in the motor zero position learning device 600 can be combined into one or several other units or modules respectively or entirely, or some of the units or modules therein can be further split into a plurality of units or modules that are functionally smaller to constitute, which can achieve the same operation without affecting the implementation of the technical effects of the embodiments of the present application. The above units or modules are divided based on logical functions, and in actual application, the functions of one unit (or module) are implemented by a plurality of units (or modules), or the functions of a plurality of units (or modules) are implemented by one unit (or module). Figure 2 The specific functional implementation of the motor zero position learning device 600 is described above, for example, the control module 610 is configured to implement the related content of S210. The various units or modules in the motor zero position learning device 600 can be combined into one or several other units or modules respectively or entirely, or some of the units or modules therein can be further split into a plurality of units or modules that are functionally smaller to constitute, which can achieve the same operation without affecting the implementation of the technical effects of the embodiments of the present application. The above units or modules are divided based on logical functions, and in actual application, the functions of one unit (or module) are implemented by a plurality of units (or modules), or the functions of a plurality of units (or modules) are implemented by one unit (or module).
[0157] Please refer to Figure 7 , Figure 7 is a structural schematic diagram of an electronic device, as shown in Figure 7 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 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 complete the communication work between each other.
[0159] The memory 720 can 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 can execute part or all of the steps of any motor zero position learning method as described in the motor zero position learning method embodiments.
[0160] The electronic device 700 can include a smart phone (such as an Android phone, an iOS phone, a Windows Phone, etc.), a tablet computer, a palm computer, a vehicle event data recorder, a vehicle-mounted electronic device, a server, a notebook computer, a mobile Internet device (MID), or a wearable electronic device (such as a smart watch, a Bluetooth headset), etc. The above are only examples and are not exhaustive, and include but are not limited to the above electronic devices.
[0161] The embodiments of the present application also provide a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, and the computer program causes a computer to execute part or all of the steps of any method as described in the method embodiments, and the computer includes an electronic device.
[0162] The embodiments of the present application also provide a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute part or all of the steps of any method as described in the method embodiments. The computer program product can be a software installation package, and the computer includes an electronic device.
[0163] It should be noted that, for the foregoing method embodiments, the sequences of the described actions can be modified, and certain actions can be performed simultaneously or in different sequences. In addition, the embodiments described in the specification are 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 focus, and the parts not described in detail in a certain embodiment can be referred to the relevant description of other embodiments.
[0165] In the several embodiments provided by the present application, it should be understood that the disclosed apparatus can be implemented in other manners. For example, the division of the units is merely a logical function division, and there can be another division manner in actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections between different units, or the among different units, can be indirect couplings or communication connections through some interfaces, devices or units, and can be in electrical, mechanical or other forms.
[0166] The units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, i.e., can be located in one place or distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purposes of the embodiments.
[0167] In addition, each functional unit in the embodiments of the present application can be integrated in a processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be implemented in the form of hardware or software functional units.
[0168] If the above integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer readable memory. Based on this understanding, the technical solutions of the present application essentially or the part of the prior art that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a memory and includes a plurality of instructions for causing a computer electronic device (which can be a personal computer, an electronic device or a network electronic device, etc.) to execute all or part of the steps of the above-mentioned method of each embodiment of the present application. The aforementioned memory includes: a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk and various program code storage media.
[0169] A person of ordinary skill in the art can understand that all or part of the steps in the above-mentioned embodiments can be completed by programs instructing relevant hardware, and the programs can be stored in a computer readable memory, which can include a flash disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0170] The embodiments of the present application are described in detail above, and the principles and implementation manners of the present application are described by applying specific examples. The above description of the embodiments is only used to help understand the method of the present application and its core idea; at the same time, for those skilled in the art, according to the idea of the present application, the specific implementation manner and application range will be changed, and the above description of the embodiments is not used to limit 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 includes: Controlling the motor to rotate multiple times at a unit electrical angle so that the motor completes a first rotation starting from an initial mechanical angle, each rotation corresponding to a step number, wherein the unit electrical angle corresponds to a control strategy of the motor; Acquire 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 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 by 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 obtaining the motor zero position result according to the optimal step number and the target step number also includes: 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 the angle value of the magnetic pole to be measured that is actually rotated from the first rotation to the step number being the first step number; Repeatedly controlling the motor to rotate multiple times by a unit electrical angle, so that the motor completes a second rotation starting from the actual rotation angle value corresponding to the first step number; Acquire second rotation data, the second rotation data including 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, 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; 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 includes: Each time the motor rotates by 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 based on 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, wherein The optimal step number also includes a third step number, and obtaining the motor zero position result according to the optimal step number and the target step number includes: 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 the angle value of the magnetic pole to be measured that is actually rotated from the first rotation to the step number being the first step number; Repeatedly controlling the motor to rotate multiple times per unit electrical angle so that the motor completes n rotations starting from the actual rotation angle value corresponding to the first step number, where n is an integer greater than or equal to 1; 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 the plurality of rotations; Calculating an 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 a rotation group to be measured according to the minimum offset value; Obtaining a third step number, where the third step number is the step number corresponding to the smallest third angle error value among the plurality of third angle error values in the rotation group to be measured; A 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, where 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 and recording the step number after each rotation of the motor by the unit electrical angle, 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, configured to control the motor to rotate multiple times in a unit electrical angle so that the motor completes a first rotation starting from an initial mechanical angle, each rotation corresponding to a step number, wherein the unit electrical angle corresponds to a control strategy of the motor; a first acquisition module, configured to 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 values being obtained by performing error calculation based on the actual rotation angle values; a second acquisition module, configured to acquire a first step number corresponding to a magnetic pole to be measured, wherein the first step number is the step number corresponding to a minimum first angle error value among a plurality of first angle error values in the first rotation data, and the magnetic pole to be measured is the magnetic pole with the minimum first angle error in the rotation numbered by the first step number; The determination module is used to obtain the motor zero position result 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.
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 according to any one of claims 1 to 7.
10. An electronic device, characterized in that: The method 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
Zero position learning method and device of motor
CN116915118A
Position estimation method, motor control device, and motor system
WO2020031938A1