Method for improving speed control precision by optimizing FOC algorithm
By removing the calculation of the current loop Iq in the FOC algorithm and increasing the speed loop limiting link, the current sampling interference and control delay problems are solved, the motor operation stability and speed control accuracy are improved, and the control structure is simplified.
Patent Information
- Application Number
- CN202411383600.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-14
AI Technical Summary
In the motor control, the existing FOC algorithm has problems such as current sampling interference affecting the speed control accuracy, the long calculation time of the current loop leads to system control delay, and difficulty in coordinating and controlling the current loop and speed loop, which affects the motor operation stability.
By removing the calculation of the current loop Iq, the output Uq is directly calculated from the speed loop PI, and a limiting link is added to the speed loop to avoid current sampling interference, simplify the control structure, realize the coordinated control of the current loop and the speed loop, and use the microcontroller Perform PARK and CLARK inverse transformation and pulse width modulation.
It effectively improves the speed control accuracy, shortens the calculation time of the current loop, reduces the system control delay, and improves the motor operation stability and dynamic response performance.
Smart Images

Figure CN119315891A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of motor control, and in particular to a method for optimizing a FOC algorithm to improve speed control accuracy. Background Art
[0002] In the field of motor control technology, the FOC (field oriented control) algorithm is a common control method. It realizes independent control of the motor torque and flux linkage by performing space vector decomposition on the motor's stator current, thereby improving the motor's operating efficiency and control accuracy. In the FOC algorithm, there are usually two control links: the current loop and the speed loop. The current loop is responsible for controlling the motor's stator current, and the speed loop is responsible for controlling the motor's speed.
[0003] See also Figure 1 As shown in the figure, in the traditional FOC algorithm, the current loop and the speed loop are two independent control links, each of which is responsible for controlling different parameters of the motor. The current loop obtains the current error by calculation, and then adjusts the output voltage through the PI controller to control the stator current of the motor. The speed loop obtains the speed error by calculation, and then adjusts the output voltage through the PI controller to control the speed of the motor.
[0004] However, the existing FOC algorithm has some problems in practical applications. First, the calculation of the current loop needs to rely on the current sampling value. If the current sampling value is disturbed, it will affect the calculation result of the current loop, and then affect the accuracy of speed control. Secondly, the calculation process of the current loop is relatively long, which will increase the control delay of the system and affect the dynamic response performance of the system. In addition, since the current loop and the speed loop are two independent control links, the coordinated control between them is also difficult, which may affect the running stability of the motor. Summary of the invention
[0005] The technical problem to be solved by the present invention is that the FOC algorithm in the prior art cannot make the motor run stably. In order to overcome the above defects of the prior art, the present invention provides a method for optimizing the FOC algorithm to improve the speed control accuracy.
[0006] The present invention provides a method for optimizing FOC algorithm to improve speed control accuracy, comprising the following steps:
[0007] S1, obtain the speed PI controller and flux PI controller in the FOC algorithm;
[0008] S2, speed loop PI controller calculates the output Uq through the target speed given value and angular velocity;
[0009] S3, flux PI controller calculates output Ud through weak magnetic given value and feedback value;
[0010] S4, Uq and Ud are transformed by PARK and then input into CLARK or SVPWM, and then the microcontroller modulates the output control signal to drive the three-phase motor.
[0011] Compared with the prior art, the method for optimizing the FOC algorithm to improve the speed control accuracy in the present application has the following advantages: on the basis of the traditional FOC algorithm, the calculation of the current loop Iq is removed, and the output Uq is directly calculated by the speed loop PI, which can effectively avoid the influence of current sampling interference on the speed control accuracy, effectively reduce the calculation time of the current loop, reduce the system control delay, and improve the motor operation stability.
[0012] In a possible implementation manner, after step S2, the following steps are specifically included:
[0013] S21, obtaining the bus current and speed signal of the motor;
[0014] S22, speed loop PI controller calculates output Uq through target speed given value and angular velocity;
[0015] S23, obtain uqlimit through current limiting calculation based on the maximum bus current and the feedback value;
[0016] S24, judging whether Uq is greater than uqlimit;
[0017] If so, let Uq=uqlimit, and then input Uq into the PARK inverse transform; otherwise, input Uq into the PARK inverse transform.
[0018] Compared with the prior art, the method can avoid the influence of controller overcurrent fault on system operation, realize the coordinated control between the two independent control links of current loop and speed loop, and improve the running stability of the motor.
[0019] In a possible implementation, in step S21 , an analog-to-digital converter on the microcontroller collects bus current and speed signals of the motor.
[0020] Compared with the prior art, data is collected through an analog-to-digital converter on a microcontroller, which makes acquisition more convenient and does not require additional hardware.
[0021] In a possible implementation, in step S4, the pulse width modulation module on the microcontroller outputs a control signal after modulation.
[0022] Compared with the prior art, modulation is performed through a pulse width modulation module on a microcontroller without adding other hardware, and the modulation process is simpler and more convenient. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 It is a block diagram of FOC algorithm in the prior art;
[0024] Figure 2 The present invention is a FOC algorithm block diagram of a method for optimizing the FOC algorithm to improve speed control accuracy. DETAILED DESCRIPTION
[0025] First, those skilled in the art should understand that these implementations are only used to explain the technical principles of the embodiments of the present application, and are not intended to limit the protection scope of the embodiments of the present application. Those skilled in the art can make adjustments to them as needed to adapt to specific application scenarios.
[0026] In the description of the embodiments of the present application, it should be noted that, unless otherwise clearly specified and limited, the terms "connected" and "connection" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms in the embodiments of the present application can be understood according to specific circumstances.
[0027] The present application is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0028] See also Figure 2 As shown, the embodiment of the present application discloses a method for optimizing the FOC algorithm to improve the speed control accuracy, and the specific steps are as follows:
[0029] S1. Obtain the speed PI controller and flux PI controller in the FOC algorithm.
[0030] In this step, a microcontroller (MCU) with high-speed processing capability is selected, such as TITMS2800137, to implement the traditional FOC algorithm and realize the calculation of the FOC algorithm. On this microcontroller, the FOC algorithm written includes the speed loop and the current loop.
[0031] Among them, the speed loop includes a speed loop PI controller, and the current loop includes a flux PI controller, PARK inverse transformation, and CLARK inverse transformation (or SVPWM).
[0032] S2, speed loop PI controller calculates the output Uq through the target speed given value and angular velocity.
[0033] In this step, the following steps are specifically included:
[0034] S21, obtaining the bus current and speed signal of the motor;
[0035] S22, speed loop PI controller calculates output Uq through target speed given value and angular velocity;
[0036] S23, obtain uqlimit through current limiting calculation based on the maximum bus current and the feedback value;
[0037] S24, judging whether Uq is greater than uqlimit;
[0038] If so, let Uq=uqlimit, and then input Uq into the PARK inverse transform; otherwise, input Uq into the PARK inverse transform.
[0039] In the FOC algorithm program, the calculation of the current loop Iq is directly removed, and the speed loop PI directly calculates the output Uq. This can effectively reduce the calculation time of the current loop and reduce the system control delay, so as to effectively avoid the influence of current sampling interference on the speed control accuracy.
[0040] At the same time, by adding a limit comparison, the controller overcurrent fault can be prevented from affecting the system operation. This method realizes the coordinated control between the two independent control links of the current loop and the speed loop, and improves the stability of the motor operation.
[0041] S3, flux PI controller calculates output Ud through weak magnetic given value and feedback value.
[0042] The calculation in this step is the FOC algorithm calculation in the prior art, which will not be described in detail here.
[0043] S4, Uq and Ud are transformed by PARK and then input into CLARK or SVPWM, and then the microcontroller modulates the output control signal to drive the three-phase motor.
[0044] The calculation in this step is the FOC algorithm calculation in the prior art, which will not be described in detail here.
[0045] Through the above steps, it is possible to improve the speed control accuracy while ensuring the stability of motor operation, effectively shorten the calculation time of the current loop, and reduce the system control delay.
[0046] This embodiment mainly solves: 1) the technical problem that current sampling interference affects the speed control accuracy; 2) the technical problem that the current loop calculation time is long, which increases the system control delay; 3) the technical problem that the coordinated control between the two independent control links of the current loop and the speed loop is difficult, which may affect the stability of motor operation.
[0047] Due to the advanced nature of this embodiment, it can be widely used in the fields of motor control systems, automation equipment, electric vehicles, etc.
[0048] First, this technical solution avoids the influence of current sampling interference on speed control accuracy by improving the FOC algorithm, and improves the operating stability of the motor, which is of great significance for the motor control system.
[0049] Secondly, this technical solution improves the dynamic response performance of the system by reducing the calculation time of the current loop, which can improve the working efficiency and accuracy of automation equipment. Therefore, this technical solution has broad market demand and good application prospects.
[0050] Compared with the existing technology, the beneficial effects of this technical solution are as follows:
[0051] 1. Optimize speed control accuracy: This technical solution removes the calculation of the current loop Iq based on the traditional FOC algorithm, allowing the speed loop PI to directly calculate the output Uq. At the same time, the speed loop adds a Uq limiting link, which effectively avoids the influence of current sampling interference on the speed control accuracy, thereby improving the speed control accuracy.
[0052] 2. Shorten the current loop calculation time: Since this technical solution cancels the calculation of the current loop Iq, the calculation time of the current loop can be greatly shortened, thereby reducing the control delay of the system and improving the dynamic response performance of the system.
[0053] 3. Simplified control structure: This technical solution combines the current loop and the speed loop into one, avoiding the coordination control problem between the two independent control links, so that the running stability of the motor is guaranteed.
[0054] 4. Improve system efficiency: Since this technical solution optimizes the speed control accuracy and shortens the current loop calculation time, it can improve the operating efficiency of the motor and improve the overall performance of the system.
[0055] In the description of the present application, the description with reference to the terms "one embodiment", "some embodiments", "in the present embodiment", "specific example", or "some examples" etc. means that the specific features, mechanisms, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, mechanisms, materials or characteristics described may be combined in a suitable manner in any one or more embodiments or examples. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0056] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A method for optimizing FOC algorithm to improve speed control accuracy, characterized in that: The steps include: S1, obtain the speed PI controller and flux PI controller in the FOC algorithm; S2, speed loop PI controller calculates the output Uq through the target speed given value and angular velocity; S3, flux PI controller calculates output Ud through weak magnetic given value and feedback value; S4, Uq and Ud are transformed by PARK and then input into CLARK or SVPWM, and then the microcontroller modulates the output control signal to drive the three-phase motor.
2. The method for improving speed control accuracy by optimizing FOC algorithm according to claim 1, characterized in that: After step S2, the following steps are specifically included: S21, obtaining the bus current and speed signal of the motor; S22, speed loop PI controller calculates output Uq through target speed given value and angular velocity; S23, obtain uqlimit through current limiting calculation based on the maximum bus current and the feedback value; S24, judging whether Uq is greater than uqlimit; If so, let Uq=uqlimit, and then input Uq into the PARK inverse transform; otherwise, input Uq into the PARK inverse transform.
3. The method for improving speed control accuracy by optimizing FOC algorithm according to claim 2, characterized in that: In step S21 , the analog-to-digital converter on the microcontroller collects bus current and speed signals of the motor.
4. The method for improving speed control accuracy by optimizing FOC algorithm according to claim 1, characterized in that: In step S4, the pulse width modulation module on the microcontroller outputs a control signal after modulation.