Method, device, storage medium and apparatus for determining position of motor rotor

By performing resolver signal demodulation and error calculation on the motor rotor position signal, the method for determining the motor rotor position in a microcontroller was improved, solving the problem of poor calculation accuracy caused by low sampling rate, and realizing high-precision rotor position determination under low sampling rate conditions.

CN114024470BActive Publication Date: 2026-07-03SHANGHAI AUTOMOBILE GEAR WORKS

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANGHAI AUTOMOBILE GEAR WORKS
Filing Date
2021-10-27
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

In existing technologies, the position signal sampling rate of microcontrollers is low and the calculation accuracy is poor, resulting in inaccurate determination of the motor rotor position.

Method used

By acquiring the position signal of the motor rotor, converting it into a resolver signal and demodulating it, the demodulated sine envelope signal and cosine envelope signal are obtained. The position error is calculated using a preset position observer and an arctangent algorithm. The output of the position observer is adjusted to determine the actual position of the motor rotor.

Benefits of technology

In microcontrollers with low sampling rates, the calculation accuracy and adaptability of motor rotor position determination are improved, ensuring the accuracy of motor control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114024470B_ABST
    Figure CN114024470B_ABST
Patent Text Reader

Abstract

This invention discloses a method, device, storage medium, and apparatus for determining the position of a motor rotor. The invention acquires the position signal of the motor rotor and converts it into a resolver signal; demodulates the resolver signal to obtain a demodulated sine envelope signal and a cosine envelope signal; acquires the sine value of the rotor position to be measured corresponding to the sine envelope signal, and the cosine value of the rotor position to be measured corresponding to the cosine envelope signal; and determines the actual position of the motor rotor based on the sine value of the rotor position to be measured, the cosine value of the rotor position to be measured, and the observed sine and cosine values ​​measured by a preset position observer. Because this invention improves upon existing technologies with low sampling rates and reliance on algorithm parameter settings leading to poor calculation accuracy, it enhances the adaptability of traditional rotor angle calculation methods to microcontrollers with slower sampling rates, thereby accurately obtaining the actual position of the motor rotor.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of electric motors, and more particularly to a method, apparatus, storage medium, and device for determining the position of an electric motor rotor. Background Technology

[0002] Currently, the accuracy of rotor position sampling in automotive permanent magnet synchronous motors is crucial for torque control. To reduce hardware costs, a method using a resolver and software decoding is widely adopted. After the microcontroller acquires the electrical signal from the resolver at the motor rotor end, it calculates the rotor position using software. This calculation method originates from a position decoding chip. Because the sampling rate of the position decoding chip is much higher than that of the microcontroller, this calculation method is well-suited for decoding chips. However, in microcontrollers, especially with lower sampling rates, this type of algorithm has poor calculation accuracy, heavily relies on the tuning of its parameters, and has poor adaptability.

[0003] The above content is only used to help understand the technical solution of the present invention and does not represent an admission that the above content is prior art. Summary of the Invention

[0004] The main objective of this invention is to provide a method, device, storage medium, and apparatus for determining the position of a motor rotor, aiming to solve the technical problems of low position signal sampling rate and poor calculation accuracy in existing microcontrollers.

[0005] To achieve the above objectives, the present invention provides a method for determining the position of a motor rotor, the method comprising the following steps:

[0006] Acquire the position signal of the motor rotor and convert the position signal into a resolver signal;

[0007] The resolver signal is demodulated to obtain the demodulated sine envelope signal and cosine envelope signal;

[0008] Obtain the sine value of the rotor position to be measured corresponding to the sine envelope signal, and the cosine value of the rotor position to be measured corresponding to the cosine envelope signal;

[0009] The actual position of the motor rotor is determined based on the sine value of the rotor position to be measured, the cosine value of the rotor position to be measured, and the observed sine and cosine values ​​measured by the preset position observer.

[0010] Optionally, the step of determining the actual position of the motor rotor based on the sine value of the rotor position to be measured, the cosine value of the rotor position to be measured, and the observed sine and cosine values ​​measured by the preset position observer includes:

[0011] The position error value between the position of the rotor under test and the observed position of the preset position observer is determined based on the sine value of the rotor position under test, the cosine value of the rotor position under test, and the observed sine and cosine values ​​measured by the preset position observer.

[0012] The actual position of the motor rotor is determined based on the position error value and the preset position observer.

[0013] Optionally, the step of determining the position error between the rotor position to be measured and the observed position of the preset position observer based on the sine value of the rotor position to be measured, the cosine value of the rotor position to be measured, and the observed sine and cosine values ​​measured by the preset position observer further includes:

[0014] The arctangent value is calculated based on the preset arctangent algorithm, the sine value of the rotor position to be measured, and the cosine value of the rotor position to be measured, and the reference position of the motor rotor is determined based on the arctangent value;

