A method and apparatus for current control of a stepper motor
By adopting a charging-slow decay-fast decay-slow decay control mode and control system in the H-bridge motor drive circuit, the problem of stepper motor angle error caused by current error is solved, and precise current control and stable motor operation are achieved.
Patent Information
- Application Number
- CN202411315885.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2044-09-20
AI Technical Summary
In existing H-bridge motor drive circuits, there is an error between the current and the set target current, resulting in a large angle error of the stepper motor. Furthermore, the current ripple is large and the stability is poor in the fast decay mode, while the current is stable but the efficiency is low in the slow decay mode.
It adopts a charging-slow decay-fast decay-slow decay control mode, and through a control system composed of a digital control module, a timing control module, a delay control module and a comparator, it precisely controls the current to be equal to the set current within the PWM cycle, thereby reducing angle error.
This achieves perfect equality between the average load current and the set current within the PWM cycle, reducing stepper motor angular position error and improving motor operation stability and efficiency.
Smart Images

Figure CN119448836B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of integrated circuits, and in particular relates to a stepping 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 transistors, and 103 and 104 are low-side power transistors. In application, the output nodes of the two half-bridge structures are connected to one end of the inductor. During operation, the pre-driver controls the switching of the four power transistors, thereby controlling the operating 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 transistors 101 and 104 are turned off. Due to the inductor characteristics, 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, the freewheeling current is relatively small, and the attenuation slope of the voltage difference across the inductor is relatively small, which is a slow decay 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 a large attenuation slope of the voltage difference across the inductor, which is a fast attenuation mode.
[0006] The relationship between current and fast / slow decay described above is as follows Figure 3 As shown. Taking 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. The time period of 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 period of 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 two other modes: charging-fast decay mode and charging-slow decay mode. However, as Figure 2 As shown in Figure 2, there is an error between the actual average current ① and the set target current ② within one PWM cycle.
[0007] The fast decay mode and the slow decay mode have respective characteristics. The fast decay mode can make the current decay as soon as possible, and quickly reach the target current, but at the same time, a larger ripple is generated. The slow decay current is relatively stable, and the motor operation is more stable. The hybrid decay mode can effectively combine the advantages of the two modes, and make the average value of the actual current closer to the set current. SUMMARY
[0008] In view of the above deficiencies, the application 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 realizing the scheme.
[0009] The technical scheme of the application is as follows:
[0010] A stepping motor current control method is used for an H-bridge motor driving circuit, and 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 driving signal, and the characteristic is that, in a PWM period, the average load current is equal to the set current by controlling the four switches of the H-bridge. In the normal working mode, the control method comprises:
[0011] The first switch and the fourth switch are turned on to charge the motor for a duration of t1, and the current value is A1 after the charging stage ends, wherein A1 is the upper limit of the set current value.
[0012] The third switch and the fourth switch are turned on to enter a first slow decay stage for a duration of t2.
[0013] The second switch and the third switch are turned on to enter a first fast decay stage for a duration of t3, and the current value is A2 after the first fast decay stage ends, wherein A2 is the set current value.
[0014] The second switch and the third switch are turned on to enter a second fast decay stage for a duration of t4.
[0015] The third switch and the fourth switch are turned on to enter a second slow decay stage for a duration of t5, and the current value is A4 after the first slow decay stage ends, wherein A4 is the lower limit of the set current value.
[0016] Wherein, t2=t3.
[0017] Further, in the zero-crossing working mode, the control method comprises:
[0018] The first switch and the fourth switch are turned on to charge the motor for a duration of t1, and the current value is A1 after the charging stage ends, wherein A1 is the upper limit of the set current value.
[0019] The third switch and the fourth switch are turned on, and a first slow attenuation stage is entered, with a duration of t2;
[0020] The second switch and the third switch are turned on, and a fast attenuation stage is entered, with a duration of t6, and a current value of A5 after the fast attenuation stage, A5 being a lower limit of the set current value;
[0021] The third switch and the fourth switch are turned on, and a second slow attenuation stage is entered, with a duration of t5;
[0022] A stepping motor current control device comprises:
[0023] An H-bridge circuit having four switching elements and connected to the stepping motor;
[0024] A digital control module driving the four switching elements in each given PWM period, so that the current passing through the H-bridge controls the motor current, and the control mode comprises a charging mode of current increase, a fast attenuation mode of current decrease, and a slow attenuation mode of current decrease at a lower speed than the fast attenuation mode;
[0025] A timing control module providing control timing for the digital control module;
[0026] A delay control module providing 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] A plurality of comparators sampling the H-bridge output current and comparing it with the set current, and providing signals for the digital control module, the timing control module and the delay control module;
[0028] A digital-to-analog converter and a step counter providing signals corresponding to different working states of the digital control module according to the set current and the control signals.
[0029] The present application can make the average load current in a PWM period equal to the set current, and reduce the error of the angle position of the stepping motor. BRIEF DESCRIPTION OF DRAWINGS
[0030] Figure 1 A charging state principle diagram for the H-bridge driving circuit in the stepping motor;
[0031] Figure 2 An attenuation state principle diagram for the H-bridge driving circuit in the stepping motor;
[0032] Figure 3 A schematic diagram of the existing attenuation mode of the stepping motor;
[0033] Figure 4The attenuation mode schematic diagram for the step motor in normal working state of the application;
[0034] Figure 5 The attenuation mode schematic diagram for the step motor in zero-crossing state of the application;
[0035] Figure 6 The attenuation mode schematic diagram for the step motor in current increasing step state of the application;
[0036] Figure 7 The attenuation mode schematic diagram for the step motor in current decreasing step state of the application;
[0037] Figure 8 The circuit structure diagram of the attenuation mode control system for the step motor of the application;
[0038] Figure 9 The circuit diagram of the time sequence control module in the attenuation mode control system for the step motor of the application. DETAILED DESCRIPTION
[0039] The application will be described in detail below with reference to the drawings and specific embodiments.
[0040] The step motor attenuation mode provided by the application adopts the sequence of charging-slow attenuation-fast attenuation-slow attenuation in normal working state, as shown in the figure. Figure 4 In a PWM cycle 400, the load current is charged to the upper target current ①, then enters the slow attenuation mode, and the duration 401. Then fast attenuation is adopted until the current is attenuated to the preset current ②, the attenuation time 402 is recorded, and a fast attenuation process is repeated, the duration 403 is equal to 402, and finally a slow attenuation process is repeated, the duration 404 is equal to 401. In a PWM cycle, the average current ② is equal to the target current ③.
[0041] Further, in the zero-crossing process, the sequence of charging-slow attenuation-fast attenuation-slow attenuation is adopted, as shown in the figure. Figure 5 Different from the normal working state, the duration of the fast attenuation stage in the step process is from the end of the first slow attenuation stage to the current attenuation to the lower target current ④, and the actual average current ② is also equal to the target current ③ at zero-crossing.
[0042] Further, in the step process, different step strategies are adopted for increasing current and decreasing current, as shown in the figure. Figure 6 to Figure 7 In the current increasing step process, the strategy is the same as in normal working state, as shown in the figure. Figure 6 In the current decreasing step process, the sequence of fast attenuation-slow attenuation is adopted, as shown in the figure. Figure 7 The fast attenuation mode is adopted before the current is attenuated to the lower target current ITHN.
[0043] The application further provides a step motor control system for realizing the attenuation mode, which comprises an H bridge, as shown in Figure 8 The step motor control system comprises a digital control module, a comparator, a timing control module, a sin digital-to-analog converter and a step counter. 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 the power tube. The current increasing and decreasing control signal, zero-crossing control signal and forward and reverse control signal generated by the step counter are connected to the input end of the digital control module. The set current and upper and lower target current in each step generated by the sin digital-to-analog converter are connected to the input end of the corresponding comparator. The stop signal of charging, fast attenuation and slow attenuation generated by the comparator and the timing control module are connected to the input end of the digital control module.
[0044] Further, in order to realize that the two time periods 402 and 403 of the fast attenuation are equal, the delay control module structure is as shown in Figure 9 The current in the branch where the switches 901 and 902 are located is equal, and the capacitors 903 and 904 on the two branches are completely identical. In the 402 time period, the first stage of fast attenuation, the switch 901 is opened, the switch 902 is closed, and the capacitor 903 is charged to VCAP1. In the 403 time period, the second stage of fast attenuation, the switch 901 is closed, the switch 902 is opened, and the capacitor 904 is charged to VCAP2. Because of the existence of the comparator, VCAP2 is equal to VCAP1. After the fast attenuation stage is over, the capacitor is discharged by the pull-up of 905.
[0045] As shown in Figure 8 and Figure 9 The step motor control system comprises an H bridge, a digital control module, comparators 1-3, a step counter, a delay control module, a timing control module and a digital-to-analog converter. The control of the angle of the step motor is determined by the current size of multiple phases, and the current size of multiple phases determines the degree of angle deviation.
[0046] In the whole working process of the step motor, the set current corresponding to the step is generated by the digital-to-analog converter, and the upper target current and the lower target current are generated according to a certain proportion. The step counter responds to the external input step changing signal, and generates the direction control signal, the increasing and decreasing control signal and the zero-crossing control signal according to the need and inputs them into the digital control module. The digital control module is a state machine, which controls 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 power tube driven by the H bridge. The load current driven by the H bridge is detected and output, and is input into three comparators, so as to generate the end and start signals of each stage, which are input into the timing control module, the delay control module and the digital control module.
[0047] As shown in Figure 4 to Figure 7As shown, in the normal working process of the stepper motor, the load current is first charged, and when the charge reaches the upper target current ①, the comparator 1 outputs a signal 801 to the digital control module and the timing control module, indicating that the charging is completed and entering the first slow decay stage. The timing control module controls the duration 401 of the first slow decay stage, and after the duration ends, outputs a signal 802 to the timing control module, and enters the first fast decay stage. At the beginning of the fast decay stage, the switch 901 in the delay control module is opened, 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 at this time, the duration of the fast decay stage is 402. After that, the switch 901 in the delay control module is closed, and the switch 902 is opened, and the capacitor 904 starts to charge until the voltage of the capacitor 904 is the same as that of the capacitor 903. The delay control module outputs a signal 803, ending the fast decay stage, and the duration of the second fast decay stage is 403. After the fast decay stage ends, the switch 905 in the delay control module is opened, and the capacitors 903 and 904 are discharged. The timing control module controls the load current to continue to decay slowly, and the duration 404 is equal to that of the first slow decay stage. The load current is finally decayed to the lower target current ④. Then the charging-slow decay-fast decay-slow decay sequence is continued and repeated until the step or zero crossing operation is performed.
[0048] In the zero crossing process of the stepper motor, after the load current is charged and slowly decayed, it directly enters the fast decay stage and continues until it decays to the lower target current ④. At this time, the comparator 3 outputs a signal to the delay control module and the timing control module, and then the stepper motor enters the slow decay mode in the reverse direction.
[0049] The step changing process has the highest priority, and no matter what state the normal working process is in, the step changing operation is stopped, that is, the charging or fast decay mode is stopped.
[0050] In the step changing process of increasing the current of the stepper motor, the working mode is the same as that in the normal working process, and the difference is that the charging time is longer, and the charging is directly performed to the upper target current ① after the step changing.
[0051] In the step changing process of reducing the current of the stepper motor, the load current directly enters the fast decay mode until it decays to the lower target current ④ after the step changing, and then the slow decay mode is performed by the timing control module similar to the normal working condition.
[0052] As can be seen from the above, the decay mode of the stepper motor provided by the application can accurately control the average current in the PWM period to be equal to the set current, and can reduce the angle error of the stepper motor in the actual application process. Moreover, the strategy of the decay mode in the zero crossing and step changing processes is properly handled, and the accuracy and efficiency are considered. The control system proposed in the application can completely realize the decay mode proposed.
[0053] It should be noted that the attenuation mode and control system provided by the application can also be applied to the field of current control appearing in other integrated circuits.
[0054] Those skilled in the art can make various other specific modifications and combinations according to the technical inspirations of the application disclosed, without departing from the essence of the application, and these modifications and combinations still fall within the scope of protection of the application.
Claims
1. A stepping motor current control method for an H-bridge motor drive circuit, defining four switches of the H-bridge 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 transistors, and the third switch and the fourth switch are low-side power transistors, the four switches controlling the working state of the motor under the control of drive signals, characterized in that, In a PWM cycle, the average current of the load is equal to the set current by controlling the four switches of the H-bridge, the maximum current value A1 and the minimum current value A2 are set, and the average current value A3 is obtained according to A1 and A2; In the normal working mode, the control method comprises: the first switch and the fourth switch are turned on, the motor enters the charging stage, the duration is t1, and the current value is A1 after the charging stage ends; the third switch and the fourth switch are turned on, and the first slow decay stage is entered, the duration is t2; the second switch and the third switch are turned on, and the first fast decay stage is entered, the duration is t3, and the current value is A3 after the first fast decay stage ends; the second switch and the third switch are turned on, and the second fast decay stage is entered, the duration is t4, t4=t3; the third switch and the fourth switch are turned on, and the second slow decay stage is entered, the duration is t5, the current value is A2 after the first slow decay stage ends, and t5=t2.
2. The method of claim 1, wherein, In the zero-crossing working mode, the control method comprises: the first switch and the fourth switch are turned on, the motor enters the charging stage, the duration is t1, and the current value is A1 after the charging stage ends; the third switch and the fourth switch are turned on, and the first slow decay stage is entered, the duration is t2; the second switch and the third switch are turned on, and the fast decay stage is entered, the duration is t6, and the current value is A2 after the fast decay stage ends; the third switch and the fourth switch are turned on, and the second slow decay stage is entered, the duration is t5, t5=t2.
3. The method of claim 1, wherein, In the step changing working mode, the control method comprises: if the current is to be increased, the current is lifted to the set upper limit of the current in the charging stage of the first PWM cycle in the step changing process, and the other processes are the same as those in the normal working mode; if the current is to be reduced, in the first PWM cycle in the step changing process, the second switch and the third switch are turned on in the first half of the PWM cycle, 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, the same as the normal working mode.
4. A stepping motor current control device for use in the stepping motor current control method according to any one of claims 1 to 3, characterized by It comprises: an H-bridge circuit having four switch elements connected with a stepper motor; a digital control module driving the four switch elements in each given PWM cycle to control the current through the H-bridge to control the motor current, the control mode comprising a charging mode for increasing the current, a fast decay mode for reducing the current, and a slow decay mode for reducing the current at a speed lower than the fast decay mode; a timing control module providing control timing for the digital control module; a delay control module providing 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; a plurality of comparators sampling the H-bridge output current and comparing it with the set current to provide signals for the digital control module, the timing control module and the delay control module; a digital-to-analog converter and a step counter providing signals corresponding to different working states of the digital control module according to the set current and the control signals.
Citation Information
Patent Citations
Chopped wave constant current control circuit of stepping motor and method thereof
CN118399806A