About Stepper Motors

Thread Starter

q12x

Joined Sep 25, 2015
2,227
I was trying a lot of permutations for the 5wire motor on this 4wire circuit.
And everything got to hell in a few moments. Im not sure what it is exactly.
I tested the 5wire stepper motor at 5V and nothing happened. But I remembered that tis particular motor likes a higher voltage. So I ramp up to 15V. It didnt happen anything for a few permutations(wire changes of the motor), but after a short time, and probably fv change, the 555 burned down. I replace it since I have enough in stock but I really dont like when they are damaged.
I also quickly changed the voltage regulator the ams1117 with a LM317. It got very hot after some permutations.
Then the second 4017 and last one I have, one of it's ouputs burned, more specific, the second, it's Q1. Then I changed all the Q's of the 4017 to count in order, except Q1. So I link it like this now: Q0,Q2,Q3,Q4. And all the leds are lighting as before, in proper sequence, no problem. But after some other permutations I made, this time Q4 stays lit up all the time. If I remove Transistor Q7 the led functions as usual, so the 4017 is not damaged on that pin. If I put another new transistor, the led gets on all the time again. Something I can not see is terrible damaged or it is getting damaged from some leak somewhere.
I believe I made a great mistake not including protection diodes on the transistors. I totally forget it and I know these things. But not when I need them.
Again, at 5V everything behaved and worked exemplary. After I switched to 15V, everything got to hell. Damn.
I have to receive 10pcs of 4017, but it will take a long time until they arrive through normal postage. Aaah.
I really wanted to test the 5wire stepper motor. It did work in a sense, by trembling a lot, but I didnt manage to make it spin at all in all the permutations I made. Pity.
 

Thread Starter

q12x

Joined Sep 25, 2015
2,227
No motors were in any danger. Only the IC's.
Somehow the voltage regulator failed in the entrance, or the spikes from the coils got through back to the 4017. Its the only explanation I can think of. Or both simultaneously?
 

ScottWang

Joined Aug 23, 2012
7,501
Good news.
I managed to make a simulation in Proteus that is actually working from the first try, for a variable driver for a 4wire stepper.
I do not have that L298 IC so I made its internal logic as a potential real board to build later.
Heck, I also attach here the actual save file in Proteus for anyone to play with.
View attachment 278383
If the power is applied with +5V then the R3~R6 using 1K is OK, If the power is applied with +15V then the R3~R6 should use 3.3K~4.3K, otherwise, the CD4017 may damage because draw too much current by LEDs.
 

sarahMCML

Joined May 11, 2019
697
I was trying a lot of permutations for the 5wire motor on this 4wire circuit.
And everything got to hell in a few moments. Im not sure what it is exactly.
I tested the 5wire stepper motor at 5V and nothing happened. But I remembered that tis particular motor likes a higher voltage. So I ramp up to 15V. It didnt happen anything for a few permutations(wire changes of the motor), but after a short time, and probably fv change, the 555 burned down. I replace it since I have enough in stock but I really dont like when they are damaged.
I also quickly changed the voltage regulator the ams1117 with a LM317. It got very hot after some permutations.
Then the second 4017 and last one I have, one of it's ouputs burned, more specific, the second, it's Q1. Then I changed all the Q's of the 4017 to count in order, except Q1. So I link it like this now: Q0,Q2,Q3,Q4. And all the leds are lighting as before, in proper sequence, no problem. But after some other permutations I made, this time Q4 stays lit up all the time. If I remove Transistor Q7 the led functions as usual, so the 4017 is not damaged on that pin. If I put another new transistor, the led gets on all the time again. Something I can not see is terrible damaged or it is getting damaged from some leak somewhere.
I believe I made a great mistake not including protection diodes on the transistors. I totally forget it and I know these things. But not when I need them.
Again, at 5V everything behaved and worked exemplary. After I switched to 15V, everything got to hell. Damn.
I have to receive 10pcs of 4017, but it will take a long time until they arrive through normal postage. Aaah.
I really wanted to test the 5wire stepper motor. It did work in a sense, by trembling a lot, but I didnt manage to make it spin at all in all the permutations I made. Pity.
Hi,
Your 4017 cannot supply enough base current to the BD139 transistors when you raise the supply voltage above 5 volts. Probably the only reason you get away with it at 5 volts is that they can supply the required motor current down there without overstressing the 4017 too much, but it's probably marginal. Make each BD 139 into a darlington pair with another, smaller transistor.
Also, the 7404, if connected to 5V, won't like having it's inputs being driven with higher voltages, and could be responsible for destroying the 4017 Q1 output. I'd connect a Schottky diode between the input of each gate (anode to gate), and a 4K7 pullup resistor from the gate to 5V.
I'll do you a diagram if you need it, but it'll have to be tomorrow as I need to go get dinner!
 