[0015] The position error value is determined based on the reference position and the observation position obtained by the preset position observer.

[0016] Optionally, the step of determining the position error between the rotor position to be measured and the observed position of the preset position observer based on the sine value of the rotor position to be measured, the cosine value of the rotor position to be measured, and the observed sine and cosine values ​​measured by the preset position observer includes:

[0017] The first calculation result is obtained by multiplying the sine value of the rotor position to be measured with the cosine value of the observation position obtained by the preset position observer.

[0018] The second calculation result is obtained by multiplying the cosine value of the rotor position to be measured with the sine value of the observation position obtained by the preset position observer.

[0019] The position error value is determined based on the first calculation result and the second calculation result.

[0020] Optionally, the step of determining the actual position of the motor rotor based on the position error value and the preset position observer includes:

[0021] The position output by the preset position observer is adjusted according to the position error value to obtain the position adjustment result;

[0022] The actual position of the motor rotor is determined based on the position adjustment result.

[0023] Optionally, after the step of adjusting the position output by the preset position observer based on the position error value to obtain the position adjustment result, the method includes:

[0024] The number of times the step of determining the position error between the position of the rotor under test and the observed position of the preset position observer is performed is counted.

[0025] When the preset number of times is reached, the actual position of the motor rotor is output.

[0026] Optionally, the step of demodulating the resolver signal to obtain the demodulated sine envelope signal and cosine envelope signal includes:

[0027] The clutter in the resolver signal is filtered out to obtain the filtered sine analog signal and cosine analog signal;

[0028] The sinusoidal analog signal and the cosine analog signal are demodulated to obtain the demodulated sinusoidal envelope signal and cosine envelope signal.

[0029] Furthermore, to achieve the above objectives, the present invention also proposes a motor rotor position determination device, which includes a memory, a processor, and a motor rotor position determination program stored in the memory and executable on the processor. The motor rotor position determination program is configured to implement the motor rotor position determination steps as described above.

[0030] In addition, to achieve the above objectives, the present invention also proposes a storage medium storing a motor rotor position determination program, wherein when the motor rotor position determination program is executed by a processor, it implements the steps of the motor rotor position determination method as described above.

[0031] Furthermore, to achieve the above objectives, the present invention also proposes a motor rotor position determination device, the motor rotor position determination device comprising:

[0032] The signal acquisition module is used to acquire the position signal of the motor rotor and convert the position signal into a resolver signal;

[0033] The signal demodulation module is used to demodulate the resolver signal to obtain the demodulated sine envelope signal and cosine envelope signal;

[0034] The position acquisition module is used to acquire the sine value of the rotor position to be measured corresponding to the sine envelope signal, and the cosine value of the rotor position to be measured corresponding to the cosine envelope signal.

[0035] The position determination module is used to determine the actual position of the motor rotor based on the sine value of the rotor position to be measured, the cosine value of the rotor position to be measured, and the observed sine and cosine values ​​measured by the preset position observer.

[0036] This invention acquires the position signal of the motor rotor and converts it into a resolver signal; it demodulates the resolver signal to obtain a demodulated sine envelope signal and a cosine envelope signal; it acquires the sine value of the rotor position to be measured corresponding to the sine envelope signal, and the cosine value of the rotor position to be measured corresponding to the cosine envelope signal; and it determines the actual position of the motor rotor based on the sine value of the rotor position to be measured, the cosine value of the rotor position to be measured, and the observed sine and cosine values ​​measured by a preset position observer. Because this invention addresses the shortcomings of existing technologies where the microcontroller sampling rate is low and the calculation accuracy is poor due to reliance on the algorithm's parameter settings, this invention improves the traditional rotor angle calculation method, making it more adaptable to microcontrollers with slower sampling rates, thereby accurately obtaining the actual position of the motor rotor. Attached Figure Description

[0037] Figure 1 This is a schematic diagram of the structure of the motor rotor position determination device in the hardware operating environment involved in the embodiments of the present invention;

[0038] Figure 2 This is a flowchart illustrating the first embodiment of the motor rotor position determination method of the present invention;

[0039] Figure 3 This is a schematic diagram of a motor rotor position calculation device according to a first embodiment of the motor rotor position determination method of the present invention;

[0040] Figure 4 This is a schematic diagram of the analog signal of the first embodiment of the motor rotor position determination method of the present invention;

[0041] Figure 5 This is a schematic diagram of the demodulated signal of the first embodiment of the motor rotor position determination method of the present invention;

[0042] Figure 6 This is a flowchart illustrating the second embodiment of the motor rotor position determination method of the present invention;

[0043] Figure 7 This is a first schematic diagram of the angle calculation method in the second embodiment of the motor rotor position determination method of the present invention;

[0044] Figure 8 This is a block diagram of the second-order position observer calculation in the second embodiment of the motor rotor position determination method of the present invention;

