Motor control method, electronic device, and storage medium

By performing differential processing and external interference compensation on the position command of the stepper motor, combined with self-immune control and weak magnetic control, the interference problem of open-loop control of the stepper motor is solved, and the motor response speed and working efficiency are improved.

WO2025161817A1PCT designated stage Publication Date: 2025-08-07SHENZHEN CREALITY 3D TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/144506
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-02-02
Filing Date
2024-12-31
Publication Date
2025-08-07

AI Technical Summary

Technical Problem

The open-loop control of stepper motors is easily affected by external interference, resulting in errors that cannot be compensated, step loss and low-frequency resonance occur, and the controller response is not strong enough, the anti-interference ability is weak, and the motor's working efficiency is low.

Method used

By performing differential processing of position instructions and external interference compensation, the initial current value is calculated, and combined with the reference value of active and reactive current, the voltage control amount is calculated to control the rotation of the motor, the self-immune interference controller and the expansion state observer are used for interference compensation, and the magnetic flux is weakened by a weak magnetic controller, and the current loop control is performed.

Benefits of technology

It improves the response speed and anti-interference ability of the motor control system, reduces the back electromotive force, and improves the working efficiency of the motor and the accuracy of the current control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024144506_07082025_PF_FP_ABST
    Figure CN2024144506_07082025_PF_FP_ABST
Patent Text Reader

Abstract

The present application provides a motor control method, an electronic device, and a storage medium. The method comprises: receiving a position instruction sent by a superordinate computer, and performing differential processing and external interference compensation on the position instruction to obtain an initial current value used for controlling rotation of a motor; on the basis of the initial current value, calculating an active current reference value used for generating torque and a reactive current reference value used for generating an excitation magnetic field, wherein the active current reference value and the reactive current reference value are standard current values required by the motor to rotate to a target position; acquiring a raw two-phase current of the motor, and calculating a voltage control quantity of the motor on the basis of the raw two-phase current, the active current reference value, and the reactive current reference value; and on the basis of the voltage control quantity, controlling the motor to rotate.
Need to check novelty before this filing date? Find Prior Art

Description

Motor control method, electronic device and storage medium

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to Chinese Patent Application No. 202410155789.1 filed on February 2, 2024, the contents of which are incorporated herein by reference in their entirety. Technical Field

[0003] The present application relates to the field of motor control technology, and in particular to a motor control method, electronic equipment, and storage medium. Background Art

[0004] In stepper motor control systems, open-loop control is often used to achieve motor position control. As long as the torque and speed of the stepper motor do not exceed performance requirements during operation, an open-loop controller can maintain the stepper motor's position without the need for a feedback system. However, open-loop control of stepper motors is susceptible to external interference. Once errors occur, they cannot be compensated, resulting in lost steps. Furthermore, open-loop control of stepper motors is prone to low-frequency resonance, resulting in high vibration and noise when the motor runs at low speeds. The open loop prevents the controller from making timely adjustments, leading to suboptimal control performance. To further improve stepper motor control accuracy, closed-loop control must be introduced. Compared to open-loop control systems, closed-loop control offers a number of advantages. In a closed-loop control system, if the controlled variable deviates from the specified value, whether due to external faults or internal system deviations, a corresponding control effect is generated to eliminate the deviation. Therefore, closed-loop control can suppress interference, is insensitive to changes in component characteristics, and improves system response.

[0005] In the related art, a closed-loop control method of a position loop and a speed loop is used to control the rotation of the motor. However, in this control method, the response of the controller is not strong enough, the anti-interference ability is weak, and the working efficiency of the motor is low. Summary of the Invention

[0006] In view of this, the present application provides a motor control method, electronic device and storage medium, which can improve the working efficiency of the motor and improve the response speed and anti-interference ability of the motor control system used to control the motor.

[0007] The first aspect of the present application provides a motor control method, comprising: receiving a position instruction sent by a host computer, performing differential processing and external interference compensation on the position instruction, and obtaining an initial current value for controlling the rotation of the motor; calculating an active current reference value for generating torque and a reactive current reference value for generating an excitation magnetic field based on the initial current value, wherein the active current reference value and the reactive current reference value are standard current values ​​required for the motor to rotate to a target position; obtaining the original two-phase current of the motor, and calculating the voltage control amount of the motor based on the original two-phase current, the active current reference value, and the reactive current reference value; and controlling the rotation of the motor based on the voltage control amount.

[0008] Compared with the related art, the embodiments of the present application have at least the following advantages: by performing differential processing on the position command, the position command can be converted into a smooth differential signal, and the differential signal is used for feedforward control of the motor control system, which can improve the response speed of the motor control system; by performing external interference compensation on the position command after differential processing, the anti-interference ability of the motor control system can be improved. In addition, because the excitation magnetic field can weaken the magnetic flux of the motor itself, thereby reducing the motor back electromotive force, the active current reference value and the reactive current reference value used to generate the excitation magnetic field are calculated based on the initial current value, and the motor voltage control value is calculated based on the original two-phase current of the motor, the active current reference value and the reactive current reference value. Finally, the motor rotation is controlled based on the voltage control value. This can make the motor back electromotive force lower at the same speed, that is, the motor can reach a higher speed at the same power supply voltage, thereby improving the working efficiency of the motor.

