About Stepper Motors

sarahMCML

Joined May 11, 2019
697
Thank you @sarahMCML ! Very cool explanation !
This is my first time when I encounter these sense resistors. Very new concept to me. I understand something from your explanation. I will practice them as you explained. LM358 I have x200pcs. Also uA741 x100pcs. And one or 2 of some other types opamps but not many, <5 and they are scrapped.

I dont understand this part. Draw it.
Here's my circuit. It's basically the same as yours, just minor mods so that I can use it with my own stepper driver board instead of the L298N. Hence the additional Enable line, as per the L6506 IC.
I used the 2.5v reference chip just to ensure a stable point for the comparator positive inputs, against any drift in the +5v supply. In any case, I have about 100 of them!


DiscreteL6506.jpg

I have a number of jumpers on my board which aren't shown on this diagram which I can link across to the L298N module.
As I use one of the pre-built L298N modules from AliExpress, I had to cut the two tracks on the bottom of the PCB to isolate pins 1 and 15 of the chip and bring them out to my board.
 

Thread Starter

q12x

Joined Sep 25, 2015
2,227
A bit of critique on your cct:
-Always make those redMarkedNames pop out - clearly and easily visible. Make them red, bold, italique, bigger, diferent font, add extra characters around them, whatever it takes just to be easy to spot. I literally spent 5minutes searching for their names and especially that top one 7476.
1670196209686.png
- Also as you know it already by now, that " Enable line" is not really enable anything. Haha. Is just a surplus wire on your cct. I know you know it. But I have to poke your eyes with it a bit. Haha. I eliminated it completly in my cct. It is a nice function on the chip itself but here in our cct, is just extra wire that does absolutly nothing other than interrupting the AND block. You can interrupt it in other ways more simpler and less wires. My point is, that wire is really not needed.

I used the 2.5v reference chip
I dont see any 2.5V chip ! What's is name? it is a voltage regulator set on this value, fixed and not variable? I imagine it must be. But I dont see it in your cct. I only see a zener diode at 2.5V that is in paralel with a 10k pot. I believe....maybe... those 2 opamps that you have there TLC3704 (or maybe LM339 - why in the hell is having 2 different names?) , maybe that opamp(s) are working with only 2.5V? I only see their input powered to 2.5V. Maybe you also powered them (the chip(s))as well from that voltage? I dont get this part very well. Im sorry about it being too insistent but you keep mentioning so it must be important and I have to understand your point using it there.
I just made a search for both of them and now I understand what those 2 names means (to you). I didnt get it from a first glance at all. So... the TLC3704 is a chip in its own, and the LM339 is another chip in its own. They are bots similar, but yours is better than LM339 and I quote "functionally similar to the LM339 but use 1/20th the power for similar response times". So is a reminder that is LIKE LM339. Now I get it. But I dont get the 2.5V part. It says that TLC3704 is a Single Supply Operation . . . 3 V to 16 V.

- Another critique is the 1/2 part of the 4 resistors which means 500mW each. You said that we need 1W. To be 1W those must be 1/4 or 250mW. Now at 1/2 are 500mW each. The 4 of them make it 2W. And 8R2/4=2.05R value. I guess this is because your coils of the motor are that value and you mirror it with this resistor value here. In my case, being 0.8R per coil, I must mirror it with a 0.8 resistor at 1W. If I understood your directions correctly. Hmmm...

- I only have and used NE555. Your TLC555 it give me a bit to think if it is or not a 555. Is very obscure mark, for me at least.

Your 7476 FF CK1 and CK2 are tied to +V. Shouldnt they be linked to the 555 output pin3? I did it in my cct. PR1 and PR2 means Preset. Im not very familiar what that preset does. It is a weird link you made there. For me at least, Im not used to it, is a new way of doing things I guess.
1670199490700.png
Thank you for your cct ! Very nice done so far.
 
Last edited:

Thread Starter

q12x

