About Stepper Motors

Thread Starter

q12x

Joined Sep 25, 2015
2,227
No, it's not a variable current driver, it's a constant current driver,
Very good that you explicitly tell me this.
Then this must be variable ! Because I have multiple stepper motors with multiple current demands!
So we will have to make it variable. Like I said, most probably with a jumper option set on %, that I mentioned already.
- How does it knows what is the best current for the motor? Or it is having a fixed current that is driving with it all the steppers ? This part is very important to decipher. If is smart and adapt to whatever current the motor needs and feeds the optimal current to it, or if is just limiting the current to the POT value we choose and that's it.
 
Last edited:

sarahMCML

Joined May 11, 2019
697
The motor is not turning/spinning at 800mA. But it does spin at 750mA. That 800mA is overflowing the entire cct.
The POT value if is over 5% of turning, and everything that is beyond this value up to 100%, will remain a constant 800mA. I can see this 800mA on my PSU ampmeter. I think this 800mA is already limited from my PSU. If I was to limit it to 2A, that L298 was in flames long time ago.
So this 800mA is the extreme maximum of the POT, but after 5% of its turn, which happens ultra very quick, from its 0 point.
But If Im careful, I can dial up and down in this very small band of 0 to 5% and get different currents.
I believe I should make a jumper module that will set a fixed percentage of the current being used.
Pretty much like the comercial versions have:
View attachment 282430
And not variable with a potentiometer like we have it right now.
I will have to try your limiter and see what really that is doing. If it is really limiting until reaching the 800mA maximum death point.
If you have your power supply current limit set to 800mA then what is happening when you try to use 800 mA motor current is that the PSU goes into overload and drops the voltage to the whole motor drive, so it no longer works properly. The L298 will be perfectly fine IF you put it on a decent sized heatsink: it is rated for over 2A after all! Once you've done that, try turning up the PSU current limit to 1Amp.
If you put the 2 diode circuit on, you will only be able to dial in 1.5Amps, at most!
 

sarahMCML

Joined May 11, 2019
697
This is the actual explanation I was looking for. But is still too simplistic. I guess... this cct will oscillate (chop) the current output pretty much like a 555 will oscilate a voltage on its pin3 output. Correct?
Sorry if these replies are out of the order in which you sent them.
Yes, the explanation is a little simplistic, there is maths involved with the inductance of the coils and the rate of rise of current in them, but this doesn't impact the way the circuit basically works as explained. It is basically PWM'ing the current to the coils, controlled by the voltage developed across the sense resistor! I think I showed the chopping waveform in an earlier post.
 

sarahMCML

Joined May 11, 2019
697
Very good that you explicitly tell me this.
Then this must be variable ! Because I have multiple stepper motors with multiple current demands!
So we will have to make it variable. Like I said, most probably with a jumper option set on %, that I mentioned already.
- How does it knows what is the best current for the motor? Or it is having a fixed current that is driving with it all the steppers ? This part is very important to decipher. If is smart and adapt to whatever current the motor needs and feeds the optimal current to it, or if is just limiting the current to the POT value we choose and that's it.
In that case your best bet is to build your circuit with as many presets as you have motors, set a jumper, or switch, to the relevant wiper for a particular motor, and adjust it for the current required.
Are you likely to use motors requiring more than 1Amp of current? If so, you will have to reduce the value of your sense resistor, otherwise you will exceed the power dissipation in the existing ones.

EDIT: Just added a quick circuit for the pots. You probably get this anyway!

TrimPots.jpg
 
Last edited:

Thread Starter

q12x