[0045] Figure 9 This is a block diagram of the third-order position observer calculation in the second embodiment of the motor rotor position determination method of the present invention;

[0046] Figure 10 This is a second schematic diagram of the angle calculation method in the second embodiment of the motor rotor position determination method of the present invention;

[0047] Figure 11 This is a schematic diagram of the rotor position calculation and execution flow of the interrupt service routine in the second embodiment of the motor rotor position determination method of the present invention;

[0048] Figure 12 This is a schematic diagram of the rotor calculation simulation results of the second embodiment of the motor rotor position determination method of the present invention;

[0049] Figure 13 This is a structural block diagram of the first embodiment of the motor rotor position determination device of the present invention.

[0050] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0051] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0052] Reference Figure 1 , Figure 1 This is a schematic diagram of the device structure for determining the motor rotor position in the hardware operating environment involved in the embodiments of the present invention.

[0053] like Figure 1 As shown, the motor rotor position determination device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to establish communication between these components. The user interface 1003 may include a display screen, and optionally, it may also include a standard wired interface or a wireless interface. In this invention, the wired interface of the user interface 1003 may be a USB interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wireless-Fidelity (Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (RAM) or a non-volatile memory (NVM), such as a disk storage device. The memory 1005 may also optionally be a storage device independent of the aforementioned processor 1001.

[0054] Those skilled in the art will understand that Figure 1 The structure shown does not constitute a limitation on the motor rotor position determination device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0055] like Figure 1 As shown, the memory 1005, which is identified as a computer storage medium, may include an operating system, a network communication module, a user interface module, and a motor rotor position determination program.

[0056] exist Figure 1 In the motor rotor position determination device shown, the network interface 1004 is mainly used to connect to the backend server and communicate with the backend server; the user interface 1003 is mainly used to connect to the user equipment; the motor rotor position determination device calls the motor rotor position determination program stored in the memory 1005 through the processor 1001 and executes the motor rotor position determination method provided in the embodiment of the present invention.

[0057] Based on the above hardware structure, an embodiment of the motor rotor position determination method of the present invention is proposed.

[0058] Reference Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the motor rotor position determination method of the present invention, which presents the first embodiment of the motor rotor position determination method of the present invention.

[0059] In this embodiment, the method for determining the position of the motor rotor includes the following steps:

[0060] Step S10: Obtain the position signal of the motor rotor and convert the position signal into a resolver signal.

[0061] It should be noted that the executing entity in this embodiment can be a device with a motor rotor position determination function. For further explanation, please refer to, for example... Figure 3 The schematic diagram of the motor rotor position calculation device shown includes a hardware part and a microcontroller part. The hardware part includes a rotary transformer 101 and a hardware filter circuit 102. The microcontroller part includes an ADC module 103, a signal demodulation module 104, and a software rotor angle calculation module 105. This embodiment uses a motor rotor position determination device as an example, and this embodiment does not limit it. In this embodiment and the following embodiments, the motor rotor position determination device is used as an example to illustrate the motor rotor position determination method based on the position observer of the present invention.

[0062] It is understood that the electronic rotor position can refer to the rotor position of a vehicle permanent magnet synchronous motor, and the position includes the rotor angle information of the motor.

[0063] It should be understood that the resolver signal refers to the conversion of the motor rotor position signal into an electrical signal through the resolver 101.

[0064] Step S20: Demodulate the resolver signal to obtain the demodulated sine envelope signal and cosine envelope signal.

[0065] It should be noted that the resolver signal input from the resolver 101 is demodulated by the signal demodulation module 104 to obtain the demodulated sine envelope signal and cosine envelope signal.

[0066] Further, step S20 includes: filtering out clutter in the resolver signal to obtain a filtered sine analog signal and a cosine analog signal; and demodulating the sine analog signal and the cosine analog signal to obtain a demodulated sine envelope signal and a cosine envelope signal.

[0067] It should be noted that, in order to improve the sampling accuracy of the microcontroller ADC module 103 in the later stage, noise in the electrical signal output by the rotary transformer 101 can be filtered out by the hardware filtering circuit 102, such as... Figure 4 A schematic diagram of the analog signals, including sin analog signals and cos analog signals. The low-frequency components in the waveform contain rotor position information.

[0068] Understandably, to facilitate microcontroller processing, the ADC module 103 converts the sin and cos analog signals input from the hardware filter circuit 102 into digital quantities. The signal demodulation module 104 is used to extract the low-frequency components from the digital quantities of the ADC module 103, such as... Figure 5 A schematic diagram of the demodulated signal, including the demodulated sin envelope signal and the demodulated cos envelope signal.

[0069] Step S30: Obtain the sine value of the rotor position to be measured corresponding to the sine envelope signal, and the cosine value of the rotor position to be measured corresponding to the cosine envelope signal.

[0070] It should be noted that the rotor position to be measured can refer to the actual position of the motor rotor to be measured.