[0009] In some possible implementations, the differential processing and external interference compensation of the position command to obtain an initial current value for controlling the rotation of the motor includes: inputting the position command into a preset active disturbance rejection controller, and calculating the initial current value based on the output value of the active disturbance rejection controller; wherein the active disturbance rejection controller includes at least a tracking differentiator for differential processing of the position command, and an extended state observer for external interference compensation of the differentiated position command.

[0010] By adopting this technical solution, a method for performing differential processing on position instructions and external interference compensation is provided, which can improve the response speed of the motor control system.

[0011] In some possible implementations, inputting the position command into a preset active disturbance rejection controller and calculating the initial current value based on the output value of the active disturbance rejection controller includes: inputting the position command into the tracking differentiator to obtain a smoothed position command, a smoothed speed command, and a smoothed acceleration command; obtaining characteristic physical parameters of the motor, inputting the characteristic physical parameters into the extended state observer to obtain a position feedback value, a speed feedback value, and an external disturbance feedback value; calculating a first difference between the smoothed position command and the position feedback value, a second difference between the smoothed speed command and the speed feedback value, and a third difference between the smoothed acceleration command and the external disturbance feedback value; and calculating the initial current value based on the first difference, the second difference, and the third difference.

[0012] In some possible implementations, the active disturbance rejection controller further includes a first nonlinear controller, a second nonlinear controller, a first PID controller, and a second PID controller; the calculating the initial current value based on the first difference, the second difference, and the third difference includes: inputting the first difference into the first nonlinear controller to perform nonlinear processing on the first difference, and then inputting the output value of the first nonlinear controller into the first PID controller; inputting the second difference into the second nonlinear controller to perform nonlinear processing on the second difference, and then inputting the output value of the second nonlinear controller into the second PID controller; and calculating the initial current value based on the output value of the first PID controller, the output value of the second PID controller, and the third difference.

[0013] In some possible implementations, the calculation of the active current reference value and the reactive current reference value for generating an excitation magnetic field based on the initial current value includes: inputting the initial current value and the smoothing speed instruction into a preset magnetic field weakening controller, and using the output value of the magnetic field weakening controller as the active current reference value and the reactive current reference value.

[0014] By adopting this technical solution, the rotor magnetic field of the motor itself can be weakened, thereby reducing the motor's back electromotive force and improving the motor's working efficiency.

[0015] In some possible implementations, the voltage control quantity includes a first voltage output value and a second voltage output value; the voltage control quantity of the motor is calculated based on the original two-phase current, the active current reference value and the reactive current reference value, including: obtaining the electrical angle of the motor, and obtaining the first decoupling current and the second decoupling current in the rotating coordinate system based on the electrical angle and the original two-phase current; inputting the active current reference value and the first decoupling current into a preset third PID controller, and using the output value of the third PID controller as the first voltage output value; inputting the reactive current reference value and the second decoupling current into a preset fourth PID controller, and using the output value of the fourth PID controller as the second voltage output value.

[0016] By adopting this technical solution, the current loop control of the motor is realized, making the current control more precise.

[0017] In some possible implementations, before controlling the rotation of the motor according to the voltage control amount, the motor control method also includes: calculating the active voltage reference value of the motor according to the active current reference value, and calculating the reactive voltage reference value of the motor according to the reactive current reference value; calculating the DC component of the voltage used to drive the motor according to the active voltage reference value and the first voltage output value, and calculating the AC component of the voltage used to drive the motor according to the reactive voltage reference value and the second voltage output value; controlling the rotation of the motor according to the voltage control amount includes: controlling the rotation of the motor according to the DC voltage component and the AC voltage component.

[0018] In some possible implementations, before controlling the rotation of the motor according to the voltage DC component and the voltage AC component, the motor control method further includes: inputting the voltage DC component into a preset coordinate converter to obtain a first voltage in a stationary coordinate system; inputting the voltage AC component into the coordinate converter to obtain a second voltage in a stationary coordinate system; inputting the first voltage and the second voltage into a preset space vector pulse width modulator respectively to obtain a first PWM wave corresponding to the first voltage and a second PWM wave corresponding to the second voltage; controlling the rotation of the motor according to the voltage DC component and the voltage AC component includes: controlling the rotation of the motor according to the first PWM wave and the second PWM wave.

[0019] A second aspect of the present application discloses an electronic device, which includes a processor and a memory, wherein the memory is used to store instructions, and the processor is used to call the instructions in the memory so that the electronic device executes the above-mentioned motor control method.

[0020] A third aspect of the present application discloses a storage medium comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned motor control method.

[0021] It can be understood that the electronic device of the second aspect and the storage medium of the third aspect provided above correspond to the method of the first aspect. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects of the corresponding methods provided above and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying any creative work.

[0023] FIG1 is a flow chart of a motor control method provided by one or more embodiments of the present application.

[0024] FIG2 is a flow chart of a motor control method provided by one or more embodiments of the present application.

[0025] FIG3 is a schematic diagram of functional modules of a motor control system provided by one or more embodiments of the present application.

[0026] FIG4 is a schematic diagram of the hardware structure of an electronic device according to one or more embodiments of the present application. DETAILED DESCRIPTION

[0027] In order to more clearly understand the above-mentioned objectives, features and advantages of the present application, the present application is described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features therein can be combined with each other in the absence of conflict.

[0028] In the following description, many specific details are set forth to facilitate a full understanding of the present application. The described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.

[0029] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application pertains. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.

[0030] It should be further noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a list of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.

[0031] In this application, "at least one" means one or more, and "more than one" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. A and B can be singular or plural.