Thread Starter

q12x

Joined Sep 25, 2015
2,227
To both mister @ScottWang and miss @sarahMCML. First of all, thank you very much for your feedback and welcome to the discussion. Both are very-very close to the truth.
- I couldn't sleep well so I started reiterate the circuit in my head, and was thinking on procedures of protection and redundancy.
But, at some point I realized I have absolutely NO Base resistors for the NPN BD139 ! This means I was giving them on the base some sort of direct 5V. This means I weakened all of them and some just give up. And after that, the potential was too great (probably) from 15V to the 5V and the current was surging not only to the 0V rail but (probably) into the 5V rail as well, (probably) through or near the base(s) of these damaged or weakened NPN's. My observations are near the POT1 variation, when fv changed, the damaged IC's occurred. This is how I suspect the damaged 4017 and very strangely, 2 of 555's ! And also the NOT gates were feeding directly 5V on the NPN Base as well. Great barbecue !
- What a stupid mistake. And I also know why I made such a stupid mistake. Because I got used from long time ago actually, to --skip-- resistors and diodes and capacitors in my --simulation-- program. Because I can get results without them and also because I get the idea of the working design circuit faster. What I did here, I print the circuit very happy on the paper, build it, and not think for a second on the protection and redundancy LAYER of the circuit. Rookie mistake from my part, again, I know these things but, I sometime, frack it up.
And back to what you said, some Led-resistor over current drain as well, most probably helped the damage force. I also noticed that after a certain level of the increased Voltage, around 15V in the beginning, but after more 'tests' it started to go down to 10V and even 6V, the amperage of the PSU was going high as 900mA, 1A, then 1.2A and finally to around 1.5A after a couple of "tests". SO definitely 1 or many components over-stressed or burned out. Also the Voltage regulator, LM317 , got very Hot - probably 100dgrC or more, and also 4017 got insanely hot as well, 100 or more. I smelled the "hot metal" in the air, and then I finger each component to check exactly which one was hot. I didnt check every component though. It will be nice if I had a thermal camera in these situations. Aaah.
I will make right away a more protected and complete circuit than this "ideatic" circuit that fried half of my components.
What a disaster !
 
Last edited:

ScottWang

Joined Aug 23, 2012
7,501
I have breadboarded this circuit:
And super success ! It worked from first try on both different types of 4wire stepper motors I have. With a slight voltage difference between the 2, like 1V or so, and also different fv speed. They are different motors after all. Both working at 5V and with substantial current draw.
At 5V, the scrapped motor is drawing 420mA when the fv(or POT1) is the lowest.
At 5V, the new motor (Nema 17) is drawing 950mA (almost 1A) when the fv(or POT1) is the lowest. Is this normal? Or I got the bad ones here? They both work and no heating whatsoever which is always good. But the power they draw, its a bit much, or at least clearly I am not used to. I included a voltage regulator in the breadboard circuit (not shown in the diagram) specifically for the logic circuit (stupidity) protection. I did jumped the voltage to 6V for a few seconds but I bring it back to 5V and even to 4V which is working fine as well. Very interesting. At lower speeds(fv) both motors are trembling but rotating. At higher speeds(fv) the trembling almost disappears especially for the new one; the scrapped one is a bit too trembling at higher speed-fv andif I turn the fv too much up, is freezing still, sign that the coils inside have a limit. The new one is fine with higher fv. Very cool so far. I am VERY happy!
Ive only breadboarded these 2 circuits for 5wire and 4wire stepper motors. It is time to make the stand alone boards for them.
I also buy that h-bridge driver L298, 10pcs for some sort of good deal, but still expensive in my book.
View attachment 278503