Joined Sep 25, 2015
2,227
It is basically PWM'ing the current to the coils, controlled by the voltage developed across the sense resistor!
Yes, this is a very good explanation. It is as I imagined as well then. You know me already, no math bullshit.
Now back to your multiple POT circuit, the one on top of this message, my idea is a bit more basic. Putting multiple POTs... yah, in a WAY, you can set each of them on the fly, indeed. But is a very expensive solution. My idea is to actually use 2 resistors, as voltage dividers(replacing each POT in your diagram), very carefully choosed, exactly as in the original design diagram, if you remember. But like 10 of them, using a switch/jumper to each pair. Also I am thinking they should be chosen in a scale, stepping as 10% UP in amperage, from the whatever consuming coil/motor is used.
Please do this thing for me and try to figure out if these L6506 chips are as I imagine they are: - If is smart and adapt to whatever current the motor needs and feeds the optimal current to it. If this is the case then I can use my % x10 resistors.
I suppose some tests will bring this little detail to the light.... but you said you have it installed and made all this cct already. Can you please concentrate on this specific detail for me? Give me a yes or a no. The test you have to make is to change different loads(instead of motors) and see if with only 1 pair of sense resistors will "adapt" to the whatever load is installed. You can use electromagnets, motors, resistors I guess, as LOAD. Load it with whatever you can.
Thanks.
 

sarahMCML

Joined May 11, 2019
697
I have found a similar Phase generator circuit to mine on the net. It's a complete unit from input right through to the output motor driver stage, although you would only need to use the LS194 section to the left of the motor driver IC.
Instead of using the LS125, it uses discrete transistors, and you could adapt it to using one of your 555 oscillators to drive it.
The webpage is:
http://www.circuitous.ca/Stepper2012Unipolar.html
It's definitely worth a read!
 

Thread Starter

q12x

Joined Sep 25, 2015
2,227
I ordered 10pcs of L6506 since I also have 10pcs of L298's. For 8.76$. A bit expensive but worth it I guess... I have multiple motors and I want them drive without problems. Optimal !
Thanks with the discuttion with you, understanding this IC a bit better, helped.
But even if I ordered the ICs we will still continue with the experiments.
Im just updating you.
 
Last edited:

sarahMCML

Joined May 11, 2019
697
Yes, this is a very good explanation. It is as I imagined as well then. You know me already, no math bullshit.
Now back to your multiple POT circuit, the one on top of this message, my idea is a bit more basic. Putting multiple POTs... yah, in a WAY, you can set each of them on the fly, indeed. But is a very expensive solution. My idea is to actually use 2 resistors, as voltage dividers(replacing each POT in your diagram), very carefully choosed, exactly as in the original design diagram, if you remember. But like 10 of them, using a switch/jumper to each pair. Also I am thinking they should be chosen in a scale, stepping as 10% UP in amperage, from the whatever consuming coil/motor is used.
Please do this thing for me and try to figure out if these L6506 chips are as I imagine they are: - If is smart and adapt to whatever current the motor needs and feeds the optimal current to it. If this is the case then I can use my % x10 resistors.
I suppose some tests will bring this little detail to the light.... but you said you have it installed and made all this cct already. Can you please concentrate on this specific detail for me? Give me a yes or a no. The test you have to make is to change different loads(instead of motors) and see if with only 1 pair of sense resistors will "adapt" to the whatever load is installed. You can use electromagnets, motors, resistors I guess, as LOAD. Load it with whatever you can.
Thanks.
No, the circuit cannot work that way, how could it! It would need to get specific feedback from the device connected to it, be it a motor, relay, solenoid or whatever, telling it the current at which it should be operated. No simple devices do that! It would take more complexity, like for instance, how a computer monitor, which has software which tells the computer what display modes it can operate in. And it doesn't need to. A more sophisticated phase controller system can do that, as I understand it. Don't quote me, I'm not at that level myself, just learning this, as you are.

Yes, you could use 2 resistors to set for each motor. Use one channel with a pot as your test channel to determine the current for a motor, then measure the ratio between the wiper and the ends, and select the resistors accordingly for a separate switch position. Much cheaper!

