A method for obtaining position signal of permanent magnet synchronous motor

A hardware system with a MATLAB model and SPI interfaces efficiently acquires precise position and speed signals for permanent magnet synchronous motors, addressing complexity and enabling rapid iteration.

CN115664272BActive Publication Date: 2025-01-03CHINA NORTH VEHICLE RES INST
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211124808.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-15
Publication Date
2025-01-03
Estimated Expiration
2042-09-15

AI Technical Summary

Technical Problem

The existing methods for obtaining position signals of permanent magnet synchronous motors, such as using SPI communication and handwriting code, are complex, inefficient, and hinder rapid iteration due to the need for extensive manual code changes in different engineering environments.

Method used

A hardware system comprising a permanent magnet synchronous motor, a resolver, a resolver decoding chip, and a DSP chip, connected through a MATLAB model, with functions one, two, and three to accurately and efficiently obtain position and speed signals using SPI interfaces.

Benefits of technology

This method allows for rapid acquisition of precise position and speed signals, supports quick iteration by adapting only specific parts of the system, and ensures accurate motor control with high data transmission rates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115664272B_ABST
    Figure CN115664272B_ABST
Patent Text Reader

Abstract

The invention discloses a method for obtaining a position signal of a permanent magnet synchronous motor, which belongs to the technical field of permanent magnet synchronous motor control, and the steps include: step one: connecting a permanent magnet synchronous motor, a rotary transformer, a rotary transformer decoding chip and a DSP chip to form a hardware system for obtaining a position signal of a permanent magnet synchronous motor; step two: constructing three functions in MATLAB, namely function one, function two and function three, wherein function one, function two and function three sequentially complete the permanent magnet synchronous motor position signal reading readiness, position signal reading and position signal reading completion through the SPI interface of the DSP chip. The method can accurately obtain the position signal of the permanent magnet synchronous motor, and can greatly improve the efficiency of the permanent magnet synchronous motor control model in obtaining the motor position signal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of permanent magnet synchronous motor control, and in particular relates to a method for obtaining a position signal of a permanent magnet synchronous motor. Background Art

[0002] As the main driving force output mechanism of the vehicle, the efficient and stable operation of the permanent magnet synchronous motor is a necessary link for the stability output of the vehicle. As the key to the control of the permanent magnet synchronous motor, the accurate acquisition of the motor position signal is crucial, which directly affects the accuracy of the AC-DC axis decoupling control of the permanent magnet synchronous motor, and ultimately affects the output power, efficiency, power factor and other key characteristics of the electric drive system.

[0003] In order to obtain the position signal of the permanent magnet synchronous motor, designers often use SPI communication to control the resolver decoder chip to obtain a more accurate position signal of the permanent magnet synchronous motor, thereby supporting the precise control of the permanent magnet synchronous motor. However, the data output timing of the resolver decoder chip is complex and involves many pins, which makes the acquisition of the position signal of the permanent magnet synchronous motor mainly achieved by handwriting code. However, the handwriting code method is not conducive to the clear division of labor in complex projects, and the handwriting code needs to be greatly changed in different engineering environments, which cannot achieve rapid iteration. Summary of the invention

[0004] In view of this, the present invention provides a method for obtaining a position signal of a permanent magnet synchronous motor. The method realizes rapid acquisition of the position signal of the permanent magnet synchronous motor by utilizing a hardware system composed of a hardware connection including a permanent magnet synchronous motor, a resolver, a resolver decoding chip and a DSP chip, based on full code generation of a MATLAB model.

[0005] The present invention adopts the following technical solutions:

[0006] A method for obtaining a position signal of a permanent magnet synchronous motor, the steps comprising:

[0007] Step 1: Connect the permanent magnet synchronous motor, the resolver, the resolver decoding chip and the DSP chip to form a hardware system for obtaining the position signal of the permanent magnet synchronous motor;

[0008] Step 2: Construct three functions in MATLAB, namely function one, function two and function three. Function one, function two and function three respectively complete the permanent magnet synchronous motor position signal reading preparation, position signal reading and position signal reading completion through the SPI interface of the DSP chip.

