Hi people
I would love some help reviewing my little circuit..
I have a stepper motor driver (TB6600) which has an "ENABLE" function.
It has an ENA- that is supposed to be connected to the ground, and a ENA+ where you supply the signal for ENABLING or DISABLING the stepper motor connected to it. That ENA+ pin is active on low, which means that if you don't supply any voltage to it OR you connect it to ground, the stepper motor driver enables the motor (movement or lock). Otherwise, if you supply any voltage to the ENA+ pin, the motor is disengaged and can be turned freely by hand.
So far so good, it all works fine.
Now, I want to be able to reverse this, so that when a voltage is supplied in an "Activate" line, the stepper motor driver (and motor) is Enabled, while if the voltage is very low, the stepper motor driver (and motor) is Disabled.
Furthermore, the enabling of the motor should be based on whether or not there is a "Step" signal provided to the stepper motor driver (the signal is on-off-on-off..., each change is a single step), to turn the motor.
However, I can't connect the step signal directly to the "Engage" line, because it needs to be consistently on, and not going on and off.
So.. I want to create a time delay circuit that will turn the "Engage" on as soon as there is a "Step" signal going high (on), and will keep it on for a bit after it turns low (off), so to make sure that it's disabling the motor just because it went off as part of the regular motion.
(my plan is to always set the "Step" signal to low, when I want to disengage (disable) the motor)
So.... I have come up with the following schematic which works!!
However, I wanted to check with people who know more than me about certain things I'm noticing, as well as ask about possible flaws in the design and design aspects and values which I've set that I'm not sure about.
The design can be accessed here : https://tinyurl.com/yh2fubnw
And here is a screenshot of it:
My questions are:
1. The transistor I'm using is basically any NPN transistor. In my case an A42.
Is that correct? It doesn't really matter what NPN transistor I use, as long as it can handle the 5V range?
2. R1 is set to 2.2k. I tested this empirically and believe that the importance here is to have in place a resistor that is low enough to not impede the ability of the opto-coupler in the Tb66000 on the ENA+, but high enough to not generate a current too high going into it.
The question is.. Do I even need a resistor there? I get the feeling I do, as otherwise there is no resistance between the 5V source voltage connected to the R1 resistor at the emitter and the ground connected at to the collector
(I did notice that a 50 Ohm resistor works fine as well.. and that a very high resistor, like 500k prevents the motor from ever disengaging)
3. The R3 resistor is just there to limit the current into the Base.
Is it correct that it doesn't really matter what specific value I use as long as it triggers the transistor when there is a base current above a certain value? Or would it be smarter to have a very specific value there?
4. R2 is there to discharge the capacitor. Playing around with the capacity and R2 value changes the time the "Engage" stays on. A capacitor of 220uF with 33K resistor for example allows me to have up to 7-8 seconds of continued engagement once the signal goes to off. Anything over 1 seconds is fine in real life.
5. The diode after the switch is a simple diode (1n4007 in my case) that there to make sure that the capacitor doesn't creep into the "Step" signal of the Tb6600. As that 40Hz signal is actually coming from the "Step" (PUL+) pin of the Tb6600, I didn't want to "confuse" the driver with signal that may come from the capacitor.
Am I correct in it's necessity? Is 1n4007 proper one for my use? (Or an overkill?)
6. The "Step" signal I'm using in the simulation is a 40Hz 0V/5V square wave.
I've observed that as soon as I close the top switch and allow the signal to flow into the circuit, the voltage after the diode jumps first to about 7.5V, and then over a short time drops to about 4.5V. I am not sure if that 7.5V is an issue for me. I know that empirically nothing bad happens when I test the mechanism in the real world.. and I believe that it has something do to with the capacity and the original signal combining, as there are no coils here to cause strange voltage spikes.. But can anyone confirm or explain it?
Thanks a lot in advance.
I would love some help reviewing my little circuit..
I have a stepper motor driver (TB6600) which has an "ENABLE" function.
It has an ENA- that is supposed to be connected to the ground, and a ENA+ where you supply the signal for ENABLING or DISABLING the stepper motor connected to it. That ENA+ pin is active on low, which means that if you don't supply any voltage to it OR you connect it to ground, the stepper motor driver enables the motor (movement or lock). Otherwise, if you supply any voltage to the ENA+ pin, the motor is disengaged and can be turned freely by hand.
So far so good, it all works fine.
Now, I want to be able to reverse this, so that when a voltage is supplied in an "Activate" line, the stepper motor driver (and motor) is Enabled, while if the voltage is very low, the stepper motor driver (and motor) is Disabled.
Furthermore, the enabling of the motor should be based on whether or not there is a "Step" signal provided to the stepper motor driver (the signal is on-off-on-off..., each change is a single step), to turn the motor.
However, I can't connect the step signal directly to the "Engage" line, because it needs to be consistently on, and not going on and off.
So.. I want to create a time delay circuit that will turn the "Engage" on as soon as there is a "Step" signal going high (on), and will keep it on for a bit after it turns low (off), so to make sure that it's disabling the motor just because it went off as part of the regular motion.
(my plan is to always set the "Step" signal to low, when I want to disengage (disable) the motor)
So.... I have come up with the following schematic which works!!
However, I wanted to check with people who know more than me about certain things I'm noticing, as well as ask about possible flaws in the design and design aspects and values which I've set that I'm not sure about.
The design can be accessed here : https://tinyurl.com/yh2fubnw
And here is a screenshot of it:
My questions are:
1. The transistor I'm using is basically any NPN transistor. In my case an A42.
Is that correct? It doesn't really matter what NPN transistor I use, as long as it can handle the 5V range?
2. R1 is set to 2.2k. I tested this empirically and believe that the importance here is to have in place a resistor that is low enough to not impede the ability of the opto-coupler in the Tb66000 on the ENA+, but high enough to not generate a current too high going into it.
The question is.. Do I even need a resistor there? I get the feeling I do, as otherwise there is no resistance between the 5V source voltage connected to the R1 resistor at the emitter and the ground connected at to the collector
(I did notice that a 50 Ohm resistor works fine as well.. and that a very high resistor, like 500k prevents the motor from ever disengaging)
3. The R3 resistor is just there to limit the current into the Base.
Is it correct that it doesn't really matter what specific value I use as long as it triggers the transistor when there is a base current above a certain value? Or would it be smarter to have a very specific value there?
4. R2 is there to discharge the capacitor. Playing around with the capacity and R2 value changes the time the "Engage" stays on. A capacitor of 220uF with 33K resistor for example allows me to have up to 7-8 seconds of continued engagement once the signal goes to off. Anything over 1 seconds is fine in real life.
5. The diode after the switch is a simple diode (1n4007 in my case) that there to make sure that the capacitor doesn't creep into the "Step" signal of the Tb6600. As that 40Hz signal is actually coming from the "Step" (PUL+) pin of the Tb6600, I didn't want to "confuse" the driver with signal that may come from the capacitor.
Am I correct in it's necessity? Is 1n4007 proper one for my use? (Or an overkill?)
6. The "Step" signal I'm using in the simulation is a 40Hz 0V/5V square wave.
I've observed that as soon as I close the top switch and allow the signal to flow into the circuit, the voltage after the diode jumps first to about 7.5V, and then over a short time drops to about 4.5V. I am not sure if that 7.5V is an issue for me. I know that empirically nothing bad happens when I test the mechanism in the real world.. and I believe that it has something do to with the capacity and the original signal combining, as there are no coils here to cause strange voltage spikes.. But can anyone confirm or explain it?
Thanks a lot in advance.