Low ohm adjustability options.

Shafto

Senior Member
I've built a switching constant current LED driver, and currently to adjust the output I use a 25 turn 10ohm potentiomter, useful for the first 3 or 4 turns.

The Rsns resistance starts at 0.18ohm which is a achieved through a combination of slight minimum resistance of the pot and a length of 32 gauge wire.

This setup works, but I have a couple issues with it.

The first issue is that these 25 turn pots only have a rotational life of 200cyles, Delta Total Resistance 3%, I suppose that means after 200 cycles it doesn't just break, but the resistance deviates by another 3%? anyway, I'd prefer a longer life pot for adjustment.

An issue of lesser importance is the fact that these pots are only available in a linear style, a log pot would be ideal for this adjustment. I've heard you can add external resistors to make a linear pot act like a log pot, but I'm not sure how, have to search some more on that.

The ideal situation would somehow use a more common high resistance single turn log pot to somehow create a slight shift in resistance from the 0.18ohm to 3ohm to bring the current down from 1200mA to 100mA

Another option I thought of, using a pot to create a voltage divider on the 0.125V signal that goes through the Rsns resistor to set the current, but I'm completely unsure how exactly to implement that, or if it's a good idea for that matter.. following a datasheet to create the driver isn't so tough.. but I just don't have the experience or know how when it comes to custom modifications like this :)

And finally, where the picaxe comes in.. it would be a more involved solution, but possibly using a digital pot controlled by the picaxe to adjust the resistance?

I know there must be some effective way to accomplish this, I'm just not sure exactly how. Too bad nobody makes a 3-5ohm log pot (that I could find) There are some 5ohm linear pots I've seen, but they're expensive usually because they're designed for high current. Also they wouldn't offer good adjustment at all in the upper current region unless I could somehow make it act like a log pot.

Now a couple pics of the driver to spice up the thread... 2 of them, larger one was made specifically for a high power flashlight and is equipped with an older (and therefore solid, and quite hefty) copper penny heatsink painted flat black for more emissivity. The second one was just made to see how small I could get it.



 
Last edited:

inglewoodpete

Senior Member
How critical is the requirement for accuracy with the resistor? Are you worried if it is outside the 3% tolerance mentioned?

A 270deg-turn mini pot could be read by an 08M. After translation, the PWM output could drive an RC tank circuit into the gate of a power MOSFET. If the required current is not too high, you may not a heatsink on the MOSFET. (The debate may turn to the old chestnut of high-side or low-side connection for the MOSFET now....)

You seem handy with SM by the look of it :). I randomly googled "surface mount power mosfet" and got the IRF5NJ6215. Probably not suited to your task but it has a maximum Rds On of .29ohms with -10v on the gate (max power 75W). So there are possibilities if you can find the right MOSFET.

I have written code that approximates linear-to-log for a volume control.
 

premelec

Senior Member
I'm not entirely sure what you are trying to do here other than regulate and vary current into an LED... often times the feedback path has fairly high impedance so you can just parallel a larger value pot across the sense resistor and use it's tap to vary effecitive feedback sense current value - when doing this it's best to put a series resistor in the bottom leg of the pot so you don't go down to 0 voltage feedback making the circuitry try to drive way high current...

There are also simple and cheap current sense amplifier ICs which translate a small voltage across a high side current sense resistor to a current when then can be used to control whatever...

Or if you want minimum power loss on the feedback resistor amplify the output voltage with an OP amp and feed that to feedback circuits. There are a number of LED drivers that regulate LED current commonly using .1 to .5 volts feedback and often with a PWM input pin as well... New LED drivers seem to arrive on the market daily!

So many ways to do these things! good luck... and yes of course you can use a PICAXE with an appropriate lookup table for your purposes with a pot feeding it's A/D input.... and add an LDR to sense LED light output or room light and so forth...
 

Shafto

Senior Member
Maybe I wasn't too clear about what I want to do? I'll try to be more concise. I have a fully working LED driver using 0.18ohm resistance as the current sense, which sets the current to 1200mA, now I want to be able to adjust that current down using a pot. Raising the Rsns resistance from 0.18ohm to 3ohm is my goal, log adjustment would be ideal.

The accuracy isn't critical as long as the minimum resistance doesn't go up, causing the LED current to drop.

I'm not really sure where the MOSFET comes in? forgive my MOSFET ignorance, as I don't know much about them, but what would that have to do with raising resistance?

Premelec, I'm not exactly sure what you're describing. Adding a 10k pot in parallel with the 0.18ohm resistor? How could that increase resistance? there will always been the 0.18ohm path..

I'm already using a modern LED driver IC with a 0.125V Vref for the current sensing with an integrated OP amp.
 

