Why won't my linear stepper motor work?

DickCappels

Joined Aug 21, 2008
10,187
This may be covering old ground, but what is the DC resistance of your coil?

It looks like the resistance is low and the inductance is also low. That means that after a short amount of time the drain current will go to (battery voltage)/(resistance) and that might be a lot more amps than your MOSFET is designed to handle.

One way to limit the current once a few L/R time constants pass is to put a resistor in series with the coil and then place a capacitor across the resistor. This gives you the full battery voltage at the start and after the capacitor discharges the current is limited by the series combination of the resistor and the coil's resistance.

Or maybe simpler is to use smaller gauge wire and more turns, keeping the E/R relationship in mind.

I'm glad to see the hand wired circuit and the 10k resistor. That's a couple of variables we don't need right now.
 

shortbus

Joined Sep 30, 2009
10,045
Anybody see what I'm doing wrong?
Don't know if it is really "wrong" but every Application Note on driving mosfets says that distance and layout of driver to gate is important.

Another thing that may be there but I am just missing is a bypass diode on the coil. All inductive loads should use a bypass diode, to take care of the back EMF caused by the collapse of the magnetic field when the power is removed. Can't really tell but did the "explosion" take place when you turned the mosfet off? I'd bet it did.
 

Thread Starter

Ben Varvil

Joined Apr 30, 2018
197
I suggest you carefully redraw a diagram of what you've just done and post it here. Draw your diagram according to the way you've actually wired things up, and not the way you thought you did it. Translation: work your way backwards.
Good idea. Here is what I thought I did, which, after scrubbing through my circuit, seems to be what I actually did also:
Judith circuit.jpg

This may be covering old ground, but what is the DC resistance of your coil?

It looks like the resistance is low and the inductance is also low. That means that after a short amount of time the drain current will go to (battery voltage)/(resistance) and that might be a lot more amps than your MOSFET is designed to handle.
I'm happy to cover any ground, old or new. I measured the coil resistance to be 0.5 ohms. With 12V, I'm expecting 24Amps. The spec sheet seems to show absolute max ratings at room temp to be 28A. Is it therefore fair to say that over-current is not the issue?
I'm not sure the implications of "low inductance." After some googling, it seems to mean that there is small resistance to the change in current flow. It also seems to mean that the energy stored in the form of a magnetic field is low... which is not good as I'm trying to maximize the magnetic field. Any clarification about what you are thinking related to "low inductance" would be appreciated. Here is the spec I'm referencing related to max current:
IRL540 pinout and spec sheet.jpg

I'm glad to see the hand wired circuit and the 10k resistor. That's a couple of variables we don't need right now.
Alright! Thanks. I'm low key proud of myself here. I wasn't sure how to secure everything in place without the breadboard and then came across the perf board solution. I gotta say though, there still has to be a better way... a DIY printed circuit board or something. Ultimately, when the circuit gets sorted, I'd like this thing to look elegant. Open to suggestions.
 

Thread Starter

Ben Varvil

Joined Apr 30, 2018
197
One way to limit the current once a few L/R time constants pass is to put a resistor in series with the coil and then place a capacitor across the resistor. This gives you the full battery voltage at the start and after the capacitor discharges the current is limited by the series combination of the resistor and the coil's resistance.
Ok. I think I get it. I'll need to dig deeper to figure out what resistance and capacitance values to use. I've sketched my next try below, is that what you mean?

Don't know if it is really "wrong" but every Application Note on driving mosfets says that distance and layout of driver to gate is important.
Thanks for bring this to my attention, but oh man, vague warnings are scary. I'm pretty baffled by this one...
Are they saying "Distance" as in the length of wire between the Arduino output pin and the MOSFET's gate post? By "important" to they mean that if the wire is too long or short the circuit performance will be jeopardized? And, what do you think they mean by "layout"?
It's like they're saying, "Don't go out after 7:00 tonight." What? Why? What's happening tonight? Scary.