[0009] Furthermore, the function 1 includes an SPI Master Transfer module, and matches the sampling time of the sampling interface of the resolver decoding chip with the data output timing of the resolver decoding chip, the data bit is the valid information bit of the resolver decoding chip, the chip select mode is set to be from the SPI peripheral, the hex2dec('FF00') constant is input, and the output is connected to the Terminator module.

[0010] Further, the function two includes a first module and a second module;

[0011] The first module includes an SPI Master Transfer module, and the sampling time of the sampling interface of the resolver decoding chip is matched with the data output timing of the resolver decoding chip, the data bit is the valid information bit of the resolver decoding chip, the chip select mode is set to be from the SPI peripheral, the input is the hex2dec ('0000') constant, and the output is connected to the input of the second module;

[0012] The second module obtains the permanent magnet synchronous motor position signal by operating the output of the first module.

[0013] Furthermore, the second module obtains the position signal of the permanent magnet synchronous motor through the following steps:

[0014] Step A: Obtain the current position signal θ of the permanent magnet synchronous motor by the following formula: e :

[0015] θ e =Angular_Digit*2*π / 4095

[0016] In the above formula, θ e is the current position signal of the permanent magnet synchronous motor, and Angular_Digit is the digital value corresponding to the resolution of the resolver decoding chip in the data bit output by the first module;

[0017] Step B: Obtain the position signal θ after the current position signal of the permanent magnet synchronous motor is positively shifted by the following method: abs :

[0018] If satisfied:

[0019] θ e -θ init >0,

[0020] So,

[0021] θ abs =θ e -θ init ,

[0022] otherwise,

[0023] θ abs =θ e -θ init +2π;

[0024] Step C: Obtain the actual position signal θ required for the permanent magnet synchronous motor control by the following method: dq :

[0025] if:

[0026] θ abs *p m / p r >2π

[0027] So:

[0028] θ dq =θ abs *p m / p r -2π

[0029] otherwise:

[0030] θ dq =θ abs *p m / p r

[0031] Among them, p r is the number of pole pairs of the rotary transformer, p m is the number of pole pairs of the permanent magnet synchronous motor.

[0032] Furthermore, the function 2 also includes a third module;

[0033] The input of the third module is connected to the output of the first module, and the permanent magnet synchronous motor speed signal is obtained by calculating the output of the first module.

[0034] Furthermore, the third module obtains the electrical angular velocity of the permanent magnet synchronous motor through the following steps:

[0035] Step 1: Determine the zero point by:

[0036] if:

[0037] |4095-Angular_Digit|≤Δ

[0038] or:

[0039] |Angular_Digit|≤Δ

[0040] Then the current position signal of the permanent magnet synchronous motor is in a zero-crossing state, otherwise the current position signal of the permanent magnet synchronous motor is in a non-zero-crossing state;

[0041] Among them, Angular_Digit is a value between 0 and FFF currently read by the third module, and Δ is a minimum value set according to the working conditions.

[0042] Step 2: If the current position signal of the permanent magnet synchronous motor is in a non-zero-crossing state, the electrical angular velocity of the permanent magnet synchronous motor is calculated according to the following formula:

[0043]

[0044] D(k) is the high twelve bits of the digital quantity obtained by reading through the SPI interface in the kth clock cycle, D(k-1) is the high twelve bits of the digital quantity obtained by reading through the SPI interface in the (k-1)th clock cycle, T s is the interruption cycle of the permanent magnet synchronous motor control algorithm execution, ω r is the electrical angular velocity of the permanent magnet synchronous motor;

[0045] Otherwise, the electrical angular velocity of the permanent magnet synchronous motor in the previous cycle is maintained.

[0046] Furthermore, the function three includes an SPI Master Transfer module, and matches the sampling time of the sampling interface of the resolver decoding chip with the data output timing of the resolver decoding chip, the data bit is sixteen bits, the chip select mode is set to be from the SPI peripheral, the hex2dec('FF00') constant is input, and the output is connected to the Terminator module.

[0047] Furthermore, in the step one, the resolver decoding chip is set to a serial communication mode.

[0048] Furthermore, in the step 2, the output signal of the resolver decoding chip is set as a position signal through the Initialize Function module of the MATLAB model, and the SPI interface working mode is set to a host mode.