[0071] Understandably, in order to accurately obtain the actual position of the motor rotor, the rotor position can be determined by the input demodulated sin envelope signal and the demodulated cos envelope signal through the software rotor angle calculation module 105.

[0072] It should be understood that the sin envelope signal corresponds to the sine value of the rotor position under test, and the cos envelope signal corresponds to the cosine value of the rotor position under test. For example, if the actual rotor position of the motor under test is θ, that is, the signal demodulation results in Sin(θ) and Cos(θ), in order to obtain the actual rotor position, it is necessary to decompose and calculate Sin(θ) and Cos(θ).

[0073] Step S40: Determine the actual position of the motor rotor based on the sine value of the rotor position to be measured, the cosine value of the rotor position to be measured, and the observed sine and cosine values ​​measured by the preset position observer.

[0074] It should be noted that, in order to accurately obtain the actual position of the motor rotor, the actual position of the motor rotor is calculated by a preset position observer. The preset position observer can be a second-order or third-order position observer. In this embodiment, no specific restriction is placed on the type of position observer.

[0075] Understandably, the observed sine value refers to the observed sine and observed cosine values ​​determined by the preset observer based on the estimated position when measuring the position of the motor rotor.

[0076] This embodiment acquires the position signal of the motor rotor and converts it into a resolver signal. The resolver signal is demodulated to obtain a demodulated sine envelope signal and a cosine envelope signal. The sine value of the rotor position to be measured corresponding to the sine envelope signal and the cosine value of the rotor position to be measured corresponding to the cosine envelope signal are obtained. The actual position of the motor rotor is determined based on the sine value of the rotor position to be measured, the cosine value of the rotor position to be measured, and the observed sine and cosine values ​​measured by a preset position observer. Because this embodiment addresses the issue of low sampling rate and poor calculation accuracy due to reliance on algorithm parameter settings in existing technologies, it improves the traditional rotor angle calculation method, making it more adaptable to microcontrollers with slower sampling rates, thereby accurately obtaining the actual position of the motor rotor.

[0077] Reference Figure 6 , Figure 6 This is a flowchart illustrating the second embodiment of the motor rotor position determination method of the present invention, based on the above. Figure 2 The first embodiment shown presents a second embodiment of the method for determining the rotor position of the motor according to the present invention.

[0078] In this embodiment, step S40 includes:

[0079] Step S401: Determine the position error value between the position of the rotor to be tested and the observed position of the preset position observer based on the sine value of the rotor position to be tested, the cosine value of the rotor position to be tested, and the observed sine and cosine values ​​measured by the preset position observer.

[0080] It should be noted that, in order to accurately obtain the actual position of the motor rotor, the actual position of the motor rotor can be determined by the position error value between the observation position of the observer and the position of the rotor to be measured.

[0081] Step S402: Determine the actual position of the motor rotor based on the position error value and the preset position observer.

[0082] Step S401 further includes: calculating an arctangent value based on a preset arctangent algorithm, the sine value of the rotor position to be measured, and the cosine value of the rotor position to be measured, and determining a reference position of the motor rotor based on the arctangent value; and determining a position error value based on the reference position and the observation position obtained by the preset position observer.

[0083] It should be noted that the preset arctangent algorithm refers to the algorithm set in advance to calculate the reference position of the motor rotor, and the arctangent value is the value used to characterize the reference position of the motor rotor.

[0084] Understandably, for further explanation, you may refer to... Figure 7 The first schematic diagram of the angle calculation method includes: an arctangent calculator 201, an adder 202, and a second- or third-order position observer 203, where Φ is the position calculation output of the observer; θ is the actual rotor angle; Φ ρεφ : This is the reference position, the angle value obtained after arctangent calculation of Sin(θ) and Cos(θ); Err: The difference between the actual rotor angle and the position calculated by the observer. The arctangent calculator receives the demodulated resolver Sin and Cos signals and calculates the arctangent value based on their ratio. This arctangent value is the reference position Φ of the motor rotor. ref Adder 202 is used to calculate the reference position Φ of the arctangent operator. ref The difference between the position output Φ of the second- or third-order observer and the position error Err = Φ. ref -Φ. A second- or third-order observer can be configured based on the reference position Φ. ref The position output Φ is continuously adjusted based on the difference between the position output Φ and the reference position Φ, so that the position output Φ approaches the reference position Φ. ref ,like Figure 8 The diagram shows the computational block diagram of a second-order position observer, where K1, a, b, and c are the gain coefficients of the second-order observer, used to adjust the observer response and convergence speed; Unit Delay is the unit delay element; Integrator is the integrator module; and Compensator is the phase compensator module. Figure 9 The diagram shown is a block diagram of the calculation of a third-order position observer, where K i K p K d The gain coefficient of the third-order observer is used to adjust the observer response and convergence speed; Unit Delay: unit delay element; MultiAdd, MultiAdd1, and MultiAdd2: are all multiply-accumulate submodules; T s : The gain coefficient of the multiply-accumulate submodule, which is related to the observer execution interval. Figure 8 , Figure 9 The input Phi_ref corresponds to the reference position Φ refThe corresponding position of Phi_out will be output as Φ. Figure 7 In the angle calculation implementation method 1 shown, the second-order or third-order observer is executed in the microcontroller interrupt service routine, and the number of executions is greater than 1. This is because the calculation of the second-order or third-order observer is a successive approximation process, and the execution count is greater than 1 to ensure the completion of this approximation process and finally obtain a stable value.

