Motor control method, computer equipment and machine readable storage medium

By generating control signals based on the motor angle and current limit value in DC brushless motor control, the motor torque fluctuation and noise problems are solved, the stability and efficiency of the motor are improved, and the service life is extended.

CN119315884APending Publication Date: 2025-01-14HUNAN BIOMETA INTELLIGENT MFG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310918060.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-07-13
Filing Date
2023-07-25
Publication Date
2025-01-14

AI Technical Summary

Technical Problem

There are problems of large torque fluctuations, low current noise and low efficiency in the existing DC brushless motor control methods, which affect the stability and service life of the motor.

Method used

By determining the current position based on the current angle value of the motor, calculating the reference speed value based on the position and target position, combining the current limit value and the current slope limit value, a motor control signal is generated to control the motor operation, so as to achieve the simultaneous motor position, speed and current of the motor Limit, reduce slight jitter, and improve the stability and working efficiency of the motor.

Benefits of technology

It effectively improves the stability and service life of the motor, achieves efficient, high-speed and precise control, reduces torque fluctuations and noise, and improves the working efficiency of the motor.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119315884A_ABST
    Figure CN119315884A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a motor control method, computer equipment and a machine readable storage medium, and belongs to the technical field of motors. The method comprises the steps of determining a current position of a motor at a current moment based on a current angle value of the motor, determining a reference speed value according to the current position and a preset target position, determining a current speed of the motor, and determining a first current value based on the reference speed value and the current speed, the second current value is determined according to the first current value and the preset current limit value, the reference current value is determined according to the second current value and the preset current slope limit value, and the current slope limit value reduces the influence caused by small jitter of the motor and improves the stability of the motor. And determining an orthogonal current based on the obtained three-phase sampling current of the motor, and determining a motor control signal based on the orthogonal current, the reference current value and the current angle value, so as to control the motor to operate through the motor control signal. Efficient control over the motor is achieved, and then the working efficiency of the motor is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of motor technology, and in particular to a motor control method, a computer device and a machine-readable storage medium. Background Art

[0002] Brushless DC motors are a product of the rapid development of semiconductor electronic technology. They combine modern electronic technology, control theory, and motor technology, and have the characteristics of good control performance, wide speed regulation range, large starting torque, and high efficiency. In the early days, the DC power entered the armature winding through brushes and commutators, so there were disadvantages such as brush wear, electromagnetic interference, high noise, and short life. In many important occasions, it is an important source of system instability. In recent years, due to the advancement of power electronics and vector control technology, brushless DC motors have entered the application stage and have been widely used due to their high reliability.

[0003] However, the square wave control method used in current products for brushless DC motor control has large torque fluctuations, certain current noise, and low motor efficiency. Summary of the invention

[0004] In view of the above-mentioned deficiencies in the prior art, an object of the embodiments of the present invention is to provide a motor control method, a computer device and a machine-readable storage medium.

[0005] In order to achieve the above object, the present invention provides a motor control method according to a first aspect, comprising:

[0006] Determine the current position of the motor at the current moment based on the current angle value of the motor;

[0007] Determine a reference speed value according to the current position and the preset target position;

[0008] Determining a current speed of the motor, and determining a first current value based on a reference speed value and the current speed;

[0009] Determining a second current value according to the first current value and a preset current limit value;

[0010] Determining a reference current value according to the second current value and a preset current slope limit value;

[0011] The orthogonal current is determined based on the acquired three-phase sampling current of the motor, and the motor control signal is determined based on the orthogonal current, the reference current value and the current angle value, so as to control the operation of the motor through the motor control signal.

[0012] In an embodiment of the present invention, determining a reference speed value according to a current position and a preset target position includes:

[0013] Determine the position error value between the current position and the target position;

[0014] Inputting the position error value into the position loop proportional integral controller to obtain a first speed value;

[0015] A reference speed value is determined according to the first speed value and a preset speed limit value.

[0016] In an embodiment of the present invention, determining a reference speed value according to a first speed value and a preset speed limit value includes:

[0017] Determine a minimum speed value and a maximum speed value based on the speed limit value;

[0018] When the first speed value is less than the minimum speed value, the minimum speed value is used as the reference speed value;

[0019] When the first speed value is greater than the maximum speed value, the maximum speed value is used as the reference speed value;

[0020] When the first speed value is greater than or equal to the minimum speed value and less than or equal to the maximum speed value, the first speed value is used as the reference speed value.

[0021] In an embodiment of the present invention, determining the first current value based on the reference speed value and the current speed includes:

[0022] Determine the speed error value between the current speed and the reference speed value;

[0023] The speed error value is input into the speed loop proportional controller to obtain a first current value.

[0024] In an embodiment of the present invention, determining the second current value according to the first current value and a preset current limit value includes:

[0025] Determine a current minimum value and a current maximum value based on the current limit value;

[0026] When the first current value is less than the minimum current value, the minimum current value is used as the second current value;

[0027] When the first current value is greater than the maximum current value, the maximum current value is used as the second current value;

[0028] When the first current value is greater than or equal to the minimum current value and less than or equal to the maximum current value, the first current value is used as the second current value.