inglewoodpete

Senior Member
I was suggesting you replace the low resistance sense resistor with the MOSFET. Their D-S resistance can be controlled by the voltage applied to the gate. The D-S resistance can be controlled between 0.1 ohm to megohms.
 

Dippy

Moderator
That requires a healthy pot Shafto.

Not sure about just using a MOSFET as variable resistor. They are pretty variable with tmperature and prob would be unstable without stabilisation.

Have a look at the L200 voltage/current regulator. You may be able to use a more convenient pot.

As I have a MOSFET fettish I would make a PWM controlled regulator. You can have fairly easy current sensing feedback with a fixed sense resistor in the LED return ground path and an average op-amp (low-sided current sensing). (You'll need a diff amp for high-sided current sensing). You can then adust your PWM to your MOSFET. Your PWM can be adjsted by PICAXE which can sense a low-cost POT input on ADC which defnes your current. Mind you that's prob a bit overcomplicated, but much more power efficient (if done correctly :) ) And you add a remote control too oooh.

As for:
"I've heard you can add external resistors to make a linear pot act like a log pot, but I'm not sure how, have to search some more on that."
- Don't search, do it yourself. Fire up Excel. Put in some 1/Rt=(1/R1) + (1/R2) type calcs. Put in a range of values , get it to plot a graph and just watch.
 

Shafto

Senior Member
I can't rework the entire design now.. it's already very efficient, 87-94% depending on the voltage delta.

Hmm, there must be some way to adjust small amounts of resistance without too much trouble.

Dippy, I would do it myself, but I don't understand maths all that well.. I scratch my head whenever I see equations full of letters, unless each letter is fully explained, and I've never used excel.

I should get it though, and figure it out, I can see how it would make these type of scenario easier, however I still had to search and find out exactly what was needed to start modifying pots with outside resistors.

Here's a good article I found:
http://www.elby-designs.com/documents/tailoringpotentionometers.pdf
 
Last edited:

BCJKiwi

Senior Member
If you don't want to do the math then do the practical!

"Premelec, I'm not exactly sure what you're describing. Adding a 10k pot in parallel with the 0.18ohm resistor? How could that increase resistance? there will always been the 0.18ohm path"
You requested adjustability - thats what you get with this suggestion.

If you have 2 100k Resistors in parallel you get 50K

If you have a 10 k and a 100k in parallel what do you expect to get - hopefully not 10K!

Same applies for 0.18R and 10K.

There is a calculator here if you want to see the results;
http://hyperphysics.phy-astr.gsu.edu/hbase/hframe.html

There is also plenty of other stuff on this site which might be of interest to help get the theory into line with the practice.
 
Last edited:

Shafto

Senior Member
Thanks for that website, that'll come in handy for sure. After I can see how everything works then I can sort of reverse engineer the math quite easily and understand it all. I lean backwards :)

I see your point about the 0.18R and the 10K, but any setup like this only has fine adjustment approaching higher resistance, down low, where I need the fine adjustment, the result is basically the same as what I have right now.

I tried using a resistor on the low side of the pot as the article I posted explains, to create a ~log curve. However I got much different results testing than shown. Obvious when you think about it, putting a resistor across the load side is similar to the above situation, with 2R across a 20R pot, you're not going to get over 2R of resistance.

Stuck again.

What are the thoughts around here on making a voltage divider with a 10K between the 0.125V and GND, putting the wiper through the sense resistor to GND? I'm not really sure what would happen, maybe I should just try it.

There has to be some way to do this somewhat simply, there's almost always a way.
 

premelec

Senior Member
If you put a _gain_ circuit across your current sense resistor it will give you _lower_ currents... e.g. if a .1ohm resistor gives you .1 amp and you insert an op amp with 10x voltage gain then the new current regulation occurs at .01 amp. There are some practical considerations of phase shifts and so forth which could result in oscillation but with a slow speed application this isn't difficult to kill... Note that if you use a gain circuit in the feedback path it can be a non-linear gain component like a log amp configuration which then gives you quite a range of effects...
 

Shafto

Senior Member
Op Amps are adjustable? I have no experience with them, I'll have to look into it.

It's not very low speed though. About 575kHz @ 1000mA and close to 1500kHz at 60mA.

Here's the datasheet for the chip I'm using.

http://www.national.com/ds/LM/LM3404.pdf

Edit: a quick look on digikey doesn't show any op amps that take 0.125V ? the lowest are rated to 1V
 
Last edited:

premelec

Senior Member
it's not the amplifier working on a power supply of .2v volts I was suggesting but that an op amp with a non-linear gain configuration could be used [there are also voltage gain controlled op amps etc... ].

