lm317 current regulation.

I did not wish to hijack another thread....

In current regulation mode, we have a sensing resistor ... here's where my brain says no

2ohm 2watt resistor.

Why is it the calculation is based on the internal voltage reference 1.25v and not on the supply voltage?

1.25/2ohm
625ma

If the voltage going out was say 12vout (15v in) why is it not 12/2 (6amps) ?

It would help if you linked the circuit you are talking about.
But basically the current sensing resistor develops a voltage across it that backs off the voltage drive into the resistor. What current are you trying to acheave?

The best thing to do would be to set up that current regulator circuit on a breadboard, after calculating for a modest output (< 20mA).

Run the output into a short and measure the voltage across the “programming resistor” and that across the LM317 (input to output).
Vary the input a few volts and note the changes, if any, across those components.

Then place a smallish resistor on the output and repeat the process.

cjdelphi:
In current regulation mode, we have a sensing resistor … here’s where my brain says no

2ohm 2watt resistor.

Why is it the calculation is based on the internal voltage reference 1.25v and not on the supply voltage?

1.25/2ohm
625ma

If the voltage going out was say 12vout (15v in) why is it not 12/2 (6amps) ?

Because the entire purpose of the LM317 in this case is to keep 1.25V across the output and the adjust terminal. It is really just a 1.25V voltage regulator.

In fact, I could use an LM7805 in exactly the same way. Input 20V, Output 5 Ohm resistor to the Ground terminal, Ground terminal to the load.

As long as the load is low enough so that 20V - 5V - 3V(minimum drop across a 7805) >0, it will keep current at a constant 1A. So with a 1 Ohm load, 1V is dropped across the load, 5V across the 5 Ohm current sense resistor, and 20-5-1 = 14V is dropped across the LM7805

With a 10 ohm load, 10V must be dropped across the load. That leaves 10V for the 7805 and current sense resistor, so we’re still within the bounds of regulation. 20-10-5 = 5V dropped across the 7805.

With a dead short, zero volts across the load. 20-5 = 15V dropped across the 7805.

12 Ohm load, 12V dropped across it. 20-12-5 = 3V dropped across the 7805.

Any higher resistance load, and the 7805 has no more headroom, so current will drop. Voltage across the current sense resistor will drop, but voltage across the load will still rise, just not enough to keep current at 1A.

Why is it the calculation is based on the internal voltage reference 1.25v and not on the supply voltage?

I mentioned in the other thread that the reference voltage point related to the ADJ pin is 1.25V. (It was also mentioned here too… and reading datasheets should be as important as anything else you do in a project) The voltage divider that is “normally” placed at the ADJ pin creates a set point for the Error Amplifier inside the regulator to compare against a (also internal) 1.25 Volt reference that is based on the OUTPUT voltage currently leaving the regulator. When the error amp balances out, the output voltage is “regulated”.

When in current regulation mode (The regulator has no clue, by the way), you are only giving the regulator a sample of the regulated output voltage based on the amount of voltage dropped across the sensing resistor, which varies based on desired current setting… so you so can do the MATH (datasheet helps you out, if you like) and determine the best case resistor for your current goal.

Maybe it makes more sense to look at the basic building block of a linear regulator as discrete parts. (crude but accurate, assuming you know how op amps work… just a little)

Yes, the drawing should say V-out on the right side… but it’s not my drawing.

Oh cool.... so the current is controlled with an op-amp .... i could build my own then!

cjdelphi:
Oh cool.... so the current is controlled with an op-amp .... i could build my own then!

Yes and in that way your current sensing resistor could be even smaller and its value not dependent on the actual current because you can set your own thresholds.