[0049] Furthermore, in the step one, the SAMPLE pin of the resolver decoding chip is connected to the SPISIMO pin of the DSP chip, the SO pin of the resolver decoding chip is connected to the SPISOMI pin of the DSP chip, the CS pin of the resolver decoding chip is connected to the SPISTEB pin of the DSP chip, and the CLK pin of the resolver decoding chip is connected to the SPICLK pin of the DSP chip.

[0050] Beneficial effects:

[0051] (1) A method for obtaining a position signal of a permanent magnet synchronous motor of the present invention comprises connecting a permanent magnet synchronous motor, a rotary transformer, a rotary transformer decoding chip and a DSP chip to form a hardware system for obtaining a position signal of the permanent magnet synchronous motor, and on this basis, based on the full code generation of MATLAB, constructing function one, function two and function three in MATLAB that cooperate with the working timing of the rotary transformer decoding chip, and the function one, function two and function three sequentially complete the work of preparing for reading the position signal of the permanent magnet synchronous motor, reading the position signal and completing the reading of the position signal through the SPI interface, so as to accurately obtain the position signal of the permanent magnet synchronous motor and greatly improve the efficiency of the permanent magnet synchronous motor control model in obtaining the motor position signal;

[0052] Moreover, when replacing the design of the resolver decoding chip or the electrolytic control system, it is only necessary to adaptively replace the parts related to SPI communication in function one, function two, and function three, and the remaining parts do not need to be changed, thus speeding up the iteration.

[0053] (2) A method for obtaining a position signal of a permanent magnet synchronous motor according to the present invention can quickly obtain the current position signal of the permanent magnet synchronous motor and the position signal actually required for controlling the permanent magnet synchronous motor through function 2 in the case where the number of pole pairs of the rotary transformer and the permanent magnet synchronous motor is the same or different, thereby meeting the requirements for controlling the permanent magnet synchronous motor.

[0054] (3) A method for obtaining a position signal of a permanent magnet synchronous motor according to the present invention, function 2 can also quickly obtain the electrical angular velocity of the permanent magnet synchronous motor by setting a third module, and then the mechanical rotation speed of the permanent magnet synchronous motor can be obtained through the electrical angular velocity, thereby satisfying the quantity of parameters required for actual control of the permanent magnet synchronous motor.

[0055] (4) In a method for obtaining a position signal of a permanent magnet synchronous motor according to the present invention, the third module in function 2 fully considers the zero-crossing state and the non-zero-crossing state of the current position signal of the permanent magnet synchronous motor when solving the electrical angular velocity of the permanent magnet synchronous motor, so that the result is more accurate and reliable.

[0056] (5) In a method for obtaining a position signal of a permanent magnet synchronous motor according to the present invention, the resolver decoding chip is set to a serial communication mode, and the data transmission rate is relatively high.

[0057] (6) A method for obtaining a position signal of a permanent magnet synchronous motor of the present invention sets the output signal of a resolver decoding chip as a position signal through the Initialize Function module of a MATLAB model, and sets the SPI interface working mode to the host mode. At this time, the data value transmitted from the corresponding SO pin of the resolver decoding chip can be directly read, and then the position of the permanent magnet synchronous motor can be obtained by parsing. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 The hardware design diagram of the embodiment of the present invention;

[0059] Figure 2 The data output timing of the resolver decoding chip AD2S1200 according to the embodiment of the present invention;

[0060] Figure 3 Three functions constructed in MATLAB according to the embodiments of the present invention;

[0061] Figure 4 is a flow chart of an embodiment of the present invention;

[0062] Figure 5 This is a schematic diagram of the modules in function one of the embodiment of the present invention;

[0063] Figure 6 This is a schematic diagram of the connection of each module of function 2 of embodiment of the present invention;

[0064] Figure 7 This is a schematic diagram of the structure of the second module in function 2 of an embodiment of the present invention;

[0065] Figure 8 This is a schematic diagram of the structure of the third module in function 2 of an embodiment of the present invention;

[0066] Fig. 9 This is a schematic diagram of the modules in function three of embodiment of the present invention. DETAILED DESCRIPTION

[0067] The following is combined with Figure 1-Figure 9 The present invention is described in detail with reference to embodiments.

[0068] The method for obtaining the position signal of a permanent magnet synchronous motor of the present invention is implemented according to the following steps:

