CN112104288B - Method for measuring offset angle - Google Patents

Method for measuring offset angle Download PDF

Info

Publication number
CN112104288B
CN112104288B CN202010986017.4A CN202010986017A CN112104288B CN 112104288 B CN112104288 B CN 112104288B CN 202010986017 A CN202010986017 A CN 202010986017A CN 112104288 B CN112104288 B CN 112104288B
Authority
CN
China
Prior art keywords
electromotive force
hall
sum
angle
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010986017.4A
Other languages
Chinese (zh)
Other versions
CN112104288A (en
Inventor
王贤会
耿永
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Key System and Integrated Circuit Co Ltd
Original Assignee
China Key System and Integrated Circuit Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Key System and Integrated Circuit Co Ltd filed Critical China Key System and Integrated Circuit Co Ltd
Priority to CN202010986017.4A priority Critical patent/CN112104288B/en
Publication of CN112104288A publication Critical patent/CN112104288A/en
Application granted granted Critical
Publication of CN112104288B publication Critical patent/CN112104288B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02PCONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
    • H02P21/00Arrangements or methods for the control of electric machines by vector control, e.g. by control of field orientation
    • H02P21/14Estimation or adaptation of machine parameters, e.g. flux, current or voltage
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02PCONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
    • H02P21/00Arrangements or methods for the control of electric machines by vector control, e.g. by control of field orientation
    • H02P21/14Estimation or adaptation of machine parameters, e.g. flux, current or voltage
    • H02P21/18Estimation of position or speed
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02PCONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
    • H02P6/00Arrangements for controlling synchronous motors or other dynamo-electric motors using electronic commutation dependent on the rotor position; Electronic commutators therefor
    • H02P6/08Arrangements for controlling the speed or torque of a single motor
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02PCONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
    • H02P6/00Arrangements for controlling synchronous motors or other dynamo-electric motors using electronic commutation dependent on the rotor position; Electronic commutators therefor
    • H02P6/14Electronic commutators
    • H02P6/16Circuit arrangements for detecting position
    • H02P6/18Circuit arrangements for detecting position without separate position detecting elements
    • H02P6/182Circuit arrangements for detecting position without separate position detecting elements using back-emf in windings

Abstract

The invention discloses a method for measuring an offset angle, which comprises the following steps: s1, in a Hall electric period, hall capture interruption and ADC interruption are utilized to calculate the Hall electric period theta 1 And the angle theta of the back emf with respect to the rising edge of the hall current period 2 Then, the offset angle theta is calculated in the main cycle 3 (ii) a S2, removing an electric cycle which cannot be used for calculating the offset angle; s3, acquiring the center position of the back electromotive force; s4, offsetting the center position of the counter electromotive force in the current Hall sector; and S5, calculating an offset angle. The invention can calculate the offset angle by utilizing the phase line voltage measurement of the driving circuit and the measuring circuit of the Hall sensor and an auxiliary algorithm without an oscilloscope and an additional encoder.

Description

Method for measuring offset angle
Technical Field
The invention belongs to the technical field of motors, and particularly relates to a method for measuring an offset angle.
Background
Firstly, capturing a time sequence between a counter electromotive force and a Hall through an oscilloscope, and then solving the angle offset through the calculation function of the oscilloscope; and secondly, the angle deviation is calculated by respectively capturing the Hall jump position and the pulse number from the motor to the zero crossing point of the back electromotive force through an external encoder. Brushless motors with the same power grade on the market generally have different offset angles, and the different offset angles can cause that the motor cannot rotate or the performance of a driver and the motor is poor.
Therefore, a method for measuring an offset angle with better applicability is needed.
Disclosure of Invention
In order to overcome the defects in the prior art, the invention provides a method for measuring an offset angle.
In order to solve the technical problems, the invention provides the following technical scheme:
the invention provides a method for measuring an offset angle, which comprises the following steps:
s1, in a Hall electric period, hall capture interruption and ADC interruption are utilized to calculate the Hall electric period theta 1 And the angle theta of the back emf with respect to the rising edge of the hall electrical period 2 Then, the offset angle theta is calculated in the main cycle 3
Figure BDA0002689239350000011
The main frequency of the singlechip is 64MHz, and the time variable t is obtained 1 ,t 2 A count value N converted into a main frequency f s Then there is
Figure BDA0002689239350000012
Then there are
Figure BDA0002689239350000013
S2, removing an electric cycle which cannot be used for calculating the offset angle;
s3, acquiring the center position of the back electromotive force;
the single chip microcomputer configures ADC injection group interruption, a back electromotive force value is collected at each interruption, and errors are solved for the back electromotive force; there are three poles at the upper end of the back emf waveform: the slope of the pole is zero, the slope of the back electromotive force is represented by the difference value of the back electromotive force sampled twice, the middle minimum value is the center point of the back electromotive force, the middle pole is the minimum value and is characterized in that the maximum values exist on two sides, and according to the characteristic, the zero crossing point of the error value of the back electromotive force and the characteristics of left negative and right positive of the zero crossing point are judged, so that the position of the center point of the back electromotive force can be obtained in real time;
s4, offsetting the center position of the counter electromotive force in the current Hall sector;
obtaining the current Hall sector TIM2 counting value MeasPrdEmf and the current sector Emf when the back electromotive force center positionThe value of the Sector is then obtained, and the count sum from the rising edge of the Hall to the center point of the back electromotive force is obtained 3
S5, calculating an offset angle phaseShift;
phaseShift=(s16)(sum 3 <<16)/(sum 1 +sum 2 )
the transformation from 0 to 2 pi into 16-bit signed shaped data, the-pi to pi correspondence range is-32768 to 32767, so the final computed angle is transformed into signed shaping s16.
As a preferred technical solution of the present invention, step S2 removes, by the acceleration limit and the duty ratio limit, an electrical cycle that cannot be used to calculate the offset angle;
first, acceleration limiting: manually rotating the motor, and measuring the voltage of the phase line to obtain the voltage value of the counter electromotive force; when the rotation acceleration of the motor is larger than 0, the wave crest of the counter electromotive force can be obviously inclined, the central point of the counter electromotive force can have the phenomenon of deviation or unobvious characteristics, the deviation angle is not suitable for calculating, and the most ideal state is to measure the deviation angle under the uniform rotation of the motor; when the motor starts to reduce the speed from the highest rotating speed, the acceleration of the motor starts to be less than 0, the speed change of an adjacent electric cycle is small, the speed change difference is ignored, the speed in one electric angle is assumed to be uniformly changed, and the offset angle starts to be calculated; the counting value CAPn (n =1 \8230; 6) of each sector is obtained at each interruption of Hall capture, and the sum of the counting values of the positive and negative pulse widths of the Hall in one electrical period is obtained and is represented by sum1 and sum 2; the count value of one electrical cycle is expressed in HallPeriod;
sum 1 =CAP 1 +CAP 2 +CAP 3
sum 2 =CAP 4 +CAP 5 +CAP 6
HallPeriod=sum 1 +sum 2
the two angle differences of the positive and negative pulse widths of the Hall are marked by delta theta, the acceleration of the motor in one electric period is expressed by a, and the motor has the following formula;
Figure BDA0002689239350000031
so can use sum 2 -sum 1 Judging the zero crossing point of the acceleration;
second, duty cycle limitation: the duty ratio of a Hall rotating at a constant speed is 50%, and the period of the Hall duty ratio close to 50% is selected and used for calculating an offset angle; if the difference between the positive and negative pulse widths is err, then there is
sum 1 -sum 2 =err
sum 1 +sum 2 =HallPeriod
The duty cycle is equal to:
Figure BDA0002689239350000032
Figure BDA0002689239350000033
for the convenience of MCU calculation, let the error limit be:
Figure BDA0002689239350000034
because:
Figure BDA0002689239350000035
then there are:
Figure BDA0002689239350000036
Figure BDA0002689239350000037
in general, the limitation of the acceleration a and the limitation of the duty ratio can eliminate abnormal and unsuitable electric cycle intervals for calculation, and ensure the accuracy of the offset angle.
In step S2, the step of obtaining the count value CAPn (n =1 \82306; 6) for each sector at each hall acquisition interruption includes the steps of:
s21: acquiring a TIM2 timer as a pre-frequency-dividing count value PreBuf, a capture count value CapBuf of a timer value capture/comparison register and an overflow count OvfCnt of the timer;
s22: judging whether OvfCnt is larger than 0, if so, executing steps S23-S26, and if not, executing steps S27-S29;
s23: if OvfCnt is greater than zero, the count value is calculated: capSum = OvfCnt 65536 (PrsBuf + 1) + CapBuf;
s24: on the premise that OvfCnt >0, if overflow of unchanged pre-frequency division occurs, setting a pre-frequency division self-increasing and pre-frequency division self-increasing flag, and then ending, wherein the pre-frequency division self-increasing flag and the pre-frequency division self-decreasing flag are all zero;
s25: on the premise that OvfCnt >0, if the pre-frequency division self-increment flag is set, the Capsum = CapBuf-0x10000; clearing a pre-frequency division increasing flag, namely the pre-frequency division increasing flag =0, and then ending;
s26: on the premise that OvfCnt >0, if a pre-frequency-division auto-subtraction flag is set, then CapSum = CapBuf +0x10000; clearing the pre-frequency division auto-decreasing mark, namely the pre-frequency division auto-decreasing mark =0, and then ending;
s27: on the premise that OvfCnt = =0, if the pre-division frequency is unchanged, then caps = CapBuf (PrsBuf + 1), and then ends;
s28: on the premise that OvfCnt = =0, if the pre-division auto-increment flag is set, the cap = CapBuf =prsbuf; and the pre-frequency division self-increasing mark is cleared, and then the operation is finished;
s29: on the premise that OvfCnt = =0, if the pre-frequency-division auto-reduction flag is set, then caps = CapBuf (PrsBuf + 2) and the pre-frequency-division auto-reduction flag is cleared (the clearing means zero-assignment), and then the process ends.
As a preferred technical solution of the present invention, the finding of the center point of the back electromotive force by the judgment in step S3 specifically includes the following steps:
s31: default in "Start State";
s32: the current state is in a 'starting state', if the counter electromotive force is larger than a certain threshold value set in a program, the slope of the counter electromotive force is a negative zero crossing point, and the negative zero crossing point is as follows: when the current slope is less than or equal to zero and the last slope is greater than or equal to zero, the state is transferred to a 'counter electromotive force slope negative state 1';
s33: the current state is in a counter electromotive force slope negative state 1, and if the counter electromotive force is smaller than a certain threshold value set in a program, the state is transferred to a starting state;
s34: the current state is in a 'counter electromotive force slope negative state 1', and if the counter electromotive force is larger than a certain threshold value set in a program and the slope of the counter electromotive force is a positive zero crossing point, the current state is transferred to a 'counter electromotive force slope positive state'; capturing a current Hall count value MeasPrdEmf and a current sector EmfSector while transferring the state;
s35: the current state is in a 'counter electromotive force slope negative state 1', and if the counter electromotive force is smaller than a certain threshold value set in a program, the state is transferred to a 'starting state';
s36: the current state is in a 'counter electromotive force slope positive state', if the counter electromotive force is larger than a certain threshold value set in a program and the slope of the counter electromotive force is a negative zero crossing point, the current state is transferred to a 'counter electromotive force slope negative state 2'; meanwhile, establishing a counter electromotive force center position capturing success mark;
s37: the current state is in a 'counter electromotive force slope negative state 1', and if the counter electromotive force is smaller than a program threshold value, the state is switched to a 'starting state'.
As a preferable technical scheme of the invention, in step S4, the counting value sum from the Hall rising edge to the back electromotive force center point is obtained 3 The method specifically comprises the following steps:
s41, setting a for-loop variable initial value, setting a loop variable of a loop ending condition to be smaller than EmfSector, and adding 1 for each loop adjusting condition;
s42, executing the loop body and accumulating the sector count value sum 3 +=CAP n
S43, automatically increasing the circulation variable, judging whether circulation is finished or not, and if not, repeatedly executing the step 2;
s44, finishing the loop body and executing sum 3 +=MeasPrdEmf;
Final sum 3 The values of (a) are:
sum 3 =CAP 1 +…+CAP n +MeasPrdEmf(n<=5)。
compared with the prior art, the invention has the following beneficial effects:
the invention can calculate the offset angle by utilizing the phase line voltage measurement of the driving circuit and the measuring circuit of the Hall sensor and an auxiliary algorithm without an oscilloscope and an external encoder.
Drawings
Fig. 1 is a schematic structural diagram of a three-phase brushless motor/three-phase permanent magnet synchronous motor with a pole pair number of 1;
fig. 2 is a diagram of a state transition of back electromotive force center position acquisition in the present invention;
FIG. 3 is a diagram showing the count sum of the rising edge of Hall to the center point of back electromotive force according to the present invention 3 A flow chart of (a);
FIG. 4 is a graph of the relationship between the electrical cycle and phaseShift participating in the operation in the single chip microcomputer.
Detailed Description
The preferred embodiments of the present invention will be described in conjunction with the accompanying drawings, and it will be understood that they are described herein for the purpose of illustration and explanation and not limitation.
Fig. 1 shows a schematic structural diagram of a three-phase brushless motor/three-phase permanent magnet synchronous motor with a pole pair number of 1, VW is three windings of a stator, NS is a schematic diagram of a rotor magnetic pole, ABC is an installation position of a switch type hall, three hall electrical angles differ by 120 degrees, and an important parameter in a vector control algorithm is a position parameter of a rotor. As the motor rotates, the rotor cuts the stator windings creating a back emf waveform that will be generated during each electrical cycle. The Hall is installed on the stator structure, the back electromotive force waveform of the stator winding is different according to the position of the rotor, and the position of the rotor can be known by calculating the angle. The period of one back electromotive force is an electrical period, a logic time sequence formed by three Hall elements in one electrical period has 6 changes, and when the single chip microcomputer is configured to be Hall capturing, six changes can be captured in one electrical period.
In order to achieve the object of the present invention, in one embodiment of the present invention, there is provided an offset angle measuring method, including the steps of:
s1, in a Hall electrical period, hall capture interruption and ADC interruption are utilized to calculate Hall electrical period theta 1 And the angle theta of the back emf with respect to the rising edge of the hall electrical period 2 Then, the offset angle theta is calculated in the main cycle 3
Figure BDA0002689239350000061
The main frequency of the singlechip is set to be 64MHz, and the time variable t is set 1 ,t 2 A count value N converted into a main frequency f s Then there is
Figure BDA0002689239350000071
Then there are
Figure BDA0002689239350000072
The timer TIM2 is configured by the singlechip to be Hall capture interrupt and timer overflow interrupt, and the TIM2 mode is a reset mode. Thus, every six Hall devices are interrupted, namely an electric cycle, and the Hall devices in the electric cycle sequentially change according to the table 1;
note: the three hall signals are switching signals respectively, and only change by 0,1. The three components together form 6 signals, which become 6 hall sectors.
Figure BDA0002689239350000073
TABLE 1
In each Hall interrupt, a timer prescaler value and a timer value capture/compare register value are saved, the frequency of the timer is divided on the basis of a main frequency, a count value relative to the main frequency can be obtained by obtaining the prescaler value and the capture count value in each Hall capture interrupt, the optimum resolution is obtained by adjusting the prescaler value to the timer in each capture, if the capture value is too low, the prescaler value is reduced, the frequency of the timer is improved, and if overflow exists in two captures, the prescaler value is improved, so that the timer is not easy to overflow. Let OvfCnt be the overflow count of the timer, preBuf be the prescaler value, capBuf be the timer value capture/compare register capture count value, capSuf be the count value with the master frequency as the time base.
S2, removing an electric cycle which cannot be used for calculating the offset angle;
step S2, removing an electric period which cannot be used for calculating the offset angle through acceleration limitation and duty ratio limitation;
first, acceleration limiting: manually rotating the motor, and measuring the voltage of the phase line to obtain the voltage value of the counter electromotive force; when the rotation acceleration of the motor is larger than 0, the wave crest of the counter electromotive force can be obviously inclined, the central point of the counter electromotive force can have the phenomenon of deviation or unobvious characteristics, the deviation angle is not suitable for calculating, and the most ideal state is to measure the deviation angle under the uniform rotation of the motor; when the motor starts to reduce the speed from the highest rotating speed, the acceleration of the motor starts to be less than 0, the speed change of an adjacent electric cycle is small, the speed change difference is ignored, the speed in one electric angle is assumed to be uniformly changed, and the offset angle starts to be calculated; the counting value CAPn (n =1 \8230; 6) of each sector is obtained at each interruption of Hall capture, and the sum of the counting values of the positive and negative pulse widths of the Hall in one electrical period is obtained and is represented by sum1 and sum 2; the count value of one electrical cycle is expressed in HallPeriod;
sum 1 =CAP 1 +CAP 2 +CAP 3
sum 2 =CAP 4 +CAP 5 +CAP 6
HallPeriod=sum 1 +sum 2
the two angle differences of the positive and negative pulse widths of the Hall are marked by delta theta, the acceleration of the motor in one electric period is expressed by a, and the motor has the following formula;
Figure BDA0002689239350000081
so can use sum 2 -sum 1 Judging the zero crossing point of the acceleration;
second, duty cycle limitation: the duty ratio of a Hall with constant-speed rotation of the motor is 50%, and the period with the duty ratio close to 50% of the Hall duty ratio is selected for calculating the offset angle; if the difference between the positive and negative pulse widths is err, then there is
sum 1 -sum 2 =err
sum 1 +sum 2 =HallPeriod
The duty cycle is equal to:
Figure BDA0002689239350000082
Figure BDA0002689239350000083
for the convenience of MCU calculation, let the error limit be:
Figure BDA0002689239350000084
because:
Figure BDA0002689239350000085
then there are:
Figure BDA0002689239350000086
Figure BDA0002689239350000091
in general, the limitation of the acceleration a and the limitation of the duty ratio can eliminate abnormal and unsuitable electric cycle intervals for calculation, and ensure the accuracy of the offset angle.
In step S2, the step of obtaining the count value CAPn (n =1 \82306; 6) for each sector during each hall capture interrupt includes the following steps:
s21: acquiring a TIM2 timer as a pre-frequency-dividing count value PreBuf, a capture count value CapBuf of a timer value capture/comparison register and an overflow count OvfCnt of the timer;
s22: judging whether OvfCnt is larger than 0, if so, executing steps S23-S26, and if not, executing steps S27-S29;
s23: if OvfCnt is greater than zero, the count value is calculated: caps = OvfCnt 65536 (PrsBuf + 1) + CapBuf;
s24: on the premise that OvfCnt >0, if overflow occurs when the pre-frequency division is unchanged, the pre-frequency division self-increasing and pre-frequency division self-increasing flags are set, and then the operation is finished, wherein the pre-frequency division self-increasing flags and the pre-frequency division self-decreasing flags are all zero;
s25: on the premise that OvfCnt >0, if the prescaled frequency self-increment flag is set, the Capsum = CapBuf-0x10000; clearing the pre-frequency self-increasing mark, namely, the pre-frequency self-increasing mark =0, and then ending;
s26: on the premise that OvfCnt >0, if a pre-frequency-division auto-subtraction flag is set, then CapSum = CapBuf +0x10000; clearing the pre-frequency division auto-decreasing mark, namely the pre-frequency division auto-decreasing mark =0, and then ending;
s27: on the premise that OvfCnt = =0, if the pre-division does not change, then caps = CapBuf (PrsBuf + 1), and then the process ends;
s28: on the premise that OvfCnt = =0, if the pre-division auto-increment flag is set, the cap = CapBuf =prsbuf; and the pre-frequency-division self-increasing mark is cleared, and then the operation is finished;
s29: on the premise that OvfCnt = =0, if the pre-frequency-division auto-reduction flag is set, then caps = CapBuf (PrsBuf + 2) and the pre-frequency-division auto-reduction flag is cleared (the clearing means zero-assignment), and then the process ends.
S3, acquiring the center position of the back electromotive force;
the single chip microcomputer configures ADC injection group interruption, a back electromotive force value is collected at each interruption, and an error is solved for the back electromotive force; there are three poles at the upper end of the back emf waveform: the slope of the pole is zero, the slope of the back electromotive force is represented by the difference value of the back electromotive force sampled twice, the middle pole is the central point of the back electromotive force, the middle pole is the pole and is characterized in that the two sides have the maximum values, and according to the characteristic, the zero crossing point of the error value of the back electromotive force and the characteristics of the left negative and the right positive of the zero crossing point are judged, so that the position of the central point of the back electromotive force can be obtained in real time;
as shown in fig. 2, a state transition diagram is obtained according to the back electromotive force center position, and in the state machine with the negative slope state 1, when the state is switched to the "positive slope state", the capture value measprdfmf and the current sector EmfSector of the hall are read at the same time. In the hall count value at this time, the count value method is similar to the steps S21 to S29, and the count value to the counter electromotive force center point position in the current hall sector can be obtained without performing the adjustment of the pre-division. The back emf center position capture success flag is established when the state machine proceeds to "slope negative state 2".
The step S3 of finding the center point of the back electromotive force by judgment specifically includes the following steps:
s31: default in "Start State";
s32: when the current state is in a 'starting state', if the counter electromotive force is greater than a certain threshold value set in a program, the slope of the counter electromotive force is a negative zero-crossing point, and the negative zero-crossing point is as follows: when the current slope is less than or equal to zero and the last slope is greater than or equal to zero, the state is transferred to a 'counter electromotive force slope negative state 1';
s33: the current state is in a 'counter electromotive force slope negative state 1', and if the counter electromotive force is smaller than a certain threshold value set in a program, the state is transferred to a 'starting state';
s34: the current state is in a 'counter electromotive force slope negative state 1', and if the counter electromotive force is larger than a certain threshold value set in a program and the slope of the counter electromotive force is a positive zero crossing point, the current state is transferred to a 'counter electromotive force slope positive state'; capturing a current Hall count value MeasPrdEmf and a current sector EmfSector while transferring the state;
s35: the current state is in a counter electromotive force slope negative state 1, and if the counter electromotive force is smaller than a certain threshold value set in a program, the state is transferred to a starting state;
s36: the current state is in a 'counter electromotive force slope positive state', if the counter electromotive force is larger than a certain threshold value set in a program and the slope of the counter electromotive force is a negative zero crossing point, the current state is transferred to a 'counter electromotive force slope negative state 2'; meanwhile, establishing a counter electromotive force center position capturing success mark;
s37: the current state is in a 'counter electromotive force slope negative state 1', and if the counter electromotive force is smaller than a program threshold value, the state is switched to a 'starting state'.
S4, offsetting the center position of the counter electromotive force in the current Hall sector;
when the back electromotive force center position is in, the counting value MeasPrdEmf of the current Hall sector TIM2 and the counting value EmfSector of the current sector are obtained, and then the counting value sum from the Hall rising edge to the back electromotive force center point is obtained 3
As shown in fig. 3, in step S4, the count sum from the rising edge of the hall to the center point of the back emf is obtained 3 The method specifically comprises the following steps:
s41, setting a for-loop variable initial value, setting a loop variable of a loop ending condition to be smaller than EmfSector, and adding 1 for each loop adjusting condition;
s42, executing a loop body and accumulating the sector count value sum 3 +=CAP n
S43, automatically increasing the circulation variable, judging whether circulation is finished or not, and if not, repeatedly executing the step 2;
s44, finishing the loop body and executing sum 3 +=MeasPrdEmf;
Final sum 3 The values of (a) are:
sum 3 =CAP 1 +…+CAPn+MeasPrdEmf(n<=5)。
s5, calculating an offset angle phaseShift;
phaseShift=(s16)(sum 3 <<16)/(sum 1 +sum 2 )
fig. 4 is a relation diagram of electric period and phaseShift participating in operation in the single chip microcomputer, 0 to 2 pi is converted into 16-bit signed shaping data, and the corresponding range from-pi to pi is-32768 to 32767, so that the finally calculated angle is converted into signed shaping s16.
Finally, it should be noted that: although the present invention has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that modifications may be made to the embodiments described above, or equivalents may be substituted for elements thereof. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (1)

1. A method of measuring an offset angle, comprising the steps of:
s1, in a Hall electrical period, hall capture interruption and ADC interruption are utilized to calculate Hall electrical period theta 1 And the angle theta of the back emf with respect to the rising edge of the hall electrical period 2 Then calculating the offset angle theta 3
Figure FDA0004053953890000011
The main frequency of the singlechip is set to be 64MHz, and the time variable t is set 1 ,t 2 A count value N converted into a main frequency f s Then there is
Figure FDA0004053953890000012
Then there are
Figure FDA0004053953890000013
S2, removing an electric cycle which cannot be used for calculating the offset angle;
s3, acquiring the center position of the back electromotive force;
the single chip microcomputer configures ADC injection group interruption, a back electromotive force value is collected at each interruption, and an error is solved for the back electromotive force; there are three poles at the upper end of the back emf waveform: the slope of the pole is zero, the slope of the back electromotive force is represented by the difference value of the back electromotive force sampled twice, the middle pole is the central point of the back electromotive force, the middle pole is the minimum, the maximum exists on the two sides of the middle pole, and according to the characteristic, the zero crossing point of the error value of the back electromotive force and the characteristics of the left negative and the right positive of the zero crossing point are judged, so that the position of the central point of the back electromotive force can be obtained in real time;
s4, offsetting the center position of the counter electromotive force in the current Hall sector;
when the back electromotive force center position is in, the current Hall sector counting value MeasPrdEmf and the current sector EmfSector value are obtained, and then the counting value sum from the Hall rising edge to the back electromotive force center point is obtained 3
S5, calculating a shift angle phaseShift;
phaseShift=(s16)(sum 3 <<16)/(sum 1 +sum 2 )
(s 16) denotes a 16-bit signed integer; sum3< <16 means shift sum3 left by 16 bits; sum1 is a counting value of a positive pulse width of the Hall signal in one electric period, sum2 is a counting value of a negative pulse width of the Hall signal in one electric period, and sum1+ sum2 refers to the counting value in one electric period;
the ratio of the amplified count value from the rising edge of the Hall to the center point of the counter electromotive force to the count value of one electric period is the shift angle phaseShift, the range of the ratio is-32768 to 32767, the corresponding electric angle is-pi to pi, and the finally calculated angle is converted into signed shaping s16;
step S2, removing an electric period which cannot be used for calculating the offset angle through acceleration limitation and duty ratio limitation;
first, acceleration limiting: manually rotating the motor, and measuring the voltage of the phase line to obtain the voltage value of the counter electromotive force; when the rotation acceleration of the motor is larger than 0, the wave crest of the counter electromotive force can be obviously inclined, the central point of the counter electromotive force can have the phenomenon of deviation or unobvious characteristics, the deviation angle is not suitable for calculating, and the most ideal state is to measure the deviation angle under the uniform rotation of the motor; when the motor starts to reduce the speed from the highest rotating speed, the acceleration of the motor starts to be less than 0, the speed change of an adjacent electric cycle is small, the speed change difference is ignored, the speed in one electric angle is assumed to be uniformly changed, and the offset angle is calculated; calculating a counting value CAPn of each sector when Hall capture is interrupted, wherein n =1 \ 82306, and calculating the sum of the counting values of positive and negative pulse widths of the Hall in one electric period, which is expressed by Suml and sum 2; the count value of one electrical cycle is expressed in HallPeriod;
sum 1 =CAP 1 +CAP 2 +CAP 3
sum 2 =CAP 4 +CAP 5 +CAP 6
HallPeriod=sum 1 +sum 2
the two angle differences of the positive and negative pulse widths of the Hall are marked by delta theta, the acceleration of the motor in one electric period is expressed by a, and the motor has the following formula;
Figure FDA0004053953890000021
so use sum 2 -sum 1 Judging the zero crossing point of the acceleration;
second, duty cycle limitation: the duty ratio of a Hall rotating at a constant speed is 50%, and the period of the Hall duty ratio close to 50% is selected and used for calculating an offset angle; if the difference between the positive and negative pulse widths is err, then there is
sum 1 -sum 2 =err
The duty cycle is equal to:
Figure FDA0004053953890000031
Figure FDA0004053953890000032
for the convenience of MCU calculation, let the error limit be:
Figure FDA0004053953890000033
because:
Figure FDA0004053953890000034
then there are:
Figure FDA0004053953890000035
Figure FDA0004053953890000036
the abnormal and unfit electrical cycle intervals for calculation can be eliminated by limiting the acceleration a and the duty ratio, and the accuracy of the offset angle is ensured.
CN202010986017.4A 2020-09-18 2020-09-18 Method for measuring offset angle Active CN112104288B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010986017.4A CN112104288B (en) 2020-09-18 2020-09-18 Method for measuring offset angle

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010986017.4A CN112104288B (en) 2020-09-18 2020-09-18 Method for measuring offset angle

Publications (2)

Publication Number Publication Date
CN112104288A CN112104288A (en) 2020-12-18
CN112104288B true CN112104288B (en) 2023-03-10

Family

ID=73759857

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010986017.4A Active CN112104288B (en) 2020-09-18 2020-09-18 Method for measuring offset angle

Country Status (1)

Country Link
CN (1) CN112104288B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116735079B (en) * 2023-08-15 2023-11-14 山东宇飞传动技术有限公司 Mining winch balance detection equipment and method

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1014554A2 (en) * 1998-12-18 2000-06-28 Toyota Jidosha Kabushiki Kaisha Electrical angle detecting apparatus and method, and motor control apparatus
US6188196B1 (en) * 1998-12-18 2001-02-13 Toyota Jidosha Kabushiki Kaisha Electrical angle detecting apparatus and method, and motor control apparatus
US20130082633A1 (en) * 2011-09-30 2013-04-04 Johns Hopkins University System and Method for Determining Position of Hall Sensors Relative to Stator Winding of Brushless DC or Synchronous AC Permanent Magnet Motor
CN103222168A (en) * 2011-09-27 2013-07-24 浙江博望科技发展有限公司 Servo motor and servo control system
CN110199467A (en) * 2016-12-21 2019-09-03 德纳汽车系统集团有限责任公司 Hall effect sensor signal offset correction in phase commutation
CN110654243A (en) * 2018-06-28 2020-01-07 福特全球技术公司 System and method for in-vehicle resolver alignment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3183071B2 (en) * 1994-12-06 2001-07-03 松下電器産業株式会社 Control drive device for sensorless DC brushless motor
US7423396B2 (en) * 2004-06-11 2008-09-09 International Rectifier Corporation Hall sensor alignment for BLDC motor
KR20190094510A (en) * 2018-02-05 2019-08-14 주식회사 엔엠씨 Motor electrical angle offset detecting device by sensorless control method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1014554A2 (en) * 1998-12-18 2000-06-28 Toyota Jidosha Kabushiki Kaisha Electrical angle detecting apparatus and method, and motor control apparatus
US6188196B1 (en) * 1998-12-18 2001-02-13 Toyota Jidosha Kabushiki Kaisha Electrical angle detecting apparatus and method, and motor control apparatus
CN103222168A (en) * 2011-09-27 2013-07-24 浙江博望科技发展有限公司 Servo motor and servo control system
US20130082633A1 (en) * 2011-09-30 2013-04-04 Johns Hopkins University System and Method for Determining Position of Hall Sensors Relative to Stator Winding of Brushless DC or Synchronous AC Permanent Magnet Motor
CN110199467A (en) * 2016-12-21 2019-09-03 德纳汽车系统集团有限责任公司 Hall effect sensor signal offset correction in phase commutation
CN110654243A (en) * 2018-06-28 2020-01-07 福特全球技术公司 System and method for in-vehicle resolver alignment

Also Published As

Publication number Publication date
CN112104288A (en) 2020-12-18

Similar Documents

Publication Publication Date Title
US8030867B1 (en) Sample and hold time stamp for sensing zero crossing of back electromotive force in 3-phase brushless DC motors
CN206564553U (en) Brushless DC motor control system based on current hysteresis-band control
CN102545749B (en) Wide-speed-regulation-range brushless direct current motor position sensorless control device and method
CN108400733A (en) A kind of rotor position detecting method of automobile permanent magnet synchronous motor
CN105680742A (en) Sensorless rotor position identification system and method for brushless direct current motor
CN111490710B (en) Method and system for identifying zero offset of permanent magnet synchronous motor for vehicle
CN112104288B (en) Method for measuring offset angle
CN113131805A (en) Control device and method of brushless direct current motor
CN203554345U (en) Constant phase shifting and changing signal detector for brushless DC motor
CN107134963B (en) The rotor-position method for tracing of permanent magnet synchronous motor
CN108667358A (en) A kind of brshless DC motor full range velocity modulation control system and its control method
CN112511060B (en) Hidden pole type permanent magnet brushless hub motor position estimation calibration method
CN109039198A (en) The bearing calibration of magneto hall position and device
CN113437909A (en) Hall position correction method of brushless motor based on Hall sensor
CN113131806A (en) Control device and method of brushless direct current motor
CN110635726A (en) Speed detection method and detection circuit for non-inductive brushless motor
CN107979319A (en) A kind of surface-mount type three-phase permanent magnet synchronous motor rotor magnetic pole initial position localization method
CN114665756A (en) Permanent magnet synchronous motor rotor position filtering and zero calibration method
CN108270373A (en) A kind of permanent magnet synchronous motor rotor position detection method
CN114123870A (en) Permanent magnet motor position detection method based on high-frequency injection
CN114826074A (en) Method for acquiring speed and electric angle of permanent magnet synchronous motor based on Hall sensor
CN112994542A (en) Brushless direct current motor non-inductive control method based on phase change point phase change
CN108322122B (en) Initial position positioning method for magnetic pole of rotor of salient pole type three-phase permanent magnet synchronous motor
CN111342713A (en) Control method for bidirectional starting of single-phase brushless direct current motor
CN202737796U (en) Brushless direct current motor sensorless control device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant