PDA

View Full Version : Simple Current Limiter (LM317)



Mad Professor
12-07-2009, 02:23 PM
Good Day All.

I want to build a simple current limiter for my stepper motors.

The most simple design I have found on the internet so far is using a LM317 Adjustable Regulator.

As I am running a 36v supply this is above the limit for a standard LM317, But lucky for me there is a high voltage version.

I am going to be running 3 stepper motors in unipolor, so I am going to need 2 LM317HV's per stepper motor.

I know that using the LM317HV's with a supply voltage of 36v is going to give out alot of heat.

I am going to be mounting all 6 of the LM317HV's to a 85x90mm heatsink that has a 80mm 12v fan.

In the datasheet for the LM317HV it shows to use a 0.1uf cap on the input, but does not show anything on the output.

As said above I have found a number of current limter designs based on and around the LM317 all of them have caps on the input and output, from 0.1uf to 200uf.

I know the hole idea of the caps is to smooth out any noise to and from the LM317 but how can I work out what is going to be the best caps to use for my design?

Thanks for your time.

BillTodd
12-07-2009, 03:51 PM
Since you can make a two terminal current source with a LM317 you could just put two in series to extend the voltage range.
(See Irving's example here:http://www.mycncuk.com/forums/attachment.php?attachmentid=585&d=1247335598)

Be careful you don't exceed the chips power rating (i.e. check data sheet for maximum simultaneous voltage drop & current)

[edit] just saw this

I am going to be running 3 stepper motors in unipolor, so I am going to need 2 LM317HV's per stepper motor.

You really need to put a separate current limiter on each phase in a unipolar design else it'll run out of puff

Mad Professor
12-07-2009, 04:28 PM
BillTodd: Thanks for your reply.

I am indeed going to use one LM317HV per phase, I should of made it more clear in my 1st post.

I am going to be using my Astrosyn MY103H702 stepper motors, thease have a max current of 1amp per phase.

I am intrested to know what caps to use to stop or limit any voltage noise.

As wile testing without any caps the stepper motor wile static will hum.

Thanks for your time.

BillTodd
12-07-2009, 04:45 PM
I am intrested to know what caps to use to stop or limit any voltage noise.
Apart from the main PSU smoothing capacitor there's not a lot you can filter (since the o/p voltage will/must vary greatly).

You'll probably need to add reverse protection diodes across the current limiters.

Mad Professor
12-07-2009, 06:13 PM
I have just scoped my power supply and it's quite clean there is only a 85.54mv deviation at 36.53volts.

http://www.mad-professor.co.uk/Misc/LM317HV%20Current%20Limiter/Power%20Supply%20Only.jpg

As soon as you connect the LM317HV and a stepper motor you can see a saw wave on the power to the LM317HV.

http://www.mad-professor.co.uk/Misc/LM317HV%20Current%20Limiter/LM317HV%20&%20Stepper%20Motor.jpg


This reading is taken from the power into the LM317, not the output.

Will adding reverse protection diodes across the current limiters cancel this out.

Thanks for your time.

BillTodd
12-07-2009, 07:42 PM
Will adding reverse protection diodes across the current limiters cancel this out.
No. When you run the motors there's a likely hood of generating large back emf from the stepper coils the diodes are to stop this damaging the LM317s.

That looks like a normal rectified transformer output. Ripple is, what?, 3v - perhaps a bit high for a few amps of load. What size (VA) transformer and smoothing cap?

Mad Professor
12-07-2009, 08:11 PM
The power supply I am using is out of a fruit machine, and is a Barcrest MPU-LF Transformer & Power Supply, that is as much as I know.

This power supply has multiple outputs, I am only using one output marked at 34VDC @ 7A.

The smoothing cap inside the power supply for the 34VDC rail is a 4700uf 80wv.

BillTodd
12-07-2009, 08:59 PM
Hmm, 4700uF is small for a 7 amp supply (4700u per amp would be typical for a reasonable ripple). However, it's not really going to effect your steppers, so don't worry about it too much.

irving2008
13-07-2009, 12:33 AM
Good Day All.

I want to build a simple current limiter for my stepper motors.

The most simple design I have found on the internet so far is using a LM317 Adjustable Regulator.

As I am running a 36v supply this is above the limit for a standard LM317, But lucky for me there is a high voltage version.

I am going to be running 3 stepper motors in unipolor, so I am going to need 2 LM317HV's per stepper motor.

I know that using the LM317HV's with a supply voltage of 36v is going to give out alot of heat.

I am going to be mounting all 6 of the LM317HV's to a 85x90mm heatsink that has a 80mm 12v fan.

In the datasheet for the LM317HV it shows to use a 0.1uf cap on the input, but does not show anything on the output.

As said above I have found a number of current limter designs based on and around the LM317 all of them have caps on the input and output, from 0.1uf to 200uf.

I know the hole idea of the caps is to smooth out any noise to and from the LM317 but how can I work out what is going to be the best caps to use for my design?

Thanks for your time.

Hi,

If you are running these steppers unipolar why go for such a high power supply voltage? you are giving yourself so many problems by doing so.

Higher voltages only apply to designs using a chopper or PWM current limiter, not a linear design. The higher voltage can then give improved current ramping in the windings but this is not the case for a linear current limiter.

The Astrosyn steppers in unipolar configuration at 1A per phase need 6.2v. A 36v supply means the limiter will be dissipating 29W. For an LM317 design, the current set resistor will be 1.25ohm and will dissipate 1.25W, needing a 3W resistor. If you put 6 LM317 on a heatsink at 30W dissipation each (worst case) you are dissipating 180W.

For an LM317 the thermal characteristics are 4degC/W junction to case so the junction temperature will be 4 x 29 = 116degC above case, the limit being 125degC. In other words you could use an infinite heatsink and they'd still fry at room temperature!

Dropping the supply volts to 12v would run the LM317 at 4.6W, the maximum case temp could then be 106degC and the required heatsink (for 6 units at 20degC ambient) would need to be better than 3.1degC/W - say atleast 1.5degC/W for safety assuming some thermal grease between the case and the heatsink. An 80mm x 80mm CPU-style fan blown heatsink (if thats what you were proposing, typically 0.8degC/W) might just be sufficient if you can get the LM317 close enough to the centre and can get sufficient airflow. Note that a CPU-style heatsink is designed for a heat source about 20mm sq in the middle, not 6 TO220 cases bolted round the edges.

A normal extruded ally heatsink with 15 - 20mm fins will be around 3 to 5degC/W for a 100mm x 75mm piece and maybe 1 - 2degC/W if blown by a fan.

You can never have too big a heatsink with linear devices!

Mad Professor
13-07-2009, 09:17 AM
irving2008: When I contacted Astrosyn I was adviced for the best speed and torque to run the steppers at 30-40volts not exceeding 1amp per phase.

I know that running at this kind of voltage is going to make alot of heat.

The heatsink is not a computer / cpu heatsink

The heatsink it's self is 85x90x4mm if you include the cooling fin's it's 85x90x24mm so the fins are 20mm, I do also have a 80mm 12volt fan bolted to the heatsink.

Kip: I am using unipolor as that is all my driver boards support.

BillTodd
13-07-2009, 01:01 PM
When I contacted Astrosyn I was adviced for the best speed and torque to run the steppers at 30-40volts not exceeding 1amp per phase.

Yes, if you don't have sufficient voltage it'll severely limit the top speed

One alternative is to use resisters instead of the LM317s. Resisters wont give you a perfect linear current drive, but you may be able to increase the supply voltage to compensate and, since they'll run to a higher temperature before failure, the extra dissipation is less of an issue.

The real answer is to get yourself a better bipolar driver with switch mode current limit (pwm ideally).

irving2008
13-07-2009, 01:32 PM
irving2008: When I contacted Astrosyn I was adviced for the best speed and torque to run the steppers at 30-40volts not exceeding 1amp per phase.

I know that running at this kind of voltage is going to make alot of heat.

The heatsink is not a computer / cpu heatsink

The heatsink it's self is 85x90x4mm if you include the cooling fin's it's 85x90x24mm so the fins are 20mm, I do also have a 80mm 12volt fan bolted to the heatsink.

Kip: I am using unipolor as that is all my driver boards support.

The point I am making is you cannot run a LM317 at 30W dissipation. The heatsink you are planning to use will be, with the fan and some thermal grease, about 2.5degC/W thermal resistance. Together with the 4degC/W of the device you have 6.5degC/W from ambient at 20degC to the chip at a maximum of 125degC. Therefore you can afford to dissipate (125 - 20)/6.5 watts = 16Watts, i.e a voltage drop of 16v at 1A. Therefore you cannot run higher than 16+1.25+6volts = 23volts, and that assumes ONE LM317 per heatsink. With 6 devices sharing that heatsink the thermal resistance of the heatsink is multiplied by 6, i.e. the equivalent of 6 x 2.5 = 15degC/W therefore doing the same calculation (125 - 20)/(15 + 4) = 5.5W = 5.5v at 1A therefore max supply volts =5.5 + 1.25 + 6 = 12v! (and that is running ther LM317 close to their max operating temperature, so expect failures over time - you should never go above 75% max operating temperature as a general rule).

While Astrosyn are correct that higher volts = higher torque at speed that doesnt apply when you have a fixed linear current limiter as the voltage across the coil will also be fixed as V = I x R. By the same token a resistive limiter wont change anything... plus you'll need 6 x 30ohm 50W resistors and they'll be considerably more expensive than the LM317s! apart from mechanically their external temperature will get to around 95degC which would need considerable protective casing.

A Chopper or PWM current limiter can make use of the higher voltage by driving a higher peak current (thats where the big capacitors, 25000uF+on a 10A supply, in the PSU come in) for shorter times into the coils but maintaining the average current at the defined value.

Short and long of it... with the unipolar, linear current limited design there is no point (nor any sensible way) in running above 12v on the power supply.

If you want to go this route then you will need to build a chopper current limiter which is more complex (but not overly so) and I'd be happy to suggest an approach for you...

Mad Professor
13-07-2009, 03:06 PM
Ok so what's involved with building a chopper or pwm current limiter?

BillTodd
13-07-2009, 05:17 PM
voltage across the coil will also be fixed as V = I x R.
Erm, It's a coil Irving, the R's a Z ;)