View attachment 278492

View attachment 278501
When I designed the circuit to do the test, I used the 555 and CD4017 to simulate the output from MCU, it is just for the test and doesn't for application, for the circuit to make it simpler, so it didn't have too much consideration.

Although you have referred to the internal structure of L298N from the datasheet, you just saw only one transistor, but I think it was some kind of darling pair, so you need to add a transistor for each bd139, like as 2N2222, 2N3904, etc.

And just take R3~R6 away or just provides them with only 1 mA.

Edit:
When you do the test and the stepper motor works correctly then you can use Arduino to do the test, the 555, CD4017 circuit is just designed for testing, not for application.
 

Thread Starter

q12x

Joined Sep 25, 2015
2,227
I stay all night to make the circuit, I had other simulator problems to deal with as well. But I managed to make this circuit more SAFE. But it is not working both in simulator or in reality. Check this circuit for me and see what terrible mistake I did again.
I find 2 burned/damaged transistors and I replace them with new ones. I measured the voltage on each base of all the transistors and I get the same voltages on all of them now, sign that they are at the same working quality. The burned ones were give me 5V on their bases, sign of damage. By measuring all of them I could compare between them and they all are nominal now. So the transistors are not a problem now, but something else in the circuit is against good operation. I measured the (OUT1-4) output to the coils and I get impulses but very weak. I really did my best.
I am baffled and tired of it. Here is the circuit:
View attachment 4wire 2phase2coil Stepper Motor logic circuit v2.jpg
Ive attached the proteus file as well, feel free to play in it.
 

Attachments

Last edited:

Thread Starter

q12x

Joined Sep 25, 2015
2,227
Holy caramboly. I literally stayed all day and all night on this problem because nothing worked for the whole 20h or so of testing. A TON of work and testing and figuring out and I finally managed to make it work ! What a relief. Ohohoa. But when it finally started to work, I was served with some serious problems.
Here they are:
A TON of heat dissipation on the Voltage Regulator itself and on the Top Transistors. Most probably over 100dgrC.
1665936804081.png
I immediately put a aluminium heat dissipation on the VoltReg. It helped on the long run, when I did some really high power (from his perspective) tests.
The (2) 4wire motors rotate very well. But the 5wire motor only tremble and I could NOT make it rotate at all.
- At 5V, for the (2) 4wire stepper motors only 1 or 2 transistors in the second h-bridge got hot but not excessively.
- At 15V for the 5wire stepper motor, ALL those TOP transistors got excessively hot !!! They smelled as hot metal and I fingered everything to be sure who was and how much. I'm like that cook from the story, that was handling his bread at 150dgrC with its bare hands. The same here, I was burned for a bit but my skin is thick and resilient enough. When the center tap of the motor was set on negative ground. When I change it to positive, all the resistors on the base of (I believe of all) the transistors got excessively hot. But the transistors themselves remained cold enough, if I remember right.
The Voltage Regulator got excessively hot !!! I couldnt do much testing on the 5wire motor because I was keeping an eye on this excessive heat. I believe the voltage regulator has an internal heat sensor that is stopping it and protecting it from burning out. I notice a couple of times the entire circuit stopped especially for higher voltages up to 20V or so. When I got down and restarted the circuit power, it started working again. The good news, this time no IC got burned. All the heat was on the extremities of the circuit, the start and the end of it. I also didnt keep it running dangerously hot too much time as I did in the first cct. Now I got some very clear hints of overheating, compared to original unprotected cct.
The conclusion:
1665934281451.png
So I was right ! The surge come from both ends of the logic circuit. Incredible.
I notice something else though. I remember very clearly the 5wire motor getting too warm in the first cct !!!
I could test it longer time back then. Also the ICs got burned as well, haha.
But now.... the ICs are considerably well protected so the heat is on the transistors and the VoltReg. The heat is not taken by the motor but by the components themselves. It will be nice if I could balance somehow this heat dissipation, 50% on the transistors and 50% on the motor. That would make a considerable difference. But Im not THAT good. I know is possible though, but not by me, haha.
Another very important point. I incline to believe the 5wire motor MAY BE old and weakened or even damaged. Thats why it is requiring higher voltage to work. Is an impression, but it may be very well the optimal voltage for it as well. Thats why is stressing so much everything around it. Also,I believe I am working with under power components here, this excessive overheating is telling me these components are weak as flark. At least for this type of circuit im making here. If I had BETTER Power transistors like 10W or so, then the story was a sexy pink one and not so morbid black as so far. Very sensitive circuit !
Im glad all those wire connections were good from the beginning. I didnt mess up anything in the logic wiring. That part put a smile in my hearth. Aaah, at least Im THAT good at this part. Haha.
So... yah... the 5wire motor didnt spin/rotate but it only trembled, for a lot of permutations. It didnt work for the permutations I did in the first cct. I noted on a paper the working permutations for it to work and I find several combinations actually. Not only 1 or 2. Like 6 ! None worked with this cct here. Very strange.
 

