A sliding mode control method of permanent magnet synchronous motor based on GPIO
Through the permanent magnet synchronous motor sliding mode control method based on GPIO, the stability and accuracy problems of the traditional position-free sensor control method in the face of external disturbances and parameter changes are solved, high-precision and strong robustness control are achieved, and jitter phenomenon is reduced.
Patent Information
- Application Number
- CN202411653806.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-04-01
AI Technical Summary
When traditional positionless sensor control methods face external disturbances and parameter changes, it is difficult to ensure the stability and accuracy of the system, and it is easy to cause vibration.
The permanent magnet synchronous motor sliding mode control method is adopted based on GPIO. By establishing a mathematical model, using a sliding mode observer to extract speed and position information, a generalized proportional integral observer is constructed for interference estimation, and a non-singular fast terminal sliding mode controller is set, and a sigmoid function is used instead of the symbol function to reduce jitter phenomenon.
The system is highly accurate and robust, which reduces vibration phenomenon and improves anti-interference ability and dynamic response.
Smart Images

Figure CN119743052A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of permanent magnet synchronous motor control, and in particular to a GPIO-based permanent magnet synchronous motor sliding mode control method. Background Art
[0002] With the invention of rare earth permanent magnet materials and the advancement of power electronics technology, the performance of permanent magnet synchronous motors has been greatly improved. Its advantages such as high efficiency, high power density, simple structure, high dynamic performance and strong robustness make it one of the important members of modern motor technology.
[0003] The speed and position information of the rotor in the PMSM control system is crucial. The traditional methods for obtaining the rotor speed and position information can be divided into two categories according to whether sensors are used: sensor-based methods and sensorless methods. The former uses sensors such as Hall sensors, incremental sensors, and rotary transformers. The disadvantages are high cost, high installation complexity, and susceptibility to environmental influences. Therefore, position sensorless control methods have gradually become the focus of research;
[0004] In recent decades, researchers have proposed a large number of nonlinear control methods without position sensors, mainly including adaptive control, fuzzy control, sliding mode control, model predictive control and other methods. Among these control strategies, the sliding mode control method is considered to be one of the most effective improvement methods. It designs a nonlinear control law so that the system state can reach a predetermined sliding surface within a limited time and maintain a specific dynamic behavior on this sliding surface. Therefore, it has the advantages of being insensitive to disturbances and parameters and having a fast response speed. However, when the system state trajectory reaches the sliding surface, the high-frequency switching of the control signal will produce high-frequency oscillations near the sliding surface, thereby producing a "jitter" phenomenon. Therefore, how to reduce jitter and improve anti-interference and dynamic response is still a problem worthy of in-depth study.
[0005] The speed controller in the three-phase permanent magnet AC speed control vector control system generally adopts the traditional PI controller, which has the advantages of simple algorithm, high reliability and convenient parameter setting. However, since PMSM is a nonlinear, strongly coupled multivariable system, when the control system is affected by external disturbances or the internal parameters of the motor change, the traditional PI control method cannot meet the actual requirements.
[0006] Traditional sliding mode control methods usually generate discontinuous control signals. This discontinuity may cause fluctuations in the system output, thus affecting the stability and accuracy of the system. In addition, when the system receives a large disturbance, the system state may not be able to approach the sliding surface in a short time, which means that the system will take longer to reach the expected stable state, thus affecting the control performance. Therefore, a sliding mode control method for permanent magnet synchronous motor based on GPIO is proposed. Summary of the invention
[0007] The object of the present invention is to provide a GPIO-based permanent magnet synchronous motor sliding mode control method to solve the problems raised in the above background technology.
[0008] To achieve the above object, the present invention provides the following technical solution: a GPIO-based permanent magnet synchronous motor sliding mode control method, comprising the following steps:
[0009] S1. Establish a mathematical model of the permanent magnet synchronous motor, use a sliding mode observer to calculate and obtain the back electromotive force, and use a phase-locked loop system to extract the rotor speed and position information;
[0010] S2, construct a generalized proportional-integral observer, and use the speed obtained from S1 as input data to estimate the disturbance and perform feedforward compensation for the speed loop;
[0011] S3, a non-singular fast terminal sliding mode controller is set to replace the traditional sliding mode controller, the exponential reaching law of the traditional sliding mode controller is improved, and the sigmoid function is used to replace the sign function sgn(s) of the traditional sliding mode controller, and the speed setting value and the feedback value are brought into the non-singular fast terminal sliding mode controller as input data to obtain the reference current of the q-axis;
[0012] S4, the q-axis reference current minus the feedforward compensation, the result is used as the input data of the current loop, and finally the control process of the permanent magnet synchronous motor is completed.
[0013] As a further preferred embodiment of the present technical solution: in S1, a mathematical model of a dq permanent magnet synchronous motor in a synchronous rotating coordinate system is established, and its stator voltage equation is:
[0014]
[0015] In formula (1), u d 、u q are the dq axis components of the stator voltage, i d 、i q are the dq components of the stator current, R is the stator resistance, ψ d , q is the dq component of the stator flux, ω e is the electrical angular velocity, L d , L q They are the dq axis inductance components, ψ f is the permanent magnet flux;
[0016] The electromagnetic torque equation is:
[0017]
[0018] In formula (2), p n is the number of motor pole pairs;
[0019] When using When the control strategy is used, the motion equation of the permanent magnet synchronous motor is:
[0020]
[0021] In formula (3), ω m is the mechanical angular velocity of the motor, J is the moment of inertia, B is the damping coefficient, T L is the load torque;
[0022] At this time, the back electromotive force obtained by the sliding mode observer is:
[0023]
[0024] As a further preferred embodiment of the present invention: the rotor speed and location information The calculation methods are:
[0025]
[0026]
[0027] In formula (5), K p , K i They are the proportional and integral coefficients of the PI regulator of the phase-locked loop respectively.
[0028] As a further preferred embodiment of the present technical solution: in S2, a generalized proportional integral observer is used to determine the disturbance or other unmeasured state of the system, and the value is used as feedforward compensation to assist the controller in effectively counteracting the influence of the disturbance;
[0029] At this point, the motion equation of the permanent magnet synchronous motor is revised as follows:
[0030]
[0031] In formula (7), is the system disturbance term;
[0032] Among them, the generalized proportional integral observer is constructed as:
[0033]
[0034] In formula (8), z0, z1, z2, z m is the estimated value of the speed ω, λ0…λ m >0;
[0035] Let e0(t)=ω-z0, e1(t)=d(t)-z1,...,e m (t) = d m (t)-z m , put it into formula (8):
[0036]
[0037] At this time, formula (9) is revised as follows:
[0038]
[0039] In formula (10), A is the Hurwitz matrix, and the disturbance term d(t) satisfies Its error prediction system is asymptotically stable.
[0040] As a further preferred embodiment of the present technical solution: a generalized proportional-integral observer is used to calculate the feedforward compensation, which combines the advantages of proportional control and integral control, and can improve the dynamic performance and steady-state accuracy of the system to a certain extent, thereby improving the robustness and anti-interference ability of the system, especially in the face of uncertainty and external disturbances.
[0041] As a further preferred embodiment of the present technical solution: in S3, in order to reduce the chattering problem, a non-singular fast terminal sliding mode controller is used instead of a traditional sliding mode controller, and the speed obtained by the sliding mode observer is used as the input data of the controller, and the state variable of the permanent magnet synchronous motor is defined as:
[0042]
[0043] In formula (11), ω ref is the motor reference speed, which is a constant, and ω is the actual speed.
[0044] As a further preferred embodiment of the present technical solution: Combining formula (3) with formula (11), the state equation of the permanent magnet synchronous motor can be obtained as follows:
[0045]
[0046] The synovial surface function is defined as:
[0047]
[0048] In formula (13), α and β are parameters greater than 0, p, q, l and h are all odd numbers, and 1 <p / q<2,l / h> p / q, since x1 and x2 have no negative exponential terms, the singularity problem can be avoided, and the synovial reaching law is:
[0049]
[0050] As a further preferred embodiment of the technical solution, in order to further reduce high-frequency jitter, a sigmoid(s) function with smooth and continuous characteristics is used to replace the sign function sgn(s) in formula (14), and its expression is:
[0051]
[0052] In formula (15), a and λ are positive constants, and the size of a and λ affects the convergence characteristics of the function.
[0053] As a further preferred embodiment of the present technical solution: According to formula (12), formula (13) and formula (14), the non-singular fast terminal sliding mode controller as the speed loop can obtain the reference current of the q axis: for:
[0054]
[0055] Finally, the q-axis reference current Subtract the feedforward compensation to realize the composite controller composed of generalized proportional integral observer and non-singular fast terminal controller. The input reference current of the current loop is for:
[0056]
[0057] As a further preferred embodiment of the present technical solution: a non-singular fast terminal sliding mode controller is used instead of a traditional sliding mode controller, and a sigmoid function with smooth and continuous characteristics is used instead of a sign function in setting an improved sliding mode reaching law, so as to achieve faster convergence speed, higher accuracy and less jitter.
[0058] Compared with the prior art, the present invention has the following beneficial effects:
[0059] 1. In the present invention, by establishing a mathematical model of a permanent magnet synchronous motor, the position and speed information obtained by the sliding mode observer is used as the input of a generalized proportional integral observer and a non-singular fast terminal sliding mode controller. The output of the former is used as the feedforward compensation of the speed loop and is combined with the q-axis reference voltage obtained by introducing a new sliding mode reaching law and replacing the sign function with a sigmoid function to obtain the input of the current loop, thereby achieving high-precision and strong robustness control of the system;
[0060] 2. The present invention adopts a generalized proportional integral observer to calculate the feedforward compensation, which combines the advantages of proportional control and integral control, and can improve the dynamic performance and steady-state accuracy of the system to a certain extent, and improve the robustness and anti-interference ability of the system, especially in the face of uncertainty and external disturbances;
[0061] 3. The present invention adopts a non-singular fast terminal sliding mode controller to replace the traditional sliding mode controller, and adopts a sigmoid function with smooth and continuous characteristics to replace the sign function in setting the improved sliding mode reaching law, so as to achieve faster convergence speed, higher accuracy and smaller jitter;
[0062] 4. The present invention combines the two technologies of GPIO and NFTSMO together, and through the mutual cooperation between the two, a higher level of control performance is achieved, including better dynamic response, higher steady-state accuracy and stronger anti-interference ability. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1 The present invention is a schematic diagram of the operation flow of a GPIO-based permanent magnet synchronous motor sliding mode control method. DETAILED DESCRIPTION
[0064] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0065] Example 1
[0066] See also Figure 1 The present invention provides a technical solution: a GPIO-based permanent magnet synchronous motor sliding mode control method, comprising the following steps:
[0067] S1. Establish a mathematical model of the permanent magnet synchronous motor, use a sliding mode observer to calculate and obtain the back electromotive force, and use a phase-locked loop system to extract the rotor speed and position information;
[0068] S2, construct a generalized proportional-integral observer, and use the speed obtained from S1 as input data to estimate the disturbance and perform feedforward compensation for the speed loop;
[0069] S3, a non-singular fast terminal sliding mode controller is set to replace the traditional sliding mode controller, the exponential reaching law of the traditional sliding mode controller is improved, and the sigmoid function is used to replace the sign function sgn(s) of the traditional sliding mode controller, and the speed setting value and the feedback value are brought into the non-singular fast terminal sliding mode controller as input data to obtain the reference current of the q-axis;
[0070] S4, the q-axis reference current minus the feedforward compensation, the result is used as the input data of the current loop, and finally the control process of the permanent magnet synchronous motor is completed.
[0071] In this embodiment, specifically: in S1, a mathematical model of a dq permanent magnet synchronous motor in a synchronous rotating coordinate system is established, and its stator voltage equation is:
[0072]
[0073] In formula (1), u d 、u q are the dq axis components of the stator voltage, i d 、i q are the dq components of the stator current, R is the stator resistance, ψ d , q is the dq component of the stator flux, ω e is the electrical angular velocity, L d , L q They are the dq axis inductance components, ψ f is the permanent magnet flux;
[0074] The electromagnetic torque equation is:
[0075]
[0076] In formula (2), p n is the number of motor pole pairs;
[0077] When using When the control strategy is used, the motion equation of the permanent magnet synchronous motor is:
[0078]
[0079] In formula (3), ω m is the mechanical angular velocity of the motor, J is the moment of inertia, B is the damping coefficient, T L is the load torque;
[0080] At this time, the back electromotive force obtained by the sliding mode observer is:
[0081]
[0082] In this embodiment, specifically: rotor speed and location information The calculation methods are:
[0083]
[0084]
[0085] In formula (5), K p , K i They are the proportional and integral coefficients of the PI regulator of the phase-locked loop respectively.
[0086] In this embodiment, specifically: in S2, a generalized proportional integral observer is used to determine the disturbance or other unmeasured state of the system, and the value is used as feedforward compensation to assist the controller in effectively counteracting the influence of the disturbance;
[0087] At this point, the motion equation of the permanent magnet synchronous motor is revised as follows:
[0088]
[0089] In formula (7), is the system disturbance term;
[0090] Among them, the generalized proportional integral observer is constructed as:
[0091]
[0092] In formula (8), z0, z1, z2, z m is the estimated value of the speed ω, λ0…λ m >0;
[0093] Let e0(t)=ω-z0, e1(t)=d(t)-z1,…,e m (t) = d m (t)-z m , put it into formula (8):
[0094]
[0095] At this time, formula (9) is revised as follows:
[0096]
[0097] In formula (10), A is the Hurwitz matrix, and the disturbance term d(t) satisfies Its error prediction system is asymptotically stable.
[0098] In this embodiment, specifically: a generalized proportional-integral observer is used to calculate the feedforward compensation, which combines the advantages of proportional control and integral control, and can improve the dynamic performance and steady-state accuracy of the system to a certain extent, thereby improving the robustness and anti-interference ability of the system, especially in the face of uncertainty and external disturbances.
[0099] Example 2
[0100] A GPIO-based sliding mode control method for a permanent magnet synchronous motor is proposed. In S3, in order to reduce the chattering problem, a non-singular fast terminal sliding mode controller is used instead of a traditional sliding mode controller. The speed obtained by the sliding mode observer is used as the input data of the controller. The state variable of the permanent magnet synchronous motor is defined as:
[0101]
[0102] In formula (11), ω refis the motor reference speed, which is a constant, and ω is the actual speed.
[0103] In this embodiment, specifically: by combining formula (3) and formula (11), the state equation of the permanent magnet synchronous motor can be obtained as follows:
[0104]
[0105] The synovial surface function is defined as:
[0106]
[0107] In formula (13), α and β are parameters greater than 0, p, q, l and h are all odd numbers, and 1 <p / q<2,l / h> p / q, since x1 and x2 have no negative exponential terms, the singularity problem can be avoided, and the synovial reaching law is:
[0108]
[0109] In this embodiment, specifically: in order to further reduce high frequency jitter, a sigmoid(s) function with smooth and continuous characteristics is used to replace the sign function sgn(s) in formula (14), and its expression is:
[0110]
[0111] In formula (15), a and λ are positive constants, and the size of a and λ affects the convergence characteristics of the function.
[0112] In this embodiment, specifically: According to formula (12), formula (13) and formula (14), the non-singular fast terminal sliding mode controller as the speed loop can obtain the reference current of the q axis: for:
[0113]
[0114] Finally, the q-axis reference current Subtract the feedforward compensation to realize the composite controller composed of generalized proportional integral observer and non-singular fast terminal controller. The input reference current of the current loop is for:
[0115]
[0116] In this embodiment, specifically: a non-singular fast terminal sliding mode controller is used to replace the traditional sliding mode controller, and a sigmoid function with smooth and continuous characteristics is used to replace the sign function in setting the improved sliding mode reaching law, so as to achieve faster convergence speed, higher accuracy and smaller jitter.
[0117] Working principle: A mathematical model of a permanent magnet synchronous motor is established, and a sliding mode observer is used to calculate and obtain the back electromotive force. At the same time, a phase-locked loop system is used to extract the speed and position information of the rotor, and a generalized proportional-integral observer is constructed. The speed obtained from S1 is used as input data to the proportional-integral observer to estimate the interference and make feedforward compensation for the speed loop. A non-singular fast terminal sliding mode controller is set to replace the traditional sliding mode controller, and the exponential reaching law of the traditional sliding mode controller is improved. The sigmoid function is used to replace the sign function sgn(s) of the traditional sliding mode controller, and the speed setting value and feedback value are used as input data into the non-singular fast terminal sliding mode controller to obtain the reference current of the q-axis. The q-axis reference current is subtracted from the feedforward compensation, and the result is used as the input data of the current loop to finally complete the control process of the permanent magnet synchronous motor.
[0118] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A GPIO-based permanent magnet synchronous motor sliding mode control method, characterized in that: The following steps are involved: S1. Establish a mathematical model of the permanent magnet synchronous motor, use a sliding mode observer to calculate and obtain the back electromotive force, and use a phase-locked loop system to extract the rotor speed and position information; S2, construct a generalized proportional-integral observer, and use the speed obtained from S1 as input data to estimate the disturbance and perform feedforward compensation for the speed loop; S3, a non-singular fast terminal sliding mode controller is set to replace the traditional sliding mode controller, the exponential reaching law of the traditional sliding mode controller is improved, and the sigmoid function is used to replace the sign function sgn(s) of the traditional sliding mode controller, and the speed setting value and the feedback value are brought into the non-singular fast terminal sliding mode controller as input data to obtain the reference current of the q-axis; S4, the q-axis reference current minus the feedforward compensation, the result is used as the input data of the current loop, and finally the control process of the permanent magnet synchronous motor is completed.
2. The GPIO-based permanent magnet synchronous motor sliding mode control method according to claim 1, characterized in that: In S1, a mathematical model of a dq permanent magnet synchronous motor in a synchronous rotating coordinate system is established, and its stator voltage equation is: In formula (1), u d 、u q are the dq axis components of the stator voltage, i d 、i q are the dq components of the stator current, R is the stator resistance, ψ d , q is the dq component of the stator flux, ω e is the electrical angular velocity, L d , L q They are the dq axis inductance components, ψ f is the permanent magnet flux; The electromagnetic torque equation is: In formula (2), p n is the number of motor pole pairs; When using When the control strategy is used, the motion equation of the permanent magnet synchronous motor is: In formula (3), ω m is the mechanical angular velocity of the motor, J is the moment of inertia, B is the damping coefficient, T L is the load torque; At this time, the back electromotive force obtained by the sliding mode observer is:
3. The GPIO-based permanent magnet synchronous motor sliding mode control method according to claim 2, characterized in that: Rotor speed and location information The calculation methods are: In formula (5), K p , K i They are the proportional and integral coefficients of the PI regulator of the phase-locked loop respectively.
4. The GPIO-based permanent magnet synchronous motor sliding mode control method according to claim 1, characterized in that: In S2, a generalized proportional-integral observer is used to determine the disturbance or other unmeasured state of the system, and the value is used as a feedforward compensation to assist the controller in effectively counteracting the influence of the disturbance; At this point, the motion equation of the permanent magnet synchronous motor is revised as follows: In formula (7), is the system disturbance term; Among them, the generalized proportional integral observer is constructed as: In formula (8), z0, z1, z2, z m is the estimated value of the speed ω, λ0…λ m >0; Let e0(t)=ω-z0, e1(t)=d(t)-z1,…,e m (t) = d m (t)-z m , put it into formula (8): At this time, formula (9) is revised as follows: In formula (10), A is the Hurwitz matrix, and the disturbance term d(t) satisfies Its error prediction system is asymptotically stable.
5. The GPIO-based permanent magnet synchronous motor sliding mode control method according to claim 1, characterized in that: In S3, in order to reduce the chattering problem, a non-singular fast terminal sliding mode controller is used instead of the traditional sliding mode controller. The speed obtained by the sliding mode observer is used as the input data of the controller. The state variable of the permanent magnet synchronous motor is defined as: In formula (11), ω ref is the motor reference speed, which is a constant, and ω is the actual speed.
6. The GPIO-based permanent magnet synchronous motor sliding mode control method according to claim 5, characterized in that: Combining formula (3) with formula (11), the state equation of the permanent magnet synchronous motor can be obtained as follows: The synovial surface function is defined as: In formula (13), α and β are parameters greater than 0, p, q, l and h are all odd numbers, and 1 <p / q<2,l / h> p / q, since x1 and x2 have no negative exponential terms, the singularity problem can be avoided, and the synovial reaching law is:
7. The GPIO-based permanent magnet synchronous motor sliding mode control method according to claim 6, characterized in that: In order to further reduce high-frequency chattering, the sigmoid(s) function with smooth and continuous characteristics is used to replace the sign function sgn(s) in formula (14), and its expression is: In formula (15), a and λ are positive constants, and the size of a and λ affects the convergence characteristics of the function.
8. The GPIO-based permanent magnet synchronous motor sliding mode control method according to claim 7, characterized in that: According to formula (12), formula (13) and formula (14), the non-singular fast terminal sliding mode controller as the speed loop can obtain the reference current of the q axis: for: Finally, the q-axis reference current Subtract the feedforward compensation to realize the composite controller composed of generalized proportional integral observer and non-singular fast terminal controller. The input reference current of the current loop is for:
Citation Information
Cited By
PMSM current loop adaptive nonsingular terminal sliding mode control method based on parameter identification
CN122159748A