[0085] Furthermore, in order to improve computing performance and improve the traditional rotor angle calculation method based on the observer, this embodiment also includes another calculation method. Step S401 further includes: multiplying the sine value of the rotor position to be measured with the observation cosine value corresponding to the observation position obtained by the preset position observer to obtain a first calculation result; multiplying the cosine value of the rotor position to be measured with the observation sine value corresponding to the observation position obtained by the preset position observer to obtain a second calculation result; and determining the position error value based on the first calculation result and the second calculation result.

[0086] It should be noted that the first calculation result can refer to the result obtained by multiplying the Sin(θ) corresponding to the demodulated envelope signal with the observation cosine value Cos(Φ) corresponding to the preset position observer, i.e., Sin(θ)*Cos(Φ); the second calculation result can refer to the result obtained by multiplying the Cos(θ) corresponding to the demodulated envelope signal with the observation cosine value Sin(Φ) corresponding to the preset position observer, i.e., Cos(θ)*Sin(Φ).

[0087] In the specific implementation Figure 10 The second schematic diagram of the angle calculation method shown includes a multiplier 301, an adder 302, a second-order or third-order position observer 303, and Sin and Cos operations 304. Where Φ is the position calculation output of the observer; θ is the actual rotor angle; Err is the difference between the actual rotor angle and the position calculation output of the observer. The multiplier multiplies the demodulated resolver Sin(θ) and Cos(θ) signals with the Sin(Φ) and Cos(Φ) values ​​of the position output Φ, respectively, to obtain Sin(θ)*Cos(Φ) and Cos(θ)*Sin(Φ). The adder calculates the difference between Sin(θ)*Cos(Φ) and Cos(θ)*Sin(Φ), which reflects the error between the position observer's position output Φ and the actual rotor position Φ, i.e., the error value Err is:

[0088] The error value Err=Sin(θ)*Cos(Φ)-Cos(θ)*Sin(Φ)=Sin(θ-Φ).

[0089] In the above formula, when the observer is in a steady state, Sin(θ-Φ)≈(θ-Φ), reflecting the position error. The second- or third-order observer continuously adjusts the position output Φ based on the error between the output Φ and the actual rotor position θ, eventually obtaining a stable value. For example... Figure 8 The block diagram for calculating the second-order position observer is shown below. The block diagram for calculating the third-order position observer is shown below. Figure 9 As shown. Figure 8 , Figure 9 The input Phi_ref corresponds to the error value between the output Φ at the corresponding position and the actual rotor position θ, and the output Phi_out corresponds to the output Φ at the corresponding position. The Sin and Cos operations calculate Cos(Φ) and Sin(Φ) based on the position output Φ of the second- or third-order observer. Figure 10 In the second schematic diagram of the angle calculation method shown, the second-order or third-order observer 303 and the Sin and Cos operations are executed in the microcontroller interrupt service routine, and the number of executions is greater than 1. This is because the calculation of the second-order or third-order observer is a successive approximation process, and the number of executions is greater than 1 to ensure the completion of this approximation process and finally obtain a stable value.

[0090] Furthermore, step S402 further includes: adjusting the position output by the preset position observer according to the position error value to obtain a position adjustment result; and determining the actual position of the motor rotor according to the position adjustment result.

[0091] It should be noted that when calculating the actual position of the motor rotor, the position measured by the position observer can be adjusted by the position error value so that the observer's calculation gradually approaches the actual position and eventually obtains a stable value.

[0092] In practice, the second- or third-order observer continuously adjusts the position output Φ based on the error between the output Φ and the actual rotor position θ, eventually obtaining a stable value. The second- or third-order observer, along with the Sin and Cos operations, are executed within the microcontroller's interrupt service routine, and the execution count is greater than one. This is because the calculation of the second- or third-order observer is a successive approximation process; the greater than one execution count ensures the completion of this approximation process, ultimately leading to a stable value.

[0093] Further, after the step of adjusting the position output by the preset position observer based on the position error value to obtain the position adjustment result, the method includes: counting the number of times the step of determining the position error value between the position of the rotor under test and the observed position of the preset position observer based on the sine value of the rotor under test position, the cosine value of the rotor under test position, and the observed sine and cosine values ​​measured by the preset position observer is performed; and when the number of times reaches a preset number, the actual position of the motor rotor is output.