[0032] In the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0033] To facilitate understanding, some illustrations of concepts related to the embodiments of the present application are given for reference.

[0034] 3D printing equipment, also known as three-dimensional printers or stereo printers, is a rapid prototyping process that typically uses digital printing technology to create materials. 3D printing equipment is often used to create models or parts in fields such as mold manufacturing and industrial design.

[0035] A stepper motor, also known as a pulse motor, converts electrical pulse signals into corresponding angular or linear displacements. Each pulse causes the rotor to rotate one degree or advance one step. The output angular or linear displacement is proportional to the number of pulses input, and the speed is proportional to the pulse frequency.

[0036] Please refer to FIG1 , which is a flow chart of a motor control method provided in an embodiment of the present application. This embodiment is applied to a motor control system. The method includes the following steps:

[0037] Step 101: Receive a position command sent by a host computer, perform differential processing and external interference compensation on the position command, and obtain an initial current value for controlling the rotation of the motor.

[0038] In some embodiments, the position instruction includes a pulse instruction, a protocol instruction, etc. This embodiment does not specifically limit the type of the position instruction.

[0039] In some embodiments, the motor control system includes an active disturbance rejection controller, and the initial current value is obtained in the following manner: a position command is input into the active disturbance rejection controller, and the initial current value is calculated based on the output value of the active disturbance rejection controller; wherein the active disturbance rejection controller includes at least a tracking differentiator for performing differential processing on the position command, and an extended state observer for performing external interference compensation on the position command after differential processing.

[0040] Specifically, the position command is input into a tracking differentiator to obtain a smoothed position command, a smoothed velocity command, and a smoothed acceleration command; characteristic physical parameters of the motor are obtained and input into an extended state observer to obtain a position feedback value, a velocity feedback value, and an external disturbance feedback value; a first difference between the smoothed position command and the position feedback value, a second difference between the smoothed velocity command and the velocity feedback value, and a third difference between the smoothed acceleration command and the external disturbance feedback value are calculated; and an initial current value is calculated based on the first, second, and third differences. It is worth noting that the smoothed commands in this embodiment are all at least first-order differentiable commands.

[0041] More specifically, the active disturbance rejection controller of this embodiment also includes a first nonlinear controller, a second nonlinear controller, a first PID controller and a second PID controller; calculating the initial current value based on the first difference, the second difference and the third difference includes: inputting the first difference into the first nonlinear controller to perform nonlinear processing on the first difference, and then inputting the output value of the first nonlinear controller into the first PID controller; inputting the second difference into the second nonlinear controller to perform nonlinear processing on the second difference, and then inputting the output value of the second nonlinear controller into the second PID controller; and calculating the initial current value based on the output value of the first PID controller, the output value of the second PID controller and the third difference.

[0042] The specific structure of the active disturbance rejection controller of this embodiment and how to obtain the initial current value are described in detail in subsequent examples. To avoid repetition, they are not described again here.

[0043] Step 102: Calculate an active current reference value for generating torque and a reactive current reference value for generating an excitation magnetic field based on the initial current value, wherein the active current reference value and the reactive current reference value are standard current values ​​required for the motor to rotate to a target position.

[0044] In some embodiments, the motor control system further includes a flux weakening controller, which inputs an initial current value and a smoothed speed command into a preset flux weakening controller so as to use an output value of the flux weakening controller as an active current reference value and a reactive current reference value.

[0045] The specific functions of the magnetic field weakening controller of this embodiment and how to obtain the active current reference value and the reactive current reference value are described in detail in subsequent examples. To avoid repetition, they are not described again here.

[0046] Step 103: Obtain the original two-phase currents of the motor, and calculate the voltage control variable of the motor according to the original two-phase currents, the active current reference value, and the reactive current reference value.

[0047] In some embodiments, the voltage control quantity includes a first voltage output value and a second voltage output value in a rotating coordinate system; the voltage control quantity of the motor is calculated based on the original two-phase current, the active current reference value, and the reactive current reference value, including: obtaining the electrical angle of the motor, and obtaining the first decoupling current and the second decoupling current in the rotating coordinate system based on the electrical angle and the original two-phase current; inputting the active current reference value and the first decoupling current into a preset third PID controller, and using the output value of the third PID controller as the first voltage output value; inputting the reactive current reference value and the second decoupling current into a preset fourth PID controller, and using the output value of the fourth PID controller as the second voltage output value.

[0048] The calculation of the first voltage output value and the second voltage output value in this embodiment is described in detail in the subsequent examples, and will not be repeated here to avoid repetition.

[0049] Step 104: Control the motor rotation according to the voltage control amount.

[0050] In some embodiments, before controlling the rotation of the motor according to the voltage control variable, the method further includes: calculating an active voltage reference value of the motor according to the active current reference value, and calculating a reactive voltage reference value of the motor according to the reactive current reference value; calculating a DC component of a voltage used to drive the motor according to the active voltage reference value and the first voltage output value, and calculating an AC component of a voltage used to drive the motor according to the reactive voltage reference value and the second voltage output value; and controlling the rotation of the motor according to the voltage control variable includes controlling the rotation of the motor according to the DC voltage component and the AC voltage component. Driving the motor to rotate by using the DC voltage component and the AC voltage component can compensate for the back electromotive force of the motor, thereby improving the operating efficiency of the motor.