HOWEVER! you mention the National part you are using and it has a DIM pin made for output current control [dimming] through PWM input... take a closer look at that and see if that doesn't do what you want - perhaps with a pot controlled 555 pwm generator or a PICAXE 08M PWMOUT with a pot intput to an A/D pin and then a lookukp table to translate to appropriate PWMOUT.

The frequency of the switched convertor is not relevent so long as you aren't trying to modulate the LED very fast [i.e. faster than 10ms].

Keep digging! you are learning a lot along the way....
 

Shafto

Senior Member
PWM dimming is almost 300% less efficient than current dimming at lower current levels.

Some LEDs chip's I've seen will dim by current with a voltage divider on the enable pin.. unfortunately this is not one of them.
 

premelec

Senior Member
I think you may have a misconception going on here in regard to the LM3404 chip - note in the rough schematic in the data sheet that the CS pin voltage and PWM input both go to the _same logic block_ which then controls the switching to produce some particular LED current effect...

Is there some reason to think that the PWM signal is grossly differently interpreted than the CS signal in controlling the switcher? It may be the case but usually National is pretty clever about what they design. The efficiency of the input VA to output to LED is primarily determined by the switching circuitry...

I suggest, as seeing is believing and you don't want to work in the dark - , you try changing the CS resistor and also try a square wave [simple PWM source] on the DIM pin and see empirically what happens...

The CS pin doesn't care where the voltage it senses comes from... So amplifying the voltage from the sense R will in effect make the switcher think more current is flowing in the sense R than is the case.

Anyhow don't be too sure of knowing what will happen when you use the DIM function on this chip - and look for an App Note from National or just try it...

If you haven't established a method of measuring output lumen efficiency you need to do that too - with a PV & capacitor and resistor holding the voltage down to .1 volt so you effectively measure PV cell current... this isn't exact but it certainly helps better than eye balling the lumens...

That's about all I have to input on this... good luck...
 

Shafto

Senior Member
I appreciate your input so far, thanks.

I should have been more clear again.. the PWM is not less efficient because of the IC. It's the LED.

I'm using the best LEDs on the market right now, CREE R2 bin. Running at 1amp they make about 75lumen/W, at 350mA it's about 110lm/W, lower than this isn't listed in the spec sheet, but speculating by testing others have done of previous bins.. they're well over 150lm/W at very low currents (40mA or so)

While PWM dimming is better for colour shift control, because the LED is always running as the same current, just at different duty cyles, lowering the current will cause the LED to make many more lm/W.

I'm beginning to wonder if I should try to build my own variable resistor using some nichrome wire or something. I don't understand why there isn't something available like this. I know there are wire wound resistors manufactured, why not make some very low ohm versions.
 
Last edited:

premelec

Senior Member
OK - I'm still not getting my point accross to you - the PWM signal on DIM _might_ have just the same effect as increasing the sense resistor which increases the sense voltage at lower currents... it depends on the LM3404 logic design.

You are thinking that the PWM -> DIM signal makes the LED current follow the PWM turning on and off with the DIM PWM - that may not be the case but can easily be tested if you have an oscilloscope across the sense resistor as you change the DIM input PWM and see what the LED current looks like... National may have an app note on this... actually you could probably test this with a multimeter seeing if an AC voltage appears on the sense resistor when you put a square wave on the DIM.

I have some 3 watt Lumex LEDs but have them to use at high currents and for low currents use the little guys...
 

moxhamj

New Member
I wonder if the answers are not forthcoming because people don't understand the question. I'm not sure I do.

The usual way to change a resistance at very low values, say 1 ohm, is to pick a lower value resistor, eg 0.1 ohms and turn it on and off with pwm. A 0.1 ohm resistor at 10% pwm will behave as a 1 ohm resistor if you pulse it fast enough. Fast enough for this purpose would be 10x faster than the fastest component, which in this case I'm guessing is the switch mode power supply. Or maybe it just needs to be fast enough not to cause flicker.

A power transistor could also be an option.

But I'm sure there is a smarter way by getting into the internals of the circuit and changing a sense resistor/current/volts somewhere.

Any chance of posting a schematic as this is all guesswork at present :)
 

premelec

Senior Member
I just downloaded the EV board rap for the LM3404 and it appears my speculation is wrong on the PWM not actually PWMing the output from the DIM pin -

I'll stick with my earlier suggestions on putting a variable gain block between the current sense resistor and the CS input pin... this could be digitally controlled with a digipot or DAC feedback on an op amp.

