Motor control PI parameter tuning method and motor control system

CN120474402BActive Publication Date: 2026-08-14HEFEI GEYI INTEGRATED CIRCUIT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-02
Publication Date
2026-08-14

AI Technical Summary

Benefits of technology

[0018]由此,本公开提出了一种基于连续模型计算得到的理论电流环、速度环PI参数,根据实际反馈电流与给定电流之间的相位和幅度差异,自适应地调整电流环PI参数,并且可以进一步调整速度环PI参数的方案。进一步地,可以通过寻找响应曲线多次最大值和最小值作差取平均求取响应信号幅值,以提高响应幅值测量精度,还可以利用拉格朗日二次插值方法求取相位差,提高相位滞后测量精度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120474402B_ABST
    Figure CN120474402B_ABST
Patent Text Reader

Abstract

A method for tuning PI parameters in motor control and a motor control system are proposed. The method includes: calculating theoretical current loop PI parameter values ​​based on the parameters of the motor when stationary; performing actual motor control using the theoretical current loop PI parameter values, during which a first given current is input to the q-axis to obtain a first feedback current, wherein the first given current is a sinusoidal current with a desired bandwidth frequency of the current loop; obtaining a first comparison result between the first feedback current and the first given current; and adjusting the current loop PI parameter values ​​based on the first comparison result until a new first comparison result obtained by performing actual motor control using the adjusted current loop PI parameter values ​​satisfies a first predetermined condition. Therefore, the motor control PI parameter tuning scheme of this disclosure can adaptively tune the theoretically calculated PI parameters based on the difference between the actual feedback current and the given current, and optionally based on the difference between the actual feedback speed and the given speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of motors, and more particularly to a method for tuning PI parameters for motor control and a motor control system. Background Technology

[0002] In motor control, to ensure maximum torque output throughout the entire control cycle, Field-Oriented Control (FOC) is commonly used. Existing permanent magnet synchronous motor control systems primarily employ PI control.

[0003] Currently, the control systems of permanent magnet synchronous motors mainly employ a dual-closed-loop control strategy: a speed loop and a current loop. The performance of the current loop and speed loop is closely related to their PI parameters. Therefore, how to tune the PI parameters to improve the performance of the current loop and speed loop has become a problem to be solved in this field. Summary of the Invention

[0004] To address at least one of the above problems, this disclosure proposes a motor control PI parameter tuning scheme, which adaptively tunes the theoretically calculated PI parameters based on the difference between the actual feedback current and the given current.

[0005] According to a first aspect of this disclosure, a method for tuning PI parameters for motor control is proposed, comprising: calculating theoretical current loop PI parameter values ​​based on parameters of the motor when stationary; performing actual motor control using the theoretical current loop PI parameter values, during which a first given current is input to the q-axis to obtain a first feedback current, wherein the first given current is a sinusoidal current having a first given frequency, and the first given frequency corresponds to the desired bandwidth frequency of the current loop; obtaining a first comparison result between the first feedback current and the first given current; and adjusting the current loop PI parameter values ​​based on the first comparison result until a new first comparison result between the new first feedback current obtained by performing actual motor control using the adjusted current loop PI parameter values ​​and the first given current satisfies a first predetermined condition.

[0006] Optionally, the first comparison result includes a first amplitude comparison result and a first phase comparison result, and obtaining the first comparison result between the first feedback current and the first given current includes: obtaining the amplitude comparison result between the first feedback current and the first given current as the first amplitude comparison result; and obtaining the phase comparison result between the first feedback current and the first given current as the first phase comparison result.

[0007] Optionally, obtaining the amplitude comparison result of the first feedback current and the first given current as the first amplitude comparison result includes: obtaining the maximum value and minimum value of the first feedback current; obtaining the amplitude of the first feedback current based on the difference between the maximum value and the minimum value; and determining the first amplitude comparison result based on the amplitude of the first feedback current and the amplitude of the first given current.

[0008] Optionally, obtaining the amplitude comparison result of the first feedback current and the first given current as the first amplitude comparison result includes: obtaining the maximum and minimum values ​​of the first feedback current over multiple cycles; obtaining the amplitude of the first feedback current based on the average of the differences between the maximum and minimum values ​​over multiple cycles; and determining the first amplitude comparison result based on the amplitude of the first feedback current and the amplitude of the first given current.

[0009] Optionally, obtaining the phase comparison result between the first feedback current and the first given current as the first phase comparison result includes: obtaining the phase value of the first zero-crossing point of the first feedback current; determining the first phase comparison result based on the phase value of the first zero-crossing point and the phase value of the second zero-crossing point of the first given current, wherein when the first given current has no bias current, the first zero-crossing point and the second zero-crossing point correspond to the actual zero-crossing point of the current, and when the first given current includes a bias current, the first zero-crossing point and the second zero-crossing point correspond to the position where the current passes through the bias current value.

[0010] Optionally, obtaining the first zero-crossing phase value of the first feedback current includes: collecting multiple data points around the zero-crossing point; performing curve fitting based on the multiple data points; and obtaining the phase value of the zero-crossing point of the fitted curve as the phase value of the first zero-crossing point.

[0011] Optionally, based on the first comparison result, adjusting the current loop PI parameter value until the new first feedback current obtained by actual motor control using the adjusted current loop PI parameter value satisfies the first predetermined condition with the new first comparison result of the first given current includes: in response to the first amplitude comparison result being greater than the first theoretical amplitude change value and the first phase comparison result being less than the first theoretical phase change value, adjusting the value of the current loop PI parameter until the newly obtained first amplitude comparison result is no longer greater than the first theoretical amplitude change value and / or the first phase comparison result is no longer less than the theoretical phase change value.

[0012] Optionally, based on the first comparison result, adjusting the current loop PI parameter value until the new first feedback current obtained by actual motor control using the adjusted current loop PI parameter value satisfies the first predetermined condition with the new first comparison result of the first given current, including: in response to the first amplitude comparison result being less than the first theoretical amplitude change value and / or the first phase comparison result being greater than the first theoretical phase change value, adjusting the value of the current loop PI parameter until the newly obtained first amplitude comparison result is no longer less than the first theoretical amplitude change value and the first phase comparison result is no longer greater than the theoretical phase change value.

[0013] Optionally, adjusting the current loop PI parameter value includes: decreasing the current loop proportional coefficient in response to the first comparison result being better than the theoretical change value; and increasing the current loop proportional coefficient in response to the first comparison result being worse than the theoretical change value.

[0014] Optionally, the first given frequency differs from the desired bandwidth frequency of the current loop by no more than a predetermined threshold, wherein the value of the desired bandwidth frequency of the current loop is determined based on the theoretical current loop PI parameter value.

[0015] Optionally, the method further includes: calculating theoretical speed loop PI parameter values ​​based on parameters when the motor is stationary; and performing actual motor control using adjusted current loop PI parameter values ​​to adjust the speed loop PI parameter values, wherein adjusting the speed loop PI parameter values ​​further includes: performing actual motor control using the adjusted current loop PI parameter values ​​and the theoretical speed loop PI parameter values, during which a second given current is input to the q-axis to obtain a second feedback current, wherein the second given current is a sinusoidal current having a second given frequency, the second given frequency corresponding to the desired bandwidth frequency of the speed loop; obtaining a second comparison result between the second feedback current and the second given current; and adjusting the speed loop PI parameter values ​​based on the second comparison result until a new second comparison result between the new second feedback current obtained by performing actual motor control using the adjusted speed loop PI parameter values ​​and the second given current satisfies a second predetermined condition.

[0016] Optionally, the method further includes: writing the adjusted current loop PI parameter value and the adjusted speed loop PI parameter value into the controller of the permanent magnet synchronous motor; and the controller performing magnetic orientation vector control based on the adjusted current loop PI parameter value and the adjusted speed loop PI parameter value during operation of the permanent magnet synchronous motor.