If you have any links to the application notes, I'd be grateful.

Another thing that may be there but I am just missing is a bypass diode on the coil. All inductive loads should use a bypass diode, to take care of the back EMF caused by the collapse of the magnetic field when the power is removed. Can't really tell but did the "explosion" take place when you turned the mosfet off? I'd bet it did.
Yes, there was definitely a delay before the MOSFET popped. I bet you're right.

Conceptually, I feel like I understand what you are saying: It's like a balloon (inductor) in series in the middle of a garden hose. After water turns on and the balloon fills to elastic capacity, water resumes full speed flow through the balloon and through the hose. When the water turns off, there is no pressure keeping the balloon expanded, so it squeezes it's water back into the hose in both directions with force equal to that of its elastic strength.

What I don't conceptually understand is how a diode in this orientation resolves the stored force.

I found this image and will modify my circuit as shown below. (Photo: wikipedia)

flyback diode.jpg

As always, thank you for your continued interest. I'm learning a lot and feel like I'm getting closer to having the tube move.
Here's what I plan to try next:
IMG_1673.JPG
 

Attachments

cmartinez

Joined Jan 17, 2007
8,257
Ok. I think I get it. I'll need to dig deeper to figure out what resistance and capacitance values to use. I've sketched my next try below, is that what you mean?



Thanks for bring this to my attention, but oh man, vague warnings are scary. I'm pretty baffled by this one...
Are they saying "Distance" as in the length of wire between the Arduino output pin and the MOSFET's gate post? By "important" to they mean that if the wire is too long or short the circuit performance will be jeopardized? And, what do you think they mean by "layout"?
It's like they're saying, "Don't go out after 7:00 tonight." What? Why? What's happening tonight? Scary.

If you have any links to the application notes, I'd be grateful.



Yes, there was definitely a delay before the MOSFET popped. I bet you're right.

Conceptually, I feel like I understand what you are saying: It's like a balloon (inductor) in series in the middle of a garden hose. After water turns on and the balloon fills to elastic capacity, water resumes full speed flow through the balloon and through the hose. When the water turns off, there is no pressure keeping the balloon expanded, so it squeezes it's water back into the hose in both directions with force equal to that of its elastic strength.

What I don't conceptually understand is how a diode in this orientation resolves the stored force.

I found this image and will modify my circuit as shown below. (Photo: wikipedia)

View attachment 152734

As always, thank you for your continued interest. I'm learning a lot and feel like I'm getting closer to having the tube move.
Here's what I plan to try next:
View attachment 152740
What's that thing in your drawingthat looks like an LED? Is it an actual LED with a 220 ohm resistor connected in series with the FET's gate? . If that's the case, then the gate might not be charging at the proper level and the FET will be operating in the saturated region, producing an equivalent series resistance much higher than the one given in the normal operation specs. That would cause the FET to overheat and ... well, you've already seen what happens next ....

I suggest you connect the arduino's output directly into the FET's gate, and forget about the resistor and LED.
 

Thread Starter

Ben Varvil

Joined Apr 30, 2018
197
What's that thing in your drawingthat looks like an LED? Is it an actual LED with a 220 ohm resistor connected in series with the FET's gate? . If that's the case, then the gate might not be charging at the proper level and the FET will be operating in the saturated region, producing an equivalent series resistance much higher than the one given in the normal operation specs. That would cause the FET to overheat and ... well, you've already seen what happens next ....

I suggest you connect the arduino's output directly into the FET's gate, and forget about the resistor and LED.
I was hoping to have visual confirmation of which Mosfet was firing, that's why I had the LED and resistor. In this initial testing stage, I can certainly ditch the resistor and LED to see if that resolves the issue.

I was warned before about running an Arduino output pin directly to the ground and how that could fry the Arduino. Isn't running the output to the MOSFET gate doing exactly that? Am I preparing to toast the controller?
 

shortbus