sarahMCML

Joined May 11, 2019
697
I stay all night to make the circuit, I had other simulator problems to deal with as well. But I managed to make this circuit more SAFE. But it is not working both in simulator or in reality. Check this circuit for me and see what terrible mistake I did again.
I find 2 burned/damaged transistors and I replace them with new ones. I measured the voltage on each base of all the transistors and I get the same voltages on all of them now, sign that they are at the same working quality. The burned ones were give me 5V on their bases, sign of damage. By measuring all of them I could compare between them and they all are nominal now. So the transistors are not a problem now, but something else in the circuit is against good operation. I measured the (OUT1-4) output to the coils and I get impulses but very weak. I really did my best.
I am baffled and tired of it. Here is the circuit:
View attachment 278568
Ive attached the proteus file as well, feel free to play in it.
I've just got around to drawing this partial circuit which should I hope deal with the problems. It does need more parts, including 4 PNP and 6 NPN small signal transistors, and 4 Schottky diodes (if you have some), but it should be self explanatory.
Best thing is all the logic can be driven from 5 volts, preferably, without the parts in the box!

StepperMod.jpg
 
Last edited:

sarahMCML

Joined May 11, 2019
697
Hi Again,

When you were powering your circuit last night at "up to 20 volts or so", what voltage was the 4017 being powered from? Your diagram says 5V to 37V, it hasn't really gone that high, has it?
Have you checked with your oscilloscope to see what the voltage on the emitters of the upper transistors get to when they are going high? they should be getting close to the positive rail, but I'm guessing they are not, hence all the heat being generated.
You should really be supplying the logic circuits from a separate lower voltage input, a USB phone charger would be ideal. Then you wouldn't need the 7805 at all!
 
Last edited:

Thread Starter

q12x

Joined Sep 25, 2015
2,227
You should really be supplying the logic circuits from a separate lower voltage input, a USB phone charger would be ideal. Then you wouldn't need the 7805 at all!
Very interesting point and very smart using a separate 5V power supply. But you know, a VoltReg is a cheap solution and small enough. And is doing it's job, to a point, until it heats up and melt.
Your diagram says 5V to 37V, it hasn't really gone that high, has it?
I explained everything exactly how I made it. The maximum I push it was 24V the first time, but now in this second cct only to 20V and a bit longer on 15-16V. That 2V to 37V part is a reminder how much the VoltReg can be run at. It's from it's datasheet. But for some reason is overheating at only 15V. It shouldn't !!! Something I still can't see. Maybe is indeed a darlington pair for each transistor I have there... that sucks. I am considering every hint I get from you.
I was thinking on improving the power and heat dissipation by putting 2 transistors in parallel replacing 1 that is now.
Is your multiple low power transistor cct improve on the power and heat dissipation? It is and interesting cct, I give you that. Ive seen it used before, more probably inside IC's themselves. I dont care how complicated it is, I care only on the randament and good performance for a wide test scenarios and power dissipation.
I believe I got over board a little bit. because this original cct was actually made to function at 5V. But I had that 5wire weird motor that only worked at 15V up to 24 or so. And I risk the 5V cct to drive this completely inappropriate motor. I think this motor is a completely other category and we will need another cct for it specific to handle more power. What I did so far was to push the limits of this precarious 5V cct, pretty much. Haha. And Im amazed it worked so far.
This more secure and more robust cct that I have right now, it also limits a little bit the speed and power of the 5V 4wire motors. I feel they are not drive at their full potential. But they work, they spin ! Not as efficient as I want but they do.
 