[0051] Compared with the related art, the embodiments of the present application have at least the following advantages: by performing differential processing on the position command, the position command can be converted into a smooth differential signal, and the differential signal is used for feedforward control of the motor control system, which can improve the response speed of the motor control system; by performing external interference compensation on the position command after differential processing, the anti-interference ability of the motor control system can be improved. In addition, because the excitation magnetic field can weaken the magnetic flux of the motor itself, thereby reducing the motor back electromotive force, the active current reference value and the reactive current reference value used to generate the excitation magnetic field are calculated based on the initial current value, and the motor voltage control value is calculated based on the original two-phase current of the motor, the active current reference value and the reactive current reference value. Finally, the motor rotation is controlled based on the voltage control value. This can make the motor back electromotive force lower at the same speed, that is, the motor can reach a higher speed at the same power supply voltage, thereby improving the working efficiency of the motor.

[0052] Please refer to Figure 2, which is a flow chart of the motor control method provided in an embodiment of the present application. This embodiment is a further improvement based on the previous embodiment. The main improvement is that: in this embodiment, FOC vector control is also performed on the DC component of the voltage and the AC component of the voltage, thereby further improving the working efficiency of the motor and reducing the heat generation of the motor.

[0053] This embodiment is applied to the motor control system of the aforementioned embodiment, and includes the following steps:

[0054] Step 201: Input the position command into the tracking differentiator to obtain a smooth position command, a smooth velocity command, and a smooth acceleration command.

[0055] Step 202: Acquire characteristic physical parameters of the motor, input the characteristic physical parameters into the extended state observer, and obtain position feedback values, speed feedback values, and external disturbance feedback values.

[0056] Step 203: Calculate a first difference between the smoothed position command and the position feedback value, a second difference between the smoothed velocity command and the velocity feedback value, and a third difference between the smoothed acceleration command and the external disturbance feedback value.

[0057] Step 204: Input the first difference into a first nonlinear controller to perform nonlinear processing on the first difference, and then input the output value of the first nonlinear controller into a first PID controller.

[0058] Step 205: Input the second difference into the second nonlinear controller to perform nonlinear processing on the second difference, and then input the output value of the second nonlinear controller into the second PID controller.

[0059] Step 206: Calculate an initial current value according to the output value of the first PID controller, the output value of the second PID controller, and the third difference.

[0060] Step 207: Input the initial current value and the smoothed speed command into a preset magnetic field weakening controller, and use the output value of the magnetic field weakening controller as an active current reference value and a reactive current reference value.

[0061] Step 208: Acquire the electrical angle of the motor, and obtain a first decoupling current and a second decoupling current in the rotating coordinate system based on the electrical angle and the original two-phase current.

[0062] Step 209: Input the active current reference value and the first decoupling current into a preset third PID controller, and use the output value of the third PID controller as the first voltage output value; input the reactive current reference value and the second decoupling current into a preset fourth PID controller, and use the output value of the fourth PID controller as the second voltage output value.

[0063] Step 210: Calculate the active voltage reference value of the motor according to the active current reference value, and calculate the reactive voltage reference value of the motor according to the reactive current reference value.

[0064] Step 211: Calculate a DC component of a voltage for driving the motor according to the active voltage reference value and the first voltage output value, and calculate an AC component of a voltage for driving the motor according to the reactive voltage reference value and the second voltage output value.

[0065] Steps 201 to 211 of this embodiment are similar to steps 101 to 103 of the aforementioned embodiment, and are not described again here to avoid repetition.

[0066] Step 212: Inputting the DC component of the voltage into a preset coordinate converter to obtain a first voltage in a stationary coordinate system; inputting the AC component of the voltage into the coordinate converter to obtain a second voltage in the stationary coordinate system.

[0067] Step 213: Input the first voltage and the second voltage into a preset space vector pulse width modulator respectively to obtain a first PWM wave corresponding to the first voltage and a second PWM wave corresponding to the second voltage.

[0068] Step 214: Control the motor to rotate according to the first PWM wave and the second PWM wave.

[0069] For ease of understanding, the motor control method of this embodiment is specifically described below with reference to FIG3 :

[0070] Please refer to Figure 3, which is a schematic diagram of the functional modules of the motor control system provided in the embodiment of the present application. The workflow of the motor control system can be divided into the following steps:

[0071] 1. The tracking differentiator 10 receives the position command v sent by the host computer and outputs a smoothed position command, a smoothed velocity command, and a smoothed acceleration command. Specifically, the tracking differentiator 10 in this embodiment can obtain the smoothed position command, the smoothed velocity command, and the smoothed acceleration command using the following formulas:

[0072] Among them, v1 is the smooth position command, which is the tracking signal of the position command v, that is, the output of the tracking differentiator 10 after filtering the position command v; v2 is the smooth velocity command, which is the ideal derivative of v1; v3 is the smooth acceleration command, which is the ideal derivative of v2; h is the execution period of the tracking differentiator 10; r is the velocity parameter of the tracking differentiator 10, which is used to adjust the tracking speed; h0 is the filtering factor of the fhan function; fhan is the fastest control tracking function in the active disturbance rejection.

[0073] Since the position command v may contain noise, directly differentiating the position command v will amplify high-frequency noise and even drown out useful signals. By inputting the position command v into the tracking differentiator 10, the tracking differentiator 10 can filter out the noise of the position command v and then extract its differential signal, thereby improving the reliability of the motor control system.