[0017] According to a second aspect of this disclosure, a motor control system is proposed, comprising: a motor; and a magneto-oriented vector control module for performing magneto-oriented vector control on the motor using adjusted PI parameters obtained based on the PI parameter tuning method described in the first aspect.

[0018] Therefore, this disclosure proposes a scheme based on theoretical current loop and velocity loop PI parameters calculated using a continuous model. The scheme adaptively adjusts the current loop PI parameters according to the phase and amplitude differences between the actual feedback current and the given current, and can further adjust the velocity loop PI parameters. Furthermore, the response signal amplitude can be obtained by finding the difference between multiple maximum and minimum values ​​of the response curve and averaging them, thereby improving the accuracy of response amplitude measurement. The phase difference can also be obtained using the Lagrange quadratic interpolation method, improving the accuracy of phase lag measurement. Attached Figure Description

[0019] The above and other objects, features and advantages of this disclosure will become more apparent from the more detailed description of exemplary embodiments thereof taken in conjunction with the accompanying drawings, wherein like reference numerals generally denote like parts.

[0020] Figure 1 The FOC control principle diagram for PMSM is shown.

[0021] Figure 2 The diagram shows the structure of a series PI-controlled motor.

[0022] Figure 3 A diagram of a continuous model motor with dual closed-loop control is shown.

[0023] Figure 4 A simplified control diagram of a continuous model motor with two closed loops is shown.

[0024] Figure 5 The Bode plot of the second-order system corresponding to Equation (8) is shown.

[0025] Figure 6 This shows the cutoff frequency ω1 and cutoff frequency ω2 when the cutoff frequency ω2 is fixed. c_s A diagram showing the relationships between them.

[0026] Figure 7 A schematic flowchart of a motor control PI parameter tuning method according to an embodiment of the present disclosure is shown.

[0027] Figure 8 A block diagram is shown for simulating the PI response of the current loop.

[0028] Figure 9 The simulated response curve is shown when the sinusoidal frequency is given as 500Hz.

[0029] Figure 10 An example of sampling three points around the zero-crossing point is shown.

[0030] Figure 11 The simulated response curve is shown when the sinusoidal frequency is given as 1000Hz.

[0031] Figure 12 The simulated response curve is shown when the sinusoidal frequency is given as 1500 Hz.

[0032] Figure 13 The actual response curve is shown when the sinusoidal frequency is given as 1000Hz.

[0033] Figure 14 The actual response curve is shown when the sinusoidal given frequency is 1000Hz after the current loop PI parameter is adjusted.

[0034] Figure 15 The actual response curve is shown when the sinusoidal given frequency is 200Hz during velocity loop tuning.

[0035] Figure 16 The actual response curve is shown when the PI parameter of the speed loop is adjusted and the sinusoidal given frequency is 200Hz.

[0036] Figure 17 The response curves of the velocity-current dual closed loop under the theoretical PI parameters are shown.

[0037] Figure 18 The response curves of the speed-current dual closed loop are shown under adjusted PI parameters.

[0038] Figure 19 A schematic diagram of the composition of a motor control system according to an embodiment of the present invention is shown. Detailed Implementation

[0039] Preferred embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While preferred embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the disclosure to those skilled in the art. The terms "first," "second," and similar expressions used herein are intended to distinguish different objects of the same kind, rather than to differentiate their sequence or importance.

[0040] In the control process of permanent magnet synchronous motor (PMSM), in order to obtain the maximum torque output throughout the entire control cycle, FOC (magnetic orientation vector control) is often used to control the motor. Figure 1 The FOC control principle diagram for PMSM is shown.

[0041] like Figure 1 As shown, a position sensor such as a magnetic encoder obtains the rotor speed n and rotor position θ of motor M (in sensorless settings, these can also be obtained using various methods; in sensorless motors, various types of observers can be used to obtain the rotor speed n and rotor position θ of motor M, such as sliding mode observers, Lombberg observers, flux linkage observers, etc.). In practical applications, for example, the speed reference n is obtained based on user input. ref The difference between the measured rotor speed n and the actual rotor speed n is input to the PID1 module (i.e., the speed loop PID). The output of the speed loop PID is the q-axis reference current i. qref Without field weakening control, the d-axis reference current i can be set. dref =0. At this point, the reference currents i on the q-axis and d-axis can be set to 0. qref and i dref The actual q-axis and d-axis currents i fed back by the motor q and i d The difference is calculated, and after being adjusted by PID2 and PID3 modules respectively (the PI parameters of the two current loops are usually the same), the output q-axis and d-axis voltages V are obtained. d and V q Then, through the inverse Park transform, it is converted into α-axis and β-axis voltages V. α and V β Then, the three-phase voltage V is obtained through SVPWM (Space Vector Modulation). a V b V c The current is then transmitted to the motor M via a three-phase inverter bridge. In FOC control, the three-phase current i is obtained through a sampling resistor. a i b i c The α-axis and β-axis currents i are obtained through Clarke transformation. α and i β Then, after Park transformation, the feedback d-axis and q-axis currents i are obtained. d and i q It participates in current loop control. It is worth noting that... Figure 1 The PID1 and PID2 / PID3 modules shown represent PID control of the speed loop and current loop, respectively. In a specific embodiment of the present invention, both the speed loop and the current loop adopt PI control.

[0042] Currently, the control systems of permanent magnet synchronous motors mainly employ a dual-loop control strategy: a speed loop and a current loop. The performance of the current loop and speed loop directly affects the control performance; therefore, reasonably improving the dynamic response capability and stability characteristics of the speed loop and current loop is crucial for enhancing control performance. With accurate motor model parameters, the standard PI parameters for the speed loop and current loop can be obtained based on the desired dual-loop response curves, thus completing the tuning of the permanent magnet synchronous motor control PI parameters.

[0043] However, in actual measurements, the electrical parameters of the motor—resistance R, inductance L—and mechanical parameters—moment of inertia J—are often affected by the measuring instruments, making accurate measurement difficult. Furthermore, the electrical and mechanical parameters measured when the motor is stationary often change during operation, leading to significant differences between the actual operating characteristic curve and the theoretical curve. Therefore, the theoretically calculated PI parameters often fail to meet the requirements of actual operating conditions.

[0044] In view of this, this disclosure proposes a motor control PI parameter tuning scheme, which adaptively tunes the theoretically calculated PI parameters based on the difference between the actual feedback current and the given current, and further based on the difference between the feedback speed and the given speed.

[0045] To facilitate understanding of this solution, the calculation of the theoretical values ​​of the PI parameters for motor control is first described. It should be understood that PID corresponds to Proportional-Integral-Derivative (PID) control. In practice, the coefficients corresponding to the proportional, integral, and derivative terms can usually be adjusted to achieve optimized control adapted to the current system. In the motor's current and speed loops, since they typically only contain proportional and integral terms, the desired control can be achieved by adjusting the proportional and integral coefficients. However, this invention is not limited to this; in embodiments where the current and speed loops include derivative terms, the corresponding derivative coefficients can also be tuned in a similar manner according to this invention. It is well known to those skilled in the art that the motor control PI parameter tuning of this invention can be considered as tuning the motor control PID parameters, and can encompass the tuning of any one or any combination of the proportional, integral, and derivative coefficients.

[0046] I. Calculation of the theoretical value of PI parameter

[0047] The PI parameter tuning for permanent magnet synchronous motor control includes the current loop and the speed loop. The tuning process is to tune the current loop first, followed by the speed loop. Therefore, we will first analyze the tuning process of the current loop, and then analyze the tuning process of the speed loop.

[0048] 1.1. Current Loop Setting

[0049] During the current loop tuning process, the motor can be approximated as an electrical model of resistor R and inductor L. Figure 2 The diagram shows the structure of a series PI-controlled motor. As shown, the proportional, integral, and derivative modules are connected in series. The coefficient of the proportional module is K. p (corresponding to the current loop proportion K below) p_c The coefficients of the integral module are K. i (corresponding to the current loop integral factor K below) i_c The coefficient of the differential module is 1 / s. Here, s refers to the Laplace transform domain. The output current is used as feedback (corresponding to the current measured in the figure) and returned to the system as input. After being adjusted sequentially by the series proportional and integral modules, it is output. At this time, the open-loop transfer function of the current loop is:

[0050]

[0051] Accordingly, the closed-loop transfer function is:

[0052]

[0053] K p_c K i_c These represent the current loop scaling factor and integral factor (also known as the current loop scaling coefficient and current loop integral coefficient, respectively), which are also the PI parameters that can be adjusted in the current loop.

[0054] As shown in equation (2), the denominator of the closed-loop transfer function is a second-order expression of s, indicating that the function has two poles; the numerator is a first-order expression of s, indicating that the function has one zero. Equation (2) corresponds to a second-order system. After adding a velocity loop, its order will increase further. Therefore, in order to reduce the overall system order, the current loop can be simplified, that is, the denominator in equation (2) can be expressed as:

[0055]

[0056] Thus, satisfying make At this time, in order to satisfy Therefore, equation (3) can be expressed as:

[0057]

[0058] As shown in equation (4), after simplification, one pole and one zero in the closed-loop transfer function of the motor's current loop cancel each other out. Therefore, the closed-loop transfer function has only one real pole and no zeros, resulting in no peak frequency response or resonance. It is simply a single-pole low-pass response with a bandwidth frequency of...

[0059] 1.2. Speed ​​Loop Tuning

[0060] Figure 3 A dual-closed-loop control diagram for a continuous-mode motor is shown. As illustrated, since the speed loop output serves as the current loop input, and the speed loop feedback requires the current loop output, the speed loop tuning must be performed based on the current loop tuning. In the diagram, K... p_s K is the speed loop proportional coefficient. i_s K represents the integral coefficient of the speed loop, which is also a PI parameter that needs to be adjusted in the speed loop. p_c K is the proportionality coefficient of the current loop. i_c Here, R is the integral coefficient of the current loop, L is the motor resistance, L is the motor inductance, P is the number of motor pole pairs, and ψ is the integral coefficient of the current loop. f For motor flux linkage, T e For electromagnetic torque, T d Let n be the disturbance torque, n be the motor speed, and J be the motor moment of inertia.

[0061] For a permanent magnet synchronous motor, the q-axis current i q The relationship with electromagnetic torque is as follows:

[0062]

[0063] The relationship between torque and speed is as follows:

[0064]

[0065] Based on the continuous current loop tuning process described above, the current loop can be approximately simplified as follows: Therefore, we obtain Figure 4 The simplified control diagram of the continuous model motor with two closed loops is shown. Multiplying all the equations in the forward path yields the following open-loop transfer function for the forward path:

[0066]

[0067] make Equation (7) can be simplified to:

[0068]

[0069] Equation (8) corresponds to a second-order system. Therefore, the open-loop transfer function characteristics of the velocity loop of the continuous model can be obtained as follows:

[0070] The two poles are located at s=0, so the low-frequency attenuation is 40dB per decade.

[0071] The other pole is located at At this point, the current controller's pole (the bandwidth frequency of the current loop) is located.

[0072] The other zero point is located at s=K i_sPlace.

[0073] In order to maintain the stable operation of the system, The frequency at the pole must be higher than s = K i_s The frequency at zero point. K can also be adjusted. p_s K i_s The countless combinations result in different frequency responses, and for these combinations, it depends on whether higher bandwidth or higher stability is desired.

[0074] Analyzing equation (8), its amplitude-frequency response curve decreases at a rate of (-40dB / dec) in the low-frequency range. When the frequency reaches the first corner frequency ω1=K i_s The slope increases by 20 dB / dec, when the second corner frequency is reached. The slope decreases by 20 dB / dec, and then decreases by -40 dB / dec in subsequent frequency bands. The frequency band with frequencies less than the first cutoff frequency ω1 is called the low-frequency band; the frequency band with frequencies greater than the first cutoff frequency ω1 and less than the second cutoff frequency ω2 is called the mid-frequency band; and the frequency band with frequencies greater than both cutoff frequencies ω2 is called the high-frequency band. Figure 5 The Bode plot of the second-order system corresponding to Equation (8) is shown.

[0075] In the control process, to ensure high system stability and response speed, the cutoff frequency ω is generally set to a certain value. c_s Between the first cutoff frequency ω1 and the second cutoff frequency ω2, that is, Figure 5 The point where the slope is gentlest at the mid-amplitude value. And when the cutoff frequency ω c When it is exactly between the first cutoff frequency ω1 and the second cutoff frequency ω2, at this time The system has the largest phase margin.

[0076] For ease of understanding, σ can be defined as the damping factor, and... Therefore ω c_s =σω1, The greater the separation between the first corner frequency ω1 (zero frequency) and the second corner frequency ω2 (pole frequency), the greater the maximum phase margin γ that can be achieved between the two frequencies. However, this stability is based on sacrificing the speed loop bandwidth. When σ = 1, the zero frequency ω1 and the pole frequency ω2 are equal, which can achieve zero-pole cancellation and put the system in a critical stable state. When σ > 1, the maximum phase margin γ > 0, and the system is stable. However, σ approaching 1 will lead to severe underdamping in performance. Combining equation (8), we know that ω1 = K i_s , Thus satisfying When σ=1, then ω1=ω2=ω c_s , When the system is stable, σ > 1, and at this time ω1 < ω c_s <ω2=ω b_c In the dual-loop design process, the bandwidth ω of the current loop... b_c Directly affects the cutoff frequency ω of the velocity loop c_s For the system to be stable, the bandwidth ω of the speed loop... b_s It must be less than the bandwidth ω of the current loop. b_c (Here, the open-loop cutoff frequency ω of the velocity loop can be used as an approximation.) c_s Replace the velocity loop bandwidth frequency ω b_s ).

[0077] ω2 is the bandwidth frequency of the current loop, and its value remains unchanged after the current loop tuning is completed. Figure 6 This shows the cutoff frequency ω1 and cutoff frequency ω2 when the cutoff frequency ω2 is fixed. c_s The relationship diagram is shown in the figure. As the figure shows, when the second corner frequency ω2 = 1000 rad / s, the smaller the damping factor σ, the more effective the relationship between the first corner frequency ω1 and the cutoff frequency ω. c_s The larger the value (at this point, the faster the system response speed, the smaller the maximum phase margin γ, and the lower the stability); the larger the damping factor σ, the higher the first corner frequency ω1 and cutoff frequency ω. c_s The smaller the value, the slower the system response speed, the larger the maximum phase margin γ, and the higher the stability.

[0078] Next, determine another parameter K of the speed loop PI. p_s The system's open-loop transfer function at the cutoff frequency ω c When it crosses the 0dB line, the condition is met.

[0079]

[0080] have to:

[0081] 1.3. Dual Closed-Loop Tuning

[0082] Therefore, for continuous models, the double-loop tuning process can be implemented as follows:

[0083] First, set the integral coefficient of the current loop. To achieve zero-pole cancellation in the current loop transfer function, the system model is simplified.

[0084] Next, set the proportional coefficient K of the current loop. p_c =ω b_c ×L, K p_c With the bandwidth frequency ωω of the current loop b In combination, when a higher stability and better filtering effect of the current loop are desired, a smaller bandwidth frequency ω can be selected.b_c When a high fast response capability of the current loop is desired, a larger bandwidth frequency ω can be selected. b_c .