The MOSFET sense resistor works fine too if you have some way to tell what the current is actually [with a sense resistor and op amp for instance]. Just put the MOSFET drain in series with the .2 ohm sense resistor to V- and then vary the gate voltage... sense the actual current with the .2 ohm R - jack it up with a gain of 20 and then input that to a PICAXE A/D which then puts a filtered PWM output to the MOSFET gate.... 4 volts = 1 amp .4 volts = .1 amp; READADC10 gives you 5/1024 single step resolution with regulated 5 volts on the PICAXE.

I'd stay away from the nichrome wire unless you enjoy that path... :)
 

Dippy

Moderator
I think a schematic is necessary here.
I'm totally confused.
If you are making a uP controlled switching C/C regulator (which I have done just recently with PIC) you don't adjust the sense resistor. You simply use the 'feedback' from a fixed sense to adjust your PWM. That's basically what 'proper' switchers do.

If you want to vary the constant-current level with a pot. you could just get your code to sample another ADC input every-so-often and use that figure in your PWM equation too.

If you are using a boughten switcher then there is probably a way to do this in the f/b loop so a hefty watt/low ohm pot is not needed.

If it's something else then I am completely lost and will make a coffee instead... good luck.
 

papaof2

Senior Member
Instead of a power-wasting sense resistor, why not use an Amploc hall effect current sensor http://www.amploc.com/ZAP25,50,100.pdf to measure the actual load current via ADC on a PICAXE? Use a standard pot to provide the control input to another ADC. You can then use PWM (or R-C integrated PWM as varying DC) to control the pass transistor circuitry.

John
 

Shafto

Senior Member
The general wiring diagram in the datasheet I posted is exactly the same as my driver, except instead of the sense resistor going straight to ground, it goes through a pot, and then to ground. (as is right now)

I'm not so sure how to put what I'm trying to achieve any more clearly.

I think what is happening is that people are perceiving that I'm trying to do something difficult.. on the contrary it's quite simple. I just looking for a way to adjust from 0ohm to 3ohm with reasonable accuracy along the way. Log adjustment would be great, as the adjustment is very touchy at low resistance with a linear pot, small differences in resistance make a big difference in current flow.. above 1ohm or so adjustment is much more smooth.. so a slow increasing resistance at first, and then faster adjustment as I turn is what I'm after.

Using a MOSFET or OpAmp is beyond my electronic knowledge.. and I still don't understand how either help me adjust resistance. I don't think the chip would like some boosted voltage by an opamp going back to the Rsns, I'm sure I'm understanding what wrong.. but it makes no sense to me. I have yet to do some good reading on MOSFETS, but I know I need to learn about them eventually. Like a transistor with adjustable gain that you can use to vary resistance? ...but if it really drifts with temp, that would be no good.. someone already debunked this method for that reason.

What I can understand so far.. is the resistor with a duty cycle, that makes sense to me, but I'm not so sure how well it would work with the rest of the switching frequency and such. That's something I could try though, just use a transistor connecting the sense resistor to ground, and try different PWM duty cycles with the resistor. But wouldn't I need to do that ridiculously fast for the IC not to notice and shut down?

I've also thought of something I should have probably considered a lot earlier on. A 12 position rotary switch would probably do just fine. I could use some nichrome wire and tap into it at different lengths on each post.. and I could make my own custom log type adjustment.

Thanks for all the input so far.

I'll try a resistor with a duty cycle and see how that works out.. If it's a no go I'll probably just opt for the rotary switch.
 
Last edited:

premelec

Senior Member
If you are happy with the switch and taps that should be fine... switch contact resistance perhaps being an issue... I'd suggest constantan wire instead of nichrome as it's easier to solder to - however if you don't mind a larger but not huge temperature coefficient fine guage copper wire would work fine too and is much easier to locate though lower resistance per foot [ unwind from an old transformer..]

I've made many low resistance resistors by taking the length of wire and using a 1 or 2 watt resistor as a form to wrap it around and solder the ends to the 1 or 2 watt resistor leads - if you need lower inductance you can wrap half in opposite direction so it tends to cancel - whatever works! have fun...

To make switch contact resistance effect minimal put all your resistors in series and connect the feedback point CS to the TOP of this string and then switch LED to the taps between resistors rather than switching the CS point... then the contact resistance appears in series with the LED but doesn't affect the CS voltage... This configuration was worked out before I was born >80 years ago... and seems to work very well.
 

moxhamj

New Member
Tapping nichrome wire should work, and length is proportional to resistance so you can calculate the resistance. There may be some resistance across the switch - probably negligable when it is new but maybe over a few years if the switch is never moved some oxide might build up.

Re switching a resistor very fast, it just needs to be faster than the switching reg etc in the controller. And pwmout can run pretty fast.
 
Top