[0074] 2. Extended State Observer (LESO) 20 estimates the motor's position feedback, velocity feedback, and external disturbance feedback. Specifically, because LESO 20 can predict and estimate unknown partial system states based on known partial states and system inputs, the motor control system obtains characteristic physical quantities of the motor, namely its output voltage and electrical angle, and inputs these quantities into LESO 20 to obtain position feedback z1, velocity feedback z2, and external disturbance feedback z3.

[0075] In some embodiments, the position feedback value z1, the speed feedback value z2, and the external disturbance feedback value z3 can be calculated using the following formula: Where, e is the system input, y is the system output (position), fe is the first nonlinear processing of e, fe1 is the second nonlinear processing of e, fal is the nonlinear function, h is the sampling period, z1 is the position output of the extended state observer, z2 is the velocity output of the extended state observer, z3 is the interference output of the extended state observer, β 01 is the gain of the extended state observer z1, β 02 is the gain of the extended state observer z2 term, β 03 is the gain of the z3 term of the extended state observer.

[0076] 3. The motor control system inputs the first difference between the smoothed position command v1 and the position feedback value z1 into the first nonlinear controller 30, and the second difference between the smoothed velocity command v2 and the velocity feedback value z2 into the second nonlinear controller 40. The first nonlinear controller 30 and the second nonlinear controller 40 perform nonlinear processing on the first and second differences, respectively. The nonlinearly processed first difference is then input into the first PID controller 50, and the nonlinearly processed second difference is then input into the second PID controller 60, thereby obtaining nonlinear first and second PID controllers 50 and 60. Because conventional linear PID controllers respond linearly at both low and high motor speeds, a set of PID parameters may respond well at low motor speeds but experience jitter at low motor speeds. By obtaining nonlinear first and second PID controllers 50 and 60, the nonlinear first and second PID controllers 50 and 60 can handle the nonlinear response of the motor control system, thereby controlling the PID parameters to be larger at low motor speeds and smaller at low motor speeds, reducing jitter and making the PID parameters suitable for both low and high motor speeds, thereby improving the versatility of the motor control system.

[0077] 4. The motor control system filters the outputs of the first PID controller 50 and the second PID controller 60 through a filter, adds the feedforward of the acceleration instruction v3, and subtracts the external interference feedback value z3 to obtain the initial current value U.

[0078] It can be understood that the output values ​​of the first PID controller 50 and the second PID controller 60 are current values. Therefore, when performing addition and subtraction operations on the outputs of the first PID controller 50 and the second PID controller 60 and the smooth acceleration instruction v3 and the external interference feedback value z3, it is necessary to first convert the units of the smooth acceleration instruction v3 and the external interference feedback value z3 into units of current.

[0079] 5. The motor control system inputs the initial current value U and the smoothed speed command v2 into the field-weakening controller 70, thereby obtaining the active and reactive current reference values ​​required for field-weakening under the smoothed speed command v2. This allows the motor to generate an excitation magnetic field through current flow, which weakens the motor's own flux linkage and thus reduces the motor's back EMF. Consequently, at the same speed, the motor generates a lower back EMF, allowing it to reach a higher speed at the same power supply voltage, thereby improving its operating efficiency.

[0080] In some embodiments, the magnetic field weakening controller 70 may calculate the active current reference value and the reactive current reference value using the following formula:

[0081] Wherein, idref is the active current reference value, iqref is the reactive current reference value; ω base is the flux weakening speed boundary, and flux weakening control is entered only when the speed exceeds this limit; ω is the current angular velocity of the motor; is the back electromotive force coefficient of the motor; L is the motor inductance; I max The maximum current that the weak magnetic controller can withstand; iqref in It is the output of the upper level controller.

[0082] 6. The motor control system obtains the electrical angle of the motor, and then controls the original two-phase current of the motor to filter the electrical angle θ e The Park transform is performed on the filtered original two-phase current to obtain the first decoupling current id and the second decoupling current iq in the rotating coordinate system. By converting the original two-phase currents iα and iβ of the motor into the two-phase decoupled first decoupling current id and the second decoupling current iq, the first decoupling current id only changes the excitation magnitude (does not generate torque, and this part of the current loop will generate relatively large heat), while the second decoupling current iq directly participates in generating torque. This avoids wasting energy in the excitation part that does not generate torque, and all energy is used for the second decoupling current iq that generates torque, thereby minimizing the heating of the motor and improving the efficiency of the motor.

[0083] In some embodiments, the electrical angle θ e The calculation formula can be: Among them, encoder is the current position pulse read back by the encoder; encoder max-bit is the maximum resolution of the encoder; p is the number of pole pairs of the motor.

[0084] 7. The motor control system inputs the reactive current reference value idref and the first decoupling current id obtained in the above steps into the third PID controller 80 to obtain a first voltage output value idout; and inputs the active current reference value iqref and the second decoupling current iq into the fourth PID controller 90 to obtain a second voltage output value iqout. In this way, the current loop control of the motor is realized, so that the motor current can accurately track the reactive current reference value idref and the active current reference value iqref, thereby improving the accuracy of the motor current control.

[0085] In some embodiments, the third PID controller 80 and the fourth PID controller 90 calculate the first voltage output value idout and the second voltage output value iqout using the following formula:

[0086] Wherein, u(k) is the output value of the third PID controller 80 and the fourth PID controller 90, i.e., idout or iqout; e(k) is the error input of the Kth cycle, i.e., idref-id for the third PID controller 80 and iqref-iq for the fourth controller PID90; K p is the proportional term control parameter; K i is the integral term control parameter; K d is the differential term control parameter.