[0094] It should be noted that the preset number of times refers to the number of times the step of determining the position error value between the position of the rotor under test and the observed position of the preset position observer is performed based on the sine value of the rotor position under test, the cosine value of the rotor position under test, and the observed sine and cosine values ​​measured by the preset position observer.

[0095] In specific implementation, this embodiment provides a specific application case A of the software decoding method for a rotary transformer based on a position observer described in this invention. However, it is not limited to this specific application case A; the microcontroller can be an Infineon Aurix series TC27x microcontroller. The DSADC module in this microcontroller can simultaneously realize high-speed acquisition and signal demodulation of Sin and Cos signals. The demodulated Sin and Cos signals are sent to the rotor angle calculation module to complete the electronic rotor position calculation. This embodiment uses... Figure 10 The second schematic diagram of the angle calculation method shown is used, with the position observer being... Figure 8 The second-order position observer is shown. Rotor angle calculation is performed in the interrupt service routine, with an interrupt cycle of 100 microseconds, consistent with the PWM frequency controlling the motor. For example... Figure 11 The diagram shows the rotor position calculation execution flow of the interrupt service routine. Upon entering the interrupt, the resolver signals Sin(θ) and Cos(θ) acquired and demodulated by the DSADC module are first read, where θ represents the actual rotor position. Then, the Sin (Φ) and Cos (Φ) values ​​from the observer's position output are calculated, and the error between the observer's calculated position output Φ and the actual rotor angle θ is obtained using Sin(θ)*Cos(Φ)-Cos(θ)*Sin(Φ). This error value is then sent to... Figure 8 The second-order position observer shown yields the position output Φ. For example... Figure 11As shown, the error calculation between the position output Φ and the actual rotor angle, and the operation of the second-order position observer, need to be performed multiple times. In this embodiment, the preset number of executions is 10. After 10 executions, the obtained position output Φ is the actual rotor position θ, which can be used for subsequent motor control calculations. In this embodiment, the control parameters of each second-order position observer are: k1 = 96, k2 = 4.14E8, a = 1, b = 0.4, c = 3.1E-6. The Matlab Simulink simulation block diagram of the rotor position calculation method in this embodiment is shown. The AngleGenerator submodule is the rotor position generator, which simulates and generates the rotor position ActualAngle and uses the Angle2SinCos submodule to generate the Sin and Cos values ​​of the rotor position, i.e., simulating the output signal after demodulation of the rotary transformer. The Isr_AngleObserv_100us submodule is the rotor position calculation module built based on the rotor calculation simulation model, and the output calculation result is Phi_out, i.e., the rotor position. Figure 12 The schematic diagram of the rotor calculation simulation results shown illustrates the simulation results of the rotor position calculation in this embodiment. It can be seen that the error between the observer's calculated result Phi_out and the actual rotor position ActualAngle does not exceed 0.0016 rad, which fully meets the requirements of actual motor control. Using the technical solution of this invention, the rotor position calculation accuracy fully meets the control requirements of automotive permanent magnet synchronous motors and has good applicability in microcontrollers with slow sampling rates.

[0096] This embodiment acquires the position signal of the motor rotor and converts it into a resolver signal. The resolver signal is demodulated to obtain demodulated sine and cosine envelope signals. The sine value of the rotor position to be measured corresponding to the sine envelope signal, and the cosine value of the rotor position to be measured corresponding to the cosine envelope signal, are obtained. The position error value between the rotor position to be measured and the observed position of the preset position observer is determined based on the sine and cosine values ​​of the rotor position to be measured, and the observed sine and cosine values ​​measured by the preset position observer. The actual position of the motor rotor is determined based on the position error value and the preset position observer. This embodiment addresses the issue of low sampling rate and poor calculation accuracy caused by reliance on algorithm parameter settings in existing technologies. By improving the traditional rotor angle calculation method, this embodiment achieves good adaptability to microcontrollers with slower sampling rates, thereby accurately obtaining the actual position of the motor rotor.

[0097] In addition, to achieve the above objectives, the present invention also proposes a storage medium storing a motor rotor position determination program, wherein when the motor rotor position determination program is executed by a processor, it implements the steps of the motor rotor position determination method as described above.

[0098] Reference Figure 13 , Figure 13 This is a structural block diagram of the first embodiment of the motor rotor position determination device of the present invention.

[0099] like Figure 13 As shown, the motor rotor position determination device proposed in this embodiment of the invention includes:

[0100] Signal acquisition module 10 is used to acquire the position signal of the motor rotor and convert the position signal into a resolver signal;

[0101] The signal demodulation module 20 is used to demodulate the resolver signal to obtain the demodulated sine envelope signal and cosine envelope signal;