[0029] In an embodiment of the present invention, determining a reference current value according to the second current value and a preset current slope limit value includes:

[0030] Determine the historical reference current value of the motor at the previous moment, and determine the time interval between the current moment and the previous moment;

[0031] determining a current slope based on the second current value, a historical reference current value, and a time interval;

[0032] The reference current value is determined based on the current slope, the historical reference current value, and the preset current slope limit value.

[0033] In an embodiment of the present invention, determining a reference current value based on a current slope, a historical reference current value, and a preset current slope limit value includes:

[0034] determining the product of the current slope limit value and the time interval;

[0035] Determining a minimum slope value and a maximum slope value based on the current slope limit value;

[0036] When the current slope is less than the minimum slope value, the difference between the historical reference current value and the product is used as the reference current value;

[0037] When the current slope is greater than the maximum slope value, the sum of the historical reference current value and the product is used as the reference current value;

[0038] When the current slope is greater than or equal to the minimum slope value and less than or equal to the maximum slope value, the second current value is used as the reference current value.

[0039] In the embodiment of the present invention, the orthogonal current includes a q-axis current value and a d-axis current value, and the motor control signal is determined based on the orthogonal current, the reference current value and the current angle value, including:

[0040] determining a first current error value between the q-axis current value and a reference current value;

[0041] determining a second current error value between the d-axis current value and zero;

[0042] Inputting the first current error value and the second current error value into the current loop proportional integral controller respectively to obtain a first space voltage vector and a second space voltage vector;

[0043] A motor control signal is determined based on the current angle value, the first space voltage vector, the second space voltage vector, and a space vector modulation algorithm.

[0044] In an embodiment of the present invention, determining the current speed of the motor includes:

[0045] Get the historical angle value of the motor at the previous moment and determine the time interval between the current moment and the previous moment;

[0046] Determine a first speed of the motor based on a difference between a current angle value and a historical angle value and a time interval;

[0047] The first speed is low-pass filtered to obtain the current speed.

[0048] A second aspect of the present invention provides a computer device, comprising: a memory, a processor, and a program stored in the memory and executable on the processor, wherein the program is configured to implement the steps of the motor control method as described in the above embodiment.

[0049] A third aspect of the present invention provides a machine-readable storage medium, on which instructions are stored. When the instructions are executed by a processor, the processor executes the motor control method as described in the above embodiment.

[0050] Through the above technical solution, the current position of the motor at the current moment is determined based on the current angle value of the motor, the reference speed value is determined according to the current position and the preset target position, the current speed of the motor is determined, and the first current value is determined based on the reference speed value and the current speed, the second current value is determined according to the first current value and the preset current limit value, and the reference current value is determined according to the second current value and the preset current slope limit value. The reference current is limited by the current slope limit value, which reduces the impact of the slight jitter of the motor, effectively improves the stability of the motor, and thus improves the service life of the motor. The orthogonal current is determined based on the three-phase sampled current of the motor, and the motor control signal is determined based on the orthogonal current, the reference current value and the current angle value, so as to control the operation of the motor through the motor control signal. By simultaneously limiting the position, speed and current of the motor, efficient, high-speed, precise, low-torque fluctuation and low-noise control of the motor is achieved, thereby improving the working efficiency of the motor.

[0051] Other features and advantages of the embodiments of the present invention will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings:

[0053] Figure 1 is a flow chart of a motor control method according to an embodiment of the present invention;

[0054] Figure 2 A schematic diagram of a device structure for applying a motor control method according to an embodiment of the present invention;

[0055] Figure 3 A schematic diagram of the control principle of a motor control method according to an embodiment of the present invention;

[0056] Figure 4 is a flow chart of a motor control method according to another embodiment of the present invention;

[0057] Figure 5 FIG. 4 is a schematic diagram of a PWM output waveform according to an embodiment of the present invention. DETAILED DESCRIPTION

[0058] The specific implementation of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the present invention, and is not used to limit the present invention.

[0059] It should be noted that if the embodiments of the present application involve directional indications (such as up, down, left, right, front, back...), the directional indications are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.

[0060] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present application, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.

[0061] Figure 1 FIG. 1 is a flow chart of a motor control method according to an embodiment of the present invention. Figure 1 As shown, in an embodiment of the present invention, a motor control method is provided. Taking the method applied to a processor as an example, the method may include the following steps:

[0062] Step S100, determining the current position of the motor at the current moment based on the current angle value of the motor;

[0063] It should be noted that field-oriented control is also called vector control. Field-oriented control converts the control of three-phase AC into the control of q-axis current that generates torque and d-axis current that generates magnetic field through coordinate transformation, thereby realizing independent control of torque and excitation. This embodiment adopts field-oriented control, and calculates three-way PWM (Pulse Width Modulation) through space vector modulation (SVPWM, Space Vector Pulse Width Modulation) for control, thereby realizing vector control of the motor stator magnetic field, and keeping the motor stator magnetic field and rotor magnetic field at 90° at all times, thereby realizing the maximum torque output of the motor under a certain current. Reference Figure 2 In this embodiment, the control of the motor can be controlled by a main control module including the above-mentioned processor, and the main control module can be connected to a current acquisition module for collecting current, a motor angle detection module for detecting the rotation angle of the motor, and a motor drive module for driving the motor to operate. The main control module realizes real-time control of the motor by interacting with each module connected to it. It can be understood that before the motor control starts, the main control module will initialize the interface of the above-mentioned current acquisition module, motor angle detection module and motor drive module so that each module can quickly enter the working state. When the main control module receives the input instruction to control the motor, the main control module controls each of the above-mentioned modules to start working to realize the control of the motor.