Joined Sep 30, 2009
10,045
Hi Ben,
The spec sheet seems to show absolute max ratings at room temp to be 28A. Is it therefore fair to say that over-current is not the issue?
Again your like me. When I started into this world I came from being a machinist, where things were what they said they were. A thousandths of an inch was just that. Cold rolled steel was just that. Electronics is a whole different animal! When specifying components it is always a good idea to most times double the rating, when it comes to volts and amperage. Something called "head room" or some other thing, can't remember right off hand. Capacitance and resistor values aren't quite as bad they are what they say they are for the most part, except for electrolytic caps then they are mostly around +or- 20%. Really blew my mind, would have got fired to work to tolerances like that.

If you have any links to the application notes, I'd be grateful
I'll try to look some up for you. Too small of a distance isn't a problem but to big is. And It can sometimes be the difference between a good working circuit and not working circuit. Has a lot to do with parasitics we talked about earlier.

I found this image and will modify my circuit as shown below.
The diode looks good, that's the way it goes. When the power shuts off suddenly like with a mosfet, voltage will try to keep up flowing and the diode will conduct it back to the battery. The cap and resistor is called a "snubber circuit" it keeps the voltage from "ringing" in the circuit, again when shut off quickly. Without a snubber some of the voltage at shut off will try to keep going in a 'circle' or 'ring' until it get to a point where there isn't enough force to left in the circuit. I'm not sure if you need the snubber but it won't hurt.

Have you looked at any of the teaching material found here on the forum? https://www.allaboutcircuits.com/textbook/ A lot of what I've tried to explain will be explained in more detail there, and better than I can do. Not trying to get out of helping just give you another source of really good information that helped me out.
 

Thread Starter

Ben Varvil

Joined Apr 30, 2018
197
Have you looked at any of the teaching material found here on the forum? https://www.allaboutcircuits.com/textbook/ A lot of what I've tried to explain will be explained in more detail there, and better than I can do. Not trying to get out of helping just give you another source of really good information that helped me out.
I have not. I'll steer my reading efforts that way. Thanks.

I'll also combine your's and CMartinez's suggestions: Ditch the 220ohm and LED for a 20ohm.
Will post what happens.
 

cmartinez

Joined Jan 17, 2007
8,257
Isn't running the output to the MOSFET gate doing exactly that? Am I preparing to toast the controller?
No ... it's not doing that at all. A MOSFET's gate is almost exactly like a capacitor. The Arduino's output pin will feed it a small amount of current until the gate is fully charged, after which no more current will flow into the MOSFET's gate, but rather into the 10K resistor to ground that is there to discharge the gate and not leaving floating for safety reasons.
 

cmartinez

Joined Jan 17, 2007
8,257
I agree with ditching the led but there should be a gate resistor , some where around 20 Ohm.
A gate resistor is needed only when the FET is switched at high frequencies (something in the order of above 15-20KHz), and it's there only to prevent "ringing" due to the gate's capacitance. If the FET is being used for steady switch on/off, then the resistor is redundant. But, I'll grant you that a 20 ohm (I normally use 10 ohms) can't hurt.

Also, at high frequencies, an inverse diode in parallel with the gate resistor is used. This so that the MOSFET's gate is charged through the "anti-ringing" resistor, and quickly discharged through the diode.
 

shortbus

Joined Sep 30, 2009
10,045
A gate resistor is needed only when the FET is switched at high frequencies (something in the order of above 15-20KHz), and it's there only to prevent "ringing" due to the gate's capacitance. If the FET is being used for steady switch on/off, then the resistor is redundant.
Hmm, never saw that before. Every thing from all of the makers app notes say one is needed, never saw where a certain frequency was involved. The need came from something to do with dt/vt. Got that from the last App Note I read on the gate resistor, just last week. https://www.fairchildsemi.com/application-notes/AN/AN-9068.pdf Learn something new every day here.
 
Last edited:

shortbus

