Stepping motor current control method and device
By controlling the four switches of the H-bridge motor drive circuit, the attenuation mode where the load average current and the set current are completely equal in the PWM period, solving the problem of angle error of stepper motors and achieving high accuracy and high efficiency current control.
Patent Information
- Application Number
- CN202411315885.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-09-20
AI Technical Summary
In the H-bridge motor driving circuit, there is an error between the actual average current and the set current during the PWM period, resulting in an error in the stepper motor angle.
By controlling the four switches of the H bridge, the load average current and the set current are completely equal to the attenuation mode in one PWM period, including charging-slow attenuation-fast attenuation-slow attenuation-slow attenuation sequence, and at zero crossing and step-changing Properly handle strategies during the process.
The load average current and set current are achieved in PWM period are completely equal, reducing the error in the angular position of the stepper motor, and taking into account both accuracy and efficiency.
Smart Images

Figure CN119448836A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of integrated circuits, and in particular relates to a stepper motor current control method and device. Background Art
[0002] In the H-bridge motor drive circuit, the four power MOS tubes (101 to 104) are located at the four corners of the letter "H". Figure 1 As shown. 101 and 102 are high-side power tubes, and 103 and 104 are low-side power tubes. When applied, the output nodes of the two half-bridge structures are connected to one end of the inductor respectively. When working, the switches of the four power tubes are controlled by the pre-stage driver, thereby controlling the working state of the motor.
[0003] When the power tubes 101 and 104 are turned on, the H-bridge motor is in a charging state, such as Figure 1 When the H-bridge driving current reaches the required value, the power tubes 101 and 104 are turned off. Due to the inductor characteristic, the current continues to flow in the original direction. At this time, there are two freewheeling modes:
[0004] The first method is to close the upper tubes 201 and 202 and open the lower tubes 203 and 204. Figure 2 As shown by the dashed arrow 205. In this freewheeling mode, the current is small, and the attenuation slope of the voltage difference across the inductor is small, which is a slow attenuation mode.
[0005] The second method is to close the upper tube 201 and the lower tube 204, and open the upper tube 202 and the lower tube 203, such as Figure 2 As shown by the dashed arrow 206. This freewheeling mode has a large current, and the attenuation slope of the voltage difference across the inductor is large, which is a fast attenuation mode.
[0006] The relationship between current and fast / slow decay described above is as follows Figure 3 As shown. Take one cycle of H-bridge driven PWM as an example, it includes three stages: charging, fast decay and slow decay, and the cycle time is 300. Among them, the time 301 is the charging stage, the power tubes 101 and 104 are turned on, and the current rises. When the current reaches the target value, it enters the fast decay stage, the upper tube 101 and the lower tube 104 are turned off, the upper tube 102 and the lower tube 103 are turned on, and the current decays faster, which lasts for 302 times. After that, the time 303 is the slow decay stage, the upper tubes 101 and 102 are turned off, the lower tubes 103 and 104 are turned on, and the current decays slower. This mode with both fast decay and slow decay stages is called a mixed decay mode. In addition, there are also two other modes: charging-fast decay mode and charging-slow decay mode. However, as Figure 2 As shown in Figure 1, there is an error between the actual average current ① and the set target current ② within one PWM cycle.
[0007] Fast decay and slow decay modes have their own characteristics. Fast decay can make the current decay as quickly as possible and quickly reach the target current, but at the same time the ripple generated is larger; slow decay current is relatively stable, and the motor operation is more stable. The mixed decay mode can effectively combine the advantages of the two and make the actual current average value closer to the set current. Summary of the invention
[0008] In view of the above-mentioned deficiencies, the present invention provides a decay mode capable of making the actual current equal to the set current, reducing the motor angle error, and proposes a circuit structure for implementing the solution.
[0009] The technical solution of the present invention is:
[0010] A stepper motor current control method is used for an H-bridge motor drive circuit, wherein four switches of the H-bridge are defined as a first switch, a second switch, a third switch, and a fourth switch, wherein the first switch and the second switch are high-side power tubes, and the third switch and the fourth switch are low-side power tubes. The four switches control the working state of the motor under the control of a drive signal. The method is characterized in that within a PWM cycle, the four switches of the H-bridge are controlled so that the average load current is equal to the set current. In a normal working mode, the control method includes:
[0011] Turn on the first switch and the fourth switch to start the charging phase of the motor, the duration is t1, and the current value after the charging phase is A1, A1 is the set upper limit of the current value;
[0012] Turn on the third switch and the fourth switch to enter the first slow decay stage, which lasts for t2;
[0013] Turn on the second switch and the third switch to enter the first fast decay stage, the duration is t3, after the first fast decay stage ends, the current value is A2, A2 is the set current value;
[0014] Turn on the second switch and the third switch to enter the second fast decay stage, which lasts for t4;
[0015] Turn on the third switch and the fourth switch to enter the second slow decay stage, the duration is t5, and the current value after the first slow decay stage is A4, A4 is the set current value lower limit;
[0016] Among them, t2=t3.
[0017] Furthermore, in the zero-crossing working mode, the control method includes:
[0018] Turn on the first switch and the fourth switch to start the charging phase of the motor, the duration is t1, and the current value after the charging phase is A1, A1 is the set upper limit of the current value;
[0019] Turn on the third switch and the fourth switch to enter the first slow decay stage, which lasts for t2;
[0020] Turn on the second switch and the third switch to enter the fast decay stage, which lasts for t6. After the fast decay stage ends, the current value is A5, which is the set lower limit of the current value;
[0021] Turn on the third switch and the fourth switch to enter the second slow decay stage, which lasts for t5;
[0022] A stepper motor current control device, comprising:
[0023] An H-bridge circuit having four switching elements is connected to the stepper motor;
[0024] A digital control module drives the four switching elements in each given PWM cycle so that the current passing through the H-bridge controls the motor current in a charging mode in which the current increases, a fast decay mode in which the current decreases, and a slow decay mode in which the current decreases at a slower rate than the fast decay mode;
[0025] A timing control module provides control timing for the digital control module;
[0026] The delay control module provides a delay time for the digital control module to switch between different control modes, so that the duration of different control modes meets the set requirements;
[0027] Multiple comparators, sampling the H-bridge output current and comparing it with the set current, providing signals for the digital control module, the timing control module and the delay control module;
[0028] The digital-to-analog converter and the pedometer provide the digital control module with signals corresponding to different working states according to the set current and the control signal.
[0029] The beneficial effects of the present invention are as follows: the present invention can make the average load current in a PWM cycle completely equal to the set current, thereby reducing the error of the stepper motor angular position, and proposes a stepper motor control device for realizing the attenuation mode accordingly. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 This is the charging state schematic diagram of the H-bridge drive circuit in the stepper motor;
[0031] Figure 2 This is the schematic diagram of the attenuation state of the H-bridge drive circuit in the stepper motor;
[0032] Figure 3 It is a schematic diagram of the attenuation mode of the existing stepper motor;
[0033] Figure 4This is a schematic diagram of the attenuation mode of the stepping motor of the present invention when it is working normally;
[0034] Figure 5 It is a schematic diagram of the attenuation mode of the stepping motor of the present invention when it passes through zero;
[0035] Figure 6 A schematic diagram of the attenuation mode when the stepping motor of the present invention increases the current and changes steps;
[0036] Figure 7 A schematic diagram of the attenuation mode of the stepping motor of the present invention to reduce the current when changing steps;
[0037] Figure 8 This is a circuit diagram of a stepping motor attenuation mode control system of the present invention;
[0038] Fig. 9 This is a circuit diagram of a timing control module in the stepping motor attenuation mode control system of the present invention. DETAILED DESCRIPTION
[0039] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0040] The stepper motor attenuation mode provided by the present invention adopts the sequence of charging-slow attenuation-fast attenuation-slow attenuation during normal operation, such as Figure 4 As shown. In a PWM cycle 400, after the load current is charged to the upper target current ①, it enters the slow decay mode, and the duration is 401. Then, the fast decay is performed until the current decays to the preset current ②, and the decay time 402 is recorded, and a fast decay process is repeated, and the duration 403 is equal to 402. Finally, a slow decay process is repeated, and the duration 404 is equal to 401. In a PWM cycle, its average current ② is equal to the target current ③.
[0041] Its further feature is that, during the zero-crossing process, the sequence of charging-slow decay-fast decay-slow decay is adopted, such as Figure 5 As shown. Different from the normal working state, the duration of the fast decay phase in the step change process is from the end of the first slow decay phase until the current decays to the lower end target current ④, and it is also ensured that the actual average current ② is equal to the target current ③ when crossing zero.
[0042] Its further characteristic is that, during the step-changing process, different step-changing strategies are adopted for increasing current and decreasing current, respectively, such as Figure 6 to Figure 7 In the process of increasing current and changing steps, the strategy is the same as that in normal operation, such as Figure 6 In the process of reducing current and changing steps, the fast decay-slow decay sequence is adopted, such as Figure 7 As shown, the fast decay mode is used before the current decays to the lower target current ITHN.
[0043] The present invention also proposes a stepper motor control system for realizing the attenuation mode, including an H bridge, such as Figure 8 As shown. It is characterized in that it includes a digital control module, a comparator, a timing control module, a sin digital-to-analog converter, and a pedometer. The control signal output end of the digital control module is connected to the input end of the H bridge to control the switch of its power tube. The pedometer generates control signals such as current increase and decrease, zero crossing, forward and reverse, etc., which are connected to the input end of the digital control module. The sin digital-to-analog converter generates the set current and the upper and lower target currents in each step, and is connected to the input end of the corresponding comparator. The comparator and the timing control module generate stop signals for charging, fast decay, and slow decay, and are connected to the input end of the digital control module.
[0044] Its further feature is that, in order to achieve the equality of the two fast decay time periods 402 and 403, the delay control module structure adopted is as follows: Fig. 9 As shown. The currents in the branches where switches 901 and 902 are located are equal, and the capacitors 903 and 904 on the two branches are exactly the same. During the first stage of fast decay within 402 seconds, switch 901 is turned on and switch 902 is turned off, charging capacitor 903 to VCAP1. During the second stage of fast decay within 403 seconds, switch 901 is turned off and switch 902 is turned on, charging capacitor 904 to VCAP2. Due to the existence of the comparator, VCAP2 is equal to VCAP1. After the fast decay stage ends, 905 is pulled up to discharge the capacitor.
[0045] like Figure 8 and Fig. 9 As shown, a stepper motor control system proposed by the present invention includes an H-bridge, a digital control module, comparators 1-3, a pedometer, a delay control module, a timing control module and a digital-to-analog converter. The control of the stepper motor angle is determined by the current magnitudes of multiple phases, and the degree of angle deviation is determined by the current magnitudes of multiple phases.
[0046] During the entire operation of the stepper motor, the digital-to-analog converter first generates the set current corresponding to the step, and generates the upper target current and the lower target current according to a certain ratio. The pedometer responds to the external input step-changing signal, and generates direction control signals, increase and decrease control signals, and zero-crossing control signals as needed and inputs them into the digital control module. The digital control module is a state machine that controls the three basic states of the motor: normal working state, step-changing state, and zero-crossing state. The output of the digital control module controls the switch of the H-bridge drive power tube. The load current driven by the H-bridge is detected and output, and is input into three comparators respectively, thereby generating the end and start signals of each stage, which are input into the timing control module, delay control module, and digital control module.
[0047] like Figures 4 to 7As shown, when the stepper motor is working normally, the load current is charged first. When charged to the upper target current ①, the comparator 1 outputs 801 signals to the digital control module and the timing control module, indicating that the charging is completed and the first slow decay stage is entered. The timing control module controls the duration 401 of the first slow decay stage, and outputs 802 signals to the timing control module after the duration ends, and performs the first fast decay stage. At the beginning of the fast decay stage, the switch 901 in the delay control module is turned on, and the capacitor 903 starts to charge. When the load current decays to the preset target current ②, the comparator 2 outputs a signal to the delay control module, and the fast decay stage duration is 402. Thereafter, the switch 901 in the delay control module is closed, the switch 902 is turned on, and the capacitor 904 starts to charge until it is charged to the same voltage as the capacitor 903. The delay control module outputs 803 signals to end the fast decay stage, and the second fast decay stage duration is 403. After the fast decay stage, the switch 905 in the delay control module is opened, the capacitors 903 and 904 are discharged, and the timing control module controls the load current to continue to decay slowly, the duration is 404, which is equal to the first slow decay stage, and the load current finally decays to the lower end target current ④. Then the sequence of charging-slow decay-fast decay-slow decay is continued and repeated until the step is changed or the zero crossing operation is performed.
[0048] During the zero-crossing process of the stepper motor, the load current directly enters the fast decay stage after the charging and slow decay stages and continues until it decays to the lower target current ④. At this time, comparator 3 outputs a signal to the delay control module and the timing control module, and then the stepper motor reverses and enters the slow decay mode.
[0049] The step-changing process has the highest priority, and the step-changing operation is stopped regardless of the normal working state, that is, charging or fast decay mode.
[0050] During the process of stepper motor current increasing and stepping, its working mode is the same as the normal working condition, the difference is that the charging time is longer, and it is directly charged to the upper target current after stepping①.
[0051] During the process of stepping motor current reduction and stepping, the load current directly enters the fast decay mode until it decays to the lower target current after stepping④, and then similar to the normal working condition, the timing control module enters the slow decay mode.
[0052] In summary, it can be seen that the stepper motor attenuation mode provided by the present invention can accurately control the average current in the PWM cycle to be completely equal to the set current, reducing the angle error of the stepper motor in actual application. And properly handle the strategy of the attenuation mode during zero crossing and step change, taking into account both accuracy and efficiency. The control system proposed by the present invention can fully realize the proposed attenuation mode.
[0053] It should be noted that the attenuation mode and control system provided by the present invention can also be applied to the current control field appearing in other integrated circuits.
[0054] A person skilled in the art may make various other specific modifications and combinations based on the technical inspirations disclosed in the present invention without departing from the essence of the present invention, and these modifications and combinations are still within the protection scope of the present invention.
Claims
1. A stepper motor current control method for an H-bridge motor drive circuit, wherein the four switches of the H-bridge are defined as a first switch, a second switch, a third switch, and a fourth switch, wherein the first switch and the second switch are high-side power tubes, and the third switch and the fourth switch are low-side power tubes, and the four switches control the working state of the motor under the control of a drive signal, characterized in that: In one PWM cycle, the four switches of the H-bridge are controlled to make the average load current equal to the set current, and the maximum current value A1 and the minimum current value A2 are set. The average current value A3 is obtained according to A1 and A2; In normal operating mode, the control method includes: Turn on the first switch and the fourth switch, the motor enters the charging stage, the duration is t1, and the current value after the charging stage is A1; Turn on the third switch and the fourth switch to enter the first slow decay stage, which lasts for t2; Turn on the second switch and the third switch to enter the first fast decay stage, the duration is t3, and the current value after the first fast decay stage ends is A3; Turn on the second switch and the third switch to enter the second fast decay stage, the duration is t4, t4 = t3; The third switch and the fourth switch are turned on to enter the second slow decay stage, which lasts for t5. After the first slow decay stage ends, the current value is A2, and t5=t2.
2. A stepper motor current control method according to claim 1, characterized in that: In zero-crossing operation mode, the control method includes: Turn on the first switch and the fourth switch, the motor enters the charging stage, the duration is t1, and the current value after the charging stage is A1; Turn on the third switch and the fourth switch to enter the first slow decay stage, which lasts for t2; Turn on the second switch and the third switch to enter the fast decay stage, which lasts for t6. After the fast decay stage ends, the current value is A2; The third switch and the fourth switch are turned on to enter the second slow decay stage, the duration is t5, t5=t2.
3. A stepper motor current control method according to claim 1, characterized in that: In the step-changing working mode, the control methods include: If the current is increased, the current is raised to the set current upper limit during the charging phase of the first PWM cycle of the step-changing process, and the other processes are the same as the normal working mode; If the current is to be reduced, then in the first PWM cycle during the step change process, the second switch and the third switch are turned on in the first half of the PWM cycle, and the current is reduced to the set value through the fast decay stage. Then, in the second half of the PWM cycle, the third switch and the fourth switch are turned on to enter the slow decay stage. Starting from the second PWM cycle, it is the same as the normal working mode.
4. A stepper motor current control device, characterized in that: include: An H-bridge circuit having four switching elements is connected to the stepper motor; A digital control module drives the four switching elements in each given PWM cycle so that the current passing through the H-bridge controls the motor current in a charging mode in which the current increases, a fast decay mode in which the current decreases, and a slow decay mode in which the current decreases at a slower rate than the fast decay mode; A timing control module provides control timing for the digital control module; The delay control module provides a delay time for the digital control module to switch between different control modes, so that the duration of different control modes meets the set requirements; Multiple comparators, sampling the H-bridge output current and comparing it with the set current, providing signals for the digital control module, the timing control module and the delay control module; The digital-to-analog converter and the pedometer provide the digital control module with signals corresponding to different working states according to the set current and the control signal.
Citation Information
Patent Citations
Average current control in stepper motor
CN112398387A
Stepping motor control method and device, electronic equipment and storage medium
CN117040323A
H-bridge adaptive attenuation control method applied to stepping motor driving
CN117749001A
Chopped wave constant current control circuit of stepping motor and method thereof
CN118399806A
Method and circuit arrangement for controlling current in motors
US20120274261A1
Cited By
Stepping motor current control method based on predicted conduction and dynamic follow current
CN122247253A
A stepping motor current control method based on predicted conduction and dynamic freewheeling
CN122247253B