Current loop control method, servo driver and computer readable storage medium
By switching between second-order and third-order linear extended state observers in the permanent magnet synchronous motor servo drive system, disturbance, delay, and decoupling compensation quantities are generated, solving the problem of insufficient disturbance tracking capability caused by the fixed order of the extended state observer, and realizing current loop control with higher bandwidth and better control accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN HUACHUANG INTELLIGENT ENTERPRISE TECHNOLOGY CO LTD
- Filing Date
- 2026-05-15
- Publication Date
- 2026-07-14
AI Technical Summary
In existing permanent magnet synchronous motor servo drive systems, the order of the extended state observer is fixed, resulting in insufficient disturbance tracking capability and difficulty in maintaining good performance under high bandwidth conditions.
A current loop control method with switching between second-order and third-order linear extended state observers is adopted. Compensation quantities are generated based on the current deviation and the operating state of the permanent magnet synchronous motor, including disturbance compensation, delay compensation and decoupling feedforward compensation. Voltage commands are generated through a space vector modulation module.
The current loop bandwidth of the servo driver has been increased, improving dynamic response performance and control accuracy, and shortening step response time and disturbance recovery time.
Smart Images

Figure CN122394433A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of motor control, and more specifically, to a current loop control method, a permanent magnet synchronous motor, and a computer-readable storage medium. Background Technology
[0002] In the servo drive system of permanent magnet synchronous motor, the current loop is the innermost control loop, and its dynamic response performance directly determines the bandwidth, anti-disturbance capability and control accuracy of the entire servo system.
[0003] Traditional current loop control uses a PI (proportional-integral) controller, which can achieve good tracking performance under ideal conditions. However, in actual operation, there are many disturbance factors: back electromotive force varies with speed, DQ axis cross-coupling effect, inductor parameter changes caused by magnetic saturation, and the inherent one-step delay of PWM control. These factors make it difficult for traditional PI controllers to maintain good performance under high bandwidth conditions, and the typical bandwidth is usually limited to around 500Hz.
[0004] Active disturbance rejection control (ADRC) technology can significantly improve control performance by introducing an extended state observer (ESO) to estimate and compensate for the total disturbance of the system. However, in existing ADRC schemes, the order of the extended state observer is fixed (usually second-order), and it is not possible to switch to third-order online according to the actual operating conditions to obtain a higher disturbance tracking capability. Summary of the Invention
[0005] The technical problem to be solved by the present invention is to provide a current loop control method, a permanent magnet synchronous motor and a computer-readable storage medium, addressing the issue that the disturbance tracking capability is relatively insufficient in the servo drive system of the aforementioned permanent magnet synchronous motor due to the fixed order of the extended state observer.
[0006] The technical solution of this invention to solve the above-mentioned technical problems is to provide a current loop control method for generating a voltage command output to a space vector modulation module based on a current command from a voltage loop of a servo driver. The method includes the following steps: A. The difference between the current command output by the voltage loop and the feedback current is used for PI control to obtain the current deviation. B. Generate a compensation amount based on the operating status of the servo driver and the permanent magnet synchronous motor, and generate a voltage command to be output to the space vector modulation module based on the current deviation and the compensation amount. The compensation amount includes a disturbance compensation amount. Step B, generating the compensation amount based on the operating state of the permanent magnet synchronous motor, includes: B1. Establish a second-order linear extended state observer and a third-order linear extended state observer; B2. When the disturbance compensation amount is generated by the second-order linear extended state observer, the disturbance change rate is generated according to the voltage command output to the space vector modulation module, and when the disturbance change rate exceeds a preset threshold, the disturbance compensation amount is switched to be generated by the third-order linear extended state observer. B3. When the disturbance compensation amount is generated by the third-order linear extended state observer, and the third-order linear extended state observer is saturated or experiences a disturbance overrun fault, the disturbance compensation amount is switched to be generated by the second-order linear extended state observer.
[0007] As a further improvement of the present invention, the second-order linear extended state observer generates current state estimates z1(k+1) and total disturbance estimates z2(k+1) according to the following discrete update equation: z1(k+1) = z1(k) + Ts·(b0·u + z2(k) - β1·(z1(k)-y)), z2(k+1) = z2(k) + Ts·(-β2·(z1(k)-y)), Where z1(k) is the current state estimate of the previous cycle, z2(k) is the total disturbance estimate of the previous cycle, y is the current feedback value, u is the voltage command, b0 is the model gain, β1=2ωo, β2=ωo², ωo is the bandwidth of the second-order linear extended state observer, and Ts is the sampling period.
[0008] As a further improvement of the present invention, the third-order linear extended state observer generates current state estimates z1(k+1), total disturbance estimates z2(k+1), and disturbance rate of change estimates z3(k+1) according to the following discrete update equation: z1(k+1) = z1(k) + Ts·(b0·u + z2(k) - β1·(z1(k)-y)), z2(k+1) = z2(k) + Ts·(z3(k)-β2·(z1(k)-y)), z3(k+1) = z3(k) + Ts·(-β3·(z1(k)-y)), Where z1(k) is the current state estimate of the previous cycle, z2(k) is the total disturbance estimate of the previous cycle, z3(k) is the disturbance rate of change estimate of the previous cycle, y is the current feedback value, u is the voltage command, b0 is the model gain, β1=3ωo, β2=3ωo², β3=ωo³, ωo is the bandwidth of the third-order linear extended state observer, and Ts is the sampling period.
[0009] As a further improvement of the present invention, the feedback current in step A is generated by a second-order linear extended state observer or a third-order linear extended state observer; or, the feedback current is generated based on the current sampled from the output of the servo driver.
[0010] As a further improvement of the present invention, the compensation amount includes a delay compensation amount and a decoupling feedforward compensation amount, and the method includes: enabling delay compensation and decoupling feedforward compensation; The compensation amount generated based on the operating state of the permanent magnet synchronous motor in step B includes: B4. Generate the delay compensation amount for the current beat based on the voltage command from the output of the previous beat to the space vector modulation module. The delay compensation amount for the current beat is composed of the product of the voltage command from the output of the previous beat to the space vector modulation module and a preset constant. B5. Real-time acquisition of the angular velocity, d-axis inductance, d-axis current, q-axis inductance, q-axis current and flux linkage of the permanent magnet synchronous motor, and generation of decoupling feedforward compensation based on the angular velocity, d-axis inductance, d-axis current, q-axis inductance, q-axis current and flux linkage; Step B, generating the voltage command to be output to the space vector modulation module based on the current deviation and compensation amount, includes: The voltage command V output to the space vector modulation module is generated according to the following formula: V = current deviation + disturbance compensation × compensation gain + delay compensation + decoupling feedforward compensation × decoupling gain.
[0011] As a further improvement of the present invention, the method includes enabling delay compensation and disabling decoupling feedforward compensation; Step B, generating the voltage command to be output to the space vector modulation module based on the current deviation and compensation amount, includes: The voltage command V output to the space vector modulation module is generated according to the following formula: V = current deviation + disturbance compensation × compensation gain + delay compensation.
[0012] As a further improvement of the present invention, the method includes disabling delay compensation and enabling decoupled feedforward compensation; Step B, generating the voltage command to be output to the space vector modulation module based on the current deviation and compensation amount, includes: The voltage command V output to the space vector modulation module is generated according to the following formula: V = current deviation + disturbance compensation × compensation gain + decoupling feedforward compensation × decoupling gain.
[0013] As a further improvement of the present invention, the method includes prohibiting delay compensation and prohibiting decoupled feedforward compensation; Step B, generating the voltage command to be output to the space vector modulation module based on the current deviation and compensation amount, includes: The voltage command V output to the space vector modulation module is generated according to the following formula: V = current deviation + disturbance compensation × compensation gain.
[0014] The present invention also provides a servo driver, including a storage unit and a control chip, wherein the storage unit stores a computer program executable on the control chip, and the control chip executes the computer program to implement the steps of the current loop control method as described above.
[0015] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the current loop control method described above.
[0016] The present invention has the following technical effects: based on the working state of the permanent magnet synchronous motor, the disturbance compensation is switched between the second-order linear extended state observer and the third-order linear extended state observer, so that the servo drive can better meet different load conditions. Attached Figure Description
[0017] Figure 1 This is a flowchart illustrating the current loop control method provided in an embodiment of the present invention.
[0018] Figure 2 This is a schematic diagram of the process of generating compensation amount based on the operating state of permanent magnet synchronous motor in the current loop control method provided in the embodiment of the present invention.
[0019] Figure 3 This is a schematic diagram of a second-order linear extended state observer in the current loop control method provided in this embodiment of the invention.
[0020] Figure 4 This is a schematic diagram of a third-order linear extended state observer in the current loop control method provided in this embodiment of the invention.
[0021] Figure 5 This is a logic block diagram of the current loop control method provided in an embodiment of the present invention.
[0022] Figure 6 This is a comparison diagram of the current loop step response between the current loop control method provided in this embodiment of the invention and existing methods.
[0023] Figure 7 This is a comparison chart of the closed-loop frequency response (BODE) of the current loop control method provided in this embodiment of the invention and existing methods. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0025] like Figure 1 The diagram shown is a flowchart of the current loop control method of the present invention. This current loop control method can be applied to a servo driver for controlling a permanent magnet synchronous motor, and can generate a voltage command output to the space vector modulation module based on the current command from the voltage loop.
[0026] The current loop control method in this embodiment can be combined with software running on the servo driver. Specifically, it can be combined with... Figure 2 As shown, the method includes the following steps: Step S10: The difference between the current command output by the voltage loop and the feedback current is used for PI control to obtain the current deviation.
[0027] As is well known to those skilled in the art, the servo controller of a permanent magnet synchronous motor typically employs a three-layer nested closed-loop structure, consisting of a position loop, a voltage loop, and a current loop from the outside in. The command current output by the voltage loop is constituted by the output of the PI controller of the voltage loop. Performing PI calculations on the difference between the current command and the feedback current can be done using techniques conventional in the art, which will not be elaborated upon here.
[0028] Step S20: Generate compensation amount based on the operating status of the servo driver and permanent magnet synchronous motor, and generate voltage command to be output to the space vector modulation module based on current deviation and compensation amount.
[0029] The operating states of the aforementioned permanent magnet synchronous motor include changes in the motor's speed, changes in the output current of the servo driver, and the impact of disturbances on the servo driver such as back electromotive force, cross-coupling, and parameter changes. By compensating for current deviations, the control accuracy of the permanent magnet synchronous motor can be improved.
[0030] The aforementioned compensation amount includes disturbance compensation, and the generation of compensation amount based on the operating state of the permanent magnet synchronous motor in step S20 includes: Step S21: Establish a second-order linear extended state observer and a third-order linear extended state observer.
[0031] Specifically, the second-order linear extended state observer is used to generate current state estimates and total disturbance estimates based on current feedback, voltage commands, sampling period, permanent magnet synchronous motor parameters, etc., while the third-order linear extended state observer is used to generate current state estimates, total disturbance estimates, and disturbance rate of change estimates based on current feedback, voltage commands, sampling period, permanent magnet synchronous motor parameters, etc.
[0032] Step S22: The disturbance compensation amount is generated by the second-order linear extended state observer, and the disturbance change rate is generated according to the voltage command output to the space vector modulation module.
[0033] That is, the disturbance compensation amount is generated by the second-order linear extended state observer by default. Furthermore, the disturbance rate of change can be obtained by sampling the voltage command output to the space vector modulation module in real time and by the voltage command of the first two cycles or the first N cycles (N is an integer greater than 2).
[0034] Step S23: Determine whether the above disturbance change rate exceeds a preset threshold. If the disturbance change rate exceeds the preset threshold, proceed to step S24; otherwise, return to step S22. The above preset threshold can be set in advance, for example, based on experience, or during debugging.
[0035] Step S24: Generate the disturbance compensation amount using a third-order linear extended state observer.
[0036] Step S25: Determine whether the third-order linear extended state observer has saturated or has a disturbance crossing fault. If the third-order linear extended state observer has saturated or has a disturbance crossing fault, execute step S22; otherwise, execute step S24.
[0037] Saturation of the third-order linear extended state observer refers to integral saturation; disturbance overshoot fault of the third-order linear extended state observer refers to the disturbance rate of change estimate continuously reaching the limit value (e.g., reaching the preset limit value for multiple consecutive frames).
[0038] The aforementioned current loop control method switches disturbance compensation between a second-order linear extended state observer and a third-order linear extended state observer based on the operating state of the permanent magnet synchronous motor. This allows the servo driver to meet different load conditions. Specifically, the servo driver can use the output of the second-order linear extended state observer to compensate for the current deviation when the bandwidth is low and the noise is low, and use the output of the third-order linear extended state observer to compensate for the current deviation when the bandwidth is high and the noise is sensitive. This significantly improves the current loop bandwidth compared to the bandwidth of a traditional PI controller.
[0039] In one embodiment of the present invention, the feedback current in step S10 is generated by a second-order linear extended state observer or a third-order linear extended state observer. That is, the feedback current is the current state estimate generated by the second-order linear extended state observer or the third-order linear extended state observer, and the difference between the current command and the feedback current is the difference between the current command and the current state estimate. This method can achieve excellent tracking performance.
[0040] In practical applications, the aforementioned feedback current can also be generated based on the current sampled from the output of the servo driver.
[0041] like Figure 3 As shown, in one embodiment of the present invention, the above-mentioned second-order linear extended state observer generates current state estimates z1(k+1) and total disturbance estimates z2(k+1) according to the following discrete update equations (1) and (2): z1(k+1) = z1(k) + Ts·(b0·u + z2(k) - β1·(z1(k)-y))(1) z2(k+1) = z2(k) + Ts·(-β2·(z1(k)-y))(2) Where z1(k) is the current state estimate of the previous cycle, z2(k) is the total disturbance estimate of the previous cycle, y is the current feedback value (i.e. the current feedback value of the previous cycle), u is the voltage command (i.e. the voltage command of the previous cycle), β1=2ωo, β2=ωo², ωo is the bandwidth of the second-order linear extended state observer, Ts is the sampling period, and b0 is the model gain, which can be automatically generated based on the identified permanent magnet synchronous motor parameters, or set manually, for example, b0 = 1 / Ld (Ld is the d-axis inductance) or b0 = 1 / Lq (Lq is the q-axis inductance).
[0042] The aforementioned current state estimate z1(k+1) can be used as a feedback current, and PI control can be performed with the current command from the voltage loop to generate the current deviation. Specifically, the disturbance compensation V_comp can be generated by the following formula (3): Disturbance compensation amount = z2(k+1) / b0(3) When generating the output voltage command, the disturbance compensation amount is multiplied by the compensation gain K_gain, which can be preset based on experience or set during debugging. The disturbance compensation generated in this way enables the current loop to achieve better tracking performance.
[0043] Furthermore, discrete update equations (1) and (2) can be used to generate current state estimates z1(k+1) and total disturbance estimates z2(k+1) for the d-axis and q-axis respectively, and the current deviation values for the d-axis and q-axis can be compensated respectively.
[0044] like Figure 4 As shown, in one embodiment of the present invention, the above-mentioned third-order linear extended state observer generates current state estimates z1(k+1), total disturbance estimates z2(k+1), and disturbance rate of change estimates z3(k+1) according to the following discrete update equations (4), (5), and (6): z1(k+1) = z1(k) + Ts·(b0·u + z2(k) - β1·(z1(k)-y)) (4) z2(k+1) = z2(k) + Ts·(z3(k)-β2·(z1(k)-y))(5) z3(k+1) = z3(k) + Ts·(-β3·(z1(k)-y))(6) Where z1(k) is the current state estimate of the previous cycle, z2(k) is the total disturbance estimate of the previous cycle, z3(k) is the disturbance rate of change estimate of the previous cycle, y is the current feedback value (i.e. the current feedback value of the previous cycle), u is the voltage command (i.e. the voltage command of the previous cycle), β1=3ωo, β2=3ωo², β3=ωo³, ωo is the bandwidth of the third-order linear extended state observer, Ts is the sampling period, and b0 is the model gain.
[0045] Similarly, the current state estimate z1(k+1) generated by the third-order linear extended state observer can be used as the feedback current, and the disturbance compensation can be generated by calculating equation (3). The disturbance compensation V_comp generated in the above manner can enable the current loop to achieve better tracking performance.
[0046] like Figure 5 As shown, in one embodiment of the present invention, the compensation amount in step S20 includes not only the disturbance compensation amount, but also the delay compensation amount and the decoupling feedforward compensation amount. Accordingly, the current loop control method further includes enabling delay compensation and decoupling feedforward compensation.
[0047] The step S20 above, which generates compensation based on the operating state of the permanent magnet synchronous motor, includes: generating a delay compensation amount for the current cycle based on the voltage command from the output of the previous cycle to the space vector modulation module, wherein the delay compensation amount for the current cycle is composed of the product of the voltage command from the output of the previous cycle to the space vector modulation module and a preset constant (this preset constant can be configured via function codes, and during debugging, it is gradually increased from 0 to 0.5–0.8, with a modulation step size of 0.001, until the step response rise time is minimized); real-time acquisition of the angular velocity ωe of the permanent magnet synchronous motor (e.g., reading the encoder feedback signal), d-axis inductance Ld, d-axis current Id, q-axis inductance Lq, q-axis current Iq, and flux linkage Ψf, and generating a decoupling feedforward compensation amount based on the angular velocity ωe, d-axis inductance Ld, d-axis current Id, q-axis inductance Lq, q-axis current Iq, and flux linkage Ψf. Specifically, the decoupling feedforward compensation amount includes decoupling voltages Vd_ff and Vq_ff, and Vd_ff = -ωe·Lq·Iq(7) Vq_ff = ωe·Ld·Id + ωe·Ψf (8).
[0048] Step S20, generating the voltage command to be output to the space vector modulation module based on the current deviation and the compensation amount, includes: generating the voltage command V to be output to the space vector modulation module according to the following calculation formula: V = current deviation + disturbance compensation amount × compensation gain + delay compensation amount + decoupling feedforward compensation amount × decoupling gain.
[0049] The aforementioned compensation gain can be preset and modified online (via function codes), with a value ranging from 0% to 200%. Furthermore, by setting the compensation gain, oscillations caused by overcompensation can be avoided when parameter uncertainties are high. Additionally, by delaying the compensation amount, the bandwidth of the current loop can be significantly improved.
[0050] like Figure 6 , Figure 7 As shown, compared with the traditional current loop PI control, the step response time and disturbance recovery time are significantly shortened after using the above current loop control method.
[0051] Specifically, the aforementioned current loop control method includes enabling delay compensation and disabling decoupling feedforward compensation. Correspondingly, the step S20 above, which generates the voltage command output to the space vector modulation module based on the current deviation and the compensation amount, includes generating the voltage command V output to the space vector modulation module according to the following formula: V = current deviation + disturbance compensation amount × compensation gain + delay compensation amount.
[0052] Furthermore, the aforementioned current loop control method also includes disabling delay compensation and enabling decoupling feedforward compensation. Accordingly, the step S20 of generating the voltage command output to the space vector modulation module based on the current deviation and the compensation amount includes: generating the voltage command V output to the space vector modulation module according to the following calculation formula: V = current deviation + disturbance compensation amount × compensation gain + decoupling feedforward compensation amount × decoupling gain.
[0053] The aforementioned current loop control method also includes disabling delay compensation and disabling decoupling feedforward compensation; correspondingly, the step S20 of generating a voltage command to be output to the space vector modulation module based on the current deviation and the compensation amount includes: generating a voltage command V to be output to the space vector modulation module according to the following calculation formula: V = current deviation + disturbance compensation amount × compensation gain.
[0054] By independently enabling the aforementioned delay compensation and decoupled feedforward compensation, on-site commissioning can be performed by gradually activating each function, reducing commissioning risks. In practical applications, the linear extended state observer compensation can also be enabled or disabled via function codes, further facilitating on-site commissioning.
[0055] The present invention also provides a servo driver, including a storage unit and a control chip, wherein the storage unit stores a computer program executable on the control chip, and the control chip executes the computer program to implement the steps of the current loop control method as described above.
[0056] The servo driver in this embodiment is the same as the one described above. Figure 1-5 The current loop control methods in the corresponding embodiments belong to the same concept. The specific implementation process can be found in the corresponding method embodiments. The technical features in the method embodiments are also applicable to this system embodiment, and will not be repeated here.
[0057] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the current loop control method described above.
[0058] The computer-readable storage medium in this embodiment is the same as described above. Figure 1-5 The current loop control methods in the corresponding embodiments belong to the same concept. The specific implementation process can be found in the corresponding method embodiments. The technical features in the method embodiments are also applicable to the embodiments of this computer-readable storage medium, and will not be repeated here.
[0059] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0060] Those skilled in the art will understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the functions can be assigned to different functional units and modules as needed. The functional units and modules in the embodiments can be integrated into a single processor, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated units can be implemented in hardware or as software functional units. Furthermore, the specific names of the functional units and modules are merely for easy differentiation and are not intended to limit the scope of protection of this application. The specific working processes of the units and modules in the above system can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0061] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0062] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0063] In the embodiments provided in this application, it should be understood that the disclosed current loop control method and servo driver can be implemented in other ways. For example, the servo driver embodiments described above are merely illustrative. Furthermore, the functional units in the various embodiments of this application can be integrated into a single processor, or each unit can exist physically separately, or two or more units can be integrated into a single unit. The integrated units described above can be implemented in hardware or as software functional units.
[0064] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or interface switching device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals.
[0065] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A current loop control method for generating a voltage command output to a space vector modulation module based on a current command from a voltage loop of a servo driver, characterized in that, The method includes the following steps: A. The difference between the current command output by the voltage loop and the feedback current is used for PI control to obtain the current deviation. B. Generate a compensation amount based on the operating status of the servo driver and the permanent magnet synchronous motor, and generate a voltage command to be output to the space vector modulation module based on the current deviation and the compensation amount. The compensation amount includes a disturbance compensation amount. Step B, generating the compensation amount based on the operating state of the permanent magnet synchronous motor, includes: B1. Establish a second-order linear extended state observer and a third-order linear extended state observer; B2. When the disturbance compensation amount is generated by the second-order linear extended state observer, the disturbance change rate is generated according to the voltage command output to the space vector modulation module, and when the disturbance change rate exceeds a preset threshold, the disturbance compensation amount is switched to be generated by the third-order linear extended state observer. B3. When the disturbance compensation amount is generated by the third-order linear extended state observer, and the third-order linear extended state observer is saturated or experiences a disturbance overrun fault, the disturbance compensation amount is switched to be generated by the second-order linear extended state observer.
2. The current loop control method according to claim 1, characterized in that, The second-order linear extended state observer generates current state estimates z1(k+1) and total disturbance estimates z2(k+1) according to the following discrete update equation: z1(k+1) = z1(k) + Ts·(b0·u + z2(k) - β1·(z1(k)-y)), z2(k+1) = z2(k) + Ts·(-β2·(z1(k)-y)), Where z1(k) is the current state estimate of the previous cycle, z2(k) is the total disturbance estimate of the previous cycle, y is the current feedback value, u is the voltage command, b0 is the model gain, β1=2ωo, β2=ωo², ωo is the bandwidth of the second-order linear extended state observer, and Ts is the sampling period.
3. The current loop control method according to claim 1, characterized in that, The third-order linear extended state observer generates current state estimates z1(k+1), total disturbance estimates z2(k+1), and disturbance rate of change estimates z3(k+1) according to the following discrete update equations: z1(k+1) = z1(k) + Ts·(b0·u + z2(k) - β1·(z1(k)-y)), z2(k+1) = z2(k) + Ts·(z3(k)-β2·(z1(k)-y)), z3(k+1) = z3(k) + Ts·(-β3·(z1(k)-y)), Where z1(k) is the current state estimate of the previous cycle, z2(k) is the total disturbance estimate of the previous cycle, z3(k) is the disturbance rate of change estimate of the previous cycle, y is the current feedback value, u is the voltage command, b0 is the model gain, β1=3ωo, β2=3ωo², β3=ωo³, ωo is the bandwidth of the third-order linear extended state observer, and Ts is the sampling period.
4. The current loop control method according to claim 1, characterized in that, The feedback current in step A is generated by a second-order linear extended state observer or a third-order linear extended state observer; or, the feedback current is generated based on the current sampled from the output of the servo driver.
5. The current loop control method according to claim 1, characterized in that, The compensation amount includes a delay compensation amount and a decoupling feedforward compensation amount, and the method includes: enabling delay compensation and decoupling feedforward compensation; The compensation amount generated based on the operating state of the permanent magnet synchronous motor in step B includes: B4. Generate the delay compensation amount for the current beat based on the voltage command from the output of the previous beat to the space vector modulation module. The delay compensation amount for the current beat is composed of the product of the voltage command from the output of the previous beat to the space vector modulation module and a preset constant. B5. Real-time acquisition of the angular velocity, d-axis inductance, d-axis current, q-axis inductance, q-axis current and flux linkage of the permanent magnet synchronous motor, and generation of decoupling feedforward compensation based on the angular velocity, d-axis inductance, d-axis current, q-axis inductance, q-axis current and flux linkage; Step B, generating the voltage command to be output to the space vector modulation module based on the current deviation and compensation amount, includes: The voltage command V output to the space vector modulation module is generated according to the following formula: V = current deviation + disturbance compensation × compensation gain + delay compensation + decoupling feedforward compensation × decoupling gain.
6. The current loop control method according to claim 5, characterized in that, The method includes enabling delay compensation and disabling decoupled feedforward compensation; Step B, generating the voltage command to be output to the space vector modulation module based on the current deviation and compensation amount, includes: The voltage command V output to the space vector modulation module is generated according to the following formula: V = current deviation + disturbance compensation × compensation gain + delay compensation.
7. The current loop control method according to claim 5, characterized in that, The method includes disabling delay compensation and enabling decoupled feedforward compensation; Step B, generating the voltage command to be output to the space vector modulation module based on the current deviation and compensation amount, includes: The voltage command V output to the space vector modulation module is generated according to the following formula: V = current deviation + disturbance compensation × compensation gain + decoupling feedforward compensation × decoupling gain.
8. The current loop control method according to claim 5, characterized in that, The method includes prohibiting delay compensation and prohibiting decoupled feedforward compensation; Step B, generating the voltage command to be output to the space vector modulation module based on the current deviation and compensation amount, includes: The voltage command V output to the space vector modulation module is generated according to the following formula: V = current deviation + disturbance compensation × compensation gain.
9. A servo driver, characterized in that, The device includes a storage unit and a control chip. The storage unit stores a computer program that can be executed on the control chip, and when the control chip executes the computer program, it implements the steps of the current loop control method as described in any one of claims 1-8.
10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the steps of the current loop control method as described in any one of claims 1-8.