[0102] The position acquisition module 30 is used to acquire the sine value of the rotor position to be measured corresponding to the sine envelope signal, and the cosine value of the rotor position to be measured corresponding to the cosine envelope signal.

[0103] The position determination module 40 is used to determine the actual position of the motor rotor based on the sine value of the rotor position to be measured, the cosine value of the rotor position to be measured, and the observed sine and cosine values ​​measured by the preset position observer.

[0104] This embodiment acquires the position signal of the motor rotor and converts it into a resolver signal. The resolver signal is demodulated to obtain a demodulated sine envelope signal and a cosine envelope signal. The sine value of the rotor position to be measured corresponding to the sine envelope signal and the cosine value of the rotor position to be measured corresponding to the cosine envelope signal are obtained. The actual position of the motor rotor is determined based on the sine value of the rotor position to be measured, the cosine value of the rotor position to be measured, and the observed sine and cosine values ​​measured by a preset position observer. Because this embodiment addresses the issue of low sampling rate and poor calculation accuracy due to reliance on algorithm parameter settings in existing technologies, it improves the traditional rotor angle calculation method, making it more adaptable to microcontrollers with slower sampling rates, thereby accurately obtaining the actual position of the motor rotor.

[0105] Furthermore, the position determination module 40 is also used to determine the position error value between the position of the rotor to be tested and the observed position of the preset position observer based on the sine value of the rotor position to be tested, the cosine value of the rotor position to be tested, and the observed sine value and observed cosine value measured by the preset position observer; and to determine the actual position of the motor rotor based on the position error value and the preset position observer.

[0106] Furthermore, the position determination module 40 is also used to calculate the arctangent value according to the preset arctangent algorithm, the sine value of the rotor position to be measured, and the cosine value of the rotor position to be measured, and to determine the reference position of the motor rotor according to the arctangent value; and to determine the position error value according to the reference position and the observation position obtained by the preset position observer.

[0107] Furthermore, the position determination module 40 is also used to multiply the sine value of the rotor position to be measured by the cosine value of the observation corresponding to the observation position obtained by the preset position observer to obtain a first calculation result; multiply the cosine value of the rotor position to be measured by the sine value of the observation corresponding to the observation position obtained by the preset position observer to obtain a second calculation result; and determine the position error value based on the first calculation result and the second calculation result.

[0108] Furthermore, the electrical position determination module 40 is also used to adjust the position output by the preset position observer according to the position error value to obtain the position adjustment result; and to determine the actual position of the motor rotor according to the position adjustment result.

[0109] Furthermore, the position determination module 40 is also used to count the number of times the step of determining the position error value between the position of the rotor under test and the observed position of the preset position observer is performed based on the sine value of the rotor under test position, the cosine value of the rotor under test position, and the observed sine value and observed cosine value measured by the preset position observer; when the number of times reaches the preset number of times, the actual position of the motor rotor is output.

[0110] Furthermore, the position determination module 40 is also used to filter out clutter in the resolver signal to obtain a filtered sine analog signal and a cosine analog signal; and to demodulate the sine analog signal and the cosine analog signal to obtain a demodulated sine envelope signal and a cosine envelope signal.

[0111] It should be understood that the above are merely illustrative examples and do not constitute any limitation on the technical solutions of the present invention. In specific applications, those skilled in the art can make settings as needed, and the present invention does not impose any restrictions on this.

[0112] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of this invention. In practical applications, those skilled in the art can select some or all of the workflow to achieve the purpose of this embodiment according to actual needs, and no restrictions are imposed here.

[0113] In addition, for technical details not described in detail in this embodiment, please refer to the motor rotor position determination method provided in any embodiment of the present invention, which will not be repeated here.

[0114] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.

[0115] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments. In the unit claims listing several devices, several of these devices may be embodied by the same hardware item. The use of the terms first, second, and third, etc., does not indicate any order and can be interpreted as names.

[0116] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as a read-only memory image (ROM) / random access memory (RAM), magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0117] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A method of determining the position of a rotor of an electric machine, characterized by, The method for determining the position of the motor rotor includes the following steps: Acquire the position signal of the motor rotor and convert the position signal into a resolver signal; The resolver signal is demodulated to obtain the demodulated sine envelope signal and cosine envelope signal; Obtain the sine value of the rotor position to be measured corresponding to the sine envelope signal, and the cosine value of the rotor position to be measured corresponding to the cosine envelope signal; The actual position of the motor rotor is determined based on the sine value of the rotor position to be measured, the cosine value of the rotor position to be measured, and the observed sine and cosine values ​​measured by the preset position observer. The preset position observer is a third-order position observer, which includes a multiply-add submodule. The step of determining the actual position of the motor rotor based on the sine value of the rotor position to be measured, the cosine value of the rotor position to be measured, and the observed sine and cosine values ​​measured by the preset position observer includes: The position error value between the position of the rotor under test and the observed position of the preset position observer is determined based on the sine value of the rotor position under test, the cosine value of the rotor position under test, and the observed sine and cosine values ​​measured by the preset position observer. The actual position of the motor rotor is determined based on the position error value and the preset position observer. The step of determining the position error between the rotor position to be measured and the observed position of the preset position observer based on the sine value of the rotor position to be measured, the cosine value of the rotor position to be measured, and the observed sine and cosine values ​​measured by the preset position observer further includes: The arctangent value is calculated based on the preset arctangent algorithm, the sine value of the rotor position to be measured, and the cosine value of the rotor position to be measured, and the reference position of the motor rotor is determined based on the arctangent value; The position error value is determined based on the reference position and the observation position obtained by the preset position observer; When determining the reference position, the position output is adjusted based on the difference between the reference position and the position output of the third-order position observer, so that the position output approximates the reference position. During the adjustment of the position output, the response and convergence speed of the third-order position observer are adjusted by the gain coefficient of the third-order observer, and the execution interval of the third-order position observer is controlled by the gain coefficient of the multiply-accumulate submodule.