[0085] • When setting the speed loop, That is, the larger the damping factor σ, the smaller the first corner frequency ω1, and K i_s The smaller it is, the better, since ω2 = ω b_c fixed, The smaller (bandwidth frequency ω) the better. b_s The smaller the damping factor σ, the greater the system's phase margin and stability, but the slower the response speed. The smaller the damping factor σ, the greater the first corner frequency ω1, and the greater the K... i_s It is also larger, and at the same time, since ω2=ω b_c fixed, The larger (bandwidth frequency ω) the frequency, the greater. b_s The larger the value, the smaller the system phase margin and the lower the stability, but the faster the response speed.

[0086] • After completing K i_s After adjustment,

[0087] As per the above, combined with the appendix Figure 2-6 A method for obtaining the theoretical PI parameters of the current loop and speed loop from the stationary motor parameters is described. It should be understood that in other implementations, methods other than those described above can also be used to calculate the theoretical PI parameters.

[0088] II. Adjustment of the theoretical value of PI parameter

[0089] 2.1. Adjustment of theoretical values ​​of current loop PI parameters

[0090] In existing technologies, calculated theoretical PI parameters are typically used directly for FOC control. However, in actual measurements, the electrical parameters of the motor are difficult to measure accurately due to the influence of measuring instruments, and the electrical and mechanical parameters often change during motor operation, making it difficult for the theoretically calculated PI parameters to meet the requirements of actual operating conditions. Therefore, this disclosure proposes a motor control PI parameter tuning scheme. Figure 7 A schematic flowchart of a motor control PI parameter tuning method according to an embodiment of the present disclosure is shown. This method fine-tunes the PI parameters based on a comparison between the actual feedback current and a given current. It should be understood that in practical operation… Figure 1 The current loops PI2 and PI3 shown have the same PI parameters, so they can be adjusted as a whole.

[0091] In step S710, the theoretical current loop PI parameter value can be calculated based on the parameters when the motor is stationary. For example, the theoretical current loop PI parameter value can be calculated based on the continuous current loop model as described in Part I above. Furthermore, the expected bandwidth of the current loop can be determined based on the theoretical current loop PI parameter value, and this expected bandwidth can be used in step S720.

[0092] In step S720, actual motor control is performed using the theoretical current loop PI parameter values, during which a first given current is input to the q-axis to obtain a first feedback current. This first given current is a sinusoidal current with a first given frequency. It can be considered that during the control process, a sinusoidal current with a defined frequency and amplitude for multiple cycles is continuously injected into the q-axis. Here, "sinusoidal current" can be a sinusoidal current injected with any initial phase; in other words, the injected current can also be a cosine current, or a sinusoidal current with other initial phases.

[0093] The motor control PI parameter tuning method disclosed herein aims to improve the actual operating performance of the motor, and the feedback current under the desired current loop bandwidth is more representative of the actual operating conditions of the motor. Therefore, in one embodiment, the first given frequency is preferably the desired current loop bandwidth value (e.g., 1000Hz in the example below). It should be understood that using a frequency not far from the desired current loop bandwidth, such as a frequency that does not differ from the desired current loop bandwidth by more than a predetermined threshold (e.g., a frequency between 950 and 1050Hz when the expected threshold is 5%), can also be considered as selecting the desired current loop bandwidth value as the first given frequency.

[0094] Subsequently, in step S730, a first comparison result between the first feedback current and the first given current is obtained. As described below, the comparison between the first feedback current and the first given current can be a comparison of amplitude or a comparison of phase, preferably a comparison of both amplitude and phase. Therefore, in one embodiment, the first comparison result includes a first amplitude comparison result and a first phase comparison result, and obtaining the first comparison result between the first feedback current and the first given current includes: obtaining the amplitude comparison result of the first feedback current and the first given current as the first amplitude comparison result; and obtaining the phase comparison result of the first feedback current and the first given current as the first phase comparison result.

[0095] Subsequently, in step S740, the current loop PI parameter value can be adjusted based on the first comparison result until the new first feedback current obtained by actual motor control using the adjusted current loop PI parameter value satisfies the first predetermined condition with the new first comparison result of the first given current. Specifically, if the first comparison result shows a difference from the first predetermined adjustment, the PI parameter value of the current loop can be adjusted, and the control of the actual motor and the q-axis first given current injection can be re-performed using the adjusted PI parameter value to obtain the actual feedback current under the adjusted current loop PI parameter. The above adjustment can be repeated until the new first comparison result of the new first feedback current and the first given current satisfies the first predetermined condition. It should be understood that in the above repeated adjustments, it is preferable that the frequency and amplitude of the first given current remain unchanged. In other embodiments, since the amplitude comparison value of the given current and the feedback current is obtained, the amplitude of the first given current can be changed. In addition, in one embodiment, the first predetermined condition may specify that the comparison result of the amplitude and phase of the actual feedback current with the amplitude and phase of the first given current needs to be limited.

[0096] Because there are deviations between the actual motor parameters obtained from labeling or measurement and their true values, and because these parameters change during motor operation, directly using the theoretical PI control parameters calculated based on labeling or measurement often leads to discrepancies between the actual response characteristics and the theoretical analysis. Therefore, this disclosure fine-tunes the theoretically calculated current loop PI parameters based on the actual response characteristics, enabling the motor control to better meet the needs of practical applications.

[0097] In practice, the amplitude and phase of the actual feedback current can be determined directly from the values ​​displayed on the oscilloscope or acquired. However, in some cases, due to insufficient acquisition accuracy or to reduce the influence of external noise, a more reliable method can be used to calculate the amplitude and phase of the actual feedback current.

[0098] In one embodiment, the amplitude of the first feedback current can be obtained by calculating the difference between the maximum and minimum values ​​of the feedback current. To this end, obtaining the amplitude comparison result of the first feedback current and the first given current as the first amplitude comparison result includes: obtaining the maximum and minimum values ​​of the first feedback current; calculating the amplitude of the first feedback current based on the difference between the maximum and minimum values ​​(the difference between the maximum and minimum values ​​should be twice the amplitude); and determining the first amplitude comparison result based on the amplitude of the first feedback current and the amplitude of the first given current.

[0099] Considering the impact of errors and noise in actual operation, the amplitude calculation as described above can be obtained by averaging the differences between the maximum and minimum values ​​collected over multiple cycles. In this case, obtaining the amplitude comparison result of the first feedback current and the first given current as the first amplitude comparison result may include: obtaining the maximum and minimum values ​​of the first feedback current over multiple cycles; calculating the amplitude of the first feedback current based on the average difference between the maximum and minimum values ​​over multiple cycles; and determining the first amplitude comparison result based on the amplitude of the first feedback current and the amplitude of the first given current.

[0100] In one embodiment, the phase of the first feedback current can be characterized by its zero-crossing phase. In this case, obtaining the phase comparison result between the first feedback current and the first given current as the first phase comparison result includes: obtaining the phase value of the first zero-crossing of the first feedback current; and determining the first phase comparison result based on the phase value of the first zero-crossing and the phase value of the second zero-crossing of the first given current. When the first given current has no bias current, the first and second zero-crossings correspond to the true zero-crossings of the current. When the first given current includes a bias current (e.g., corresponding to the q-axis given sinusoidal current (or cosine current) const + amp * sin(ωt) as described below), the first and second zero-crossings correspond to the positions where the current passes through the bias current value (e.g., the current value equals const).

[0101] In practice, due to the limited frequency of the control signal (fPWM as shown below), it is usually impossible to sample the feedback current precisely at the current zero-crossing point. Therefore, the zero-crossing point position can be determined by curve fitting of data points around the zero-crossing point, thereby obtaining the zero-crossing point phase value. In this case, obtaining the first zero-crossing point phase value of the first feedback current includes: sampling multiple data points around the zero-crossing point; performing curve fitting based on the multiple data points; and obtaining the zero-crossing point phase value of the fitted curve as the first zero-crossing point phase value.