Joined Sep 25, 2015
2,227
Miss @sarahMCML, success !
I only changed those 1k I had before with 4x3.9R (@ 250mW each) in paralel as you told me. 3.9R/4=0.9R at 1W now. No one got warm or hot. But I didnt test them long enough because other problems to resolve first.
The motor(s) - all of them - are spinning !
I tested my NEMA17, the scrapped one, and the recent new NEMA8.
But with some notable problems:
- The 10k pot is not doing much, at least in my cct. It is literally jumping from 1 state to another state. I am watching my PSU Ampmeter and for 1 side of the 10k POT is 100mA and for another it jumps to 500mA. Depends on the motor, these values differ. Not really ramping down or up anything.
- Another thing was the power of the motor was incredibly weak. If I hold the axe of the motor with my fingers, it stopped spinning with very little pressure.
- I have that variable fv external module now, and if I vary the fv from it, the speed of the motor changes, which is good.
So far, this cct does nothing really. At least for me. I expected it to slowly ramp up or down the amperage, but... is not doing it.
 

sarahMCML

Joined May 11, 2019
697
A bit of critique on your cct:
-Always make those redMarkedNames pop out - clearly and easily visible. Make them red, bold, italique, bigger, diferent font, add extra characters around them, whatever it takes just to be easy to spot. I literally spent 5minutes searching for their names and especially that top one 7476.
View attachment 282186
- Also as you know it already by now, that " Enable line" is not really enable anything. Haha. Is just a surplus wire on your cct. I know you know it. But I have to poke your eyes with it a bit. Haha. I eliminated it completly in my cct. It is a nice function on the chip itself but here in our cct, is just extra wire that does absolutly nothing other than interrupting the AND block. You can interrupt it in other ways more simpler and less wires. My point is, that wire is really not needed.


I dont see any 2.5V chip ! What's is name? it is a voltage regulator set on this value, fixed and not variable? I imagine it must be. But I dont see it in your cct. I only see a zener diode at 2.5V that is in paralel with a 10k pot. I believe....maybe... those 2 opamps that you have there TLC3704 (or maybe LM339 - why in the hell is having 2 different names?) , maybe that opamp(s) are working with only 2.5V? I only see their input powered to 2.5V. Maybe you also powered them (the chip(s))as well from that voltage? I dont get this part very well. Im sorry about it being too insistent but you keep mentioning so it must be important and I have to understand your point using it there.
I just made a search for both of them and now I understand what those 2 names means (to you). I didnt get it from a first glance at all. So... the TLC3704 is a chip in its own, and the LM339 is another chip in its own. They are bots similar, but yours is better than LM339 and I quote "functionally similar to the LM339 but use 1/20th the power for similar response times". So is a reminder that is LIKE LM339. Now I get it. But I dont get the 2.5V part. It says that TLC3704 is a Single Supply Operation . . . 3 V to 16 V.

- Another critique is the 1/2 part of the 4 resistors which means 500mW each. You said that we need 1W. To be 1W those must be 1/4 or 250mW. Now at 1/2 are 500mW each. The 4 of them make it 2W. And 8R2/4=2.05R value. I guess this is because your coils of the motor are that value and you mirror it with this resistor value here. In my case, being 0.8R per coil, I must mirror it with a 0.8 resistor at 1W. If I understood your directions correctly. Hmmm...

- I only have and used NE555. Your TLC555 it give me a bit to think if it is or not a 555. Is very obscure mark, for me at least.
Thank you for your cct ! Very nice done so far.
Right, here we go!
As I pointed out when I sent the original diagram, YOU didn't need the extra ENABLE input, because you are only driving an L298N. I, on the other hand, need it because my discrete built motor driver MOSFET board doesn't have one.

I think the names are big enough, especially as they are located close to the relevant devices. Duplicated names in brackets are only to show equivalents, which YOU might have used instead.

The "2.5V chip" is the ZR285. Its is, as you surmised, a fixed voltage regulator in a 3 pin package (only 2 pins used). It is even shown as a zener in the datasheets!

If you look closely at the TLC3704 you will note that pin 3 is connected to +5V, and pin 12 to 0V. These are the power pins of the device (and the equivalent LM339).

You need AT LEAST 1W if you use a 1 Ohm resistor in each leg. If using 0.47 Ohm, the power dissipated will be less, so you COULD get away with a half watt one. It all depends on how much current is passing through how much resistance: Ohms Law! But it's your choice as the designer what values to use, within reason!