As an aside, I found the original circuit board of the harddrive that my motor came from, so connected it up and measured the motor output coil voltages. I was surprised to find it was driven by 12V. So now I know that it can take a maximum of 0.5A. However, even driving it with 0.25A using the new circuit at about 15V, it is quite difficult to stop it, and it has a 9mm diameter adaptor on the output shaft!
 

Thread Starter

q12x

Joined Sep 25, 2015
2,227
Check this out.
I believe this is why the range of the POT is so small. L298 is limiting it.
1670417861298.png
 

sarahMCML

Joined May 11, 2019
697
Check this out.
I believe this is why the range of the POT is so small. L298 is limiting it.
View attachment 282454
No, that's not a limitation!
You don't want, or need, the voltage to go very high, because the more voltage you put across the sense resistor, the more power it has to dissipate! The sense resistor only has to drop enough voltage to serve its purpose and give an acceptably accurate level of feedback for the comparators to switch.
For example, your 1.7A motor, with your existing ~1 Ohm sense resistor is going to have 1.7V across it. That gives a power dissipation of 1.7x1.7=2.89W, much too high for your existing resistors! They either need to be replaced by 5W ones, or their value needs to be lowered (which is preferable!) Lowering it to 0.47 Ohms reduces the dissipation to ~ 1.36W.
 

BobTPH

Joined Jun 5, 2013
11,527
You can make the pot use its entire range and thus be easier to adjust by adding a fixed resistor in series with one side of the pot.

For instance, if your 22K pot is using only the first 10% if the pot range, replace it with a 2K pot in series with a 20K resistor.
 

Thread Starter

q12x

Joined Sep 25, 2015
2,227
I have found a similar Phase generator circuit to mine on the net. It's a complete unit from input right through to the output motor driver stage, although you would only need to use the LS194 section to the left of the motor driver IC.
Instead of using the LS125, it uses discrete transistors, and you could adapt it to using one of your 555 oscillators to drive it.
The webpage is:
http://www.circuitous.ca/Stepper2012Unipolar.html
It's definitely worth a read!
From that very page:
1670443344970.png
I will need everything a stepper can deliver. Not only torque or speed but also positioning. So luckily this is an alternative cct.
I hope the original cct is more accurate. But we didnt get to that stage yet.
- I will consider this cct as well actually, because until positioning problem, there are more to be done. Most probably I will build this cct as well, why not.
I believe the positioning problem will have some special circuit in it. Very different and very funky. @MisterBill2 here I believe it was, he promised with its hand on his hearth he will find this kind of cct from the 1980 magazine or something. He has time until I will reach that stage.
 
Last edited:

Thread Starter

q12x

Joined Sep 25, 2015
2,227
Before jumping into unipolar-bipolar switch cct, which is a bit complex and it will take some time, I said I should try first the 2 options for the 10k POT very limited RANGE.
1-aintz I tried first misis @sarahMCML version, that failed in agony. This one:
1670449839361.png
What this actually did, was to STOP any variation of the POT !
It stopped it to a FIXED Amperage value. In my case was 700mA, enough for the motor to spin and low enough under the MAX 800mA, which is basically a short if I didnt limit it in time from my PSU.

- I did check specifically, just to be frikin sure if I was having the PSU amperage set to 800mA and it was indeed, and I forget about it. When I turned the knob up, when the cct was in the 800mA mode - and motor stopped spinning- , the PSU amperage got to 1A, and it was enough for me to understand that the thing was all this time limiting at that 800mA. I turn it back to 800mA to continue with this value as a reference as it was until now. So now, when somethign will go in short, it will go up to this 800mA as it was until now.

