# Current Limiting Mosfet

Discussion in 'Electronic Design' started by Nav2u, Mar 6, 2006.

1. ### Nav2uGuest

Hey Guys,

I am making a stepper motor controller to control a stepper motor rated
@ 1A 3.15ohm using the
UCN5804(www.allegromicro.com/datafile/archive/5804.pdf) chip. The motor
operates fine if i use 10ohm resistors @ 5volts (L/R Drive as shown on
page 5 of the datasheet). What i would like to ideally do is limit
current using a MOSFET instead of a resistor, currently i am driving
the MOSFET gate with a 20KHz signal @ 63% duty cycle which i think
should give me 3.15V but this does not seem to work; on putting this
circuit together i find that the motor windings are energised but the
motor does not operate, it is as-though the motor is not getting enough
juice. Is it possible to limit the current in this manner; what am i
doing wrong??? suggestions...

2. ### Sven WilhelmssonGuest

Does the MOSFETS switch current to zero during the low part of the period?
If so the motor inductance will limit the current to a few mA.

3. ### Nav2uGuest

thanks 4 ur prompt reply....yes i think the MOSFET does switch current
to zero!!! Could you please explain as to why this happens cause i
would have thought that switching at such a high rate @ 63% duty cycle
would allow me to get a mean voltage of 3.15v. In my present circuit i
have the MOSFET's gate controlled by a PWM signal, drain connected to
5v and source connected to the motor supply. How can this problem be
resolved???

4. ### John Jardine.Guest

Odd that it's working 'fine' in the LR mode. 10 ohms and 5V implies the
motor coil is only seeing 1.2V and 0.4A. Motor coil power=0.5 Watt(16% of
nominal). Dropper resistor only 1.5Watt.
(even less shaft horsepower available when the motor starts to run up). For
both chopper and LR mode, something like 20-30V would have been be better
john

5. ### Guest

The interesting question here is whicih of the two L/R drive circuits
on page of the data sheet - the top one with series blocking diodes, or
the bottom one with parallel clamping diodes. I'd have gone for the
bottom one myself, and then the average voltage across the coil isn't
63% of 5V (3.15V) but 63% of 5V plus 37% of -5.6V (-2.07V) for a total
of 1.08V, which sounds like what you are seeing Try an "on" period of
82.6%..

If you gone for the top circuit, the situation is more interesting.
Every time you turn on the MOSFET, you apply 5V across the coil, and
the current builds up, limited by the inductance and and resistance of
the coil. When you turn the MOSFET off after your 31.5usec, the current
can only charge up the coil capacitance (which is considerable - try to
measure the self-resonant frequency of your motor coil sometime), and
for the next 18.5usec the current rhough the coil is is decreasing
rapidly, while the voltage across the coil goes up well above 5V.

When you turn the MOSFET back on, the situation gets really interesting
- the coil capacitance is distributed along the winding, mostly between
the successive layers of wire, and you are trying to discharge the
capacitance rapidly, and in fact reversing the voltage across the coil,
implying large currents within the coil, opposing the current you are
trying to set up. and quite a lot of heating.

So you've effectively increased the resistive losees in your coils, and
again, the 3.15V average voltage across the coil isn't going to
generate the current you expected.

Setting up a PWM drive for a stepper motor is not as easy as it looks -
the motor coils aren't resistors, but inductors, and in a motor set up
for unipolar drive (as shown in the UCN5804 data sheet) you have to
keep in mind that each pair of coils have almost as high a mutual
inductance as their self-inductance. And don't forget the capacitance
between the individual turns of each coil - you really do want to
measure the self-resonant frequency of the coil if you want to find out
what is actually going on.

6. ### Guest

Nav2u skrev:
what mosfet? how are you driving it? tried at 100% dutycycle and
resistors?

-Lasse

7. ### Nav2uGuest

ok...firstly im not using a 10ohm resistor its a 5ohm 10W
resistor....my bad. I am using the second circuit on the page 5 of the
datasheet, the MOSFET is
IRF540(www.ece.utexas.edu/~valvano/EE345M/IRF540.pdf).

"how are you driving it?".
I have the Gate connected to a PWM signal (20KHz....i tried some
different frequencies from 400Hz to 20KHz as well no luck!!!) the duty
cycle is 63% also tried 82% but changing that makes no difference. The
source is then connected to the motor supply input and pin 2 & 7 of the
chip.