For my motor the coils have a resistance of 23 Ohms, but I made the choice, having no data on it, to limit the current to 0.5A maximum. On that basis, and not wanting to waste too much power in the resistors, I chose to put 1V across them, which at 0.5A equals 2 Ohms. That's 0.5W, so I used 4x8.2 Ohm 0.5W in parallel for each.

As you have no doubt discovered by now, the TLC3704 and TLC555 are CMOS versions of the older ICs. The TLC3704 doesn't need a pullup resistor, and the CMOS 555's are much nicer to use than the old bipolar part!
 

sarahMCML

Joined May 11, 2019
697
Miss @sarahMCML, success !
I only changed those 1k I had before with 4x3.9R (@ 250mW each) in paralel as you told me. 3.9R/4=0.9R at 1W now. No one got warm or hot. But I didnt test them long enough because other problems to resolve first.
The motor(s) - all of them - are spinning !
I tested my NEMA17, the scrapped one, and the recent new NEMA8.
But with some notable problems:
- The 10k pot is not doing much, at least in my cct. It is literally jumping from 1 state to another state. I am watching my PSU Ampmeter and for 1 side of the 10k POT is 100mA and for another it jumps to 500mA. Depends on the motor, these values differ. Not really ramping down or up anything.
- Another thing was the power of the motor was incredibly weak. If I hold the axe of the motor with my fingers, it stopped spinning with very little pressure.
- I have that variable fv external module now, and if I vary the fv from it, the speed of the motor changes, which is good.
So far, this cct does nothing really. At least for me. I expected it to slowly ramp up or down the amperage, but... is not doing it.
Just seen this post, have been replying to the previous one.

You should try setting the voltage on your 10K pot to about 0.6V above zero, and leaving it there to start with. Can you connect your scope to that point and see if it is stable? Do you have enough decoupling capacitors around the board, especially near the NE555?
 

Thread Starter

q12x

Joined Sep 25, 2015
2,227
Can you connect your scope to that point and see if it is stable?
Very interesting to see this on my hercules. This is the first time I see a POT on the osciloscope.
I measure "that point" and I assume is this point here:
1670205249466.png
this is what I scoped. And it is indeed lowering from 5V down to 0V.
Also as you can notice, it goes straight to the rails.
I believe that Amperage jump, was the fact I reached 0V rail? Hmmmm....
1670205220007.png
Do you have enough decoupling capacitors around the board, especially near the NE555?
I am always putting 100nF on pin5 of the 555 to gnd.
2caps on the voltage regulator input and output:
20221205_035843.jpg
and here is an overview of the entire cct as I have it at this point.
20221205_035910.jpg
 

Thread Starter

q12x

Joined Sep 25, 2015
2,227
I re-checked the entire cct on the breadboard and I didnt see anything out of the order.
"it works" but at a much lower power, both electrical and mechanical.
Also it doesn't really changing the amperage.
 

sarahMCML

Joined May 11, 2019
697
Very interesting to see this on my hercules. This is the first time I see a POT on the osciloscope.
I measure "that point" and I assume is this point here:
View attachment 282195
this is what I scoped. And it is indeed lowering from 5V down to 0V.
Also as you can notice, it goes straight to the rails.
I believe that Amperage jump, was the fact I reached 0V rail? Hmmmm....
View attachment 282194

I am always putting 100nF on pin5 of the 555 to gnd.
2caps on the voltage regulator input and output:
View attachment 282197
and here is an overview of the entire cct as I have it at this point.
View attachment 282198
I've just noticed something. Are you using the circuit exactly as in post #237? Because I don't see a NE555 section in there. The 2 preset inputs should go to pin3 of the NE555 chopper circuit, not to your motor speed clock input!
There is an error where you have the flipflop clock inputs tied to the preset inputs, but they should be connected to +5V.

Must sleep now, back tomorrow.
 

Thread Starter

q12x

Joined Sep 25, 2015
2,227
Are you using the circuit exactly as in post #237?
yes
Because I don't see a NE555 section in there.
Really? Look again, Is there.
There is an error where you have the flipflop clock inputs tied to the preset inputs, but they should be connected to +5V.
I linked both clocks of the FF 4027 to +5V as you said.
And the circuit is still working, which is weird. But no significant difference from before.
The 2 preset inputs should go to pin3 of the NE555 chopper circuit, not to your motor speed clock input!
This part I dont get it.
Must sleep now, back tomorrow.
Have a good sleep, thank you so far. Good job.
 

