A method for measuring speed of permanent magnet synchronous motor
Through the combination of the rotary transformer and the Kalman filter model, the problem of poor speed detection accuracy of the permanent magnet synchronous motor is solved, and high-precision speed detection and anti-interference ability are improved.
Patent Information
- Application Number
- CN202210960819.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-11
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2042-08-11
AI Technical Summary
The existing permanent magnet synchronous motor speed detection technology has poor accuracy and relies on complex calculations. It is difficult to accurately obtain the magnetic pole position of the motor rotor, which affects the effect of vector control.
The rotary transformer and AD2S1210 decoding chip are used to measure the absolute position of the motor rotor magnetic pole, and the Kalman filter model is used to predict the magnetic pole position and speed. The DSP chip is used for digital-to-analog conversion and filtering to reduce errors and improve anti-interference capabilities.
It improves the speed measurement accuracy, reduces the dependence on motor parameters, enhances the anti-interference ability of the system, and achieves high-precision speed detection.
Smart Images

Figure CN115208259B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of motor speed measurement, and in particular to a permanent magnet synchronous motor speed measurement method. Background Art
[0002] Permanent magnet synchronous motors are widely used in aerospace, weapons and equipment, and other servo transmission fields that require high reliability and high precision due to their wide speed regulation range, high efficiency, and simple maintenance. Vector control is one of the most commonly used control strategies in permanent magnet synchronous servo control systems. Its core is to use coordinate transformation to decouple current and control the direct axis current and quadrature axis current separately. Therefore, in vector control, the motor rotor pole position must be accurately obtained as the coordinate transformation angle.
[0003] In the existing permanent magnet synchronous motor speed detection technology, the motor speed is mainly obtained by performing first-order difference calculation on the acquisition angle. The above detection method has poor accuracy and needs to rely on motor parameters and complex calculations. Therefore, this application proposes a permanent magnet synchronous motor speed measurement method. Summary of the invention
[0004] The purpose of this application is to provide a permanent magnet synchronous motor speed measurement method to address the above problems.
[0005] The present application provides a permanent magnet synchronous motor speed measurement method, the method comprising the following steps:
[0006] Obtaining a first position measured value; the first position measured value is an analog measured value of the absolute position of the motor rotor magnetic pole;
[0007] The first position measured value is converted to obtain a second position measured value; the second position measured value is a measured value of a digital quantity of the absolute position of the motor rotor magnetic pole;
[0008] Based on the second position measured value and the Kalman filter model, the motor rotor magnetic pole position and the motor rotor speed are predicted to obtain a first position prediction value and a first speed prediction value; the first position prediction value is a digital value prediction value of the motor rotor magnetic pole position; the first speed prediction value is a digital value prediction value of the motor rotor magnetic pole position;
[0009] The first position prediction value and the first speed prediction value are converted and calculated to obtain a second position prediction value and a second speed prediction value; the second position prediction value is a physical quantity prediction value of the motor rotor magnetic pole position; the second speed prediction value is a physical quantity prediction value of the motor rotor speed.
[0010] According to the technical solution provided in some embodiments of the present application, based on the second position measured value and the Kalman filter model, the motor rotor magnetic pole position and the motor rotor speed are predicted to obtain a first position prediction value and a first speed prediction value, specifically including:
[0011] Define the motor rotor speed error. The speed error expression is as follows:
[0012] e(k)=a(k)-a p (k-1)-ω p (k-1) (1)
[0013] Wherein, k is a natural number greater than zero; e(k) is the speed error of the kth carrier cycle; a(k) is the actual measured value of the second position of the kth carrier cycle; a p (k-1) is the first position prediction value of the k-1th carrier cycle; ω p (k-1) is the first speed prediction value of the k-1th carrier cycle;
[0014] Based on the Kalman filter model, the first position prediction value and the first speed prediction value of the kth carrier cycle are defined, and the expression of the first position prediction value of the kth carrier cycle is as follows:
[0015] a p (k) = (1-k1)[a p (k-1)+ω p (k-1)]+k1a(k) (2)
[0016] Among them, k1 is the first filter coefficient, and its value range is 0 <k1<1;
[0017] The expression of the first speed prediction value of the kth carrier cycle is as follows:
[0018] ω p (k)=(1-k2)ω p (k-1)+k2[a(k)-a p (k-1)] (3)
[0019] Among them, k2 is the second filter coefficient, and its value range is 0 <k2<1;
[0020] Substituting formula (1) into formula (2) and formula (3), we get:
[0021] a p (k) = a p (k-1)+ω p (k-1)+k1·e(k) (4)
[0022] ω p(k) = ω p (k-1)+k2·e(k) (5).
[0023] According to the technical solutions provided in some embodiments of the present application, the conversion calculation formula of the second position prediction value θ(k) is as follows:
[0024]
[0025] Wherein, θ(k) is the second position prediction value of the kth carrier cycle, in degrees; and p is the number of pole pairs of the motor.
[0026] The conversion calculation formula of the second speed prediction value n(k) is as follows:
[0027]
[0028] Where n(k) is the second speed prediction value of the kth carrier cycle, in rpm; T s is the carrier period in seconds.
[0029] According to the technical solutions provided in some embodiments of the present application, the specific method for obtaining the first position measured value is:
[0030] The rotary transformer is used as a sensor to measure the absolute position of the rotor poles of the permanent magnet synchronous motor;
[0031] AD2S1210 is used as a decoding chip to process the resolver signal to obtain the first position measured value, wherein the resolution of the digital output of the decoding chip is set to m bits.
[0032] According to the technical solution provided in certain embodiments of the present application, it also includes: when it is determined that the absolute value of the difference between the actual measured value of the second position of the kth carrier period and the actual measured value of the second position of the k-1th carrier period is greater than the first set value n, that is, |a(k)-a(k-1)|>n, the speed error is processed over the circle.
[0033] According to the technical solutions provided in some embodiments of the present application, the value of the first set value n is:
[0034]
[0035] According to the technical solutions provided in some embodiments of the present application, the method for processing the loop specifically includes:
[0036] When the rotor of the permanent magnet synchronous motor rotates in the positive direction, and the difference between the second position measured value of the k-1th carrier cycle and the second position measured value of the kth carrier cycle is greater than the first set value, that is, a(k-1)-a(k)>n, the speed error e(k) of the kth carrier cycle is adjusted to:
[0037] e(k)=a(k)-a p (k-1)-ω p (k-1)+2 m (8);
[0038] When the rotor of the permanent magnet synchronous motor rotates in the opposite direction, and the difference between the second position measured value of the kth carrier cycle and the second position measured value of the k-1th carrier cycle is greater than the first set value, that is, a(k)-a(k-1)>n, the speed error e(k) of the kth carrier cycle is adjusted to:
[0039] e(k)=a(k)-a p (k-1)-ω p (k-1)-2 m (9).
[0040] Compared with the prior art, the present application has the following beneficial effects: the present application uses a rotary transformer as a sensor to measure the absolute position of the permanent magnet synchronous motor rotor pole, uses AD2S1210 as a decoding chip to process the rotary transformer signal, and uses a DSP chip to read the motor rotor pole position digitally output by the decoding chip; then based on the Kalman filter algorithm, the digital quantity of the motor rotor pole position and speed is predicted; finally, the predicted value of the digital quantity is converted and calculated to obtain the position and speed value of the permanent magnet synchronous motor; the rotary transformer decoding chip used in the present invention requires a simple peripheral circuit and has strong anti-interference ability, and is suitable for digital-to-analog conversion of output signals of various rotary transformers; due to the difference in rotary transformer ratio and non-linear excitation signal Due to reasons such as ideal and disturbances introduced into the signal line, the position output of the rotating transformer will produce periodic errors and random errors. The present application uses a Kalman filter to predict the motor rotor pole position and speed. While effectively eliminating the position error, the speed is also smoothed and filtered, which greatly improves the system's anti-interference ability. The permanent magnet synchronous motor speed measurement method provided by the present application cleverly combines the measurement data and the prediction data, and performs closed-loop control of the error. The introduction of measurement data will correct the prediction data to prevent the prediction data error from being too large, and limit the error to a certain range. It has a good filtering effect on the noise of the measurement signal, and therefore has a higher measurement accuracy. At the same time, the present application can also avoid relying on motor parameters and complex calculations. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 A flow chart of a permanent magnet synchronous motor speed measurement method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0042] In order to enable those skilled in the art to better understand the technical solution of the present application, the present application is described in detail below in conjunction with the accompanying drawings. The description in this section is only exemplary and explanatory and should not have any limiting effect on the scope of protection of the present application.
[0043] This embodiment provides a method for measuring speed of a permanent magnet synchronous motor. The flow chart of the method is as follows: Figure 1 As shown, the method comprises the following steps:
[0044] S1. Obtain a first position measured value; the first position measured value is an analog measured value of the absolute position of the motor rotor magnetic pole.
[0045] The specific method for obtaining the measured value of the first position is:
[0046] S11. Use a rotary transformer as a sensor to measure the absolute position of the rotor pole of the permanent magnet synchronous motor; the model of the rotary transformer is: winding type 80XFW975.
[0047] S12. Use AD2S1210 as a decoding chip to process the resolver signal to obtain a first position measured value, wherein the resolution of the digital output of the decoding chip is set to m bits.
[0048] The decoder chip of the resolver is the AD2S1210 chip of Analog Devices. The AD2S1210 chip has A0 and A1 input pins. The AD2S1210 allows users to read angular position or angular velocity data directly from the parallel output or through the serial interface. The A0 and A1 inputs can be used to select the required information. These inputs can also be used to put the device into configuration mode. The configuration mode is set as shown in Table 1.
[0049] Table 1
[0050]
[0051] The AD2S1210 chip also has RES0 and RES1 input pins. In normal mode, the resolution of the digital output is selected using the RES0 and RES1 input pins. In configuration mode, the resolution is selected by setting the RES0 and RES1 bits in the control register. When switching between normal mode and configuration mode, the user is responsible for ensuring that the resolution set in the control register is consistent with the resolution set by the RES0 and RES1 input pins; the resolution setting method is shown in Table 2.
[0052] Table 2
[0053]
[0054] When in use, first configure the chip pins A0 and A1 to low level, and set the working mode to normal mode position output; then configure the chip pins RES0 and RES1 to high level, and set the resolution of digital output to 16 bits; then configure the chip pin SOE (serial output enable) to high level, and select the parallel interface to connect directly to the DSP chip; finally, according to the write timing of the chip parallel port, configure the pins CS (chip select), RD (edge-triggered logic input), and SAMPLE (sampling result) level changes.
[0055] S2. Convert the first position measured value to obtain a second position measured value; the second position measured value is a measured value of a digital quantity of the absolute position of the motor rotor magnetic pole.
[0056] The DSP chip used in this embodiment is TMS320F28335 of TI, and its development environment is CCS3.3. The XINTF interface of the DSP chip reads the motor rotor pole position digitally output by the AD2S1210 chip at a certain sampling period, that is, the DSP chip samples the analog data of the rotary transformer obtained by the AD2S1210 chip at a certain sampling period to obtain the corresponding digital quantity. In this embodiment, the sampling period is 100 microseconds.
[0057] S3. Based on the second position measured value and the Kalman filter model, the motor rotor pole position and the motor rotor speed are predicted to obtain a first position prediction value and a first speed prediction value; the first position prediction value is a digital prediction value of the motor rotor pole position; the first speed prediction value is a digital prediction value of the motor rotor pole position.
[0058] Specifically include:
[0059] S31. Define the motor rotor speed error. The speed error expression is as follows:
[0060] e(k)=a(k)-a p (k-1)-ω p (k-1) (1)
[0061] Wherein, k is a natural number greater than zero; e(k) is the speed error of the kth carrier cycle; a(k) is the actual measured value of the second position of the kth carrier cycle; a p (k-1) is the first position prediction value of the k-1th carrier cycle; ω p (k-1) is the first speed prediction value of the k-1th carrier cycle, which is represented by the digital amount of rotation of the rotary transformer in each carrier cycle.
[0062] S32. Based on the Kalman filter model, define the first position prediction value and the first speed prediction value of the kth carrier cycle. The expression of the first position prediction value of the kth carrier cycle is as follows:
[0063] a p (k) = (1-k1)[a p (k-1)+ω p (k-1)]+k1a(k) (2)
[0064] Among them, k1 is the first filter coefficient. The greater the noise, the smaller the filter coefficient. Its value range is 0 <k1<1;
[0065] The expression of the first speed prediction value of the kth carrier cycle is as follows:
[0066] ω p (k)=(1-k2)ω p (k-1)+k2[a(k)-a p (k-1)] (3)
[0067] Among them, k2 is the second filter coefficient. The greater the noise, the smaller the filter coefficient. Its value range is 0 <k2<1。
[0068] The present application estimates the speed by taking the difference of the rotor position in a fixed sampling period, sets two coefficients k1 and k2, i.e., weights, and distributes the weights between the predicted value of the Kalman model and the actual value collected, thereby obtaining the final estimated values of the position and speed.
[0069] S33. Substitute formula (1) into formula (2) and formula (3) respectively to obtain:
[0070] a p (k) = a p (k-1)+ω p (k-1)+k1·e(k) (4)
[0071] ω p (k) = ω p (k-1)+k2·e(k) (5).
[0072] In this embodiment, the actual value of the rotor magnetic pole position digital quantity collected for the first time when the system is powered on is used as the first position prediction value a p (0), the first speed prediction value ω p (0)Set to 0.
[0073] Next, an example is given to illustrate how to obtain the first position prediction value and the first speed prediction value of each carrier cycle of the permanent magnet synchronous motor.
[0074] Assume that when the permanent magnet synchronous motor is powered on, the absolute position of its rotor poles is 30°, then the first position prediction value a p (0) is the binary number corresponding to 30°, and the first speed prediction value ω p (0) is set to 0, then:
[0075] For the first carrier period, i.e., when k = 1:
[0076] According to formula (1), the speed error is: e(1) = a(1) - a p (0) - ω p (0), where a p (0) and ω p (0) are both known values, a(1) is the second position measured value actually obtained by the DSP chip in this carrier period, that is, it is also a known value. Therefore, e(1) can be obtained through the above known values;
[0077] According to formula (4), the first position prediction value is: a p (1) = a p (0) + ω p (0) + k1e(1), where a p (0) and ω p (0) are both known values, e(1) can be obtained according to the known values and is also a known value, k1 is the first filtering coefficient, and its value range is 0 < k1 < 1. In this embodiment, the value of k1 can be 0.1. Therefore, a p (1) can be obtained through the above known values;
[0078] According to formula (5), the first speed prediction value is: ω p (1) = ω p (0) + e(1), where ω p (0) is a known value, e(1) is obtained according to the known values and is also a known value. Therefore, ω p (1) can be obtained through the above known values.
[0079] For the second carrier period, i.e., when k = 2,
[0080] According to formula (1), the speed error is: e(2) = a(2) - a p (1) - ω p (1), where a(2) is the second position measured value actually obtained by the DSP chip in this carrier period, a p (1) and ω p (1) are the calculation results of the previous carrier period respectively and are both known values. Therefore, e(2) can be obtained through the above known values;
[0081] According to formula (4), the first position prediction value is: ap (2) = a p (1)+ω p (1)+k1e(2), where a p (1) and ω p (1) are all the calculation results of the previous carrier cycle and are known values. e(2) can be obtained based on the known values and is also a known value. Therefore, a can be obtained by the above known values. p (2);
[0082] According to formula (5), the first speed prediction value is: p (2) = ω p (1)+e(2), where ω p (1) is the calculation result of the previous carrier cycle, which is a known value. e(2) is obtained based on the known value, which is also a known value. Therefore, ω can be obtained by the above known values. p (2).
[0083] By analogy, based on the first position prediction value and the first speed prediction value obtained in the previous carrier cycle and the second position measured value actually obtained in the current carrier cycle, the first position prediction value and the first speed prediction value of the motor rotor in each carrier cycle can be obtained through iterative calculation.
[0084] S4. Convert and calculate the first position prediction value and the first speed prediction value to obtain a second position prediction value and a second speed prediction value; the second position prediction value is a physical quantity prediction value of the motor rotor magnetic pole position; the second speed prediction value is a physical quantity prediction value of the motor rotor speed.
[0085] The conversion calculation formula of the second position prediction value θ(k) is as follows:
[0086]
[0087] Wherein, θ(k) is the second position prediction value of the kth carrier cycle, in degrees; and p is the number of pole pairs of the motor.
[0088] The conversion calculation formula of the second speed prediction value n(k) is as follows:
[0089]
[0090] Where n(k) is the second speed prediction value of the kth carrier cycle, in rpm; T s is the carrier period in seconds.
[0091] Furthermore, in step S3, it also includes: judging that when the absolute value of the difference between the second position measured value of the kth carrier period and the second position measured value of the k-1th carrier period is greater than the first set value n, that is, |a(k)-a(k-1)|>n, the speed error is over-circled.
[0092] In this embodiment, the value of the first setting value n is:
[0093]
[0094] Specifically, the method for processing the circle includes:
[0095] When the rotor of the permanent magnet synchronous motor rotates in the positive direction, and the difference between the second position measured value of the k-1th carrier cycle and the second position measured value of the kth carrier cycle is greater than the first set value, that is, a(k-1)-a(k)>n, the speed error e(k) of the kth carrier cycle is adjusted to:
[0096] e(k)=a(k)-a p (k-1)-ω p (k-1)+2 m (8);
[0097] When the rotor of the permanent magnet synchronous motor rotates in the opposite direction, and the difference between the second position measured value of the kth carrier cycle and the second position measured value of the k-1th carrier cycle is greater than the first set value, that is, a(k)-a(k-1)>n, the speed error e(k) of the kth carrier cycle is adjusted to:
[0098] e(k)=a(k)-a p (k-1)-ω p (k-1)-2 m (9).
[0099] To ensure the accuracy of the calculation results, the speed error needs to be processed. If a positive overturn occurs, the speed error and the full-bias digital value need to be added. If a reverse overturn occurs, the speed error and the full-bias digital value need to be subtracted, where the full-bias digital value is 2. 16 Next, we will give an example to illustrate how to perform circle processing.
[0100] In this embodiment, since the resolution of the digital output of the AD2S1210 chip is set to 16 bits, the range of the second position measured value is between 0 and 65536. When the permanent magnet synchronous motor rotates forward, the second position measured value of the kth carrier cycle is greater than the second position measured value of the k-1th carrier cycle. When the second position measured value collected by a certain carrier cycle is less than the previous carrier cycle, for example, the second position measured value of the previous carrier cycle is 65530, and the second position measured value collected by the current carrier cycle is 20, 65530-20=65510, 65510>65530 / 2, it means that the phenomenon of positive over-circle occurs, then the second position measured value of the current carrier cycle is adjusted by adding the full-bias digital value, that is, adding 2 16 , which is the speed error plus the full-scale digital value.
[0101] When the permanent magnet synchronous motor rotates in the reverse direction, the second position measured value of the kth carrier cycle is smaller than the second position measured value of the k-1th carrier cycle. When the second position measured value collected in a certain carrier cycle is larger than the previous carrier cycle, for example, the second position measured value of the previous carrier cycle is 20, and the second position measured value collected in the current carrier cycle is 65530, 65530-20=65510, 65510>65530 / 2, it means that the reverse rotation phenomenon occurs. Then the second position measured value of the current carrier cycle is adjusted by subtracting the full-bias digital value, that is, subtracting 2. 16 , which is the speed error minus the full-scale digital value.
[0102] The permanent magnet synchronous motor speed measurement method provided in the embodiment of the present application first uses a rotary transformer as a sensor to measure the absolute position of the permanent magnet synchronous motor rotor pole, uses AD2S1210 as a decoding chip to process the rotary transformer signal, and uses the DSP chip XINTF interface to read the motor rotor pole position digitally output by the decoding chip; then based on the Kalman filter algorithm, the digital quantity of the motor rotor pole position and speed is predicted; finally, the predicted value of the digital quantity is converted and calculated. The peripheral circuit required by the rotary transformer decoding chip used in the present invention is simple, has strong anti-interference ability, and is suitable for digital-to-analog conversion of a variety of rotary transformer output signals; due to the difference in rotary transformer ratio, non-ideal excitation signal, and disturbance in the signal line, the rotary transformer position output will produce periodic errors and random errors. The present application uses a Kalman filter to predict the motor rotor pole position and speed. While effectively eliminating the position error, the speed is also smoothed and filtered, which greatly improves the anti-interference ability of the system.
[0103] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and its core ideas of this application. The above is only the preferred implementation method of this application. It should be pointed out that due to the limitations of textual expression and the objective existence of infinite specific structures, ordinary technicians in this technical field can make several improvements, modifications or changes without departing from the principles of the present invention, and can also combine the above technical features in an appropriate manner; these improvements, modifications, changes or combinations, or the direct application of the inventive concept and technical solution to other occasions without improvement, should be regarded as the scope of protection of this application.
Claims
1. A method for measuring speed of a permanent magnet synchronous motor, characterized in that: The method comprises the following steps: Obtaining a first position measured value; the first position measured value is an analog measured value of the absolute position of the motor rotor magnetic pole; The first position measured value is converted to obtain a second position measured value; the second position measured value is a measured value of a digital quantity of the absolute position of the motor rotor magnetic pole; Based on the second position measured value and the Kalman filter model, the motor rotor magnetic pole position and the motor rotor speed are predicted to obtain a first position prediction value and a first speed prediction value; the first position prediction value is a digital value prediction value of the motor rotor magnetic pole position; The first speed prediction value is a digital value prediction value of the motor rotor magnetic pole position; The first position prediction value and the first speed prediction value are converted and calculated to obtain a second position prediction value and a second speed prediction value; the second position prediction value is a physical quantity prediction value of the motor rotor magnetic pole position; the second speed prediction value is a physical quantity prediction value of the motor rotor speed; Based on the second position measured value and the Kalman filter model, the motor rotor magnetic pole position and the motor rotor speed are predicted to obtain a first position prediction value and a first speed prediction value, specifically including: Define the motor rotor speed error. The speed error expression is as follows: (1) in, k is a natural number greater than zero; e(k) For the k The speed error of the carrier cycle; a(k) For the k The second position measured value of the carrier period; a p (k-1) For the k-1 The first position prediction value of the carrier cycle; ω p (k-1) For the k-1 The first speed prediction value of the carrier cycle; Based on the Kalman filter model, define the k The first position prediction value and the first speed prediction value of the carrier cycle, k The expression of the first position prediction value of carrier cycles is as follows: (2) in, k 1 is the first filter coefficient, and its value range is 0< k 1 <1 ; No. k The expression of the first speed prediction value of the carrier cycle is as follows: (3) in, k 2 is the second filter coefficient, and its value range is 0< k 2 <1 ; Substituting formula (1) into formula (2) and formula (3), we get: (4) (5); The second position prediction value The conversion formula is as follows: (6) in, θ(k) For the k The second position prediction value of the carrier cycle is in degrees; p is the number of pole pairs of the motor; The second speed prediction value The conversion formula is as follows: (7) in, For the k The second speed prediction value of the carrier cycle, in rpm; T s is the carrier period, in seconds; The specific method for obtaining the measured value of the first position is: The rotary transformer is used as a sensor to measure the absolute position of the rotor poles of the permanent magnet synchronous motor; AD2S1210 is used as a decoding chip to process the resolver signal and obtain the first position measured value. The resolution of the digital output of the decoding chip is set to m Bit; The method further comprises: determining when the k The measured value of the second position of the carrier cycle is k-1 The absolute value of the difference between the second position measured values of the carrier cycle is greater than the first set value n ,Right now When the speed error is over-circled, The method for processing the loop specifically includes: When the rotor of the permanent magnet synchronous motor rotates in the positive direction and the k-1 The measured value of the second position of the carrier cycle is k The difference between the measured values of the second position of the carrier cycle is greater than the first set value, that is, When k Speed error of carrier cycles e(k) Adjusted to: (8); When the rotor of the permanent magnet synchronous motor rotates in the reverse direction, and the k The measured value of the second position of the carrier cycle is k-1 The difference between the measured values of the second position of the carrier cycle is greater than the first set value, that is, When k Speed error of carrier cycles e(k) Adjusted to: (9)。 2. The permanent magnet synchronous motor speed measurement method according to claim 1, characterized in that: The first setting value n The value of is: 。