The heatsink it's self is 85x90x4mm if you include the cooling fin's it's 85x90x24mm so the fins are 20mm, I do also have a 80mm 12volt fan bolted to the heatsink.

Ah Missed that bit! - Irving's right, that's nowhere near big enough for 4 devices.

Have you got a couple of Intel P4 coolers kicking around? the old 478pin cooler could dump 50-60w with the fan screaming. Using Irving's figures, you could clamp four lm316s to each which, if you ran the limiters in series, would give you the desired voltage drops for one motor.

[edit]if you ran the limiters in series - brain-fart! they're not going to work in series, unless the currents are exactly matched. You'd have to parallel them at half an amp each.

irving2008
13-07-2009, 11:01 PM
Erm, It's a coil Irving, the R's a Z ;)

True, but if you read the Astrosyn spec you will see that the DC resistance of the coil is 6.2ohms so at 1A the static voltage across the coil is 6.2v. The current through the coil can never be greater than 1A because of the current limiter so while the voltage across the coil may be higher at t=0 you get no benefit from it, as the magnetic field is proportional to current. A chopper or PWM will drive a higher current through the coil faster due to the higher voltage but average it out (i.e. the RMS current = 1A) but the magnetic field build up is faster therefore torque at high revs is better.

Here is a graph showing the coil current for different applied voltages. A good rule of thumb is a maximum step rate of 3x the 95% energised point , which at 6volts is about 3 x 6.5mS or 51steps/sec = 15rpm. At 12v the maximum rate is 90rpm. At 18v its 142rpm. With a 5mm leadscrew these equate to 75mm/min, 450mm/min and 710mm/min. Realistically for a small router/mill using these lightweight motors 450mm/min is probably the fastest you want to go.

So there again this shows there is no point going above 12v with a linear current limiter; there is little to gain and much to lose....

What these also show is that with a chopper-based limiter there is little point in going much above 18 or 24v as you won't gain much in a unipolar configuration - the law of diminishing returns applies.

You might sensibly go to 36v in a bipolar chopper configuration where you gain the benefit of the higher 1.4A current capability and the full motor torque.