sarahMCML

Joined May 11, 2019
697
yes

Really? Look again, Is there.

I linked both clocks of the FF 4027 to +5V as you said.
And the circuit is still working, which is weird. But no significant difference from before.

This part I dont get it.

Have a good sleep, thank you so far. Good job.
Hi, back again.
We are at cross purposes here. I didn't mean the 555 timer right over at the left side of your diagram that goes to your "Run/Single Step" switch.
Your circuit is trying to chop the drive waveform at the same rate as the step speed, and getting totally confused.

You need a totally seperate 555 oscillator running at high frequency driving the preset inputs, just like in my circuit.
The L6506 recommends values of 22K, 1K and 3.9nF for the timing components. I used what I had available, which was close enough.
More construction needed, I'm afraid!
 

Thread Starter

q12x

Joined Sep 25, 2015
2,227
Thank you for confirming it. I was afraid it would need a second clock. I really thought it would have worked from a single clock all at once. Ive seen that internal clock of the L6506 (using external RC). But I kind of omitted and tried to outsmart it.
- How do you suggest to make this second clock? With another 555? or actually with an RC? (I rarely made RC cct for timing). And at what fv? How fast?
- I do have actually a second "clock", that PWM box I made, that is using a 555. It also have somewhat variable speed using 6 different caps and 1 jumper, connecting 1 cap per jumper choice. I used: 10u, 1u, 100n, 10n, 1n, 100p. The fastest being with the 100p. I believe I should attach this module. But im not completely sure how. I will give it a try and update you with my resolve.
 

Thread Starter

q12x

Joined Sep 25, 2015
2,227
This is the FIRST 555 box that is a fv-Variable frequency oscillator , the one that is used right now.
fv-Variable frequency oscillator v2.jpg
And this is the SECOND box, that is actually a 555 PWM but also with an option for changing the fv more than it was originally designed.
PWM with a 555 and a Mosfet.jpg
 

Thread Starter

q12x

Joined Sep 25, 2015
2,227
Here, with the 2nd external clock. Im showing the cct modification. This is how I think it should be linked to. I believe this (internal) clock is only for it's internal Flip-Flop of the chip. Am I right?
Here in the cct Im using a clock generator. But in reality I will add that second 555 box set to 100pF capacitor(fastest).
(the simulation also works but not for fv>1kHz; works with slower speed <=1kHz)
1670250149191.png
 
Last edited:

Thread Starter

q12x

Joined Sep 25, 2015
2,227
And, Glorious Success !
Thank you miss @sarahMCML !
- I can visibly see the PSU ampmeter ramping up and down the amperage as I rotate my Potentiometers on my 2 clocks. Very cool. Also a bit dangerous, playing with naked amperage on unknown motors like that. But so far so good.
- Now, with the second clock, ALL the motors are running even more smoother than before. Very smooth I may add. But at certain specific dial of my 2 clock speeds. As I said, for the 2nd clock, the one with the PWM, I used its fastest setting, with the jumper on the 100pF cap setting. Im very proud of this jumper option I put there - VERY ! haha.
- I still have the problem of these NEMA8 mechanical power. They are VERY easy to stop spinning by finger with small pressure. VERY EASY. Im thinking maybe there are other ways of driving a stepper motor. Single phase and double phase or something. I believe these specific NEMA8, needs special driving for increased mechanical torque. Is my belief. But until then, This cct right here is a success.
I believe I will build it as a stand alone cct. Hmmm. It definitely deserves its own board.
 

Thread Starter

q12x

Joined Sep 25, 2015
2,227
I was wondering, on my 4027, this NOT Q... is staying in air. Shouldn't be connected to 5V or 0V? Which is usually the right option?
1670253265633.png
 

Thread Starter

q12x