[0064] Specifically, in one embodiment, the motor angle detection module adopts a magnetic encoder detection circuit, and the processor controls the motor angle detection module to obtain the value of the magnetic encoder at the current moment through SPI (Serial Peripheral Interface) communication to obtain the current angle value of the motor. The current position of the motor at the current moment is determined according to the current angle value. It can be understood that if the value range of the magnetic encoder is 0° to 360°, the motor angle detection module will obtain the value of the magnetic encoder at the current moment in real time, and the motor will count every time it detects the value of the magnetic encoder 360° from the start of the motor control until the value of the magnetic encoder is obtained at the current moment, and the value of the magnetic encoder at the current moment is accumulated with the value counted before to determine the current position of the motor at the current moment. For example, from the start time to the current moment, the motor angle detection module detects that the magnetic encoder value has 2 times of 360°, and the value at the current moment is 2°, then the value is accumulated to 360×2+2=722°, that is, the current position of the motor rotation is 722°.

[0065] It is understandable that before the motor control starts, the magnetic encoder will be corrected for zero bias, thereby reducing the impact caused by the error of the device itself and improving the accuracy of motor control.

[0066] Step S200, determining a reference speed value according to the current position and a preset target position;

[0067] It should be noted that, in this embodiment, the control of the motor adopts a three-loop control method, and the three-loop control specifically includes an outer position loop, an intermediate speed loop, and an inner current loop. Among them, the output of the position loop is used as an input of the speed loop, and the output of the speed loop is used as an input of the current loop, and then the control signal of the motor is finally determined based on the output of the current loop. In this embodiment, corresponding limit values ​​are set for each loop, including pre-setting the target position in the position loop to limit the motor position, so as to accurately control the motor to rotate to the specified position; pre-setting the speed limit value in the speed loop to limit the maximum speed of the motor during the rotation process; pre-setting the current limit value in the current loop to limit the maximum torque of the motor during the rotation process. The motor position, speed, and torque are set simultaneously through the three-loop control, so as to achieve efficient, high-speed, precise, low-torque fluctuation, and low-noise control of the DC brushless motor.

[0068] Specifically, the preset target position is a position reference pre-set in the position loop control for limiting the motor position. After determining the current position of the motor, the position error between the current position and the target position is calculated in the position loop, thereby determining the reference speed value based on the position error. The reference speed value is a speed value used for reference to the motor speed in the speed loop, and the obtained reference speed value is input into the speed loop. In one embodiment, the determination of the reference speed value based on the position error can be implemented by a position loop controller, and the position loop controller can implement the determination of the reference speed value by running a PID (Proportional Integral Derivative, proportional, integral, differential) algorithm, a PI (proportional integral) algorithm, or a P (proportional) algorithm.

[0069] Step S300, determining the current speed of the motor, and determining a first current value based on a reference speed value and the current speed;

[0070] It should be noted that the current speed is the speed of the motor at the current moment, and the first current value is a reference current value for controlling the motor current. After determining the current speed of the motor in the speed loop, the speed error between the current speed and the reference speed value is calculated, so as to determine the first current value based on the speed error. In one embodiment, the determination of the first current value based on the speed error can be implemented by a speed loop controller, and the speed loop controller can implement the determination of the first current value by running a PID (Proportional Integral Derivative, proportional, integral, differential) algorithm, a PI (proportional integral) algorithm, or a P (proportional) algorithm.

[0071] Step S400, determining a second current value according to the first current value and a preset current limit value;

[0072] It should be noted that the preset current limit value is used to limit the current of the motor to limit the maximum torque of the motor during rotation. The second current value is a current value for controlling the motor obtained by limiting the reference current value. Specifically, after confirming the first current value of the reference current value, the first current value is limited based on the current limit value to obtain the second current value.

[0073] Step S500, determining a reference current value according to the second current value and a preset current slope limit value;

[0074] It should be noted that in order to reduce the impact of the slight jitter of the motor and improve the stability of the motor, the slight jitter of the motor is reduced by limiting the rate of change of the motor current in this embodiment. Specifically, the slope of the motor current is limited by presetting the current slope limit value, thereby limiting the rate of change of the motor current. After determining the second current value, the second current value is further limited based on the current slope limit value to determine the reference current value. Among them, the reference current value is a speed value used to refer to the motor current in the current loop, and the obtained reference current value is input into the current loop.

[0075] Step S600, determining the orthogonal current based on the acquired three-phase sampled current of the motor, and determining the motor control signal based on the orthogonal current, the reference current value and the current angle value, so as to control the operation of the motor through the motor control signal.