"tried at 100% dutycycle and resistors?"
No, but what i did try was got rid of the MOSFET and changed the supply
voltage to 3.15v and this time around the stepper motor was hard locked
not spinning but locked.

8. ### Sven WilhelmssonGuest

The easy solution would be to use resistors as in the application example!

Do you have access to an oscilloscope? I would think one is needed
in order to understand the situation correctly.
The inductance in the stepper is, I would guess, a few mH.
So it will take about one ms, maybe more, to reach the current needed to
move the motor, and at 63%@20KHz there is only some 30 us available.
So some kind of "flywheel diode" is needed.

If you want the motor to move at high speed, then 3.15 V is not good enough.
Not only the inductance, but also the back-emf must be defeated.
Typically steppers are driven by 30-50V, and current is regulated using
a switch regulator. Some stepper driver chips include such regulators.
Sorry, I did not read your data sheet carefully enough to say whether this
chip has one or not.

9. ### Guest

The next question is whether you are turning on your MOSFET within the
41usec of "on" time. The IRF540 is not a logic-level MOSFET, and really
needs +10V on the gate to deliver the performance you are paying for.
The data sheet say that 4V is adequate for 1A of drain current for a
typical part, but a worst case part would only be sinking 250uA at that
gate voltage.

Even with the typical part, you've got to supply at least 10nF of
charge to get the gate to +4V - that's 0,25mA for 41usec - and anything
up to 60nF to get the transistor fully on - which is 1.5mA over 41usec.

That mean a 680R pull-up resistor. If you want the MOSFET fully turned
on for 35 of your 41usec, that resistor goes down to 100R - which
dissipates 0.25W when the MOSFET is off.

What value of pull-up resistor are you actually using?

A logic-level MOSFET with a gate threshold closer to 2V would be a lot
easier to turn on at 20kHz.

Turning off the MOSFET isn't going to be a problem - the 5804 can sink
up to 1.5A, which would be enough to turn the IRF540 off in 40nsec if
the 5804 were that quick.

10. ### Guest

Nav2u skrev:
as in using a N-channel fet as a high side switch? where does the pwm
signal
come from? whats the voltage? relative to ground?
if you are actually driving the fet properly 100% duty cycle should be
fully on and
give you the same result

-Lasse

11. ### Nav2uGuest

Hey guys thanks for all your input....
I got hold of a signal generator and an oscilloscope and tried a couple
of different things.
The signal generator allows me to "DC Offset" my square wave....and
this was it....offset the square wave +ve by a couple of volts and my
motor started to rotate drawing about 0.8 to 0.9Amps. This obviously
points out that the MOSFET is not being driven properly...exactly what
you guys have been trying to explain me.

As suggested by Bill that the MOSFET is not a Logic Level MOSFET; i may
be able to score a couple of MAX4427ESA
(http://www.datasheetarchive.com/datasheet/pdf/12797.html) to drive the
MOSFET 2maro mornin so will try that and see how it goes. Thanks

12. ### John Jardine.Guest

Really nice to see a bit of feedback from a poster. Way, way too often I've
seen the guys supply some fascinating commentary and suggestions in response
to a problem that's giving an OP some headache and yet see nothing by the OP
in response. I can't imagine the guys want a pat on the head, more like
confirmation that their comprehension skills are on form and that their
advice was valid and of value.
(Selfishly!); Over time, I've learnt a lot from specialists in the oddball
threads that can turn up. If the OPs don't bother responding to give some
kind of validation to the offered info then I lose out as well. Who of those
contributors should I be listening to? .
john

13. ### Nav2uGuest

ok Back 2 square 1! Unable to get the MOSFET driver chip....Yes its a
N-channel FET...High Side = YES....PWM comes from a M16 micro, temp
using a signal generator as i can easily change frequencies.....working
with 5 volts and yes relative to ground.

If you guys were to design a stepper motor driver circuit using the
UCN5804 chip and limit the current using a MOSFET how would you guys do
it...suggestions will be highly appreciated.

Also I have looked around for other Stepper Motor Driver chips and they
are so expensive and require a lot of external
components...suggestions...

14. ### Sven WilhelmssonGuest

Using your cirquit I would probably use a P-channel FET, and a flywheel
diode between drain and ground.

If you need to run at high speed, use higher voltage and a current
regulator. That implies a comparator and a current sensing
resistor (about 1 ohm) in the MOSFET source cirquit.
The comparator should turn the MOSFET off at the right current and turn it
on at some lower current (hysteresis).
One type I have used is PBL 3717. Current regulator included.