[0069] Step 1: Connect the permanent magnet synchronous motor, the resolver, the resolver decoding chip and the DSP chip to form a hardware system for obtaining the position signal of the permanent magnet synchronous motor;

[0070] Step 2: Based on the full code generation of MATLAB, three functions (or three control systems) are constructed in Simulink in MATLAB, namely Function 1, Function 2 and Function 3. Function 1, Function 2 and Function 3 complete the three functions of permanent magnet synchronous motor position signal reading preparation, position signal reading and position signal reading completion in turn through the SPI interface of the DSP chip.

[0071] The method for obtaining the position signal of a permanent magnet synchronous motor connects a permanent magnet synchronous motor, a resolver, a resolver decoding chip and a DSP chip to form a hardware system for obtaining the position signal of the permanent magnet synchronous motor, and on this basis, based on the full code generation of MATLAB, constructs function one, function two and function three in MATLAB to sequentially read the position signal of the permanent magnet synchronous motor through an SPI interface, read the position signal and complete the position signal, the implementation method is simple, and the model is concise and easy to engineer, the position signal of the permanent magnet synchronous motor can be accurately obtained, and the efficiency of the permanent magnet synchronous motor control model in obtaining the motor position signal can be greatly improved.

[0072] In the hardware system for obtaining the position signal of the permanent magnet synchronous motor, the resolver decoding chip can be a variety of resolver decoding chips such as AD2S1200 and AD2S1210. In this embodiment, AD2S1200 is selected. The resolver decoding chip AD2S1200 is powered by 5V, and the effective number of information bits is 12 bits. Therefore, when communicating with 3.3V chips such as DSP chips, the communication level needs to be converted through the level conversion chip. The logic level of the resolver decoding chip AD2S1210 can be flexibly set to 5V or 3.3V, so when the logic level is set to 3.3V, the setting of the level conversion chip can be discarded, and its effective information bits are 16 bits. Because the resolver decoding chip AD2S1200 can realize continuous motor position data output without conversion lag, and with a 12-bit resolution, its maximum tracking speed can reach 1000rps. In addition, the resolver decoding chip AD2S1200 has its own system fault detection, and its detection circuit can monitor the loss of resolver signals, input overtravel, input mismatch or position tracking loss in real time.

