Motor rotor position harmonic compensation method and system and electronic equipment

By performing offset correction, amplitude correction and phase compensation on the magnetic encoder signal in motor rotor position detection, the problem of signal inaccuracy and high computational resource consumption is solved, and low-cost, high-reliability motor rotor position detection is achieved. .

CN119362964APending Publication Date: 2025-01-24ZHIQI AUTOMOTIVE TECH (SHANGHAI) CO LTD

Patent Information

Application Number
CN202411009786.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-25
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

In the motor rotor position detection, the positive cosine signal output by the magnetic encoder has amplitude deviation, phase deviation, DC bias and high harmonics, resulting in inaccurate position signals, and Fourier analysis method calculates resource consumption. Large, expensive.

Method used

By using a magnetic encoder to obtain at least two consecutive cycles of sine and cosine signals, perform offset correction and amplitude correction, calculate the motor position and calculate the phase deviation through trigonometric functions, perform phase compensation, and obtain the compensated signal.

Benefits of technology

It realizes the calculation of phase deviation and phase compensation based on simple trigonometric functions, reduces the calculation amount and cost, is suitable for embedded systems, and ensures real-time correction and high reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119362964A_ABST
    Figure CN119362964A_ABST
Patent Text Reader

Abstract

The invention provides a motor rotor position harmonic compensation method and system and electronic equipment, and the method comprises the steps: obtaining a first sinusoidal signal and a first cosine signal of at least two continuous periods through a magnetic encoder, and carrying out the offset correction and amplitude correction of the first sinusoidal signal and the first cosine signal, obtaining a second sinusoidal signal and a second cosine signal; according to the second sinusoidal signal and the second cosine signal of the previous period, calculating a motor position theta by using an arc tangent algorithm; and according to the motor position theta, calculating a phase deviation # imgabs0 # by using a trigonometric function, and performing phase compensation on the second sinusoidal signal and the second cosine signal of the current period by using the phase deviation # imgabs1 # to obtain a compensated third sinusoidal signal and a compensated third cosine signal. Through the method, the phase deviation can be calculated based on the simple trigonometric function, phase compensation is achieved, the calculation amount is small, cost is low, the method is more suitable for an embedded system, and due to the small calculation amount, real-time correction can be achieved, and reliability is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of motor rotor detection, and in particular to a motor rotor position harmonic compensation method, system and electronic equipment. Background Art

[0002] Magnetic encoders based on the tunnel magnetoresistance effect (TMR) are widely used to detect motor movement. Due to the physical characteristics of the TMR magnetic encoder itself, interference in the magnetic field, or deviations in the installation process will cause the sine and cosine analog signals output by the TMR magnetic encoder to be non-ideal signals, with amplitude deviation, phase deviation, DC bias and high-order harmonics. If they are not compensated, it is inevitable that a more accurate position signal cannot be obtained.

[0003] The patent with publication number CN109579880B proposes a magnetic encoder with adaptive compensation function. After Fourier transforming the original signal, the high-order harmonic compensator removes the high-order harmonic components and DC bias components contained in the sine and cosine signals processed by the data processor according to the discrete Fourier transform, leaving the first fundamental component, and then performing phase compensation based on the phase angle information in the fundamental component. However, the Fourier analysis method used for compensation consumes a lot of computing resources and is costly to use in embedded systems.

[0004] The patent with publication number CN115882754A proposes an angle error compensation device for a permanent magnet synchronous motor linear Hall encoder. The amplitude compensation module, the offset compensation module and the phase compensation module are all based on the Sin signal and the Cos signal of the linear Hall sensor for compensation. The low-pass filter coefficient set for the sine and cosine signals is used to solve the problem of non-orthogonality of the sine and cosine signals, but it will bring about a phase lag problem, resulting in insufficient real-time performance of the angle decoding. Summary of the invention

[0005] In view of this, the present application proposes a motor rotor position harmonic compensation method, system and electronic device to solve the problems reflected in the above background technology.

[0006] According to one aspect of the present application, a method for compensating harmonics of a motor rotor position is provided, comprising the following steps:

[0007] Using a magnetic encoder to obtain at least two consecutive cycles of a first sine signal and a first cosine signal, performing offset correction and amplitude correction on the first sine signal and the first cosine signal to obtain a second sine signal and a second cosine signal;

[0008] According to the second sine signal and the second cosine signal of the previous cycle, the motor position θ is calculated using the arc tangent algorithm;

[0009] Based on the motor position θ, the phase deviation is calculated using trigonometric functions

[0010] Use Phase Deviation Phase compensation is performed on the second sine signal and the second cosine signal of the current cycle to obtain a compensated third sine signal and a third cosine signal.