[0076] It should be noted that the three-phase sampling current includes Ia, Ib, and Ic. The three-phase sampling current can be transformed into two-phase currents Iα and Iβ after Clark transformation (the three basis vectors Ia, Ib, and Ic are non-orthogonal, and the basis transformation is performed to orthogonalize them into a rectangular coordinate system, and the new rectangular coordinate system is named α-β coordinates). The angle of rotation of the α-β coordinate system is the current angle of the rotor. Further, the two-phase current variables Iα and Iβ are transformed by Park to obtain orthogonal currents Id and Iq. Under steady-state conditions, Id and Iq are constants. In this embodiment, the three-phase sampling current of the motor is the current of the motor at the current moment. The three-phase sampling current of the motor is calculated by obtaining the three-phase AD value in the current acquisition module. The processor performs Clark transformation on the three-phase sampling current to obtain the two-phase current, and then performs Park transformation on the two-phase current to obtain the orthogonal current.

[0077] Among them, Clark transformation formula:

[0078] Iα=Ia-cos(2π / 3)Ib-cos(2π / 3)Ic;

[0079] Iβ=sin(2π / 3)Ib-sin(2π / 3)Ic.

[0080] Park transformation formula:

[0081] Id=Iαcos(θ)+Iβsin(θ);

[0082] Iq=-Iαsin(θ)+Iβcos(θ).

[0083] In one embodiment, the obtained quadrature current may be subjected to low-pass filtering to obtain a smoothed quadrature current.

[0084] After the orthogonal current of the motor is determined in the current loop, the current error between the orthogonal current and the reference current value is calculated, and the space voltage vector is determined based on the current error. The motor control signal is determined according to the space voltage vector and the current angle value.

[0085] Through the above scheme, the current position of the motor at the current moment is determined based on the current angle value of the motor, the reference speed value is determined according to the current position and the preset target position, the current speed of the motor is determined, and the first current value is determined based on the reference speed value and the current speed, the second current value is determined according to the first current value and the preset current limit value, and the reference current value is determined according to the second current value and the preset current slope limit value. The reference current is limited by the current slope limit value, which reduces the impact of the slight jitter of the motor, effectively improves the stability of the motor, and thus improves the service life of the motor. The orthogonal current is determined based on the three-phase sampled current of the motor, and the motor control signal is determined based on the orthogonal current, the reference current value and the current angle value, so as to control the operation of the motor through the motor control signal. By simultaneously limiting the position, speed and current of the motor, efficient, high-speed, precise, low-torque fluctuation and low-noise control of the motor is achieved, thereby improving the working efficiency of the motor.

[0086] In one embodiment, determining a reference speed value according to a current position and a preset target position includes:

[0087] Determine the position error value between the current position and the target position;

[0088] Inputting the position error value into the position loop proportional integral controller to obtain a first speed value;

[0089] A reference speed value is determined according to the first speed value and a preset speed limit value.

[0090] In this embodiment, it should be noted that a position loop proportional-integral controller is called in the control of the position loop, and the position loop proportional-integral controller runs a PI algorithm. After the processor determines the position error value between the current position and the target position, the position error value is input into the position loop proportional-integral controller. The position loop proportional-integral controller performs a PI operation based on the input position error value to obtain a first speed value.

[0091] Specifically, the PI algorithm of the position loop is the sum of two components: proportional and integral:

[0092] P(k)=PP(k)+PI(k);

[0093] Proportional value: PP(k) = D*e(k);

[0094] Integral value: PI(k)=PI(k-1)+I*((e(k)+e(k-1)) / 2)*Ts;

[0095] Among them, k represents the current moment; k-1 represents the previous moment; P(k) represents the first speed value at moment k; e(k) represents the position error value at moment k; e(k-1) represents the position error value at moment k-1; PP(k) represents the proportional value at moment k; PI(k) represents the integral value at moment k, and PI(k-1) represents the integral value at moment k-1; D represents the proportional modulation coefficient, and I represents the integral modulation coefficient, both of which are preset values ​​determined based on experience; Ts represents the interval time between moment k and moment k-1.

[0096] In this embodiment, when the motor rotates rapidly, differential regulation cannot achieve the effect of leading control. Instead, differential regulation has an amplifying effect on noise interference. Strengthening differential regulation has an adverse effect on the system's anti-interference. Differential processing is not used in the position loop, which not only reduces the complexity of control and regulation but also achieves fast and stable control. The position loop uses the PI algorithm to quickly eliminate static position errors.

[0097] It should be noted that the speed limit value is used to limit the first speed and limit the maximum speed of the motor. Specifically, the reference speed value is determined according to the first speed value and the preset speed limit value, including:

[0098] Determine a minimum speed value and a maximum speed value based on the speed limit value;

[0099] When the first speed value is less than the minimum speed value, the minimum speed value is used as the reference speed value;

[0100] When the first speed value is greater than the maximum speed value, the maximum speed value is used as the reference speed value;

[0101] When the first speed value is greater than or equal to the minimum speed value and less than or equal to the maximum speed value, the first speed value is used as the reference speed value.

[0102] It should be noted that the speed limit value is a value that limits the speed. In this embodiment, the negative value of the speed limit value is used as the minimum speed value, and the positive value of the speed limit value is used as the maximum speed value. For example, if the speed limit value is SC, the minimum speed value is -SC; the maximum speed value is SC.