[0102] It should be understood that the calculations above for the amplitude and phase of the actual feedback current can also be performed for the amplitude and phase of both the simulated and actual feedback currents. Similarly, the zero-crossing point of the first given current can be obtained based on the fitting operation described above.

[0103] The first predetermined condition typically requires that the new first comparison result is not worse than the theoretical change value. Here, "worse than" can mean that the amplitude and phase changes of the actual feedback current are generally worse than the theoretical change value; more specifically, the amplitude decay of the actual feedback current is greater than the theoretical amplitude decay (i.e., the amplitude change value of the decayed actual feedback current is smaller than the theoretical amplitude change value), and / or the phase change of the actual feedback current is greater than the theoretical phase change value (the actual feedback current lags behind the theoretical value by a larger margin in phase compared to the given current). Therefore, the first predetermined condition requires that both the new first amplitude comparison result and the first phase comparison result are not worse than their respective theoretical values.

[0104] In one embodiment, the first predetermined condition may be that the comparison result of the new first amplitude of the new first feedback current obtained under the current loop PI parameters after tuning and the new first amplitude of the first given current is not less than the first theoretical amplitude change value, and the comparison result of the new first phase of the new first feedback current and the new first phase of the first given current is not greater than the first theoretical amplitude change value. In other words, it is required that the actual feedback amplitude is not less than the amplitude of the simulated feedback current obtained from the theoretical simulation, and the phase is not lagging behind the phase of the simulated feedback current. For example, in the following combination Figure 11 In the example, when the first given current is the desired bandwidth of the current loop, the ratio of the amplitude of the simulated feedback current to the given current is 0.707 (i.e., the amplitude change is 0.707), and the phase of the simulated feedback current lags behind the phase of the given current by 45°. At this point, the first theoretical amplitude change can also be 0.707, and the first theoretical amplitude change can be 45°. In this case, the first predetermined adjustment can require that the new first amplitude comparison result is not less than 0.707, and the new first phase comparison result is not greater than 45°. In other words, it requires that the ratio of the amplitude of the new first feedback current to the first given current is not less than 0.707, and the phase lag does not exceed 45°.

[0105] At this time, based on the first comparison result, the current loop PI parameter value is adjusted until the new first feedback current obtained by actual motor control using the adjusted current loop PI parameter value satisfies the first predetermined condition with the new first comparison result of the first given current. This includes: in response to the first amplitude comparison result being greater than the first theoretical amplitude change value and / or the first phase comparison result being less than the first theoretical phase change value, the value of the current loop PI parameter is adjusted until the newly obtained first comparison result is no longer inferior to the theoretical change value, that is, the newly obtained first amplitude comparison result is not less than the first theoretical amplitude change value and the first phase comparison result is not greater than the theoretical phase change value.

[0106] In one embodiment, the current loop integral coefficient K can be adjusted. i_c and current loop proportionality coefficient K p_cBoth are used to adjust the PI parameter value of the current loop. In one embodiment, this is achieved by increasing the current loop integral coefficient K. i_c This could easily lead to system malfunction; therefore, only adjusting the current loop proportional coefficient K is recommended. p_c By increasing the current loop proportionality coefficient K p_c This increases the actual bandwidth of the current loop, thereby improving the control performance of the motor.

[0107] While increasing the actual bandwidth of the current loop can improve the motor's response speed, it can also easily lead to system instability. Therefore, when the performance of the first feedback current obtained from the theoretical current loop PI parameters is better than the theoretical change value, the proportional gain K of the current loop can be reduced. p_c This reduces the actual bandwidth of the current loop to match the desired bandwidth, improving system stability while meeting theoretical control performance requirements. Similarly, "better than" here can refer to the actual feedback current's amplitude and phase changes being better than their corresponding theoretical values; more specifically, the actual feedback current's amplitude attenuation should be less than the theoretical amplitude attenuation (i.e., the attenuated actual feedback current's amplitude change should be greater than the theoretical amplitude change), and the actual feedback current's phase change should be less than the theoretical phase change (the actual feedback current's phase lag compared to the given current is smaller than the theoretical value). Therefore, as a supplement, the first predetermined condition also requires that both the new first amplitude comparison result and the first phase comparison result are not both better than their respective theoretical values.

[0108] Therefore, in one embodiment, based on the first comparison result, adjusting the current loop PI parameter value until the new first feedback current obtained by actual motor control using the adjusted current loop PI parameter value satisfies the first predetermined condition with the new first comparison result of the first given current includes: in response to the first amplitude comparison result being greater than the first theoretical amplitude change value and the first phase comparison result being less than the first theoretical phase change value, adjusting the value of the current loop PI parameter until the newly obtained first comparison result is no longer better than the theoretical change value, that is, the newly obtained first amplitude comparison result is no longer greater than the first theoretical amplitude change value and / or the first phase comparison result is no longer less than the theoretical phase change value.

[0109] Furthermore, it should be understood that the adjustment of the current loop PI parameter value in this disclosure can be performed automatically based on the comparison result. For example, if the comparison result indicates that the current loop proportional coefficient needs to be increased, the current loop proportional coefficient can be adjusted according to a predetermined step length until the new comparison result meets the condition. Similarly, if the comparison result indicates that the current loop proportional coefficient needs to be decreased, the current loop proportional coefficient can be adjusted according to a predetermined step length until the new comparison result meets the condition. When near the preferred value, the current loop proportional coefficient can also be adjusted with a smaller step length.

[0110] To facilitate understanding, the adjustment of the theoretical value of the current loop PI parameter will be further described below with reference to the accompanying drawings and examples.

[0111] 2.3. Example of adjusting the PI parameter value of the current loop

[0112] The response was tested on a 24V motor with resistance R = 0.24Ω and inductance L = 0.00023H; mechanical parameters: moment of inertia J = 0.0000288Kg·m. 2 First, the implementation process can be simulated and tested. During the test, the motor parameters and motor model are accurate. During the test, the current loop bandwidth ω is adjusted according to the response requirements. b_c Set to 6283 rad / s, corresponding to a frequency of f. b_c =1000Hz. Velocity loop damping factor σ = 5, at which point the velocity loop bandwidth ω b_s ≈1256 rad / s, corresponding to a frequency of f b_s =200Hz.

[0113] Based on the above calculation process, the current loop PI parameters can be obtained. K p_c =ω b_c ×L=1.382; Speed ​​loop PI parameter

[0114] First, a current loop frequency sweep test is performed in the simulation. Figure 8 A block diagram for simulating the current loop PI response is shown. During the current loop PI parameter tuning, operations related to the speed loop are not included. Figure 8 The test does not need to include Figure 1 The speed loop PI is shown. Additionally, since the PI parameters of the two current loops are identical, no further details are provided here. Figure 1 The distinction between PI2 and PI3 is shown.

[0115] `const + amp * sin(ωt)` represents the q-axis current input. Here, `const` is a reference bias value corresponding to the bias of a given sinusoidal current (or cosine current, or other sinusoidal current with an initial phase), `amp` is the amplitude of the given sinusoidal current, `sin(ωt)` is the sinusoidal input, and `ω` is the given signal frequency. In some control modes with position sensors, where the rotor position θ can be correctly detected even when the motor is at zero speed or in cyclic forward and reverse rotation, `const` can be set to 0. However, in some sensorless control modes, the rotor position θ can only be correctly detected when the motor is rotating. Therefore, bias values ​​can be selectively added according to the actual application (the rotor position θ participates in Park transformation and inverse Park transformation, which are essential in the current loop control process). This simulation model uses a sensorless model, so `const` is set to 1A. This means that when the motor is rotating normally, the sensorless model observes the rotor position θ, performs Park and inverse Park transformations, and then implements current loop control. By changing the given current frequency, the ratio of the decayed amplitude of the response current to the given current amplitude (i.e., the amplitude change) and the phase lag value are obtained. The decayed amplitude is obtained by repeatedly calculating the maximum and minimum values ​​of the response current and then subtracting them. The phase lag is obtained using the Lagrange quadratic interpolation method. Additionally, although not shown in the figure, the given current can also have a non-zero initial phase. Since only the phase lag between the feedback current and the given current is needed, the introduction of the initial phase will not affect this value.