[0087] 8. Calculate the active voltage reference value and reactive voltage reference value of the motor based on the active current reference value idref and the reactive current reference value iqref of the motor. Then, add the active voltage reference value and the first voltage output value to obtain the DC component ud of the voltage used to drive the motor. Add the reactive voltage reference value and the second voltage output value to obtain the AC component uq of the voltage used to drive the motor.

[0088] In some embodiments, the voltage DC component ud and the voltage AC component uq can be calculated using the following formulas:

[0089] Wherein, ud is the DC component of the voltage, uq is the AC component of the voltage; R is the motor phase resistance, L d is the motor d-axis inductance, L q is the motor q-axis inductance, i d is the d-axis current, i q is the q-axis current, ω e is the motor electrical speed, is the motor back electromotive force coefficient.

[0090] 9. The voltage DC component ud, voltage AC component uq and electrical angle θ e After inputting the coordinate converter IPark, the first voltage ua and the second voltage ub in the stationary coordinate system are obtained. These first and second voltages ua and ub are then input into the space vector pulse width modulator 100, which converts the first voltage ua into a first PWM wave and the second voltage ub into a second PWM wave. This method enables the motor to be driven.

[0091] Compared with the related art, the embodiments of the present application have at least the following advantages: by performing differential processing on the position command, the position command can be converted into a smooth differential signal, and the differential signal is used for feedforward control of the motor control system, which can improve the response speed of the motor control system; by performing external interference compensation on the position command after differential processing, the anti-interference ability of the motor control system can be improved. In addition, because the excitation magnetic field can weaken the magnetic flux of the motor itself, thereby reducing the motor back electromotive force, the active current reference value and the reactive current reference value used to generate the excitation magnetic field are calculated based on the initial current value, and the motor voltage control value is calculated based on the original two-phase current of the motor, the active current reference value and the reactive current reference value. Finally, the motor rotation is controlled based on the voltage control value. This can make the motor back electromotive force lower at the same speed, that is, the motor can reach a higher speed at the same power supply voltage, thereby improving the working efficiency of the motor.

[0092] Please refer to Figure 4, which is a schematic diagram of the hardware structure of an electronic device 1000 provided in an embodiment of the present application. As shown in Figure 4, the electronic device 1000 may include a processor 1001 and a memory 1002. The memory 1002 is used to store one or more computer programs 1003. The one or more computer programs 1003 are configured to be executed by the processor 1001. The one or more computer programs 1003 include instructions, and the above instructions can be used to implement the above-mentioned motor control method in the electronic device 1000.

[0093] It is understood that the structure shown in this embodiment does not constitute a specific limitation on the electronic device 1000. In other embodiments, the electronic device 1000 may include more or fewer components than shown, or combine or separate some components, or arrange the components differently.

[0094] The processor 1001 may include one or more processing units. For example, the processor 1001 may include an application processor (AP), a modem, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors.

[0095] Processor 1001 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in processor 1001 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 1001. If processor 1001 needs to use the same instruction or data again, it can directly access it from this memory. This avoids duplicate accesses, reduces the waiting time of processor 1001, and thus improves system efficiency.

[0096] In some embodiments, the processor 1001 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a SIM interface, and / or a USB interface.

[0097] In some embodiments, memory 1002 may include high-speed random access memory and may also include non-volatile memory, such as a hard disk, memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage device.

[0098] This embodiment further provides a storage medium storing computer instructions. When the instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the motor control method in the above-mentioned embodiment.

[0099] Among them, the electronic device and computer storage medium provided in this embodiment are used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.

[0100] In practical applications, the above functions can be distributed to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0101] In the several embodiments provided in this application, the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are schematic. For example, the division of the modules or units is a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0102] The units described as separate components may or may not be physically separate, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0103] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0104] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0105] The above description is only a specific implementation method of the present application, but the protection scope of the present application is not limited thereto. Any changes or replacements within the technical scope disclosed in the present application should be included in the protection scope of the present application.

Claims

1. A motor control method, characterized in that: include: Receive the position command sent by the host computer, perform differential processing and external interference compensation on the position command, and obtain the initial current value for controlling the rotation of the motor; Calculating an active current reference value for generating torque and a reactive current reference value for generating an excitation magnetic field according to the initial current value, wherein the active current reference value and the reactive current reference value are standard current values required for the motor to rotate to a target position; Obtaining the original two-phase currents of the motor, and calculating the voltage control amount of the motor according to the original two-phase currents, the active current reference value, and the reactive current reference value; The rotation of the motor is controlled according to the voltage control amount.

2. The motor control method according to claim 1, wherein: The differential processing and external interference compensation of the position command are performed to obtain an initial current value for controlling the rotation of the motor, including: Inputting the position command into a preset active disturbance rejection controller, and calculating the initial current value according to an output value of the active disturbance rejection controller; The active disturbance rejection controller at least includes a tracking differentiator for performing differentiation processing on the position command, and an extended state observer for performing external disturbance compensation on the position command after differentiation processing.

3. The motor control method according to claim 2, wherein: Inputting the position command into a preset active disturbance rejection controller and calculating the initial current value according to an output value of the active disturbance rejection controller includes: Inputting the position command into the tracking differentiator to obtain a smooth position command, a smooth velocity command, and a smooth acceleration command; Acquiring characteristic physical parameters of the motor, inputting the characteristic physical parameters into the extended state observer, and obtaining a position feedback value, a speed feedback value, and an external disturbance feedback value; calculating a first difference between the smoothed position command and the position feedback value, a second difference between the smoothed velocity command and the velocity feedback value, and a third difference between the smoothed acceleration command and the external disturbance feedback value; The initial current value is calculated according to the first difference, the second difference, and the third difference.