[0103] In one embodiment, the reference speed value may be determined by a preset speed algorithm, specifically:

[0104]

[0105] Among them, PO(k) represents the reference speed value at time k; SC is the speed limit value, -SC represents the minimum speed value; SC represents the maximum speed value; P(k) represents the first speed value.

[0106] When the first speed value P(k) is less than the minimum speed value -SC, the minimum speed value -SC is used as the reference speed value PO(k); when the first speed value P(k) is greater than the maximum speed value SC, the maximum speed value SC is used as the reference speed value PO(k); when the first speed value P(k) is greater than or equal to the minimum speed value -SC and less than or equal to the maximum speed value SC, the first speed value P(k) is used as the reference speed value PO(k).

[0107] In this embodiment, the speed of the motor is limited by the speed limit value to prevent the motor from running too fast or too slow, thereby improving the motor's operating efficiency.

[0108] In one embodiment, determining the first current value based on the reference speed value and the current speed includes:

[0109] Determine the speed error value between the current speed and the reference speed value;

[0110] The speed error value is input into the speed loop proportional controller to obtain a first current value.

[0111] In this embodiment, it should be noted that a speed loop proportional controller is called in the control of the speed loop, and the speed loop proportional controller runs a P algorithm. After the processor determines the speed error value between the current speed and the reference speed value, the speed error value is input into the speed loop proportional controller. The speed loop proportional controller performs a P operation based on the input speed error value to obtain a first current value.

[0112] Specifically, the P algorithm of the speed loop is a proportional value:

[0113] S(k)=SP(k);

[0114] Proportional value: SP(k) = D*e(k)

[0115] Among them, k represents the current moment; S(k) represents the first current value at moment k; e(k) represents the speed error value at moment k; SP(k) represents the proportional value at moment k; D represents the proportional modulation coefficient, and D is a preset value determined based on experience.

[0116] In this embodiment, when the motor rotates rapidly, the differential adjustment cannot achieve the effect of leading control. On the contrary, the differential has an amplifying effect on noise interference, and strengthening the differential has an adverse effect on the anti-interference of the system. Differential processing is not used in the speed loop, which not only reduces the complexity of control and regulation but also achieves fast and stable control. Moreover, since the magnitude of the motor current is proportional to the speed, the static error of the speed loop is placed in the integral I of the current loop to eliminate it, reducing the complexity of the three-loop control and regulation, and can achieve the same effect.

[0117] In one embodiment, determining the second current value according to the first current value and a preset current limit value includes:

[0118] Determine a current minimum value and a current maximum value based on the current limit value;

[0119] When the first current value is less than the minimum current value, the minimum current value is used as the second current value;

[0120] When the first current value is greater than the maximum current value, the maximum current value is used as the second current value;

[0121] When the first current value is greater than or equal to the minimum current value and less than or equal to the maximum current value, the first current value is used as the second current value.

[0122] It should be noted that the current limit value is a value for limiting the current. In this embodiment, the negative value of the current limit value is used as the minimum current value, and the positive value of the current limit value is used as the maximum current value. For example, if the speed limit value is Cc, the minimum speed value is -Cc; the maximum speed value is Cc.

[0123] In one embodiment, the second current value may be determined by a preset current algorithm, specifically:

[0124]

[0125] Wherein, SO(k) represents the second current value at time k; Cc is the current limit value, -Cc represents the minimum current value; Cc represents the maximum current value; S(k) represents the first current value.

[0126] When the first current value S(k) is less than the minimum speed value -Cc, the minimum speed value -Cc is used as the second current value SO(k); when the first current value S(k) is greater than the maximum speed value Cc, the maximum speed value Cc is used as the second current value SO(k); when the first current value S(k) is greater than or equal to the minimum speed value -Cc and less than or equal to the maximum speed value Cc, the first current value S(k) is used as the second current value SO(k).

[0127] In this embodiment, the current limiting value is used to limit the current of the motor, thereby limiting the torque during the rotation of the motor and improving the accuracy of the motor control.

[0128] In one embodiment, determining the reference current value according to the second current value and a preset current slope limit value includes:

[0129] Determine the historical reference current value of the motor at the previous moment, and determine the time interval between the current moment and the previous moment;

[0130] determining a current slope based on the second current value, a historical reference current value, and a time interval;

[0131] The reference current value is determined based on the current slope, the historical reference current value, and the preset current slope limit value.

[0132] In this embodiment, it should be noted that the historical reference current value refers to the reference current value corresponding to the motor at the previous moment. After determining the time interval between the current moment and the previous moment, the current slope of the motor is determined based on the second current value, the historical reference current value and the time interval. Specifically, it can be calculated by the following formula:

[0133] Cr=(SO(k)-SO(k-1)) / Ts

[0134] Wherein, Cr represents the current slope; k represents the current moment; k-1 represents the previous moment; SO(k) represents the second current value at moment k; SO(k-1) represents the second current value at moment k-1; Ts represents the time interval between moment k and moment k-1.

[0135] Further, after the current slope is determined, a reference current value is determined based on the current slope, a historical reference current value, and a preset current slope limit value, specifically including:

[0136] determining the product of the current slope limit value and the time interval;

[0137] Determining a minimum slope value and a maximum slope value based on the current slope limit value;

[0138] When the current slope is less than the minimum slope value, the difference between the historical reference current value and the product is used as the reference current value;

[0139] When the current slope is greater than the maximum slope value, the sum of the historical reference current value and the product is used as the reference current value;

[0140] When the current slope is greater than or equal to the minimum slope value and less than or equal to the maximum slope value, the second current value is used as the reference current value.

[0141] It should be noted that the current slope limit is a value that limits the current slope. In this embodiment, the negative value of the current slope limit is used as the minimum slope value, and the positive value of the current slope limit is used as the maximum slope value. For example, the current slope limit is R C , then the minimum slope is -R C ; The maximum slope is R C .

[0142] In one embodiment, the reference speed value may be determined by a preset speed algorithm, specifically:

[0143]

[0144] Where k represents the current moment; k-1 represents the previous moment; SO(k)' represents the reference current value at moment k; Cr represents the current slope; R C is the current slope limit value, -R C Indicates the minimum slope; R C represents the maximum slope value; SO(k) represents the second current value; SO(k-1)' represents the historical reference current value.

[0145] Calculate the current slope limit value R C The product R between the time interval Ts C *Ts; when the current slope Cr is less than the minimum slope - R C In the case of C *Ts is used as the reference current value SO(k)'; when the current slope Cr is greater than the maximum slope R C In the case of C *The sum between Ts is used as the reference current value SO(k)'; when the current slope Cr is greater than or equal to the minimum slope value -R C And less than or equal to the maximum slope R C In this case, the second current value SO(k) is used as the reference speed value SO(k)'.

[0146] In this embodiment, the reference current is limited by the current slope limit value, which reduces the impact of slight jitter of the motor and effectively improves the stability of the motor, thereby increasing the service life of the motor.

[0147] In one embodiment, the quadrature current includes a q-axis current value and a d-axis current value, and determining the motor control signal based on the quadrature current, the reference current value, and the current angle value includes:

[0148] determining a first current error value between the q-axis current value and a reference current value;

[0149] determining a second current error value between the d-axis current value and zero;

[0150] Inputting the first current error value and the second current error value into the current loop proportional integral controller respectively to obtain a first space voltage vector and a second space voltage vector;

[0151] A motor control signal is determined based on the current angle value, the first space voltage vector, the second space voltage vector, and a space vector modulation algorithm.

[0152] In this embodiment, it should be noted that the orthogonal current includes the q-axis current value and the d-axis current value. Among them, the d-axis current value is not needed by us, and the reference current value of the d-axis is set to zero, because the d-axis current will not generate output force for the rotation of the drive motor, so the second current error value between the obtained d-axis current value and the value of 0 is input into the current loop; and the q-axis current value needs to be limited, and the first current error value between the q-axis current value and the reference current value is determined and input into the current loop. In the control of the current loop, the current loop proportional-integral controller is called, and the current loop proportional-integral controller runs the PI algorithm. After the processor determines the first current error value and the second current error value, the first current error value and the second current error value are respectively input into the current loop proportional-integral controller, and the current loop proportional-integral controller performs PI operation based on the input first current error value and the second current error value, thereby obtaining the first space voltage vector and the second space voltage vector.

[0153] Specifically, the PI algorithm of the current loop is the sum of two components: proportional and integral:

[0154] C(k)=CP(k)+CI(k);

[0155] Proportional value: CP(k) = D*e(k);

[0156] Integration value: CI(k)=CI(k-1)+I*((e(k)+e(k-1)) / 2)*Ts;

[0157] Among them, k represents the current moment; k-1 represents the previous moment; C(k) represents the spatial voltage vector at moment k; e(k) represents the current error value at moment k; e(k-1) represents the current error value at moment k-1; CP(k) represents the proportional value at moment k; CI(k) represents the integral value at moment k, and CI(k-1) represents the integral value at moment k-1; D represents the proportional modulation coefficient, and I represents the integral modulation coefficient, both of which are preset values ​​determined based on experience; Ts represents the interval time between moment k and moment k-1.

[0158] In this embodiment, when the motor rotates rapidly, differential regulation cannot achieve the effect of leading control. Instead, differential regulation has an amplifying effect on noise interference, and strengthening differential regulation has an adverse effect on the system's anti-interference. Differential processing is not used in the current loop, which not only reduces the complexity of control and regulation but also achieves fast and stable control. The current loop adopts the PI algorithm, so that the static error of the speed loop and the current loop can be quickly eliminated through the integral I of the current loop. This not only reduces the complexity of the three-loop control and regulation, but also achieves the same effect as when the three-loop control adopts the integral I.