[0011] Furthermore, the first sine signal and the first cosine signal are subjected to offset correction and amplitude correction to obtain a second sine signal and a second cosine signal, and the formula is:

[0012]

[0013] Furthermore, the inverse tangent algorithm is used to calculate the motor position θ, and the formula is:

[0014]

[0015] Furthermore, the phase deviation is calculated using trigonometric functions include:

[0016] Calculate the trigonometric function Sin for multiple motor positions 2 +Cos 2 The value of; multiple motor positions are at least two;

[0017] Based on the trigonometric function Sin under multiple motor positions 2 +Cos 2 The value of the phase deviation is calculated based on the properties of the trigonometric function.

[0018] Further, the motor positions include: θ=45°, θ=135°, θ=225°, θ=315°.

[0019] Furthermore, the phase deviation is calculated using trigonometric functions The formula is:

[0020]

[0021] Furthermore, the magnetic encoder is a tunnel magnetoresistance effect magnetic encoder.

[0022] Furthermore, the formula for phase compensation is:

[0023]

[0024] Cos=Cos

[0025] The present application also provides a motor rotor position harmonic compensation system, comprising:

[0026] An offset correction and amplitude correction module is used to obtain a first sine signal and a first cosine signal of at least two consecutive cycles using a magnetic encoder, and perform offset correction and amplitude correction on the first sine signal and the first cosine signal to obtain a second sine signal and a second cosine signal;

[0027] A motor position calculation module, used for calculating the motor position θ using an inverse tangent algorithm according to the second sine signal and the second cosine signal of the previous cycle;

[0028] Phase deviation calculation module, used to calculate the phase deviation using trigonometric functions according to the motor position θ

[0029] Phase compensation module, using phase deviation Phase compensation is performed on the second sine signal and the second cosine signal of the current cycle to obtain a compensated third sine signal and a third cosine signal.

[0030] The present application also provides an electronic device, including:

[0031] processor;

[0032] a memory for storing processor-executable instructions;

[0033] Wherein, the processor is configured to implement any of the above-mentioned motor rotor position harmonic compensation methods when executing executable instructions.

[0034] Beneficial effects of this application:

[0035] The present application uses a magnetic encoder to obtain a first sine signal and a first cosine signal of at least two consecutive cycles, performs offset correction and amplitude correction on the first sine signal and the first cosine signal, and obtains a second sine signal and a second cosine signal; uses an inverse tangent algorithm to calculate the motor position θ according to the second sine signal and the second cosine signal of the previous cycle; and uses a trigonometric function to calculate the phase deviation according to the motor position θ. Using the phase deviation Phase compensation is performed on the second sine signal and the second cosine signal of the current cycle to obtain the compensated third sine signal and the third cosine signal, thereby realizing the calculation of phase deviation and phase compensation based on simple trigonometric functions, with small calculation amount and low cost, and being more suitable for embedded systems. Moreover, due to the small calculation amount, real-time correction can be realized with high reliability. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 A schematic diagram of a flow chart of a motor rotor position harmonic compensation method according to an embodiment of the present application;

[0037] Figure 2 Sin is an embodiment of the present application2 +Cos 2 Graphs;

[0038] Figure 3 4 is a system block diagram of a motor rotor position harmonic compensation system according to an embodiment of the present application. DETAILED DESCRIPTION

[0039] Various exemplary embodiments, features and aspects of the present application will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.

[0040] Among them, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "radial", "circumferential" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present application or simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present application.

[0041] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0042] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0043] In addition, in order to better illustrate the present application, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present application can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present application.

[0044] The solution of the present application is applied to an embedded system. By using trigonometric functions to calculate the phase deviation and perform phase compensation, the sine and cosine signals obtained by the magnetic encoder can be compensated in real time in the embedded system, so as to facilitate the subsequent acquisition of more accurate motor rotor position information.

[0045] Example 1

[0046] Figure 1 The flow chart of the motor rotor position harmonic compensation method according to an embodiment of the present application is shown. By using this method, the amount of calculation can be reduced, thereby reducing the operating cost of the embedded system and enhancing reliability. Figure 1 , the flow chart includes:

[0047] Step S100: using a magnetic encoder to obtain at least two consecutive cycles of a first sine signal and a first cosine signal, performing offset correction and amplitude correction on the first sine signal and the first cosine signal to obtain a second sine signal and a second cosine signal.

[0048] Specifically, a magnetic encoder is used to obtain a first sine signal and a first cosine signal of at least two consecutive cycles, and offset correction and amplitude correction are performed on the first sine signal and the first cosine signal. The formula is as follows:

[0049]

[0050] After the offset correction and amplitude correction, the expressions of the second sine signal and the second cosine signal are:

[0051] Sin=Sin(ωt)

[0052]

[0053] Among them, Sin represents the sine signal, Cos represents the cosine signal, ω is the angular frequency, is the phase deviation.

[0054] Optionally, the magnetic encoder is a tunnel magnetoresistance (TMR) magnetic encoder.

[0055] Through the above steps, the sine and cosine signals can be preliminarily corrected to better calculate the motor position.

[0056] Step S200, calculating the motor position θ using an inverse tangent algorithm according to the second sine signal and the second cosine signal of the previous cycle.

[0057] Specifically, the formula for calculating the motor position θ using the inverse tangent algorithm is:

[0058]

[0059] Through the above steps, the position information of the motor can be calculated through the sine and cosine signals.

[0060] Step S300, using trigonometric functions to calculate the phase deviation according to the motor position θ

[0061] Specifically, the steps include:

[0062] Step S310, calculating the trigonometric function Sin under multiple motor positions 2 +Cos 2 at least two for multiple motor positions.

[0063] Optionally, as an optional implementation, the motor positions are selected as: θ = 45°, θ = 135°, and the trigonometric function Sin at these two angles can be calculated simultaneously. 2 +Cos 2 The value of , and the corresponding phase deviation is calculated based on the calculation result.

[0064] Optionally, as another possible implementation, the motor positions are selected as: θ = 45°, θ = 135°, θ = 225°, θ = 315°, and the trigonometric function Sin at these four angles can be calculated at the same time. 2 +Cos 2 The value of , and the corresponding phase deviation is calculated based on the calculation result.

[0065] Step S320, based on the trigonometric function Sin under multiple motor positions 2 +Cos 2 The value of the phase deviation is calculated based on the properties of the trigonometric function.

[0066] Specifically, see Figure 2 , Figure 2 Shows phase deviation When Sin is 0.2rad, 2 +Cos 2 Graph of the curve.

[0067] When there is a phase deviation, Sin 2 +Cos 2 It is expressed as:

[0068]

[0069] When θ = 45°, that is hour,

[0070] When θ=135°, that is hour,

[0071] When θ=225°, that is hour,

[0072] When θ=315°, that is hour,

[0073] Optionally, when the motor position is: θ = 45°, θ = 135°, the calculation is:

[0074]

[0075] After finishing, we get:

[0076]

[0077] Optionally, when the motor positions are: θ=45°, θ=135°, θ=225°, θ=315°, the calculation results are:

[0078]

[0079] After finishing, we get:

[0080]

[0081] Through the above steps, the phase deviation can be calculated by using simple trigonometric functions, thereby reducing the amount of calculation and being better applied in embedded systems.

[0082] Step S400, using phase deviation Phase compensation is performed on the second sine signal and the second cosine signal of the current cycle to obtain a compensated third sine signal and a third cosine signal.

[0083] Specifically, the phase compensation formula is:

[0084]

[0085] Cos=Cos

[0086] Through the above steps, the sine and cosine signals can be phase compensated, so as to more accurately reflect the position information of the motor rotor.

[0087] Example 2

[0088] Based on the same principle as the above method, a motor rotor position harmonic compensation system is also proposed, see Figure 3 , Figure 3 A motor rotor position harmonic compensation system according to an embodiment of the present application is shown, comprising:

[0089] The offset correction and amplitude correction module 100 is used to obtain a first sine signal and a first cosine signal of at least two consecutive cycles using a magnetic encoder, and perform offset correction and amplitude correction on the first sine signal and the first cosine signal to obtain a second sine signal and a second cosine signal.

[0090] The motor position calculation module 200 is used to calculate the motor position θ using an inverse tangent algorithm according to the second sine signal and the second cosine signal of the previous cycle.

[0091] The phase deviation calculation module 300 is used to calculate the phase deviation using trigonometric functions according to the motor position θ.

[0092] Phase compensation module 400 uses phase deviation Phase compensation is performed on the second sine signal and the second cosine signal of the current cycle to obtain a compensated third sine signal and a third cosine signal.

[0093] Obviously, those skilled in the art should understand that all or part of the processes in the above-mentioned embodiment method can be implemented by instructing the relevant hardware through a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned control methods. The modules or steps of the present invention can be implemented by a general-purpose computing device. They can be concentrated on a single computing device or distributed on a network composed of multiple computing devices. Optionally, they can be implemented by program codes executable by computing devices, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules respectively, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the present invention is not limited to any specific combination of hardware and software.