[0116] Figure 9 The simulated response curve is shown when the sinusoidal given frequency is 500Hz. As shown in the figure, the sinusoidal given frequency is set to ω=3142rad / s, corresponding to a frequency of f=500Hz, and amp=0.5A.

[0117] When calculating the amplitude of the response current signal, first record the multiple maximum and minimum values ​​of the response current, as shown in the figure, which are max1, max2, max3...max n min1, min2, min3...min n The value of n can be selected according to the actual usage. The change in the amplitude of the response signal is calculated as follows:

[0118]

[0119] In the formula, max1 = 1.445, max2 = 1.447, max3 = 1.446; min1 = 0.554, min2 = 0.553, min3 = 0.555, and amp is the amplitude of the given signal, thus representing the amplitude change value (characterizing the remaining amplitude after attenuation). respone =0.892.

[0120] When calculating phase lag, it is necessary to calculate Figure 9 The phase difference between the given current and the feedback current, point A is the zero-crossing point of the given current (the amplitude changes from positive to negative), and its coordinates are (x... A 1), Point B is the zero-crossing point of the feedback current (the amplitude changes from positive to negative), and its coordinates are (x... B 1) The zero-crossing ordinate is 1 because a DC bias of const = 1A was added. For a sinusoidal signal, the zero-crossing point is raised by 1A. Therefore, the phase lag value is:

[0121]

[0122] In the formula, f PWM To control the signal frequency, it is generally set to 16KHz in motor control, where f is the given signal frequency. However, in reality, due to the influence of discretization, it is impossible to accurately sample points A and B. In most cases, surrounding points will be sampled. The feedback current is used as an example for description. Figure 10 An example of sampling three points around the zero-crossing point is shown. Over three consecutive control cycles, the sampled points around the zero-crossing point are D(64, 1.118), E(65, 1.032), and F(66, 0.9441). To improve the accuracy of the zero-crossing point calculation, Lagrange quadratic interpolation can be used to fit the curve near the zero-crossing point to find the zero-crossing point. To simplify the calculation, the signal bias is first removed, resulting in D1(64, 0.118), E1(65, 0.032), and F1(66, -0.059). The amplitudes of the first two points are greater than 0, while the amplitude of the last point is less than or equal to 0. Then, a quadratic function with respect to time t is generated near the zero-crossing point, which can be expressed as:

[0123] x = at 2 +bt+c (12)

[0124] In the formula, t represents time, which can be obtained according to the Lagrange interpolation formula:

[0125] a = 0.5x(n-2) - x(n-1) + 0.5x(n)

[0126] b=-0.5x(n-2)×(2n-1)+x(n-1)×(2n-2)-0.5x(n)×(2n-3)

[0127] c=0.5x(n-2)×(n-1)×nx(n-1)×(n-2)×n+0.5x(n)×(n-2)×(n-1)

[0128] In the formula, n = 66, D1 corresponds to x(n-2) = 0.118; E1 corresponds to x(n-1) = 0.032; F1 corresponds to x(n) = -0.0559; substituting the above into the solution, we get:

[0129] a=-0.000095, b=0.0365, c=1.670.

[0130] When the fitted curve crosses zero, at this point, the condition at is satisfied. 2 +bt+c=0, To determine the values ​​of t1 and t2, choose the value between n-2 = 64 and n = 66, i.e., t = t2 = 65.3666, which is x. B =65.3666.

[0131] The zero-crossing point of the given signal can be calculated using the same method, t = 63.0, i.e., xA = 63.0, thus... The calculation here only describes the process of finding a zero-crossing point for the given current signal and the feedback current signal and calculating the phase lag based on the zero-crossing point. In actual implementation, in order to improve the stability of the system, multiple sets of zero-crossing points can be obtained, the phase lag can be calculated separately, and the average phase lag value can be used as the final phase lag.

[0132] Using the same method, the amplitude variation and phase lag values ​​for different sinusoidal frequencies can be calculated. Figure 11 The simulated response curve is shown when the sinusoidal given frequency is 1000Hz. In this case, the sinusoidal given frequency of 1000Hz is equal to the current loop bandwidth frequency ω. b_c =1000Hz. Using a similar method as above, the amplitude variation value amp can be obtained. respone =0.707105, with a phase lag of 45°.

[0133] Figure 12 The simulated response curve is shown when the sinusoidal given frequency is 1500Hz. At this point, the sinusoidal given frequency is 1500Hz, which is greater than the current loop bandwidth frequency ω. b_c =1000Hz, using a similar method as above, the amplitude change value amp can be obtained. respone =0.554699, with a phase lag of 56.3°.

[0134] Based on the above model response curves, it can be seen that when the current loop is tuned as a first-order inertial element, the measured response curve characteristics of its tuned PI parameters are consistent with the theoretical analysis. When the sinusoidal given frequency is within the current loop bandwidth frequency ω... b_c At 1000Hz, the amplitude change value amp respone =0.707, with a phase lag of 45°, perfectly consistent with the theoretical analysis; when the given frequency of the sine wave is less than the bandwidth frequency ωb_c When the amplitude change is small, the phase lag is also small. When the given frequency of the sine wave is greater than the bandwidth frequency ω b_c At that time, the amplitude change value is relatively large, and the phase lag is also relatively large.

[0135] The above analysis is based on a theoretical model, where all parameters are accurate, thus the results are also accurate. However, in actual implementation (using an MCU to control motor rotation), inaccurate measured motor parameters, changes in motor parameters during operation, inaccurate current sampling with numerous glitches, and dead zones in the drive output all affect the control process. This leads to discrepancies between the theoretically tuned PI parameters and the actual control response characteristics. Therefore, it is necessary to fine-tune the theoretically tuned PI parameters based on the actual response characteristics to meet the requirements of practical applications. The following will introduce a method for automatically fine-tuning PI parameters using an MCU based on the amplitude response and phase hysteresis.

[0136] The test is preferably performed using the response at a given bandwidth frequency, such as a given current loop bandwidth ω. b_c Set to 6283 rad / s, corresponding to a frequency of f. b_c =1000Hz. The given current signal bias const = 0.6A, the given current signal amplitude amp = 0.4A, and the PI parameters based on the current loop theory can be set, K i_c =1091, K p_c The current loop response is obtained when the value is 1.382. Figure 13 The actual response curve is shown when the sinusoidal frequency is given as 1000Hz. At this time, the change in the amplitude of the response signal is amp. respone =0.663, with a phase lag of 89.1°. Compared to Figure 11 It can be seen that the actual feedback amplitude change is less than the theoretical change value of 0.707 at the bandwidth of the first-order inertial element (that is, the amplitude attenuation of the actual feedback current is greater than that of the simulated feedback current), and the phase lag of 89.1° is greater than that of 45.0° at the bandwidth of the first-order inertial element (that is, the phase lag is greater than that of the simulated feedback current).

[0137] Therefore, the PI parameter obtained theoretically usually needs fine-tuning to meet actual requirements (corresponding to the first predetermined condition). During the adjustment process, the integral factor K is increased. i_c This can easily lead to system malfunction; therefore, it is preferable to use an adjustment factor K. p_c The method ensures that the bandwidth meets the actual requirements. Here, the actual response bandwidth is less than the theoretical bandwidth, so K is automatically increased. p_c The method expands the bandwidth until the given theoretical bandwidth ω is reached. b_cThe amplitude change value (the ratio of the attenuated amplitude of the actual feedback current to the given current amplitude) is greater than 0.707 and the phase lag is less than 45.0°.