4. The motor control method according to claim 3, wherein: The active disturbance rejection controller further includes a first nonlinear controller, a second nonlinear controller, a first PID controller and a second PID controller; The calculating the initial current value according to the first difference, the second difference, and the third difference includes: inputting the first difference into the first nonlinear controller to perform nonlinear processing on the first difference, and then inputting the output value of the first nonlinear controller into the first PID controller; inputting the second difference into the second nonlinear controller to perform nonlinear processing on the second difference, and then inputting the output value of the second nonlinear controller into the second PID controller; The initial current value is calculated according to the output value of the first PID controller, the output value of the second PID controller, and the third difference.

5. The motor control method according to claim 3, wherein: The calculating, based on the initial current value, an active current reference value for generating torque and a reactive current reference value for generating an excitation magnetic field comprises: The initial current value and the smoothing speed instruction are input into a preset magnetic field weakening controller, and the output value of the magnetic field weakening controller is used as the active current reference value and the reactive current reference value.

6. The motor control method according to claim 1, wherein: The voltage control amount includes a first voltage output value and a second voltage output value in a rotating coordinate system; The calculating the voltage control amount of the motor according to the original two-phase current, the active current reference value, and the reactive current reference value includes: Acquire the electrical angle of the motor, and obtain a first decoupling current and a second decoupling current in a rotating coordinate system according to the electrical angle and the original two-phase current; The active current reference value and the first decoupling current are input into a preset third PID controller, and the output value of the third PID controller is used as the first voltage output value; the reactive current reference value and the second decoupling current are input into a preset fourth PID controller, and the output value of the fourth PID controller is used as the second voltage output value.

7. The motor control method according to claim 6, wherein: Before controlling the rotation of the motor according to the voltage control amount, the motor control method further includes: Calculating an active voltage reference value of the motor according to the active current reference value, and calculating a reactive voltage reference value of the motor according to the reactive current reference value; Calculating a DC component of a voltage for driving a motor according to the active voltage reference value and the first voltage output value, and calculating an AC component of a voltage for driving a motor according to the reactive voltage reference value and the second voltage output value; The step of controlling the rotation of the motor according to the voltage control amount includes: The rotation of the motor is controlled according to the DC voltage component and the AC voltage component.

8. The motor control method according to claim 7, wherein: Before controlling the rotation of the motor according to the DC voltage component and the AC voltage component, the motor control method further includes: Inputting the DC component of the voltage into a preset coordinate converter to obtain a first voltage in a stationary coordinate system; inputting the AC component of the voltage into the coordinate converter to obtain a second voltage in a stationary coordinate system; Inputting the first voltage and the second voltage into a preset space vector pulse width modulator respectively to obtain a first PWM wave corresponding to the first voltage and a second PWM wave corresponding to the second voltage; The controlling the rotation of the motor according to the DC voltage component and the AC voltage component includes: The motor is controlled to rotate according to the first PWM wave and the second PWM wave.

9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program executable by the processor, wherein: The processor performs: Receive the position command sent by the host computer, perform differential processing and external interference compensation on the position command, and obtain the initial current value for controlling the rotation of the motor; Calculating an active current reference value for generating torque and a reactive current reference value for generating an excitation magnetic field according to the initial current value, wherein the active current reference value and the reactive current reference value are standard current values required for the motor to rotate to a target position; Obtaining the original two-phase currents of the motor, and calculating the voltage control amount of the motor according to the original two-phase currents, the active current reference value, and the reactive current reference value; The rotation of the motor is controlled according to the voltage control amount.

10. The electronic device according to claim 9, wherein The differential processing and external interference compensation of the position command are performed to obtain an initial current value for controlling the rotation of the motor, including: Inputting the position command into a preset active disturbance rejection controller, and calculating the initial current value according to an output value of the active disturbance rejection controller; The active disturbance rejection controller at least includes a tracking differentiator for performing differentiation processing on the position command, and an extended state observer for performing external disturbance compensation on the position command after differentiation processing.

11. The electronic device according to claim 10, wherein: Inputting the position command into a preset active disturbance rejection controller and calculating the initial current value according to an output value of the active disturbance rejection controller includes: Inputting the position command into the tracking differentiator to obtain a smooth position command, a smooth velocity command, and a smooth acceleration command; Acquiring characteristic physical parameters of the motor, inputting the characteristic physical parameters into the extended state observer, and obtaining a position feedback value, a speed feedback value, and an external disturbance feedback value; calculating a first difference between the smoothed position command and the position feedback value, a second difference between the smoothed velocity command and the velocity feedback value, and a third difference between the smoothed acceleration command and the external disturbance feedback value; The initial current value is calculated according to the first difference, the second difference, and the third difference.

12. The electronic device according to claim 11, wherein: The active disturbance rejection controller further includes a first nonlinear controller, a second nonlinear controller, a first PID controller and a second PID controller; The calculating the initial current value according to the first difference, the second difference, and the third difference includes: inputting the first difference into the first nonlinear controller to perform nonlinear processing on the first difference, and then inputting the output value of the first nonlinear controller into the first PID controller; inputting the second difference into the second nonlinear controller to perform nonlinear processing on the second difference, and then inputting the output value of the second nonlinear controller into the second PID controller; The initial current value is calculated according to the output value of the first PID controller, the output value of the second PID controller, and the third difference.