[0094] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment method can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned control methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory (Flash Memory), a hard disk (Hard Disk Drive, abbreviated as: HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above-mentioned types of memory.

[0095] Example 3

[0096] Furthermore, an electronic device is proposed, comprising:

[0097] processor;

[0098] a memory for storing processor-executable instructions;

[0099] Wherein, the processor is configured to implement the motor rotor position harmonic compensation method of embodiment 1 when executing executable instructions.

[0100] The electronic device of the embodiment of the present application includes a processor and a memory for storing processor executable instructions, wherein the processor is configured to implement any of the above motor rotor position harmonic compensation methods when executing the executable instructions.

[0101] It should be noted that the number of processors may be one or more. At the same time, the electronic device in the embodiment of the present application may also include an input device and an output device. The processor, memory, input device, and output device may be connected via a bus or in other ways, which are not specifically limited here.

[0102] The memory, as a computer-readable storage medium for implementing the motor rotor position harmonic compensation method, can be used to store software programs, computer executable programs, and various modules, such as: the program or module corresponding to the motor rotor position harmonic compensation method of the embodiment of the present application. The processor executes various functional applications and data processing of the electronic device by running the software program or module stored in the memory.

[0103] The input device can be used to receive input numbers or signals. The signal can be a key signal related to user settings and function control of the device / terminal / server. The output device can include a display device such as a display screen.

[0104] The embodiments of the present application have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A method for compensating harmonics of a motor rotor position, characterized in that: The following steps are involved: Using a magnetic encoder to obtain at least two consecutive cycles of a first sine signal and a first cosine signal, performing offset correction and amplitude correction on the first sine signal and the first cosine signal to obtain a second sine signal and a second cosine signal; Calculate the motor position θ using an inverse tangent algorithm according to the second sine signal and the second cosine signal of the previous cycle; According to the motor position θ, the phase deviation is calculated using trigonometric functions. Using the phase deviation Phase compensation is performed on the second sine signal and the second cosine signal of the current period to obtain a compensated third sine signal and a third cosine signal.

2. The motor rotor position harmonic compensation method according to claim 1, characterized in that: The offset correction and amplitude correction are performed on the first sine signal and the first cosine signal to obtain a second sine signal and a second cosine signal, and the formula is:

3. The motor rotor position harmonic compensation method according to claim 1, characterized in that: The inverse tangent algorithm is used to calculate the motor position θ, and the formula is:

4. The motor rotor position harmonic compensation method according to claim 1, characterized in that: The phase deviation is calculated using trigonometric functions include: Calculate the trigonometric function Sin for multiple motor positions 2 +Cos 2 The value of the plurality of motor positions is at least two; Based on the trigonometric function Sin under the multiple motor positions 2 +Cos 2 The phase deviation is calculated based on the properties of trigonometric functions.

5. The motor rotor position harmonic compensation method according to claim 4, characterized in that: The motor positions include: θ=45°, θ=135°, θ=225°, θ=315°.

6. The motor rotor position harmonic compensation method according to claim 5, characterized in that: The phase deviation is calculated using trigonometric functions The formula is:

7. The motor rotor position harmonic compensation method according to claim 1, characterized in that: The magnetic encoder is a tunnel magnetoresistance effect magnetic encoder.

8. The motor rotor position harmonic compensation method according to any one of claims 1 to 7, characterized in that: The phase compensation formula is: Cos=Cos.

9. A motor rotor position harmonic compensation system, characterized in that: include: An offset correction and amplitude correction module, used to use a magnetic encoder to obtain a first sine signal and a first cosine signal of at least two consecutive cycles, and perform offset correction and amplitude correction on the first sine signal and the first cosine signal to obtain a second sine signal and a second cosine signal; A motor position calculation module, used to calculate the motor position θ using an inverse tangent algorithm according to the second sine signal and the second cosine signal of the previous cycle; A phase deviation calculation module is used to calculate the phase deviation using trigonometric functions according to the motor position θ. The phase compensation module uses the phase deviation Phase compensation is performed on the second sine signal and the second cosine signal of the current period to obtain a compensated third sine signal and a third cosine signal.

10. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to implement the motor rotor position harmonic compensation method described in any one of claims 1-8 when executing the executable instructions.

Citation Information

Patent Citations

  • Magnetic encoder with adaptive compensation

    CN109579880B

  • Angle error compensation device for linear Hall encoder of permanent magnet synchronous motor

    CN115882754A

Cited By

  • Method and device for obtaining position signal of motor rotor and new energy automobile

    CN121508405A

  • TMR current acquisition self-calibration error compensation method, device, equipment and medium

    CN121831657A