[0138] K p_c The value automatically increases until both the amplitude change and phase lag are simultaneously satisfied: greater than 0.707 and less than 45.0°. At this point, K... p_c =4.01, amplitude variation value is 1.03, phase lag is 45.0°. Figure 14 The actual response curve is shown when the sinusoidal given frequency is 1000Hz after the current loop PI parameter is adjusted.

[0139] Therefore, in a preferred embodiment, the complete current loop tuning steps are as follows:

[0140] First, the theoretical PI value K of the current loop is calculated based on the motor parameters. p_c K i_c The theoretical PI parameters are then fed into the MCU to control the motor operation.

[0141] The given current during control is const + amp * sin(ωt), and the frequency ω is the desired current loop bandwidth ω. b_c const is DC bias to maintain motor rotation, and amp is the given sinusoidal current amplitude.

[0142] The amplitude change value (amp) is obtained by averaging the differences between the maximum and minimum values ​​of the feedback current at multiple points. respone The phase lag is obtained by Lagrange quadratic interpolation. lag .

[0143] If both amp are satisfied respone Greater than 0.707, phase lag If the angle is less than 45.0°, it proves that the actual bandwidth is greater than the expected current loop bandwidth ω. b_c The program automatically reduces K. p_c Until the amplitude change value amp respone and phase lag lag If the boundary conditions are satisfied first, then it can be proven that the current loop bandwidth is the desired bandwidth ω. b_c .

[0144] Other cases (amp) respone Less than 0.707, phase lag Less than 45.0°; or amp respone Less than 0.707, phase lag Greater than 45.0°; or amp respone Greater than 0.707, phase lagIf the actual bandwidth is greater than 45.0°, it proves that the actual bandwidth is less than the expected current loop bandwidth ω. b_c The program automatically increases K. p_c Until the amplitude change value amp respone and phase lag lag All satisfy the boundary conditions. For example, amp respone Less than 0.707, phase lag When the angle is less than 45.0°, increase K. p_c phase lag It will continue to decrease, remaining below 45.0° (i.e., the phase lag value always meets the condition). At this point, the judgment only needs to be based on the amplitude change value, i.e., the condition is amp. respone A value of 0.707 is sufficient. This proves that the current loop bandwidth at this point is the desired bandwidth ω. b_c .

[0145] 2.4. Adjustment of Speed ​​Loop PI Parameter Values

[0146] In one embodiment, only the current loop PI parameter value can be adjusted. In this case, the adjusted current loop PI parameter value can be used to obtain the speed loop PI parameter value, and the obtained speed PI parameter value can be directly used in the actual motor control.

[0147] In another embodiment, the speed loop PI parameters can also be adjusted after the current loop PI parameter values ​​have been fully adjusted. In this case, the PI parameter adjustment method of this disclosure further includes: calculating the theoretical speed loop PI parameter values ​​based on the parameters when the motor is stationary; performing actual motor control using the adjusted current loop PID parameter values ​​to adjust the speed loop PID parameter values, wherein adjusting the speed loop PID parameter values ​​further includes: performing actual motor control using the adjusted current loop PI parameter values ​​and the theoretical speed loop PI parameter values, during which a second given speed is input to the speed loop to obtain a second feedback speed, wherein the second given speed is a sinusoidal speed signal with a second given frequency; obtaining a second comparison result between the second feedback speed and the second given speed; and adjusting the speed loop PI parameter values ​​based on the second comparison result until the new second feedback speed obtained by performing actual motor control using the adjusted speed loop PI parameter values ​​and the new second comparison result between the second given speed and the second feedback speed satisfy a second predetermined condition.

[0148] It should be understood that the theoretical speed loop PI parameter values ​​can be calculated together with the theoretical current loop PI parameter values ​​in step S710 based on the parameters when the motor is stationary. Furthermore, although "second given speed" and "second feedback speed" are used here, "second" is intended to indicate operation for the speed loop, but does not imply that a "first given speed" needs to be prepared or a "first feedback speed" needs to be obtained when setting the current loop PI parameter values.

[0149] Similar to adjusting the current loop PI parameters, when adjusting the speed loop PI parameters, the desired bandwidth of the speed loop can be used as the frequency corresponding to the second given speed. In specific comparisons, the amplitude change and phase lag of the second feedback speed compared to the second given speed can be compared with the theoretical changes, and adjustments are made accordingly. It should be understood that if, due to the adjustment of the current loop PI parameters, the amplitude change and phase lag of the second feedback speed under the control of the resulting speed loop PI parameters are better than the theoretical changes (i.e., the amplitude attenuation of the feedback speed is less than the theoretical amplitude attenuation (the second amplitude comparison result is greater than the corresponding theoretical value) and the phase lag is less than the theoretical phase lag), then no further adjustment of the speed loop PI parameters is necessary.

[0150] In a specific implementation example, after completing the current loop tuning, the tuned current loop parameters (K) are... p_c =4.01, K i_c Substituting (=1091) into the theoretical speed loop PI parameter K, i_s =251.3, K p_s =0.074 for speed loop tuning. During speed loop tuning, the frequency of the given speed is equal to the theoretical bandwidth ω of the speed loop. b_s ≈1256 rad / s, corresponding to a frequency of f b_s =200Hz.

[0151] Figure 15 The actual response curve is shown when the velocity loop is tuned to a sinusoidal given frequency of 200Hz. The amplitude variation value amp can be calculated using a method similar to the one described above. respone =0.824, phase lag lag =56.2°. At this point, if the theoretical changes are still 0.707 and 45.0°, the phase lag does not meet the second predetermined condition, and the speed loop PI parameters need to be adaptively adjusted. In this case, the speed loop PI parameters can be automatically adjusted using a method similar to that used for the current loop. Figure 16 The actual response curve is shown when the PI parameter of the speed loop is adjusted and the sinusoidal given frequency is 200Hz. When K... p_s When = 0.090, the amplitude change value amp respone =0.95, phase lag lag=45.0°. That is, the new actual amplitude change value is greater than the theoretical amplitude change value by 0.707, while the new phase lag value is equal to the feedback phase lag value of 45.0°. At this time, the response curve of the velocity loop can meet the actual response requirements.

[0152] Figure 17 The response curves of the velocity-current dual closed loop are shown under theoretical PI parameters. The upper part is the velocity loop response curve, and the lower part is the current loop response curve.

[0153] The graph clearly shows that the speed loop's response speed is significantly slower than the current loop's. While the speed loop is still adjusting, the current loop has already stabilized, fluctuating around the given current. When a step change occurs at the given speed, the time from the moment of the step change to the feedback speed reaching 0.707 times the given speed (the time from point A to point B) is approximately 10 ms, which is similar to the speed loop bandwidth f. b_s The reciprocal of 1 / 200Hz = 5.0ms is not significantly different; the time from the given speed step to the feedback speed fluctuating around the actual speed (the time from point A to point C) is approximately 35ms. However, in reality, at the beginning of the speed step, although the feedback current is close to the given current, there is still a steady-state error. This indicates that the bandwidth of the current loop is not large enough, resulting in a slow response speed, that is, the theoretical PI current loop response speed is relatively slow.

[0154] Figure 18 The response curves of the speed and current dual closed loops are shown under adjusted PI parameters. Similarly, the upper part is the speed loop response curve, and the lower part is the current loop response curve.

[0155] Since the speed loop PI parameters did not change significantly during the adjustment process, the speed loop response curve remained largely unchanged from the unadjusted version. After adjustment, the current loop bandwidth increased significantly. At the instant of a sudden change in the given current, the feedback current immediately followed the change in the given current. The speed loop step response curve also proved the accuracy of adjusting the speed loop bandwidth using the frequency sweep characteristic.