[0073] The permanent magnet synchronous motor, resolver, resolver decoding chip AD2S1200 and DSP chip are connected to form a hardware system for obtaining the position signal of the permanent magnet synchronous motor. Figure 1 As shown ( Figure 1(The permanent magnet synchronous motor is not shown in the figure). Specifically, in this hardware system, the CS pin and RD pin of the resolver decoder chip AD2S1200 are short-circuited, the SOE pin is pulled down to GND through a 0Ω resistor, and the remaining pins can be connected according to the requirements of the chip manual, that is, the communication mode of the resolver decoder chip AD2S1200 is set to the serial communication mode. Since the pin connection between the resolver decoder chip AD2S1200 and the DSP chip is inconsistent in level, a 5V to 3.3V level conversion chip is required to be added, the SPI serial communication pin is converted through the level conversion chip, and the SAMPLE pin of the resolver decoder chip AD2S1200 is associated with the SPISIMO function pin of the DSP chip (or connected, the same below), the SO pin of the resolver decoder chip AD2S1200 is associated with the SPISOMI function pin of the DSP chip, the CS pin of the resolver decoder chip AD2S1200 is associated with the SPISTEB pin of the DSP chip, and the CLK pin of the resolver decoder chip AD2S1200 is associated with the SPICLK pin of the DSP chip. As for the connection between the resolver, the resolver decoding chip and the permanent magnet synchronous motor, they can be connected according to the general connection method, which will not be repeated here.

[0074] According to Figure 2 The data output timing diagram of the resolver decoder chip AD2S1200 shown in the figure requires that the SAMPLE_n pin of the resolver decoder chip AD2S1200 be pulled low for t1 time at the initial stage of access control, and then the CS_n pin be pulled low until the entire access control cycle is over before it can be pulled high. During this process, the RD_n pin needs to be pulled low to maintain a continuous reading state, and at the same time, by setting the high and low states of the RDVEL_n pin, the signal output by the resolver decoder chip AD2S1200 is controlled to be a position signal. At this time, the data value uploaded on the corresponding SO pin can be directly read, and then the position signal can be parsed and obtained. In addition, when the entire access process ends, SAMPLE_n needs to be pulled high for at least t1 time to end the entire access process.

[0075] To meet the above control timing, it is necessary to pull down the RDVEL_n pin of the resolver decoder chip AD2S1200 through the GPIO pin in the Initialize Function module of the MATLAB model, set the output signal of the resolver decoder chip AD2S1200 to the position signal output, and set the SPI interface clock period to 10MHz and the working mode to host mode in the hardware implementation interface.

[0076] like Figure 3As shown, the position signal of the permanent magnet synchronous motor is acquired by three functions (i.e., function one, function two and function three), and the order of function execution in the process of position signal reading is set by MATLAB's Function-Call Split and Function-Call Generator functions, that is, function one is executed first, then function two, and finally function three.

[0077] Reference Figures 4 to 9 In function one, the SPI Master Transfer module in C28x that comes with MATLAB is included, and the sampling time of the sampling interface of the resolver decoding chip is matched with the data output timing of the resolver decoding chip. The module is set to delay the rising edge of the CLK pin by half a cycle and read through the SAMPLE_n pin. The data bit is 16 bits, and the chip select mode is selected as from the SPI peripheral. The hex2dec('FF00') constant is input to the module. The output of the SPI Master Transfer module is connected to the Terminator module to complete the readout of the permanent magnet synchronous motor position signal.

[0078] Specifically, Figure 6 Function 2 consists of three modules, wherein the first module obtains the digital quantity corresponding to the current position signal of the permanent magnet synchronous motor, and its output is connected to the input of the second module and the third module. The second module obtains the position signal of the permanent magnet synchronous motor by calculation using the digital quantity output by the first module, and the third module obtains the mechanical speed of the permanent magnet synchronous motor by calculation using the digital quantity output by the first module.

[0079] Specifically, refer to Figure 6 and Figure 7 The first module includes the SPI MasterTransfer module in C28x that comes with MATLAB, and matches the sampling time of the sampling interface of the resolver decoding chip with the data output timing of the resolver decoding chip. The module is set to delay the rising edge of the CLK pin by half a cycle and read through the SAMPLE_n pin. The data bit is 16 bits, and the chip select mode is selected as from the SPI peripheral. The hex2dec('0000') constant is input to the module, and the output signal is a 16-bit digital quantity. The high 12 bits of the digital quantity (corresponding to the resolution of the resolver decoding chip) correspond to the current rotation position signal of the permanent magnet synchronous motor.

[0080] In the second module, the current position signal of the permanent magnet synchronous motor is obtained through the following conversion relationship:

[0081] θ e =Angular_Digit*2*π / 4095

[0082] In the above formula, θ e is the current position signal of the permanent magnet synchronous motor, and Angular_Digit is the high 12-bit digital value output by the SPI Master Transfer module in the C28x that comes with MATLAB.

[0083] On this basis, in the second module, it is assumed that the initial position signal of the permanent magnet synchronous motor is θ init ,θ abs It is the position signal of the permanent magnet synchronous motor after the current position signal is positively converted.

[0084] If satisfied:

[0085] θ e -θ init >0

[0086] So,

[0087] θ abs =θ e -θ init

[0088] otherwise,

[0089] θ abs =θ e -θ init +2π

[0090] After obtaining the current position signal of the permanent magnet synchronous motor and taking the positive position signal θ abs Based on this, in the second module, it is assumed that the position signal actually required for permanent magnet synchronous motor control is θ dq , in order to obtain the actual required position signal is θ dq , then the positive position signal θ abs After multiplication, the value range of the position signal is limited to the range of [0,2*π]. Specifically:

[0091] If the following equation is satisfied:

[0092] θ abs *p m / p r >2π

[0093] So:

[0094] θ dq =θ abs *p m / p r -2π

[0095] otherwise:

[0096] θ dq =θ abs*p m / p r

[0097] p r is the number of pole pairs of the resolver, p m is the number of pole pairs of the permanent magnet synchronous motor.

[0098] After the above processing, the position signal actually required for permanent magnet synchronous motor control can be obtained as θ dq .

[0099] Furthermore, the third module is used to obtain the speed signal of the permanent magnet synchronous motor, which includes its electrical angular velocity and mechanical rotation speed.

[0100] Specifically, refer to Figure 6 and Figure 8 After obtaining the digital quantity corresponding to the current position signal of the permanent magnet synchronous motor by parsing the first module, in order to obtain the speed signal, the third module needs to perform a zero-crossing judgment. Specifically, it is necessary to judge whether a certain actual count value (Angular_Digit) in 0~FFF currently read by the third module satisfies the difference with the upper limit of the count 4095 or the difference with the lower limit of the count 0 is less than a certain very small set value Δ (set according to the working condition, 235 in this embodiment). If it is satisfied, then the current position signal of the permanent magnet synchronous motor is in a zero-crossing state (zero_cross_flag=1), otherwise the current position signal of the permanent magnet synchronous motor is in a non-zero-crossing state (zero_cross_flag=0). That is:

[0101] if:

[0102] |4095-Angular_Digit|≤Δ

[0103] or:

[0104] |Angular_Digit|≤Δ

[0105] Then the current position signal of the permanent magnet synchronous motor is in a zero-crossing state, otherwise the current position signal of the permanent magnet synchronous motor is in a non-zero-crossing state.

[0106] The read digital quantity is differentiated when the position signal is not zero-crossing (zero_cross_flag = 0), that is, the position signal obtained at this time is subtracted from the position signal at the previous moment and the absolute value is taken and then divided by the execution period to obtain the electrical angular velocity of the permanent magnet synchronous motor. Specifically, the electrical angular velocity ω of the permanent magnet synchronous motor is r The calculation formula is as follows:

[0107]

[0108] In the above formula, D(k) represents the high 12 bits of the digital quantity obtained by reading through the SPI interface in the kth clock cycle, D(k-1) represents the high 12 bits of the digital quantity obtained by reading through the SPI interface in the k-1th clock cycle, and T s represents the interruption period of the permanent magnet synchronous motor control algorithm execution, ω r It represents the electrical angular velocity of the permanent magnet synchronous motor.

[0109] In the zero-crossing state (zero_cross_flag=1), the electrical angular velocity obtained by solving the previous cycle is maintained.

[0110] On this basis, taking into account factors such as signal interference, the traditional filtering method can be used to filter the speed signal, and then the mechanical rotation speed of the permanent magnet synchronous motor can be obtained by combining the relationship between the mechanical speed and the electrical angular velocity of the permanent magnet synchronous motor.

[0111] like Fig. 9 As shown, in function three, the SPI Master Transfer module in C28x that comes with MATLAB is included, and the sampling moment of the sampling interface of the resolver decoding chip is matched with the data output timing of the resolver decoding chip. The module is set to delay the rising edge of the CLK pin by half a cycle and read through the SAMPLE_n pin. The data bit is 16 bits, and the chip select mode is selected as from the SPI peripheral. The input of the module is the hex2dec('00FF') constant, and the output is connected to the Terminator module. Function three is used to prepare for the position signal reading of the permanent magnet synchronous motor in the next cycle.

[0112] In summary, the above are only preferred embodiments of the present invention and are not intended to limit the protection scope of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for obtaining a position signal of a permanent magnet synchronous motor, characterized in that: include: Step 1: Connect the permanent magnet synchronous motor, the resolver, the resolver decoding chip and the DSP chip to form a hardware system for obtaining the position signal of the permanent magnet synchronous motor; Step 2: construct three functions in MATLAB, namely, function one, function two and function three, wherein the function one, the function two and the function three sequentially complete the permanent magnet synchronous motor position signal reading readiness, position signal reading and position signal reading completion through the SPI interface of the DSP chip; The function 2 includes a first module and a second module; The first module includes an SPI Master Transfer module, and the sampling time of the sampling interface of the resolver decoding chip is matched with the data output timing of the resolver decoding chip, the data bit is the valid information bit of the resolver decoding chip, the chip select mode is set to be from the SPI peripheral, the input is the hex2dec ('0000') constant, and the output is connected to the input of the second module; The second module obtains the permanent magnet synchronous motor position signal by calculating the output of the first module; The second module obtains the position signal of the permanent magnet synchronous motor by the following steps: Step A: Obtain the current position signal of the permanent magnet synchronous motor by the following formula: : In the above formula is the current position signal of the permanent magnet synchronous motor, is a digital quantity corresponding to the resolution of the resolver decoding chip in the data bit output by the first module; Step B: Obtain the position signal of the permanent magnet synchronous motor after the current position signal is positively adjusted by the following method: : If satisfied: , So, , otherwise, ; Step C: Obtain the actual position signal required for the permanent magnet synchronous motor control by the following method: : if: So: otherwise: in, p r is the number of pole pairs of the resolver, p m is the number of pole pairs of the permanent magnet synchronous motor.

2. A method for obtaining a position signal of a permanent magnet synchronous motor according to claim 1, characterized in that: Function 1 includes an SPI Master Transfer module, and matches the sampling time of the sampling interface of the resolver decoding chip with the data output timing of the resolver decoding chip. The data bit is the valid information bit of the resolver decoding chip. The chip select mode is set to be from the SPI peripheral, the hex2dec ('FF00') constant is input, and the output is connected to the Terminator module.

3. A method for obtaining a position signal of a permanent magnet synchronous motor according to claim 1, characterized in that: The function two also includes a third module; The input of the third module is connected to the output of the first module, and the permanent magnet synchronous motor speed signal is obtained by calculating the output of the first module.

4. A method for obtaining a position signal of a permanent magnet synchronous motor as claimed in claim 3, characterized in that: The third module obtains the electrical angular velocity of the permanent magnet synchronous motor by the following steps: Step 1: Determine the zero point by: if: |4095-Angular_Digit|≤ or: |Angular_Digit|≤ Then the current position signal of the permanent magnet synchronous motor is in a zero-crossing state, otherwise the current position signal of the permanent magnet synchronous motor is in a non-zero-crossing state; Wherein, Angular_Digit is a value between 0 and FFF currently read by the third module. It is the minimum value set according to the working conditions; Step 2: If the current position signal of the permanent magnet synchronous motor is in a non-zero-crossing state, the electrical angular velocity of the permanent magnet synchronous motor is calculated according to the following formula: For the The high twelve bits of the digital quantity are read through the SPI interface in one clock cycle. For the first ( ) cycles to read the high twelve bits of the digital quantity through the SPI interface. is the interruption cycle of the permanent magnet synchronous motor control algorithm execution, is the electrical angular velocity of the permanent magnet synchronous motor; Otherwise, the electrical angular velocity of the permanent magnet synchronous motor in the previous cycle is maintained.

5. A method for obtaining the position signal of the permanent magnet synchronous motor according to any one of claims 1, 2 and 4, characterized in that: Function three includes an SPI Master Transfer module, and matches the sampling time of the sampling interface of the resolver decoding chip with the data output timing of the resolver decoding chip. The data bit is sixteen bits, the chip select mode is set to be from the SPI peripheral, the hex2dec ('FF00') constant is input, and the output is connected to the Terminator module.

6. A method for obtaining a position signal of a permanent magnet synchronous motor according to any one of claims 1, 2 and 4, characterized in that: In the step one, the resolver decoding chip is set to a serial communication mode.

7. A method for obtaining a position signal from a permanent magnet synchronous motor according to any one of claims 1, 2 and 4, characterized in that: In the step 2, the output signal of the resolver decoding chip is set as a position signal through the Initialize Function module of the MATLAB model, and the SPI interface working mode is set to the host mode.

8. A method for obtaining a position signal of a permanent magnet synchronous motor according to any one of claims 1, 2 and 4, characterized in that: In the step one, the SAMPLE pin of the resolver decoding chip is connected to the SPISIMO pin of the DSP chip, the SO pin of the resolver decoding chip is connected to the SPISOMI pin of the DSP chip, the CS pin of the resolver decoding chip is connected to the SPISTEB pin of the DSP chip, and the CLK pin of the resolver decoding chip is connected to the SPICLK pin of the DSP chip.

Citation Information

Patent Citations

  • High-speed permanent magnet synchronous motor rotor position detection device and method

    CN111817615A

  • Self-detection system for connection lines of rotary transformer

    WO2021073139A1