Thread Starter

q12x

Joined Sep 25, 2015
2,227
Maybe this simple configuration, resistor-base-transistor, is drawing too much power from the VoltReg, overheating it at only 15V when it shouldn't, he should resist up to 37V as in its datasheet. Correct?
1665941317525.png
Maybe this simple configuration , resistor-base-transistor, also overheating the transistors themselves. Especially the Top ones.
So i believe that your more complicated cct using small power transistors like you showed me, MAYBE that will solve the entire power consumption both on the voltReg and on the driving transistors themselves.
I am correct to assume this? Or there is something else?
Tell me now before I start building the thing. Haha.
 

sarahMCML

Joined May 11, 2019
697
Maybe this simple configuration, resistor-base-transistor, is drawing too much power from the VoltReg, overheating it at only 15V when it shouldn't, he should resist up to 37V as in its datasheet. Correct?
View attachment 278611
Maybe this simple configuration , resistor-base-transistor, also overheating the transistors themselves. Especially the Top ones.
So i believe that your more complicated cct using small power transistors like you showed me, MAYBE that will solve the entire power consumption both on the voltReg and on the driving transistors themselves.
I am correct to assume this? Or there is something else?
Tell me now before I start building the thing. Haha.
I couldn't read the details of the circuit you gave earlier, it came up too small on my laptop. So I still don't know what voltage the 4017 is powered from?
If you are driving the input of this circuit with anything more than 5V, then the inputs of the 7404 are being massively over driven. Use the circuit in the box that I sent earlier.
The Darlington transistor setup gives a massive gain for the stages, and greatly reduces the load on the drive requirements of the 4017.
 

Thread Starter

q12x

Joined Sep 25, 2015
2,227
I couldn't read the details of the circuit you gave earlier, it came up too small on my laptop.
You have to click on the image and then use the zoom function (if is not gray)
1665949321840.png
Here is a closeup anyway
I probably mentioned this already, all the logic circuit gets a constant 5V from the VoltReg LM317.
The 555, 4017 and the Not gate and the bases of all transistors. The ground is common to both 5V and 15V.
Without any motor connected, the circuit by itself consumes about 100mA at 5V.
1665949257365.png
 

sarahMCML

Joined May 11, 2019
697
You have to click on the image and then use the zoom function (if is not gray)
View attachment 278626
Here is a closeup anyway
I probably mentioned this already, all the logic circuit gets a constant 5V from the VoltReg LM317.
The 555, 4017 and the Not gate and the bases of all transistors. The ground is common to both 5V and 15V.
Without any motor connected, the circuit by itself consumes about 100mA at 5V.
View attachment 278625
If you're supplying the 4017 from 5V, then the Q outputs cannot drive the bases of the upper transistors to more than that, therefore the emitters won't get much above 4.5V. No wonder the transistors get hot!
To get proper drive to those you need to try my circuit.
Your other choice is to use N and P type MOSFETs.
 

Thread Starter

q12x

Joined Sep 25, 2015
2,227
To get proper drive to those you need to try my circuit.
Its the next thing to do in my list and I will do it.
Your other choice is to use N and P type MOSFETs.
I have those as well, 100pcs of IRFZ44N. Will it simplify the circuit (not so many transistors) ?
Can you draw for me the mosfet version please?
- Thank you officially for your extraordinary involvement and real help ! I really enjoyed working with you.
You are an awesome person. I assume you are from america, your info doesnt tell. You have the right 'accent'. Haha.
 
Top