2-zvai The second version was this:
You can make the pot use its entire range and thus be easier to adjust by adding a fixed resistor in series with one side of the pot.
For instance, if your 22K pot is using only the first 10% if the pot range, replace it with a 2K pot in series with a 20K resistor.
I didnt had to change any POT value, because, strangely enough, the POT value doesnt matter and try believe my word on this.
- This version WORKED, ta -ta - taaaa. Not 100% but it enlarged significantly the range of the POT - I say to 30%. And I like it now as it is. It is good enough.
If before, when it was only the POT mounted, was struggling in a 7% (because it was multiturn POT) it was still very-very picky and hard to reach a desired value. It was jumping 100mA up for every light touch of the knob, just like that. The one turn POT was disastrous touchy less than 5% range. Very bad.
Now, what I did was this: Because the pot value doesnt matter, Ive added 1M resistor in series with the 22k POT multiturn. And I notice the difference in turning. THEN, I change back the 10k single turn POT with 1M in series. And it got like 30% range increase rezolution. Excellent I SAY ! Then I tried a 100K POT with the same 1M in series. The range decreased !!!!! ta- ta - taaa. So its a percentage thing here, not a per value thing. Thats why the values doesnt matter. Only the percentage between them. How much of one and how little of the other. Of course, leaving high values it will diminish the current significantly and is a good thing because this is the logic side of the cct.
I increased the POT wiper range, putting a 10M in series with the 10K POT. And I had to rotate the FULL range of the 10k POT to reach 500mA.
Then I got lower in value, to a 3M resistor in series with the 10K POT. And NOW, it is having the complete FULL range. 150mA to 760mA. BUT, because the L298 is starting to heat up slowly, also the amperage is increasing slowly. So after a few seconds, from 760mA goes up slowly until is reaching 800mA and bam, short, motor is stopping. Actually the motor is randomly stopping and spinning due to this heating of the L298.
The heating of the L298 is not critical, it is like 10-20dgr over the ambient temperature and because right now in my room is a bit chilly because is winter, the temperature is quite cold for the chip. I should consider the worse case scenario when is middle of the summer and is very hot. And adjust for that. But... nah. Not now.
The setup:
The minimum this cct is drawing and is showing on the PSU ampmeter is ~150mA and never 0. And the amp meter is highly fluctuating because is the lowest speed 1Hz - 1beat per second. Why this fv? Because this is where I can see the highest amp increase. This is the worst case scenario. If I increase the fv and the speed of the motor along with it, the amp will go down very much, without me needing to adjust anything. So you get it now, worst case scenario, ok?
- In conclusion, thank you both for the ideas ! Now I am very happy I can turn the bastard full range and get a very nice amperage slope which is quite linear I may add. Youpii.
And a picture, showing how it looks now:
1670452798978.png
 
Last edited:

sarahMCML

Joined May 11, 2019
697
Before jumping into unipolar-bipolar switch cct, which is a bit complex and it will take some time, I said I should try first the 2 options for the 10k POT very limited RANGE.
1-aintz I tried first misis @sarahMCML version, that failed in agony. This one:
View attachment 282483
What this actually did, was to STOP any variation of the POT !
It stopped it to a FIXED Amperage value. In my case was 700mA, enough for the motor to spin and low enough under the MAX 800mA, which is basically a short if I didnt limit it in time from my PSU.

- I did check specifically, just to be frikin sure if I was having the PSU amperage set to 800mA and it was indeed, and I forget about it. When I turned the knob up, when the cct was in the 800mA mode - and motor stopped spinning- , the PSU amperage got to 1A, and it was enough for me to understand that the thing was all this time limiting at that 800mA. I turn it back to 800mA to continue with this value as a reference as it was until now. So now, when somethign will go in short, it will go up to this 800mA as it was until now.

2-zvai The second version was this:

I didnt had to change any POT value, because, strangely enough, the POT value doesnt matter and try believe my word on this.
- This version WORKED, ta -ta - taaaa. Not 100% but it enlarged significantly the range of the POT - I say to 30%. And I like it now as it is. It is good enough.
If before, when it was only the POT mounted, was struggling in a 7% (because it was multiturn POT) it was still very-very picky and hard to reach a desired value. It was jumping 100mA up for every light touch of the knob, just like that. The one turn POT was disastrous touchy less than 5% range. Very bad.
Now, what I did was this: Because the pot value doesnt matter, Ive added 1M resistor in series with the 22k POT multiturn. And I notice the difference in turning. THEN, I change back the 10k single turn POT with 1M in series. And it got like 30% range increase rezolution. Excellent I SAY ! Then I tried a 100K POT with the same 1M in series. The range decreased !!!!! ta- ta - taaa. So its a percentage thing here, not a per value thing. Thats why the values doesnt matter. Only the percentage between them. How much of one and how little of the other. Of course, leaving high values it will diminish the current significantly and is a good thing because this is the logic side of the cct.
I increased the POT wiper range, putting a 10M in series with the 10K POT. And I had to rotate the FULL range of the 10k POT to reach 500mA.
Then I got lower in value, to a 3M resistor in series with the 10K POT. And NOW, it is having the complete FULL range. 150mA to 760mA. BUT, because the L298 is starting to heat up slowly, also the amperage is increasing slowly. So after a few seconds, from 760mA goes up slowly until is reaching 800mA and bam, short, motor is stopping. Actually the motor is randomly stopping and spinning due to this heating of the L298.
The heating of the L298 is not critical, it is like 10-20dgr over the ambient temperature and because right now in my room is a bit chilly because is winter, the temperature is quite cold for the chip. I should consider the worse case scenario when is middle of the summer and is very hot. And adjust for that. But... nah. Not now.
The setup:
The minimum this cct is drawing and is showing on the PSU ampmeter is ~150mA and never 0. And the amp meter is highly fluctuating because is the lowest speed 1Hz - 1beat per second. Why this fv? Because this is where I can see the highest amp increase. This is the worst case scenario. If I increase the fv and the speed of the motor along with it, the amp will go down very much, without me needing to adjust anything. So you get it now, worst case scenario, ok?
- In conclusion, thank you both for the ideas ! Now I am very happy I can turn the bastard full range and get a very nice amperage slope which is quite linear I may add. Youpii.
And a picture, showing how it looks now:
View attachment 282486
If this is how your circuit is now, and I believe you when you say it is, then there is something very wrong somewhere!
I suspect, but cannot prove, that the LM358's may be part of the problem. They are lousy amplifiers and make even worse comparators, but as they are all that you had.....
My trimmer setup works perfectly, and should have done for you. You don't need to constantly adjust the motor current, just set it to its rated value and leave it there!
 

sarahMCML

Joined May 11, 2019
697
Can you do me a favour? Please would you measure the voltage between 0V and the pot wiper for a number of different speeds (up to the highest) for one of your motors, and note them down. If it's not too much trouble.
Thank you. Back tomorrow.
 

Thread Starter

q12x

Joined Sep 25, 2015
2,227
Can you do me a favour? Please would you measure the voltage between 0V and the pot wiper for a number of different speeds (up to the highest) for one of your motors, and note them down. If it's not too much trouble.
Thank you. Back tomorrow.
The entire cct is powered from 6V (or 6.3V)
I put my DMM to 200mA range. I never had to measure such low voltages, probably in my life. This is a rare occasion.
click on image to enlarge - and see how the knob is set.
20221208_063504.jpg
And here are the results: It actually put a 0 in front of the number, because such small values.
I write down exactly what the DMM was showing me:
20221208_063056.jpg
The motor tested is the same as until now, Nema17.
The wiper of the POT is still jumping from 100 to 100mA but it is doing it in a larger step than before.
The mA are jumping around because the cct is set to a very low fv of about 1Hz, and also very low speed where the power is the highest through the circuit. Its a visible fluctuating mA reading. I kind of catch the extremes, but in reality was more in between these values.
Here is where I put the probes of the DMM:
1670475035575.png
 
Last edited:
Top