[0156] The adjusted current loop PI parameter values ​​obtained via the method described in this disclosure (and the adjusted speed loop PI parameters are also written when adjusting the speed loop parameters) can be written into the controller of the permanent magnet synchronous motor. The controller can then perform magneto-oriented vector control on the permanent magnet synchronous motor based on the adjusted current loop PI parameter values. In some application scenarios, the PI parameters can be adjusted again based on the current actual feedback current after the motor has been in actual use for a period of time.

[0157] In motors where this method is used to adjust PI parameters, if a sinusoidal signal (current loop, speed loop) is given, its feedback signal (current, speed) will also exhibit a sinusoidal change, and its amplitude change value and phase lag value are better than those of motors controlled based on theoretical PI parameters, thus making it easy to identify.

[0158] Figure 19 A schematic diagram of a motor control system according to an embodiment of the present invention is shown. As shown, in addition to the motor portion, the motor control system also includes a magnetorientation vector control (FOC) module for controlling the motor. Figure 19 As shown, in one embodiment, the motor control system further includes a power supply, a microcontroller (MCU), a driver, an inverter, and a current sampling device, wherein the FOC module can be implemented by a processing unit in the MCU. In this disclosure, the FOC module can use a PI parameter tuning method based on the method described above. Figure 19 The adjusted PI parameters obtained from the PID module shown are used to perform magneto-oriented vector control on the motor.

[0159] This disclosure proposes a scheme for adaptively adjusting the current loop PI parameters based on theoretical current loop and velocity loop parameters calculated using a continuous model. This adjustment is made by considering the phase and amplitude differences between the actual feedback current and the given current, as well as between the actual feedback velocity and the given velocity. Furthermore, the velocity loop PI parameters can be further adjusted. Additionally, the response signal amplitude can be obtained by averaging the differences between multiple maximum and minimum values ​​of the response curve, thus improving the accuracy of response amplitude measurement. The phase difference can also be obtained using a Lagrange quadratic interpolation method, thereby improving the accuracy of phase lag measurement.

[0160] The various embodiments of the present invention have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or improvement of the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.

Claims

1. A method for tuning PI parameters for motor control, comprising: The theoretical current loop PI parameter values ​​are calculated based on the parameters of the motor when it is stationary. The actual motor control is performed using the current loop PI parameter values ​​of the theory, during which a first given current is input to the q-axis to obtain a first feedback current, wherein the first given current is a sinusoidal current with a first given frequency, and the first given frequency corresponds to the desired bandwidth frequency of the current loop. Calculate the first comparison result between the first feedback current and the first given current; and Based on the first comparison result, the current loop PI parameter value is adjusted until the new first feedback current obtained by using the adjusted current loop PI parameter value for actual motor control and the new first comparison result of the first given current satisfy the first predetermined condition. The first comparison result includes a first amplitude comparison result and a first phase comparison result, and obtaining the first comparison result between the first feedback current and the first given current includes: The amplitude comparison result between the first feedback current and the first given current is obtained as the first amplitude comparison result; and The phase comparison result between the first feedback current and the first given current is taken as the first phase comparison result. The step of adjusting the current loop PI parameter value based on the first comparison result until the new first feedback current obtained by using the adjusted current loop PI parameter value for actual motor control and the new first comparison result of the first given current satisfy the first predetermined condition includes: In response to the first amplitude comparison result being less than the first theoretical amplitude change value and / or the first phase comparison result being greater than the first theoretical phase change value, the value of the current loop PI parameter is adjusted until the newly obtained first amplitude comparison result is not less than the first theoretical amplitude change value and the first phase comparison result is not greater than the first theoretical phase change value.

2. The method as described in claim 1, wherein, Obtaining the amplitude comparison result between the first feedback current and the first given current as the first amplitude comparison result includes: Obtain the maximum and minimum values ​​of the first feedback current; The amplitude of the first feedback current is calculated based on the difference between the maximum and minimum values; and The first amplitude comparison result is determined based on the amplitude of the first feedback current and the amplitude of the first given current.

3. The method as described in claim 1, wherein, Obtaining the amplitude comparison result between the first feedback current and the first given current as the first amplitude comparison result includes: Obtain the maximum and minimum values ​​of the first feedback current over multiple cycles; The amplitude of the first feedback current is calculated based on the average of the differences between the maximum and minimum values ​​over multiple cycles; and The first amplitude comparison result is determined based on the amplitude of the first feedback current and the amplitude of the first given current.

4. The method of claim 1, wherein, Obtaining the phase comparison result between the first feedback current and the first given current as the first phase comparison result includes: Obtain the phase value of the first zero-crossing point of the first feedback current; and Based on the phase value at the first zero-crossing point and the phase value at the second zero-crossing point of the first given current, the first phase comparison result is determined. Wherein, when the first given current has no bias current, the first zero-crossing point and the second zero-crossing point correspond to the actual zero-crossing point of the current, and when the first given current includes bias current, the first zero-crossing point and the second zero-crossing point correspond to the position where the current passes through the bias current value.

5. The method of claim 4, wherein, Obtaining the first zero-crossing phase value of the first feedback current includes: Multiple data points were collected around the zero point; Curve fitting is performed based on the multiple data points; and The phase value of the zero-crossing point of the fitted curve is taken as the phase value of the first zero-crossing point.

6. The method of claim 1, wherein, Based on the first comparison result, the current loop PI parameter value is adjusted until the new first feedback current obtained by actual motor control using the adjusted current loop PI parameter value satisfies the first predetermined condition with the new first comparison result of the first given current, including: In response to the first amplitude comparison result being greater than the first theoretical amplitude change value and the first phase comparison result being less than the first theoretical phase change value, the value of the current loop PI parameter is adjusted until the newly obtained first amplitude comparison result is not greater than the first theoretical amplitude change value and / or the first phase comparison result is not less than the first theoretical phase change value.

7. The method of claim 1, wherein, Adjusting the current loop PI parameter values ​​includes: In response to the first comparison result being better than the theoretical change value, the value of the current loop proportional coefficient is reduced; and In response to the first comparison result being worse than the theoretical change value, the value of the current loop proportional coefficient is increased.

8. The method of claim 1, wherein, The first given frequency differs from the desired bandwidth frequency of the current loop by no more than a predetermined threshold, wherein the value of the desired bandwidth frequency of the current loop is determined based on the theoretical current loop PI parameter value.

9. The method of claim 1, further comprising: Calculate the theoretical speed loop PI parameter value based on the parameters of the motor when it is stationary; as well as Actual motor control is performed using adjusted current loop PI parameter values ​​to adjust the speed loop PI parameter values, wherein adjusting the speed loop PI parameter values ​​includes: Actual motor control is performed using the adjusted current loop PI parameter values ​​and the theoretical speed loop PI parameter values, during which a second given speed is input to the speed loop to obtain a second feedback speed, wherein the second given speed is a sinusoidal speed signal with a second given frequency, and the second given frequency corresponds to the desired bandwidth frequency of the speed loop. Calculate the second comparison result between the second feedback speed and the second given speed; and Based on the second comparison result, the speed loop PI parameter value is adjusted until the new second feedback speed obtained by actual motor control using the adjusted speed loop PI parameter value and the new second comparison result of the second given speed satisfy the second predetermined condition.

10. The method of claim 9, further comprising: The adjusted current loop PI parameter values ​​and the adjusted speed loop PI parameter values ​​are written into the motor controller; as well as The controller performs magnetodirectional vector control during the operation of the motor based on the adjusted current loop PI parameter values ​​and the adjusted speed loop PI parameter values.

11. A motor control system, comprising: Electric motor; as well as A magnetic orientation vector control module is used to perform magnetic orientation vector control on the motor using adjusted PI parameters obtained based on the PI parameter tuning method as described in any one of claims 1-9.

Citation Information

Patent Citations

  • Current loop realization method and realization system of switched reluctance motor controller

    CN102545771A

  • Automatic calibration of current regulator control compensation for an elevator motor drive with locked rotor

    US5880415A