Switching of a running ULN2003 Stepper Motor Driver IC

Thread Starter

Doceave

Joined Nov 16, 2019
49
The calculation of R22(Q7), R23(Q6) below:
Ib_Q7 = 25mA/10 = 2.5mA
Ib_Q6 = 25mA/10 = 2.5mA

R22 = (V_ESP32-Vbe_Q7)/Ib_Q7
= (5V-0.7V)/2.5mA
= 4.3V/2.5mA
= 1.72K (Try 1.8K)

When the bjt using as switch then the hFE = 10 (some others maybe = 20)
So Ic_Q1 = 250mA
Ic_Q7 = Ib_Q1 = Ic_Q1/10 = 250mA/10 = 25mA

Ib_Q7 = Ic_Q7/10 = 25mA/10 = 2.5mA
With your help I am taking this circuit on part-by part :)

So we now have an NPN-PNP combination switching the stepper and its driver.

1574094233255.png

The schematic is a bit upside down but do you otherwise agree with this?
 

ScottWang

Joined Aug 23, 2012
7,409
You know you can still use a spare channel of the ULN2003 and eliminate Q7 and R22.
Nice, although I have had thought about that, but I don't have time to write down yesterday, when you using ULN2003 to replace npn, you need to reconsidering the values of R23 in #43, the Vce of npn as 0.2V, so I ignored it, but Vce of ULN2003 as 0.9V ...
 

Thread Starter

Doceave

Joined Nov 16, 2019
49
Nice, although I have had thought about that, but I don't have time to write down yesterday, when you using ULN2003 to replace npn, you need to reconsidering the values of R23 in #43, the Vce of npn as 0.2V, so I ignored it, but Vce of ULN2003 as 0.9V ...
If I understand correctly: The output of the Darlington array within the ULN2003 does not return as close to zero as would an NPN transistor --- thus a larger R23 resistor (as in #43) would be needed to prevent the current flow into the base of Q7...

Sadly I have not been able to figure out how to calculate this confidently...
 

ElectricSpidey

Joined Dec 2, 2017
2,786
No, just the opposite, you would want a lower value resistor to make up the voltage drop across the 2003.

I also wanted to offer an alternative to switching off the steppers on the high side…that would be simply switching off the 2003 using a N-Channel MOSFET connected to the ground line.

This avoids the current usage for the PNP, and the voltage drop across it. (and 2 resistors, assuming the control for the MOSFET is push/pull)
 

Thread Starter

Doceave

Joined Nov 16, 2019
49
No, just the opposite, you would want a lower value resistor to make up the voltage drop across the 2003.

I also wanted to offer an alternative to switching off the steppers on the high side…that would be simply switching off the 2003 using a N-Channel MOSFET connected to the ground line.

This avoids the current usage for the PNP, and the voltage drop across it. (and 2 resistors, assuming the control for the MOSFET is push/pull)
I really like this idea... does this reflect what you are saying?
1574183722476.png
 

Thread Starter

Doceave

Joined Nov 16, 2019
49
Hi there Spidey

I have finally received the parts and built the circuit. The problem, however, is that when the MOSFET is switched off by the ESP32, the stepper motor is still turning (with little torque; easily stalled). When turned on the motor is much stronger.

What would explain this "leakage"?

Thanks.
 

Attachments

ScottWang

Joined Aug 23, 2012
7,409
Please measure the voltages of following points when they turn on and off:
1. Two control pins of ESP32.
2. Two pin 8 of ULN2003.
3. The 8 input pins of ULN2003.
 

MisterBill2

Joined Jan 23, 2018
18,607
To stop a stepper from moving you must also stop the command states from changing. And quite possibly the way that the enable pin is driven is not correct. I see a pull down FET but I see nothing to pull it up.
But the most obvious thing is to stop delivering step commands.
 

MaxHeadRoom

Joined Jul 18, 2013
28,702
In some applications, it is required to hold a stepper motor steady at rest using its built in holding torque, to do this the rated DC current should be applied to hold it stationary.
Max.
 

Thread Starter

Doceave

Joined Nov 16, 2019
49
Please measure the voltages of following points when they turn on and off:
1. Two control pins of ESP32.
2. Two pin 8 of ULN2003.
3. The 8 input pins of ULN2003.
Thanks Scott

The circuit is really only partly constructed. But I will answer what I can.

1) From the ESP32 the signal is either 5V or 0V
2) Pin 8 of the ULN2003 is at 2.1V relative to ground ---- this is in keeping with the low torque behavior of the motor when its driver is supposed to be "disabled"
3) The input pins of the ULN2003 are cycled by the ESP32 to 0V and 5V continuously

I believe point #2 above is the reason for this...

Even if I remove the FET entirely this continues.

1581361017899.png
 

Thread Starter

Doceave

Joined Nov 16, 2019
49
Thanks Scott

The circuit is really only partly constructed. But I will answer what I can.

1) From the ESP32 the signal is either 5V or 0V
2) Pin 8 of the ULN2003 is at 2.1V relative to ground ---- this is in keeping with the low torque behavior of the motor when its driver is supposed to be "disabled"
3) The input pins of the ULN2003 are cycled by the ESP32 to 0V and 5V continuously

I believe point #2 above is the reason for this...

Even if I remove the FET entirely this continues.

View attachment 198756
Is there not an error in the way the ULN is being used to drive the stepper?

VCC is 5.0V
Inputs to ULN are either 5V or 0V

The ULN is physically disconnected from GND and the motor is still turning with low torque.

Puzzled..
 
Top