A stepping motor drive circuit
By using A phase and B phase H bridge driving circuits in the stepper motor drive circuit, two phases and four beats are realized by using the two IO ports of the MCU, which solves the problem of MCU resource tightness, reduces hardware costs and improves system reliability.
Patent Information
- Application Number
- CN202010274439.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-04-09
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2040-04-09
AI Technical Summary
The existing stepper motor drive control method requires occupancy of 4 IO ports of the MCU, resulting in shortage of resources, and using higher-level MCUs will increase costs.
The first and second control signals generated by the MCU are used to control the A-phase and B-phase H-bridge driving circuits respectively, and the current direction of the stepper motor is controlled through the output interfaces of the A-phase and B-phase H-bridge driving circuits. Only the two IO ports of the MCU are used to realize two-phase and four-beat driving.
It reduces the use of the MCU IO port, saves hardware resources and reduces hardware costs, while enhancing the reliability and anti-interference performance of the system.
Smart Images

Figure CN111355408B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of stepping motors, and in particular to a stepping motor driving circuit. Background Art
[0002] A stepper motor uses electromagnetic principles to convert electrical energy into mechanical energy. It's a controlled motor that converts electrical pulse signals into mechanical angular displacement. Because the input signal is a pulse voltage, the output angular displacement is intermittent, and each electrical pulse causes the rotor to advance one step, it's called a stepper motor, also known as a pulse motor.
[0003] Stepper motors are used as actuators in various automation control systems. To meet the operating requirements of stepper motors, existing stepper motors typically use an H-bridge drive circuit, outputting PWM waves through the MCU's four I / O ports to achieve two-phase, four-beat drive control. However, this stepper motor drive control method requires four I / O ports on the MCU, significantly consuming MCU resources and often leaving designers facing insufficient I / O ports on low-cost MCU chips. Choosing a higher-end MCU with more I / O ports would significantly increase costs. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide a stepper motor drive circuit capable of reducing the use of IO ports of a control chip.
[0005] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0006] A stepper motor drive circuit includes an MCU, an A-phase H-bridge drive circuit, and a B-phase H-bridge drive circuit. The MCU generates a first control signal and a second control signal for controlling the current direction of the A-phase coil and the B-phase coil of the stepper motor. The two IO ports of the MCU correspondingly output the first control signal and the second control signal. The two output interfaces of the A-phase H-bridge drive circuit are connected to the two ends of the A-phase coil of the stepper motor in a one-to-one correspondence. The A-phase H-bridge drive circuit receives the first control signal and controls the current direction of the A-phase coil of the stepper motor according to the first control signal. The two output interfaces of the B-phase H-bridge drive circuit are connected to the two ends of the B-phase coil of the stepper motor in a one-to-one correspondence. The B-phase H-bridge drive circuit receives the second control signal and controls the current direction of the B-phase coil of the stepper motor according to the second control signal.
[0007] Preferably, the stepper motor driving circuit further includes a switch protection circuit, and the switch protection circuit controls the opening or closing of the stepper motor according to an enable signal output by the MCU.
[0008] Preferably, the stepper motor drive circuit further includes a clamping circuit for clamping the voltages of the two output interfaces of the A-phase H-bridge drive circuit and the two output interfaces of the B-phase H-bridge drive circuit.
[0009] Preferably, the A-phase H-bridge drive circuit includes a PNP transistor Q1, an NPN transistor Q2, an NPN transistor Q3, a PNP transistor Q4, a PNP transistor Q5, a resistor R1, a resistor R2, a resistor R3, a resistor R4, a resistor R5, a resistor R6, and a resistor R7. The emitter of the transistor Q1 and the emitter of the transistor Q4 are connected to the first DC power supply, the base of the transistor Q1 is connected to the collector of the transistor Q4 through the resistor R4, the collector of the transistor Q1 is connected to one end of the resistor R1 and the resistor R2 respectively, the other end of the resistor R2 is connected to the base of the transistor Q4, the other end of the resistor R1 is connected to the collector of the transistor Q2, the emitter of the transistor Q2 is grounded, and the base of the transistor Q2 is grounded. It is connected to the second DC power supply through resistors R3 and R7, the emitter of the transistor Q5 is connected to the second DC power supply, the collector of the transistor Q5 is connected to the base of the transistor Q3 through resistor R6, the emitter of the transistor Q3 is grounded, the collector of the transistor Q3 is connected to the collector of the transistor Q4 through resistor R5, the base of the transistor Q5 is connected to the MCU as the input interface of the A-phase H-bridge drive circuit, and the connection node between the resistor R3 and the resistor R7 is connected to the input interface of the A-phase H-bridge drive circuit; the connection node between the collector of the transistor Q1 and the resistor R1 and the connection node between the collector of the transistor Q4 and the resistor R5 serve as the two output interfaces of the A-phase H-bridge drive circuit.
[0010] Preferably, the A-phase H-bridge driving circuit further includes a resistor R8 , one end of the resistor R8 is connected to the MCU as an input interface of the A-phase H-bridge driving circuit, and the other end is connected to the base of the transistor Q5 .
[0011] Preferably, the B-phase H-bridge drive circuit includes a PNP transistor Q6, an NPN transistor Q7, a PNP transistor Q8, an NPN transistor Q9, a PNP transistor Q10, a resistor R9, a resistor R10, a resistor R11, a resistor R12, a resistor R13, a resistor R14, and a resistor R15. The emitter of the transistor Q6 and the emitter of the transistor Q8 are connected to the first DC power supply, the base of the transistor Q6 is connected to the collector of the transistor Q8 through the resistor R12, the collector of the transistor Q6 is connected to one end of the resistor R9 and the resistor R10 respectively, the other end of the resistor R10 is connected to the base of the transistor Q8, the other end of the resistor R9 is connected to the collector of the transistor Q7, the emitter of the transistor Q7 is grounded, and the base of the transistor Q7 is grounded. The transistor Q10 is connected to the second DC power supply through resistors R11 and R15, the emitter of the transistor Q10 is connected to the second DC power supply, the collector of the transistor Q10 is connected to the base of the transistor Q9 through resistor R14, the emitter of the transistor Q9 is grounded, the collector of the transistor Q9 is connected to the collector of the transistor Q8 through resistor R13, the base of the transistor Q10 is connected to the MCU as the input interface of the B-phase H-bridge drive circuit, the connection node between the resistor R11 and the resistor R15 is connected to the input interface of the B-phase H-bridge drive circuit; the connection node between the collector of the transistor Q6 and the resistor R9 and the connection node between the collector of the transistor Q8 and the resistor R13 serve as two output interfaces of the B-phase H-bridge drive circuit.
[0012] Preferably, the B-phase H-bridge driving circuit further includes a resistor R16 , one end of the resistor R16 is connected to the MCU as an input interface of the B-phase H-bridge driving circuit, and the other end is connected to the base of the transistor Q10 .
[0013] Preferably, the switch protection circuit includes a PNP transistor Q11, a resistor R17 and a resistor R18, the base of the transistor Q11 is connected to the MCU through the resistor R18, the emitter of the transistor Q11 is grounded, the resistor R17 is connected between the base of the transistor Q11 and the ground, and the collector of the transistor Q11 is respectively connected to the A-phase H-bridge drive circuit and the B-phase H-bridge drive circuit.
[0014] Preferably, the MCU adopts a control chip of model BD6384EFV-E2.
[0015] Preferably, the first DC power supply is a 12V DC power supply, and the second DC power supply is a 5V DC power supply.
[0016] The beneficial technical effect of the present invention is that the above-mentioned stepper motor drive circuit can realize the two-phase four-beat drive control of the stepper motor by using only two IO ports of the MCU, thereby reducing the use of the IO ports of the control chip MCU, saving hardware resources, and fundamentally reducing hardware costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 is a circuit schematic diagram of a stepping motor driving circuit in one embodiment of the present invention;
[0018] Figure 2 2 is a circuit schematic diagram of a stepping motor driving circuit in another embodiment of the present invention. DETAILED DESCRIPTION
[0019] In order to enable those skilled in the art to more clearly understand the objectives, technical solutions and advantages of the present invention, the present invention is further described below with reference to the accompanying drawings and embodiments.
[0020] like Figure 1 As shown, in one embodiment of the present invention, a stepper motor drive circuit includes an MCU, an A-phase H-bridge drive circuit, and a B-phase H-bridge drive circuit. The MCU generates a first control signal and a second control signal for controlling the current direction of the A-phase coil and the B-phase coil of the stepper motor, and the two IO ports of the MCU output the first control signal and the second control signal accordingly. The output interface A+ and the output interface A- of the A-phase H-bridge drive circuit are connected to the two ends of the A-phase coil of the stepper motor in a one-to-one correspondence. The A-phase H-bridge drive circuit receives the first control signal and controls the current direction of the A-phase coil of the stepper motor according to the first control signal. The output interface B+ and the output interface B- of the B-phase H-bridge drive circuit are connected to the two ends of the B-phase coil of the stepper motor in a one-to-one correspondence. The B-phase H-bridge drive circuit receives the second control signal and controls the current direction of the B-phase coil of the stepper motor according to the second control signal.
[0021] The MCU serves as the control core of the stepper motor drive circuit and adopts the BD6384EFV-E2 control chip.
[0022] The A-phase H-bridge drive circuit includes a PNP transistor Q1, an NPN transistor Q2, an NPN transistor Q3, a PNP transistor Q4, a PNP transistor Q5, a resistor R1, a resistor R2, a resistor R3, a resistor R4, a resistor R5, a resistor R6, and a resistor R7.
[0023] The emitter of the transistor Q1 and the emitter of the transistor Q4 are connected to a 12V DC power supply, the base of the transistor Q1 is connected to the collector of the transistor Q4 through a resistor R4, the collector of the transistor Q1 is connected to one end of the resistor R1 and the resistor R2 respectively, the other end of the resistor R2 is connected to the base of the transistor Q4, the other end of the resistor R1 is connected to the collector of the transistor Q2, the emitter of the transistor Q2 is grounded, the base of the transistor Q2 is connected to a 5V DC power supply through resistors R3 and R7, the emitter of the transistor Q5 is connected to the 5V DC power supply, and the collector of the transistor Q5 is connected to the base of the transistor Q3 through a resistor R6. The emitter of the transistor Q3 is grounded, the collector of the transistor Q3 is connected to the collector of the transistor Q4 through the resistor R5, the base of the transistor Q5 is connected to the input interface A1+ of the A-phase H-bridge drive circuit, the input interface A1+ is connected to the IO port MCU_A of the MCU, and the connection node between the resistor R3 and the resistor R7 is connected to the input interface A1+; the connection node between the collector of the transistor Q1 and the resistor R1 is connected to the output interface A+ of the A-phase H-bridge drive circuit, and the connection node between the collector of the transistor Q4 and the resistor R5 is connected to the output interface A- of the A-phase H-bridge drive circuit.
[0024] The working principle of the A-phase H-bridge drive circuit is as follows:
[0025] When the input interface A1+ inputs a high level, transistors Q5, Q1, and Q3 are all turned off, while transistors Q2 and Q4 are turned on. Current flows from the 12V DC power supply through transistor Q4 into the output interface A-, then flows through the coil in the motor to the output interface A+, and then flows from the output interface A+ through resistor R1 to the transistor Q2 grounding, forming a loop. When the input interface A1+ inputs a low level, transistors Q5, Q1, and Q3 are all turned on, while transistors Q2 and Q4 are turned off. Current flows from the 12V DC power supply through transistor Q1 into the output interface A+, then flows through the coil in the motor to the output interface A-, and then flows from the output interface A- through resistor R5 to the transistor Q3 grounding, forming a loop.
[0026] The B-phase H-bridge drive circuit includes a PNP transistor Q6, an NPN transistor Q7, a PNP transistor Q8, an NPN transistor Q9, a PNP transistor Q10, a resistor R9, a resistor R10, a resistor R11, a resistor R12, a resistor R13, a resistor R14, and a resistor R15.
[0027] The emitter of the transistor Q6 and the emitter of the transistor Q8 are connected to a 12V DC power supply, the base of the transistor Q6 is connected to the collector of the transistor Q8 through a resistor R12, the collector of the transistor Q6 is connected to one end of the resistor R9 and the resistor R10 respectively, the other end of the resistor R10 is connected to the base of the transistor Q8, the other end of the resistor R9 is connected to the collector of the transistor Q7, the emitter of the transistor Q7 is grounded, the base of the transistor Q7 is connected to a 5V DC power supply through resistors R11 and R15, the emitter of the transistor Q10 is connected to a 5V DC power supply, the collector of the transistor Q10 is connected to the base of the transistor Q9 through a resistor R14, and the transistors The emitter of Q9 is grounded, the collector of the transistor Q9 is connected to the collector of the transistor Q8 through the resistor R13, the base of the transistor Q10 is connected to the input interface B1+ of the B-phase H-bridge drive circuit, the input interface B1+ is connected to the IO port MCU_B of the MCU, and the connection node between the resistor R11 and the resistor R15 is connected to the input interface B1+ of the B-phase H-bridge drive circuit; the connection node between the collector of the transistor Q6 and the resistor R9 is connected to the output interface B+ of the B-phase H-bridge drive circuit, and the connection node between the collector of the transistor Q8 and the resistor R13 is connected to the output interface B- of the B-phase H-bridge drive circuit.
[0028] The working principle of the B-phase H-bridge drive circuit is as follows:
[0029] When the input interface B1+ inputs a high level, transistors Q10, Q6, and Q9 are all turned off, while transistors Q7 and Q8 are turned on. Current flows from the 12V DC power supply through transistor Q8 into the output interface B-, flows through the coil in the motor to the output interface B+, and then flows from the output interface B+ through resistor R9 to the transistor Q7 grounded, forming a loop. When the input interface B1+ inputs a low level, transistors Q10, Q6, and Q9 are all turned on, while transistors Q7 and Q8 are turned off. Current flows from the 12V DC power supply through transistor Q6 into the output interface B+, flows through the coil in the motor to the output interface B-, and then flows from the output interface B- through resistor R13 to the transistor Q9 grounded, forming a loop.
[0030] The stepper motor drive circuit of the present invention can realize two-phase four-beat drive control of the stepper motor by using only two IO ports (MCU_A and MCU_B) of the MCU, thereby reducing the use of the IO ports of the control chip MCU, saving hardware resources, and fundamentally reducing hardware costs.
[0031] In a preferred embodiment of the present invention, the A-phase H-bridge drive circuit further includes a resistor R8. One end of the resistor R8 is connected to the MCU's IO port MCU_A as the input interface A1+ of the A-phase H-bridge drive circuit, and the other end is connected to the base of transistor Q5. Resistor R8 serves to limit current in the circuit. Since the internal resistance of the coil is extremely small at the moment of pulse starting of the stepper motor, the starting current is very large. To suppress the starting current, a current-limiting resistor R8 is added to prevent the transistors within the A-phase H-bridge drive circuit from burning out.
[0032] In a preferred embodiment of the present invention, the B-phase H-bridge drive circuit further includes a resistor R16. One end of the resistor R16 is connected to the MCU's IO port MCU_B as the B-phase H-bridge drive circuit's input interface B1+, and the other end is connected to the base of transistor 10. Resistor R16 serves to limit current in the circuit. Because the coil's internal resistance is extremely low at the moment of pulse startup of the stepper motor, the startup current is very high. To suppress this startup current, a current-limiting resistor R16 is added to prevent burnout of the transistors within the B-phase H-bridge drive circuit.
[0033] In a preferred embodiment of the present invention, the stepper motor drive circuit further includes a clamping circuit comprising bidirectional diodes DD1, DD2, DD3, and DD4. Bidirectional diodes DD1 and DD2 are used to clamp the voltages of output interfaces A+ and A- of the A-phase H-bridge drive circuit, respectively; bidirectional diodes DD3 and DD4 are used to clamp the voltages of output interfaces B+ and B- of the B-phase H-bridge drive circuit, respectively. Bidirectional diodes DD1, DD2, DD3, and DD4 can absorb spikes generated during stepper motor operation, smoothing and reducing noise.
[0034] like Figure 2 As shown, in another embodiment of the present invention, the stepper motor drive circuit includes an MCU, an A-phase H-bridge drive circuit, a B-phase H-bridge drive circuit and a switch protection circuit, and the switch protection circuit controls the start or stop of the stepper motor according to the enable signal output by the MCU.
[0035] The circuit structure and working principle of the A-phase H-bridge drive circuit and the B-phase H-bridge drive circuit are similar to Figure 1 The circuit structures and working principles of the A-phase H-bridge driving circuit and the B-phase H-bridge driving circuit in the illustrated embodiment are the same, and are not described in detail here.
[0036] The switch protection circuit includes a PNP transistor Q11, a resistor R17, and a resistor R18. The base of transistor Q11 is connected to the MCU's IO port MCU_EN through resistor R18, the emitter of transistor Q11 is grounded, and resistor R17 is connected between the base of transistor Q11 and ground. The collector of transistor Q11 is connected to the A-phase H-bridge drive circuit and the B-phase H-bridge drive circuit, respectively. When the stepper motor needs to be turned on, the MCU's IO port MCU_EN outputs an enable signal (high level) to drive transistor Q11 to turn on, enabling the ground terminals of the A-phase H-bridge drive circuit and the B-phase H-bridge drive circuit to be connected to ground, and the stepper motor begins to operate.
[0037] The stepper motor drive circuit of the embodiment of the present invention includes a switch protection circuit, which can completely cut off the connection between the stepper motor and the power supply, thereby enhancing the reliability of the system, improving the anti-interference performance from the hardware perspective, and eliminating the loss of step caused by interference.
[0038] The above description is merely a preferred embodiment of the present invention and does not constitute any form of limitation to the present invention. Those skilled in the art may make various equivalent changes and improvements based on the above embodiment. Any equivalent changes or modifications made within the scope of the claims shall fall within the scope of protection of the present invention.
Claims
1. A stepping motor drive circuit, characterized in that: The stepper motor drive circuit includes: An MCU, which generates a first control signal and a second control signal for controlling the current direction of the A-phase coil and the B-phase coil of the stepper motor, and the two IO ports of the MCU correspondingly output the first control signal and the second control signal; an A-phase H-bridge drive circuit, wherein two output interfaces of the A-phase H-bridge drive circuit are connected one-to-one with two ends of the A-phase coil of the stepper motor, and the A-phase H-bridge drive circuit receives the first control signal and controls the current direction of the A-phase coil of the stepper motor according to the first control signal; a B-phase H-bridge drive circuit, wherein two output interfaces of the B-phase H-bridge drive circuit are connected one-to-one with two ends of the B-phase coil of the stepper motor, and the B-phase H-bridge drive circuit receives the second control signal and controls the current direction of the B-phase coil of the stepper motor according to the second control signal; The A-phase H-bridge drive circuit includes a PNP transistor Q1, an NPN transistor Q2, an NPN transistor Q3, a PNP transistor Q4, a PNP transistor Q5, a resistor R1, a resistor R2, a resistor R3, a resistor R4, a resistor R5, a resistor R6, and a resistor R7. The emitter of the transistor Q1 and the emitter of the transistor Q4 are connected to a first DC power supply, the base of the transistor Q1 is connected to the collector of the transistor Q4 through the resistor R4, the collector of the transistor Q1 is connected to one end of the resistor R1 and the resistor R2 respectively, the other end of the resistor R2 is connected to the base of the transistor Q4, the other end of the resistor R1 is connected to the collector of the transistor Q2, the emitter of the transistor Q2 is grounded, and the base of the transistor Q2 is connected through Resistors R3 and R7 are connected to a second DC power supply, the emitter of transistor Q5 is connected to the second DC power supply, the collector of transistor Q5 is connected to the base of transistor Q3 through resistor R6, the emitter of transistor Q3 is grounded, the collector of transistor Q3 is connected to the collector of transistor Q4 through resistor R5, the base of transistor Q5 is connected to the MCU as the input interface of the A-phase H-bridge drive circuit, and the connection node between resistor R3 and resistor R7 is connected to the input interface of the A-phase H-bridge drive circuit; the connection node between the collector of transistor Q1 and resistor R1 and the connection node between the collector of transistor Q4 and resistor R5 serve as two output interfaces of the A-phase H-bridge drive circuit.
2. The stepping motor driving circuit according to claim 1, wherein: The stepper motor driving circuit further includes a switch protection circuit, which controls the stepper motor to be turned on or off according to an enable signal output by the MCU.
3. The stepping motor driving circuit according to claim 1 or 2, wherein: The stepper motor drive circuit further includes a clamping circuit for clamping the voltages of the two output interfaces of the A-phase H-bridge drive circuit and the two output interfaces of the B-phase H-bridge drive circuit.
4. The stepping motor driving circuit according to claim 1, wherein: The A-phase H-bridge driving circuit further includes a resistor R8 , one end of which is connected to the MCU as an input interface of the A-phase H-bridge driving circuit, and the other end of which is connected to the base of the transistor Q5 .
5. The stepping motor driving circuit according to claim 1, wherein: The B-phase H-bridge drive circuit includes a PNP transistor Q6, an NPN transistor Q7, a PNP transistor Q8, an NPN transistor Q9, a PNP transistor Q10, a resistor R9, a resistor R10, a resistor R11, a resistor R12, a resistor R13, a resistor R14, and a resistor R15. The emitter of the transistor Q6 and the emitter of the transistor Q8 are connected to the first DC power supply, the base of the transistor Q6 is connected to the collector of the transistor Q8 through the resistor R12, the collector of the transistor Q6 is connected to one end of the resistor R9 and the resistor R10 respectively, the other end of the resistor R10 is connected to the base of the transistor Q8, the other end of the resistor R9 is connected to the collector of the transistor Q7, the emitter of the transistor Q7 is grounded, and the base of the transistor Q7 is connected through Resistors R11 and R15 are connected to a second DC power supply, the emitter of transistor Q10 is connected to the second DC power supply, the collector of transistor Q10 is connected to the base of transistor Q9 through resistor R14, the emitter of transistor Q9 is grounded, the collector of transistor Q9 is connected to the collector of transistor Q8 through resistor R13, the base of transistor Q10 is connected to the MCU as the input interface of the B-phase H-bridge drive circuit, and the connection node between the resistor R11 and the resistor R15 is connected to the input interface of the B-phase H-bridge drive circuit; the connection node between the collector of transistor Q6 and resistor R9 and the connection node between the collector of transistor Q8 and resistor R13 serve as two output interfaces of the B-phase H-bridge drive circuit.
6. The stepping motor driving circuit according to claim 5, wherein: The B-phase H-bridge driving circuit further includes a resistor R16 , one end of which is connected to the MCU as an input interface of the B-phase H-bridge driving circuit, and the other end of which is connected to the base of the transistor Q10 .
7. The stepping motor driving circuit according to claim 2, wherein: The switch protection circuit includes a PNP transistor Q11, a resistor R17 and a resistor R18. The base of the transistor Q11 is connected to the MCU through the resistor R18, the emitter of the transistor Q11 is grounded, the resistor R17 is connected between the base of the transistor Q11 and the ground, and the collector of the transistor Q11 is connected to the A-phase H-bridge drive circuit and the B-phase H-bridge drive circuit respectively.
8. The stepping motor driving circuit according to claim 1, wherein: The MCU adopts the BD6384EFV-E2 control chip.
9. The stepping motor driving circuit according to claim 1, wherein: The first DC power supply is a 12V DC power supply, and the second DC power supply is a 5V DC power supply.
Citation Information
Patent Citations
Step motor drive arrangement
CN204597834U
Stepping motor driving circuit
CN211656035U