Joined Sep 25, 2015
2,227
New problems!
- I managed to spin the 5 wire motor as well, putting its common pin to motor VCC and the rest of the pins as the 4wire were connected. The only downside is that it is heating up relatively quickly. Why? Because this cct still have some issues. This 5wire motor is made to work at 5V. It is the only motor that is heating up. The rest are running cold.
- The entire cct will work from a minimum of 6V. Well, up to to 12V but I didnt raise it that far yet. I dont know why exactly from 6V. I suspect my 5V voltage regulator. The first clock is not working under 6V while connected in this entire cct. By itself, is working fine from 3V(I think). Very strange. I posted its cct a bit earlier, in post 252.
- I also did a small stress test. And everything is running cold except L298. At 800mA it is warming up, but not hot. I didnt let it get too hot either. The circuit and the motors are behaving erroneously when I keep the stress test too long. If I let it cool down, is behaving normally. I suspect L298 having some thermal regulator inside it? But im not very certain.
 

sarahMCML

Joined May 11, 2019
697
Here, with the 2nd external clock. Im showing the cct modification. This is how I think it should be linked to. I believe this (internal) clock is only for it's internal Flip-Flop of the chip. Am I right?
Here in the cct Im using a clock generator. But in reality I will add that second 555 box set to 100pF capacitor(fastest).
(the simulation also works but not for fv>1kHz; works with slower speed <=1kHz)
View attachment 282238
Back again after an exhausting day shopping!

Your circuit is still wrong! Please connect pins 3 and 13 of the 4027 to +5V, just like the J and K inputs. Only pins 7 and 9 should go to your external clock box, and it should be set to a FIXED frequency of around 15KHz, which is what the datasheet components set it to. You would be better off building another 555 circuit like mine, but using the datasheet components, if you have them. It's only a few parts after all!

The other fundamental problem with your circuit is that your 4027 reset and clear inputs operate on the positive signal, whereas because of the way they are wired, the comparators detect when the overcurrent goes above the set voltage, but output a NEGATIVE reset pulse. So the flipflops are being held in the wrong state at least half the time. This can be corrected by swapping their inputs, so that the positive inputs go to the sense resistors, and the negatives to the pot wiper.
Try these for now. I suspect other problems, but this is enough to be getting on with.

P.S. The /Q outputs should be left disconnected!
 

shortbus

Joined Sep 30, 2009
10,050
@sarahMCML, You really need to change your member name. From SarahMCML to Saintsarah. No one before you has ever spent so much time trying to get him to do something right.

One thing that may be wrong when things don't work is he is using mosfet with a breadboard. Many times they don't mke good connections in them, even really good breadboards, which from his postings his probably isn't.
 

Thread Starter

q12x

Joined Sep 25, 2015
2,227
So the flipflops are being held in the wrong state at least half the time. This can be corrected by swapping their inputs, so that the positive inputs go to the sense resistors, and the negatives to the pot wiper.
You mean to swap the opamp inputs, right?
(BTW, the 10k pot is still not doing anything important, at least until this point)
I made your 2 corrections:
1670286794207.png
 
Last edited:

Thread Starter

q12x

Joined Sep 25, 2015
2,227
No one before you has ever spent so much time trying to get him to do something right.
How mighty of you. If you have anything constructive to say, then why didnt you come with the RIGHT solution until now? Haha.
Do you think is EASY or FUN for me (or Sarah) to do it this way? It is Very hard and nerve stretching. At least for me.
I am usually used to work after simple circuit DIAGRAMS, and not from explanations. Especially when english is my second language and especially me doing these things so rarely and for what is worth, for the first time, for a lot of these modules.
Sarah here and another english friend from another forum, they both, only can HELP with explanations, and NOT with diagrams. And I adapted to their ways of doing things. As well as they both adapted to my particular way of doing my things as well, because this works in 2 ways. They both understood my level and they try to teach me the way of logic IC's. Which is what I asked actually. I wished I could be served with a straight forward circuit DIAGRAM, but if explanations are all there is, then I will try my BEST to do the BEST I can. You can not do what we are doing here. Its very hard to do it this way. But it is working, as slow and painful as it is.
I have the strong belief that WE will make it work. I didnt try the arduino yet. I only concentrated on logic IC method. And I am learning something, for sure. But most important, I get experience with them.
Clear now?(as mud) Haha.
 
Top