13. The electronic device according to claim 11, wherein: The calculating, based on the initial current value, an active current reference value for generating torque and a reactive current reference value for generating an excitation magnetic field comprises: The initial current value and the smoothing speed instruction are input into a preset magnetic field weakening controller, and the output value of the magnetic field weakening controller is used as the active current reference value and the reactive current reference value.

14. The electronic device according to claim 9, wherein: The voltage control amount includes a first voltage output value and a second voltage output value in a rotating coordinate system; The calculating the voltage control amount of the motor according to the original two-phase current, the active current reference value, and the reactive current reference value includes: Acquire the electrical angle of the motor, and obtain a first decoupling current and a second decoupling current in a rotating coordinate system according to the electrical angle and the original two-phase current; The active current reference value and the first decoupling current are input into a preset third PID controller, and the output value of the third PID controller is used as the first voltage output value; the reactive current reference value and the second decoupling current are input into a preset fourth PID controller, and the output value of the fourth PID controller is used as the second voltage output value.

15. The electronic device according to claim 14, characterized in that Before controlling the rotation of the motor according to the voltage control amount, the motor control method further includes: Calculating an active voltage reference value of the motor according to the active current reference value, and calculating a reactive voltage reference value of the motor according to the reactive current reference value; Calculating a DC component of a voltage for driving a motor according to the active voltage reference value and the first voltage output value, and calculating an AC component of a voltage for driving a motor according to the reactive voltage reference value and the second voltage output value; The step of controlling the rotation of the motor according to the voltage control amount includes: The rotation of the motor is controlled according to the DC voltage component and the AC voltage component.

16. The electronic device according to claim 15, characterized in that Before controlling the rotation of the motor according to the DC voltage component and the AC voltage component, the motor control method further includes: Inputting the DC component of the voltage into a preset coordinate converter to obtain a first voltage in a stationary coordinate system; inputting the AC component of the voltage into the coordinate converter to obtain a second voltage in a stationary coordinate system; Inputting the first voltage and the second voltage into a preset space vector pulse width modulator respectively to obtain a first PWM wave corresponding to the first voltage and a second PWM wave corresponding to the second voltage; The controlling the rotation of the motor according to the DC voltage component and the AC voltage component includes: The motor is controlled to rotate according to the first PWM wave and the second PWM wave.

17. A storage medium storing a computer program, characterized in that: The computer program is executed by a processor: Receive the position command sent by the host computer, perform differential processing and external interference compensation on the position command, and obtain the initial current value for controlling the rotation of the motor; Calculating an active current reference value for generating torque and a reactive current reference value for generating an excitation magnetic field according to the initial current value, wherein the active current reference value and the reactive current reference value are standard current values required for the motor to rotate to a target position; Obtaining the original two-phase currents of the motor, and calculating the voltage control amount of the motor according to the original two-phase currents, the active current reference value, and the reactive current reference value; The rotation of the motor is controlled according to the voltage control amount.

18. The storage medium according to claim 17, wherein The differential processing and external interference compensation of the position command are performed to obtain an initial current value for controlling the rotation of the motor, including: Inputting the position command into a preset active disturbance rejection controller, and calculating the initial current value according to an output value of the active disturbance rejection controller; The active disturbance rejection controller at least includes a tracking differentiator for performing differentiation processing on the position command, and an extended state observer for performing external disturbance compensation on the position command after differentiation processing.

19. The storage medium according to claim 18, wherein Inputting the position command into a preset active disturbance rejection controller and calculating the initial current value according to an output value of the active disturbance rejection controller includes: Inputting the position command into the tracking differentiator to obtain a smooth position command, a smooth velocity command, and a smooth acceleration command; Acquiring characteristic physical parameters of the motor, inputting the characteristic physical parameters into the extended state observer, and obtaining a position feedback value, a speed feedback value, and an external disturbance feedback value; calculating a first difference between the smoothed position command and the position feedback value, a second difference between the smoothed velocity command and the velocity feedback value, and a third difference between the smoothed acceleration command and the external disturbance feedback value; The initial current value is calculated according to the first difference, the second difference, and the third difference.

20. The storage medium according to claim 19, wherein The active disturbance rejection controller further includes a first nonlinear controller, a second nonlinear controller, a first PID controller and a second PID controller; The calculating the initial current value according to the first difference, the second difference, and the third difference includes: inputting the first difference into the first nonlinear controller to perform nonlinear processing on the first difference, and then inputting the output value of the first nonlinear controller into the first PID controller; inputting the second difference into the second nonlinear controller to perform nonlinear processing on the second difference, and then inputting the output value of the second nonlinear controller into the second PID controller; The initial current value is calculated according to the output value of the first PID controller, the output value of the second PID controller, and the third difference.

Citation Information

Patent Citations

  • ADRC servo motor control method based on RBF neural network optimization

    CN111711407A

  • Active-disturbance-rejection position servo control method for permanent magnet synchronous motor

    CN113364377A

  • Synchronous motor robust control device and method based on switching structure and controller

    CN113809965A

  • Method and system for controlling rotating speed of position-sensorless ultra-high-speed permanent magnet synchronous motor based on active disturbance rejection

    CN115001334A

  • Motor control method, electronic equipment and storage medium

    CN117978018A