Joined Sep 30, 2009
10,045
I was hoping to have visual confirmation of which Mosfet was firing, that's why I had the LED and resistor. In this initial testing stage, I can certainly ditch the resistor and LED to see if that resolves the issue.
I think in the end you will need to use mosfet gate drivers along with your Arduino. This will allow you to both drive the gates closer to the mosfets and use more amperage to do it. This is the way most motor drive circuits work too. Or you could use a "shield" of some type with the Arduino. The shield does the same thing as a gate driver just more expensive.
 

cmartinez

Joined Jan 17, 2007
8,257
I think in the end you will need to use mosfet gate drivers along with your Arduino. This will allow you to both drive the gates closer to the mosfets and use more amperage to do it. This is the way most motor drive circuits work too. Or you could use a "shield" of some type with the Arduino. The shield does the same thing as a gate driver just more expensive.
Speaking of which. Here's a nice n-fet, low-side, double-driver that I've been using for a while. It's very practical and easy to implement.
 

Attachments

be80be

Joined Jul 5, 2008
2,072
If you have a look at a mosfet you will see that to power a load like your trying to power the mosfet is charging up too slow and that blowing the chips body diode you have to switch the mosfet fast takes more voltage then your using. the turn on times using a uC only can be really slow.

It's why there still power NPN and why we have IGBT there a lot easier to switch fast.
That's not to say you can't switch a mosfet fast it's just harder to do if you don't use a gate driver and build a driving circuit to drive the gate.

If you have a try with a power mosfet and just using a uC on loads like this you'll see that the gate turn on time's are way slow when you have a load that is a few amps the part can handle the amp's if you switch it on fast But you have to do that with more parts then just hooking the gate to a uC output you need a higher gate voltage.

Even a so called logic-level MOSFET could need 10 volts to switch the gate fast. I been playing with the test circuits in the data sheet.
I put a led with a resistor on the drain and you can see the charge turn on times and turn off time of the gate.
I used a motor and a npn to drive the gate the turn on times and off drop to nothing but at 5 volts you had lag.

A coil like your using could pull above 10 amps have you tested it to see Im sure it would blow the fuse on your meter Id read the voltage across it.
 

shortbus

Joined Sep 30, 2009
10,045
If you have a look at a mosfet you will see that to power a load like your trying to power the mosfet is charging up too slow and that blowing the chips body diode you have to switch the mosfet fast takes more voltage then your using. the turn on times using a uC only can be really slow.

It's why there still power NPN and why we have IGBT there a lot easier to switch fast.
That's not to say you can't switch a mosfet fast it's just harder to do if you don't use a gate driver and build a driving circuit to drive the gate.
First time I'm hearing something like this. It's always be my understanding that IGBT's are slower than Mosfet's. That for low frequency's(slower switching) you pick an IGBT when using high current. But for lower current and higher frequency(faster switching) you pick a mosfet.

Never compared the Qg between similar valued mosfets and IGBTs. But since they both have "capacitor" loads as the gate wouldn't they take the same to turn on? I also have not used a micro or logic level mosfet, but am a believer in gate drivers.

Even a so called logic-level MOSFET could need 10 volts to switch the gate fast. I been playing with the test circuits in the data sheet.
.
Is that a good idea, to use maximum voltage on a logic level gate? Don't most logic level mosfets have 10V as the absolute maximum?
 

be80be

Joined Jul 5, 2008
2,072
Here a video of a 48 ohm coil witch using more amps then I have supply but it shows this can move a piece of metal.
I would need a bigger supply this thing max out at 3 amps.
 

be80be

Joined Jul 5, 2008
2,072
I didn't say faster I said easier and logic level fet one of the more used ones is +- 20 volt
and gate capacitance it 2 times as high as the IGBt
I got find a rod to fit I aluminum pipe I found to have a go at this.

This why there still power NPN and why we have IGBT there a lot easier to switch fast.
 
Top