[0159] refer to Figure 3 and Figure 4 , pre-set the target position, current limit value, current slope limit value and speed limit value. The current position of the motor at the current moment is determined based on the current angle value of the motor collected by the motor angle detection module, and the position error value between the current position and the target position is input into the position loop proportional integral controller, and the reference speed value is determined in combination with the speed limit value; the current speed of the motor is determined based on the current angle and the running time, and the speed error value between the current speed and the reference speed value is input into the speed loop proportional controller, and the reference current value is determined in combination with the preset current limit value and the current slope limit value; the orthogonal current (Iq, Id) is determined based on the three-phase sampled current (Ia, Ib, Ic) of the motor collected by the current acquisition module, and the orthogonal current includes a q-axis current value and a d-axis current value, and the first current error value between the q-axis current value and the reference current value and the second current error value between the d-axis current value and zero are respectively input into the current loop proportional integral controller to obtain a first space voltage vector Vq and a second space voltage vector Vd, and three PWM waveforms (PWM A, PWM B, PWM C) are determined by the space vector modulation algorithm, so that the motor drive module obtains the motor control signal (three-phase voltage vector values ​​Va, Vb and Vc) based on the three PWM waveforms.

[0160] Specifically, after determining the first space voltage vector and the second space voltage vector, the motor control signal can be determined based on the current angle value, the first space voltage vector, the second space voltage vector and the space vector modulation algorithm. Specifically, the space vector modulation algorithm is as follows:

[0161] The first step is to calculate the sector where the rotor is located. One revolution of the rotor is 360 degrees, which is divided into 6 sectors, each sector is 60 degrees. The calculation of the current sector S is: S = (θ / (π / 3)) + 1; where θ represents the current angle value;

[0162] In each sector, two adjacent space voltage vectors and a zero vector are selected to synthesize any space voltage vector in each sector.

[0163] The second step is to calculate the time T0, T1 and T2. T1 and T2 represent the time when the output space voltage vector is output, and T0 represents the time when the output space voltage vector is 0. The three-phase PWM output waveform (PWM A, PWM B, PWMC) in a PWM cycle time is as follows: Figure 5 As shown, when the three-phase PWM is low level or high level, the space voltage vector generated is 0. Assume T0+T1+T2=1, T0+T1+T2 represents a PWM cycle time (1PWM cycle).

[0164] Among them, VPower represents the voltage value provided to the motor, and Vout represents the normalized voltage value.

[0165]

[0166]

[0167] T0 = ​​1 - T1 - T2;

[0168] Wherein, θ represents the current angle value; S represents the sector; and Vout represents the normalized voltage value.

[0169] The third step is to project the T0, T1, and T2 values ​​to the appropriate duty cycle times Ta, Tb, and Tc. Ta, Tb, and Tc are the duty cycle times of the three PWMs. These duty cycle times directly depend on the sector in which the motor is currently located, as shown in Table 1. After obtaining the duty cycle time of each sector, the three PWMs are output to the motor drive module.

[0170] Table 1

[0171] S(Sector) Ta (A channel duty cycle time) Tb (B-channel duty cycle time) Tc (C-channel duty cycle time) 1 T1+T2+T0 / 2 T2+T0 / 2 T0 / 2 2 T1+T0 / 2 T1+T2+T0 / 2 T0 / 2 3 T0 / 2 T1+T2+T0 / 2 T2+T0 / 2 4 T0 / 2 T1+T0 / 2 T1+T2+T0 / 2 5 T2+T0 / 2 T0 / 2 T1+T2+T0 / 2 6 T1+T2+T0 / 2 T0 / 2 T1+T0 / 2

[0172] The motor drive module consists of a driver chip and surrounding circuits. It receives three PWM waveforms output by the main control module and then generates the desired motor control signals: three-phase voltage vector values ​​Va, Vb and Vc, thereby controlling the operation of the motor. Ensure that the magnetic force generated by these voltages in the motor stator is offset by 90 degrees from its rotor (permanent magnet), which ensures maximum torque to drive the motor.

[0173] In this embodiment, the maximum voltage range of the power supply is better utilized by using the space vector algorithm. When the modulation ratio is 1, the peak value of the phase voltage of the sine wave generated by the sine modulation (SPWM, Sinusoidal Pulse Width Modulation) is 0.5 times the bus voltage, while the peak value of the phase voltage of the "double sine wave" (saddle wave) generated by the space vector modulation is 0.557 times the bus voltage, that is, 0.577 / 0.5=1.1547, which means that when using the same power supply, space vector modulation can output 15.47% more power to the motor than sinusoidal modulation, thereby improving the utilization of the bus voltage and providing a better dynamic response of the motor.

[0174] In one embodiment, determining the current speed of the motor includes:

[0175] Get the historical angle value of the motor at the previous moment and determine the time interval between the current moment and the previous moment;

[0176] Determine a first speed of the motor based on a difference between a current angle value and a historical angle value and a time interval;

[0177] The first speed is low-pass filtered to obtain the current speed.

[0178] In this embodiment, the acquired first speed of the motor is preprocessed by low-pass filtering to obtain a smoothed speed value as the current speed of the motor. Specifically, it can be calculated by the following low-pass filtering formula:

[0179] Uf(k)=α*Uf(k-1)+(1-α)*U(k)

[0180] Among them, Uf(k) represents the filter value at time k; α represents the coefficient, α=Tf / (Tf+Ts); Uf(k-1) represents the filter value at the previous moment before time k (time K-1), U(k) is the measured value at time k, Tf is the filter time constant, and Ts is the sampling time.