2. The method of claim 1, wherein, The step of determining the position error between the rotor position to be measured and the observed position of the preset position observer based on the sine value of the rotor position to be measured, the cosine value of the rotor position to be measured, and the observed sine and cosine values ​​measured by the preset position observer includes: The first calculation result is obtained by multiplying the sine value of the rotor position to be measured with the cosine value of the observation position obtained by the preset position observer. The second calculation result is obtained by multiplying the cosine value of the rotor position to be measured with the sine value of the observation position obtained by the preset position observer. The position error value is determined based on the first calculation result and the second calculation result.

3. A method of determining the position of a rotor of an electrical machine as claimed in claim 1 or 2, characterized in that The step of determining the actual position of the motor rotor based on the position error value and the preset position observer includes: The position output by the preset position observer is adjusted according to the position error value to obtain the position adjustment result; The actual position of the motor rotor is determined based on the position adjustment result.

4. The method of claim 3, wherein, After the step of adjusting the position output by the preset position observer based on the position error value to obtain the position adjustment result, the following steps are included: The number of times the step of determining the position error between the position of the rotor under test and the observed position of the preset position observer is performed is counted. When the preset number of times is reached, the actual position of the motor rotor is output.

5. The method for determining the position of a motor rotor as described in claim 1, characterized in that, The step of demodulating the resolver signal to obtain the demodulated sine envelope signal and cosine envelope signal includes: The clutter in the resolver signal is filtered out to obtain the filtered sine analog signal and cosine analog signal; The sinusoidal analog signal and the cosine analog signal are demodulated to obtain the demodulated sinusoidal envelope signal and cosine envelope signal.

6. A device for determining the position of a motor rotor, characterized in that, The motor rotor position determination device includes: a memory, a processor, and a motor rotor position determination program stored in the memory and executable on the processor. When the motor rotor position determination program is executed by the processor, it implements the motor rotor position determination method as described in any one of claims 1 to 5.

7. A storage medium, characterized in that, The storage medium stores a motor rotor position determination program, which, when executed by a processor, implements the motor rotor position determination method as described in any one of claims 1 to 5.

8. A device for determining the position of a motor rotor, characterized in that, The motor rotor position determination device includes: The signal acquisition module is used to acquire the position signal of the motor rotor and convert the position signal into a resolver signal; The signal demodulation module is used to demodulate the resolver signal to obtain the demodulated sine envelope signal and cosine envelope signal; The position acquisition module is used to acquire the sine value of the rotor position to be measured corresponding to the sine envelope signal, and the cosine value of the rotor position to be measured corresponding to the cosine envelope signal. The position determination module is used to determine the actual position of the motor rotor based on the sine value of the rotor position to be measured, the cosine value of the rotor position to be measured, and the observed sine and cosine values ​​measured by the preset position observer. The preset position observer is a third-order position observer, which includes a multiply-add submodule. The position determination module is further configured to determine the position error value between the position of the rotor under test and the observed position of the preset position observer based on the sine value of the rotor position under test, the cosine value of the rotor position under test, and the observed sine value and observed cosine value measured by the preset position observer; and to determine the actual position of the motor rotor based on the position error value and the preset position observer. The position determination module is further configured to calculate an arctangent value based on a preset arctangent algorithm, the sine value of the rotor position to be measured, and the cosine value of the rotor position to be measured, and determine a reference position of the motor rotor based on the arctangent value; and determine a position error value based on the reference position and the observation position obtained by the preset position observer. The position determination module is further configured to adjust the position output based on the difference between the reference position and the position output of the third-order position observer when determining the reference position, so that the position output approximates the reference position; during the adjustment of the position output, the response and convergence speed of the third-order position observer are adjusted by the gain coefficient of the third-order observer, and the execution interval of the third-order position observer is controlled by the gain coefficient of the multiply-accumulate submodule.