Method and device for calibrating a position sensor applied to an electric machine
By combining PWM signal feedback and quadrature signals, a calibration mapping table is generated, which solves the interference and step loss problems in motor position sensor calibration and realizes high-precision position information transmission.
Patent Information
- Application Number
- CN202210724099.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-24
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2042-06-24
AI Technical Summary
Existing motor position sensor calibration is susceptible to interference, resulting in inaccurate position information, especially in long-distance communication and high-resolution situations, which poses a risk of lost steps.
The absolute position information of the motor is obtained by feedback of PWM signal, and the relative angles in different directions are recorded by orthogonal signal to generate a calibration mapping table, thereby reducing errors and achieving accurate calibration.
This effectively avoids interference and step loss during the position sensor calibration process, improves the accuracy and stability of position information, and ensures smooth motor start-up.
Smart Images

Figure CN115189622B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of position calibration technology, and in particular to a method and apparatus for calibrating a position sensor for an electric motor. Background Technology
[0002] When using high-precision magnetic encoders as position sensors to provide position information to motors, the communication between the controller and the position sensor generally takes three forms: First, SPI. The main problem is that when the distance between the position sensor and the motor controller is long, the position information is easily interfered with. Second, PWM pulse width communication has a long communication distance, but as the position resolution increases, the communication lag becomes significant. Third, quadrature signals cannot provide absolute position information, making it difficult for direct-drive motors using quadrature signals to start smoothly. Furthermore, quadrature signals are prone to step loss. Summary of the Invention
[0003] To address the aforementioned problems, this invention provides a method and apparatus for calibrating a position sensor for motors. This method solves the issues of existing sensor position calibration being easily interfered with and having inaccurate position information. It utilizes the hysteresis absolute angle fed back by PWM information to calibrate a relative angle with better real-time performance, thereby avoiding the occurrence of missed steps.
[0004] The technical solution adopted in this invention is: a method for calibrating a position sensor for a motor, the method comprising: providing a PWM signal to the motor; obtaining the absolute position information of the motor through feedback of the PWM signal; providing an orthogonal signal to the motor; providing an electrical angle of the motor in a first direction, and recording a first relative angle fed back by the orthogonal signal; obtaining a first calibration mapping table mapping the first relative angle to the electrical angle according to the mapping relationship between the first relative angle and the electrical angle; and setting the first calibration mapping table as the calibration mapping table of the position sensor for calibration.
[0005] A further improvement to the above scheme is that, after giving the orthogonal signal of the motor and before outputting the first calibration mapping table, the method further includes: giving the electrical angle of the motor in a second direction, recording the second relative angle fed back by the orthogonal signal, wherein the second direction is the opposite direction of the first direction; obtaining a second calibration mapping table that maps the second relative angle to the electrical angle according to the mapping relationship between the second relative angle and the electrical angle; and setting the first calibration mapping table as the calibration mapping table of the position sensor, which includes: obtaining an average calibration mapping table that maps the first relative angle and the second relative angle to the electrical angle according to the first calibration mapping table and the second calibration mapping table; and setting the average calibration mapping table as the calibration mapping table of the position sensor.
[0006] A further improvement to the above scheme is that the step of obtaining the average calibration mapping table of the first relative angle and the second relative angle mapped to the electrical angle includes: according to the formula Calculate the third relative angle corresponding to the electrical angle in the average calibration mapping table, where, ...is the third relative angle. ...is the first relative angle. ...is the second relative angle.
[0007] A further improvement to the above scheme is that, after giving the orthogonal signal of the motor and before outputting the first calibration mapping table, the method further includes: giving the electrical angle of the motor in the second direction, recording the second relative angle fed back by the orthogonal signal, wherein the second direction is the opposite direction of the first direction; obtaining a second calibration mapping table mapping the second relative angle to the electrical angle according to the mapping relationship between the second relative angle and the electrical angle; and setting the first calibration mapping table as the mapping table after calibration of the position sensor, which includes: when the relative angle to be calibrated is the first direction, setting the first calibration mapping table as the mapping table after calibration of the position sensor; and when the relative angle to be calibrated is the second direction, setting the second calibration mapping table as the mapping table after calibration of the position sensor.
[0008] A further improvement to the above scheme is that the electrical angle is 360 degrees.
[0009] A further improvement to the above scheme is that the method further includes:
[0010] According to the formula Calculate the relative angles between adjacent angles and The corresponding electrical angles, where the X variable is the relative angle and the Y variable is the electrical angle. and They are respectively and The corresponding electrical angle.
[0011] A position sensor calibration device for an electric motor, the device comprising:
[0012] First signal module: used to provide the PWM signal for the motor;
[0013] Absolute position acquisition module: used to acquire the absolute position information of the motor through feedback of the PWM signal;
[0014] Second signal module: used to provide orthogonal signals to the motor;
[0015] First angle acquisition module: used to give the electrical angle of the motor in a first direction and record the first relative angle fed back by the orthogonal signal;
[0016] First mapping acquisition module: used to acquire a first calibration mapping table that maps the first relative angle to the electrical angle based on the mapping relationship between the first relative angle and the electrical angle;
[0017] Mapping table output module: used to set the first calibration mapping table as the calibrated mapping table of the position sensor for calibration.
[0018] A further improvement to the above solution is that the device further includes:
[0019] Second angle acquisition module: used to give the electrical angle of the motor in a second direction and record the second relative angle fed back by the orthogonal signal, wherein the second direction is the opposite direction of the first direction;
[0020] The second mapping acquisition module is used to acquire a second calibration mapping table that maps the second relative angle to the electrical angle based on the mapping relationship between the second relative angle and the electrical angle.
[0021] The mapping table output module includes:
[0022] First mapping output module: used to set the first calibration mapping table to the calibrated mapping table of the position sensor when the relative angle to be calibrated is the first direction;
[0023] The second mapping output module is used to set the second calibration mapping table to the calibrated mapping table of the position sensor when the relative angle to be calibrated is the second direction.
[0024] The beneficial effects of this invention are:
[0025] This invention addresses the problems of existing sensor position calibration being easily affected by interference and inaccurate position information. It obtains the absolute position information of the motor through feedback of a PWM signal; provides an orthogonal signal to the motor; provides an electrical angle of the motor in a first direction; records a first relative angle fed back by the orthogonal signal; obtains a first calibration mapping table mapping the first relative angle to the electrical angle based on the mapping relationship between the first relative angle and the electrical angle; and sets the first calibration mapping table as the calibration table for the position sensor to perform calibration.
[0026] This invention relates to a position sensor calibration device for motors. It addresses the problems of interference and inaccurate positioning in existing motor position sensor calibration methods. Specifically, it includes: a first signal module for providing a PWM signal to the motor; an absolute position acquisition module for acquiring the absolute position information of the motor through feedback from the PWM signal; a second signal module for providing an orthogonal signal to the motor; a first angle acquisition module for providing an electrical angle of the motor in a first direction and recording the first relative angle fed back by the orthogonal signal; a first mapping acquisition module for acquiring a first calibration mapping table mapping the first relative angle to the electrical angle based on the mapping relationship between the first relative angle and the electrical angle; and a mapping table output module for setting the first calibration mapping table as the calibrated mapping table for the position sensor, enabling calibration. The invention utilizes the hysteresis absolute angle fed back from the PWM information to calibrate a relative angle with better real-time performance, thus avoiding missed steps. Attached Figure Description
[0027] Figure 1 This is a schematic diagram of Embodiment 1 of the position sensor calibration method of the present invention;
[0028] Figure 2 This is a schematic diagram of Embodiment 2 of the position sensor calibration method of the present invention;
[0029] Figure 3 This is a partial schematic diagram of Embodiment 2 of the position sensor calibration method of the present invention;
[0030] Figure 4 This is a schematic diagram of Embodiment 4 of the position sensor calibration method of the present invention;
[0031] Figure 5 This is a partial schematic diagram of Embodiment 4 of the position sensor calibration method of the present invention;
[0032] Figure 6 This is a schematic diagram of the present invention applied to a position sensor calibration device for a motor;
[0033] Figure 7 for Figure 6 A schematic diagram of another embodiment of a position sensor calibration device applied to a motor. Detailed Implementation
[0034] To facilitate understanding of the present invention, a more complete description will be given below with reference to the accompanying drawings. Preferred embodiments of the invention are shown in the drawings. However, the invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to provide a thorough and complete understanding of the disclosure of the invention.
[0035] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.
[0036] PWM signals belong to Pulse Width Modulation, an analog control method. It modulates the bias of the base of a transistor or the gate of a MOSFET based on changes in the load, thereby altering the conduction time of the transistor or MOSFET and thus changing the power output. It utilizes digital signals from a microprocessor to control analog circuits.
[0037] Example 1
[0038] like Figure 1 As shown, this embodiment provides a method for calibrating a position sensor for a motor, including the following:
[0039] Given the PWM signal for the motor;
[0040] The absolute position information of the motor is obtained through feedback of the PWM signal; a quadrature signal for the motor is given.
[0041] Given the electrical angle of the motor in the first direction, record the first relative angle fed back by the orthogonal signal;
[0042] Based on the mapping relationship between the first relative angle and the electrical angle, obtain the first calibration mapping table that maps the first relative angle to the electrical angle;
[0043] Set the first calibration mapping table to the calibrated mapping table of the position sensor for calibration.
[0044] In this embodiment, when a quadrature signal for the motor is given, the quadrature signal is preferably a quadrature differential signal. The first direction can be either the forward or reverse rotation of the motor. This allows a first calibration mapping table to be generated based on the PWM pulse width signal, the quadrature signal, and the electrical angle of the motor. The first calibration mapping table is then used by the position sensor to calibrate the motor.
[0045] Example 2
[0046] See appendix Figures 2-3 As shown, this embodiment provides a method for calibrating a position sensor for a motor, including the following:
[0047] Given the PWM signal for the motor;
[0048] The absolute position information of the motor is obtained through feedback of the PWM signal; a quadrature signal for the motor is given.
[0049] Given the electrical angle of the motor in the first direction, record the first relative angle fed back by the orthogonal signal;
[0050] Based on the mapping relationship between the first relative angle and the electrical angle, obtain the first calibration mapping table that maps the first relative angle to the electrical angle;
[0051] Set the first calibration mapping table to the calibrated mapping table of the position sensor for calibration;
[0052] After providing the quadrature signal of the motor and before outputting the first calibration mapping table, the method further includes:
[0053] Given the electrical angle of the motor in the second direction, record the second relative angle fed back by the orthogonal signal. The second direction is the opposite of the first direction.
[0054] Based on the mapping relationship between the second relative angle and the electrical angle, obtain the second calibration mapping table that maps the second relative angle to the electrical angle;
[0055] The steps of setting the first calibration mapping table to the mapping table after the position sensor calibration include:
[0056] Based on the first calibration mapping table and the second calibration mapping table, obtain the average calibration mapping table that maps the first relative angle and the second relative angle to the electrical angle.
[0057] Set the average calibration map to the map after the position sensor is calibrated.
[0058] In this embodiment, unlike Embodiment 1 above, the angles are obtained in the first and second directions. The average calibration mapping table of the first and second relative angles is obtained and the two tables are averaged. The purpose of this method is to reduce the given angle error caused by the cogging torque. Compared with Embodiment 1, the calibration angle can be obtained more accurately.
[0059] Example 3
[0060] This embodiment provides a method for calibrating a position sensor for a motor, including the following:
[0061] Given the PWM signal for the motor;
[0062] The absolute position information of the motor is obtained through feedback of the PWM signal; a quadrature signal for the motor is given.
[0063] Given the electrical angle of the motor in the first direction, record the first relative angle fed back by the orthogonal signal;
[0064] Based on the mapping relationship between the first relative angle and the electrical angle, obtain the first calibration mapping table that maps the first relative angle to the electrical angle;
[0065] Set the first calibration mapping table to the calibrated mapping table of the position sensor for calibration;
[0066] After providing the quadrature signal of the motor and before outputting the first calibration mapping table, the method further includes:
[0067] Given the electrical angle of the motor in the second direction, record the second relative angle fed back by the orthogonal signal. The second direction is the opposite of the first direction.
[0068] Based on the mapping relationship between the second relative angle and the electrical angle, obtain the second calibration mapping table that maps the second relative angle to the electrical angle;
[0069] The steps of setting the first calibration mapping table to the mapping table after the position sensor calibration include:
[0070] Based on the first calibration mapping table and the second calibration mapping table, obtain the average calibration mapping table that maps the first relative angle and the second relative angle to the electrical angle.
[0071] Set the average calibration mapping table to the mapping table after the position sensor is calibrated;
[0072] The steps for obtaining the average calibration mapping table that maps the first relative angle and the second relative angle to electrical angles include:
[0073] According to the formula Calculate the third relative angle corresponding to the electrical angle in the average calibration mapping table, where, ...is the third relative angle. ...is the first relative angle. ...is the second relative angle.
[0074] In this embodiment, the third relative angle corresponding to the electrical angle in the average calibration map table is calculated according to the formula. The purpose of taking the average calibration map table is to reduce the given angle error caused by the cogging torque.
[0075] Example 4
[0076] See appendix Figures 4-5 As shown, this embodiment provides a method for calibrating a position sensor for a motor, including the following:
[0077] Given the PWM signal for the motor;
[0078] The absolute position information of the motor is obtained through feedback of the PWM signal; a quadrature signal for the motor is given.
[0079] Given the electrical angle of the motor in the first direction, record the first relative angle fed back by the orthogonal signal;
[0080] Based on the mapping relationship between the first relative angle and the electrical angle, obtain the first calibration mapping table that maps the first relative angle to the electrical angle;
[0081] Set the first calibration mapping table to the calibrated mapping table of the position sensor for calibration;
[0082] After providing the quadrature signal of the motor and before outputting the first calibration mapping table, the method further includes:
[0083] Given the electrical angle of the motor in the second direction, record the second relative angle fed back by the orthogonal signal. The second direction is the opposite of the first direction.
[0084] Based on the mapping relationship between the second relative angle and the electrical angle, obtain the second calibration mapping table that maps the second relative angle to the electrical angle;
[0085] The steps of setting the first calibration mapping table to the mapping table after the position sensor calibration include:
[0086] When the relative angle to be calibrated is the first direction, the first calibration mapping table is set to the mapping table after the position sensor is calibrated.
[0087] When the relative angle to be calibrated is the second direction, the second calibration mapping table is set to the mapping table after the position sensor is calibrated.
[0088] In any of the above embodiments, the method further includes:
[0089] According to the formula Calculate the relative angles between adjacent angles and The corresponding electrical angles, where X is the relative angle and Y is the electrical angle. and They are respectively and The corresponding electrical angle.
[0090] In any of the above embodiments, the larger the electrical angle, the more accurate the resulting mapping table. However, considering that the calibration time should not be too long in the actual production process, otherwise it will not be beneficial to mass production.
[0091] In the above embodiments, the electrical angle is the angle value that the motor continuously reaches from 0. This results in a series of first relative angles.
[0092] See Figure 6 As shown, a position sensor calibration device for a motor includes the following:
[0093] First signal module: Used for the PWM signal of the given motor;
[0094] Absolute position acquisition module: used to acquire the absolute position information of the motor through feedback of the PWM signal;
[0095] Second signal module: used for quadrature signals to the given motor;
[0096] First angle acquisition module: used to record the first relative angle fed back by the orthogonal signal after giving the electrical angle of the motor in the first direction;
[0097] First mapping acquisition module: used to acquire a first calibration mapping table that maps the first relative angle to the electrical angle based on the mapping relationship between the first relative angle and the electrical angle;
[0098] Mapping table output module: Used to set the first calibration mapping table as the mapping table after the position sensor is calibrated, so as to perform calibration.
[0099] See Figure 7 As shown, in another embodiment, a position sensor calibration device for a motor includes the following:
[0100] First signal module: Used for the PWM signal of the given motor;
[0101] Absolute position acquisition module: used to acquire the absolute position information of the motor through feedback of the PWM signal;
[0102] Second signal module: used for quadrature signals to the given motor;
[0103] First angle acquisition module: used to record the first relative angle fed back by the orthogonal signal after giving the electrical angle of the motor in the first direction;
[0104] First mapping acquisition module: used to acquire a first calibration mapping table that maps the first relative angle to the electrical angle based on the mapping relationship between the first relative angle and the electrical angle;
[0105] Mapping table output module: used to set the first calibration mapping table as the mapping table after the position sensor is calibrated, so as to perform calibration;
[0106] The device also includes:
[0107] Second angle acquisition module: used to give the electric angle of the motor in the second direction, record the second relative angle fed back by the orthogonal signal, the second direction being the opposite direction of the first direction;
[0108] The second mapping acquisition module is used to acquire a second calibration mapping table that maps the second relative angle to the electrical angle based on the mapping relationship between the second relative angle and the electrical angle.
[0109] The mapping table output module includes:
[0110] First mapping output module: used to set the first calibration mapping table to the mapping table after the position sensor calibration when the relative angle to be calibrated is the first direction;
[0111] Second mapping output module: When the relative angle to be calibrated is the second direction, the second calibration mapping table is set to the mapping table after the position sensor is calibrated.
[0112] Electrical angle is the angle value that the motor continuously reaches from 0, thus obtaining a series of initial relative angles.
[0113] In any of the above embodiments, the larger the electrical angle, the more accurate the resulting mapping table. However, considering that the calibration time should not be too long in the actual production process, otherwise it will not be beneficial to mass production, preferably, the electrical angle is 360 degrees, so as to ensure that the calibration time is appropriate and the accuracy of the mapping table is also guaranteed, with the error within an acceptable range.
[0114] In the above embodiments, the electrical angle is the angle value that the motor continuously reaches from 0. This results in a series of first relative angles.
[0115] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of this patent should be determined by the appended claims.
Claims
1. A method for calibrating a position sensor for a motor, characterized in that, The method includes: Given the PWM signal for the motor; The absolute position information of the motor is obtained through feedback of the PWM signal; Given the orthogonal signal of the motor; Given the electrical angle of the motor in the first direction, record the first relative angle fed back by the orthogonal signal; Based on the mapping relationship between the first relative angle and the electrical angle, a first calibration mapping table is obtained that maps the first relative angle to the electrical angle; Set the first calibration mapping table to the calibrated mapping table of the position sensor for calibration; Also includes: According to the formula Calculate the relative angles between adjacent angles and The corresponding electrical angles, where the X variable is the relative angle and the Y variable is the electrical angle. and They are respectively and The corresponding electrical angle.
2. The position sensor calibration method according to claim 1, characterized in that, After providing the orthogonal signal of the motor and before obtaining the first calibration mapping table, the method further includes: Given the electrical angle of the motor in the second direction, record the second relative angle fed back by the orthogonal signal, wherein the second direction is the opposite direction of the first direction; Based on the mapping relationship between the second relative angle and the electrical angle, a second calibration mapping table is obtained that maps the second relative angle to the electrical angle; The step of setting the first calibration mapping table as the calibrated mapping table of the position sensor includes: Based on the first calibration mapping table and the second calibration mapping table, obtain an average calibration mapping table that maps the first relative angle and the second relative angle to the electrical angle; Set the average calibration mapping table to the calibrated mapping table of the position sensor.
3. The position sensor calibration method according to claim 2, characterized in that, The steps of obtaining the average calibration mapping table of the first relative angle and the second relative angle to the electrical angle include: According to the formula Calculate the third relative angle corresponding to the electrical angle in the average calibration mapping table, where, As the third relative angle, As the first relative angle, This is the second relative angle.
4. The position sensor calibration method according to claim 1, characterized in that, After providing the orthogonal signal of the motor and before obtaining the first calibration mapping table, the method further includes: Given the electrical angle of the motor in the second direction, record the second relative angle fed back by the orthogonal signal, wherein the second direction is the opposite direction of the first direction; Based on the mapping relationship between the second relative angle and the electrical angle, a second calibration mapping table is obtained that maps the second relative angle to the electrical angle; The step of setting the first calibration mapping table as the calibrated mapping table of the position sensor includes: When the relative angle to be calibrated is the first direction, the first calibration mapping table is set to the calibrated mapping table of the position sensor; When the relative angle to be calibrated is the second direction, the second calibration mapping table is set as the calibrated mapping table of the position sensor.
5. A position sensor calibration device for motors, characterized in that, include: First signal module: used to provide the PWM signal for the motor; Absolute position acquisition module: used to acquire the absolute position information of the motor through feedback of the PWM signal; Second signal module: used to provide orthogonal signals to the motor; First angle acquisition module: used to give the electrical angle of the motor in a first direction and record the first relative angle fed back by the orthogonal signal; First mapping acquisition module: used to acquire a first calibration mapping table that maps the first relative angle to the electrical angle based on the mapping relationship between the first relative angle and the electrical angle; Mapping table output module: used to set the first calibration mapping table as the calibrated mapping table of the position sensor for calibration; Also includes: Second angle acquisition module: used to give the electrical angle of the motor in a second direction and record the second relative angle fed back by the orthogonal signal, wherein the second direction is the opposite direction of the first direction; The second mapping acquisition module is used to acquire a second calibration mapping table that maps the second relative angle to the electrical angle based on the mapping relationship between the second relative angle and the electrical angle. The mapping table output module includes: First mapping output module: used to set the first calibration mapping table to the calibrated mapping table of the position sensor when the relative angle to be calibrated is the first direction; The second mapping output module is used to set the second calibration mapping table to the calibrated mapping table of the position sensor when the relative angle to be calibrated is the second direction.
Citation Information
Patent Citations
Method for feeding back initial absolute position of motor, apparatus and encoder frequency-dividing apparatus
CN105676685A
Magnetic encoder, calibration method and device for magnetic encoder, motor and unmanned aerial vehicle
CN109655083A