[0181] It is understandable that in the method of performing low-pass filtering on the orthogonal current to obtain a smoothed orthogonal current, the calculation can also be performed using the above low-pass filtering formula.

[0182] In this embodiment, by performing low-pass filtering on the speed of the motor, it is ensured that the current speed obtained is a smooth speed value, thereby reducing the interference effect of the motor control, improving the accuracy of the motor control, and further improving the efficiency of the motor operation.

[0183] An embodiment of the present invention provides a computer device, which includes: a memory, a processor, and a program stored in the memory and executable on the processor, wherein the program is configured to implement the steps of the motor control method described in the above embodiment.

[0184] An embodiment of the present invention provides a machine-readable storage medium, on which instructions are stored. When the instructions are executed by a processor, the processor executes the motor control method as described in the above embodiment.

[0185] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0186] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0187] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0188] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0189] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0190] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0191] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0192] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0193] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A motor control method, characterized in that: include: Determining a current position of the motor at a current moment based on a current angle value of the motor; Determine a reference speed value according to the current position and a preset target position; determining a current speed of the motor, and determining a first current value based on the reference speed value and the current speed; Determining a second current value according to the first current value and a preset current limit value; Determining a reference current value according to the second current value and a preset current slope limit value; A quadrature current is determined based on the acquired three-phase sampled current of the motor, and a motor control signal is determined based on the quadrature current, the reference current value and the current angle value, so as to control the operation of the motor through the motor control signal.

2. The motor control method according to claim 1, characterized in that: The step of determining a reference speed value according to the current position and a preset target position includes: determining a position error value between the current position and the target position; Inputting the position error value into a position loop proportional integral controller to obtain a first speed value; A reference speed value is determined according to the first speed value and a preset speed limit value.

3. The motor control method according to claim 1, characterized in that: The determining of the reference speed value according to the first speed value and a preset speed limit value comprises: Determine a minimum speed value and a maximum speed value based on the speed limit value; In the case where the first speed value is less than the minimum speed value, taking the minimum speed value as a reference speed value; When the first speed value is greater than the maximum speed value, taking the maximum speed value as a reference speed value; When the first speed value is greater than or equal to the minimum speed value and less than or equal to the maximum speed value, the first speed value is used as a reference speed value.

4. The motor control method according to claim 1, characterized in that: The determining of the first current value based on the reference speed value and the current speed comprises: determining a speed error value between the current speed and the reference speed value; The speed error value is input into a speed loop proportional controller to obtain a first current value.

5. The motor control method according to claim 1, characterized in that: The determining the second current value according to the first current value and a preset current limit value includes: Determine a current minimum value and a current maximum value based on the current limit value; When the first current value is less than the minimum current value, taking the minimum current value as the second current value; When the first current value is greater than the maximum current value, taking the maximum current value as the second current value; When the first current value is greater than or equal to the minimum current value and less than or equal to the maximum current value, the first current value is used as the second current value.

6. The motor control method according to claim 1, characterized in that: The determining of the reference current value according to the second current value and a preset current slope limit value includes: Determine a historical reference current value of the motor at a previous moment, and determine a time interval between a current moment and the previous moment; determining a current slope based on the second current value, the historical reference current value, and the time interval; A reference current value is determined based on the current slope, the historical reference current value, and a preset current slope limit value.

7. The motor control method according to claim 6, characterized in that: The determining of the reference current value based on the current slope, the historical reference current value and a preset current slope limit value includes: determining a product of the current slope limit value and the time interval; Determining a minimum slope value and a maximum slope value based on the current slope limiting value; In a case where the current slope is less than the minimum slope value, taking the difference between the historical reference current value and the product as a reference current value; In a case where the current slope is greater than the maximum slope value, taking the sum of the historical reference current value and the product as a reference current value; When the current slope is greater than or equal to the minimum slope value and less than or equal to the maximum slope value, the second current value is used as a reference current value.

8. The motor control method according to claim 1, characterized in that: The orthogonal current includes a q-axis current value and a d-axis current value, and determining the motor control signal based on the orthogonal current, the reference current value, and the current angle value includes: determining a first current error value between the q-axis current value and the reference current value; determining a second current error value between the d-axis current value and zero; Inputting the first current error value and the second current error value into a current loop proportional-integral controller respectively to obtain a first space voltage vector and a second space voltage vector; A motor control signal is determined based on the current angle value, the first space voltage vector, the second space voltage vector, and a space vector modulation algorithm.

9. The motor control method according to claim 1, characterized in that: The determining the current speed of the motor comprises: Obtain the historical angle value of the motor at the previous moment, and determine the time interval between the current moment and the previous moment; determining a first speed of the motor based on a difference between the current angle value and the historical angle value and the time interval; The first speed is low-pass filtered to obtain the current speed.

10. A computer device, characterized in that: The computer device comprises: a memory, a processor, and a program stored in the memory and executable on the processor, wherein the program is configured to implement the steps of the motor control method according to any one of claims 1 to 9.

11. A machine-readable storage medium having instructions stored thereon, the instructions being used to enable a machine to execute the steps of the motor control method according to any one of claims 1 to 9.