Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

current sensing for a linear power supply

Status
Not open for further replies.

gehan_s

Member level 3
Joined
Aug 31, 2012
Messages
62
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Location
Sri Lanka
Activity points
1,797
hey all,

i am designing a linear power supply (Vout upto 20V and Iout upto 1A). after going through some regulator ICs i've chosen the lm317. i have covered most of the basics and this is my design.

View attachment power.jpg

i regulate the output voltage via a low passed PWM signal which is then given a gain of 4 and applied to the adjust pin of the lm317 and it works really well (both in software and when i implement the circuit).
for sensing the current i have used the 1ohm resistor and a difference amplifier. the output voltage of it will be equal to the current flowing to the load. this also works really well in software but when i implement it, it does not work. it is more frustrating because when i short circuit the load the current is sensed perfectly (it actually senses 0.01A increments of current). how can i resolve this?????

thanks in advance !!!!!!!!!!
 

Attachments

  • power.zip
    42.2 KB · Views: 17

albert22

Full Member level 6
Joined
Jul 20, 2004
Messages
333
Helped
68
Reputation
136
Reaction score
65
Trophy points
1,308
Activity points
5,005
The problem could be at the diff amp. The 100k resistors should be matched to 1% (or better) to have a suitable CMRR.
 

Fe(II)man

Member level 1
Joined
Aug 26, 2012
Messages
38
Helped
5
Reputation
10
Reaction score
5
Trophy points
1,288
Location
Durban
Activity points
1,633
okay so here's the thing. In my opinion and experience with current sensing using a sense resistor and a built diff. amp using in your case the LM317 or in my case the LM324 or LM358 op amps, the voltage drop is far to small across the sense resistor.

What you can do is one of the following:

1. Configure the op-amps in an Instrumentation amplifier configuration.
2. Buy an Instrumentation amplifer eg. AD620 - beautiful IC which works extremely well and very accurately!
3. Buy a breakout board from sparkfun : ACS712 beautiful board requiring no sense resistor.
4. Use a sense amplifier such as the MAX4173 across the sense resistor.

I just finished building a power meter which required current sensing, with the same spec as you. All of the above techniques worked for me, however I chose to go with number 2 in my design.

Hope this helps;
Gooduck

1. https://www.google.co.za/search?q=instrumentation+amplifier+design&aq=3&oq=instrumentation+amplifier&sugexp=chrome,mod=7&sourceid=chrome&ie=UTF-8&safe=active

2. https://www.sparkfun.com/products/8882

3.http://www.stanford.edu/class/ee122/Parts_Info/datasheets/ad620.pdf

4. http://www.stanford.edu/class/ee122/Parts_Info/datasheets/ad620.pdf

Please let me know if this helps.

- - - Updated - - -

okay so here's the thing. In my opinion and experience with current sensing using a sense resistor and a built diff. amp using in your case the LM317 or in my case the LM324 or LM358 op amps, the voltage drop is far to small across the sense resistor.

What you can do is one of the following:

1. Configure the op-amps in an Instrumentation amplifier configuration.
2. Buy an Instrumentation amplifer eg. AD620 - beautiful IC which works extremely well and very accurately!
3. Buy a breakout board from sparkfun : ACS712 beautiful board requiring no sense resistor.
4. Use a sense amplifier such as the MAX4173 across the sense resistor.

I just finished building a power meter which required current sensing, with the same spec as you. All of the above techniques worked for me, however I chose to go with number 2 in my design.

Hope this helps;
Gooduck

1. https://www.google.co.za/search?q=instrumentation+amplifier+design&aq=3&oq=instrumentation+amplifier&sugexp=chrome,mod=7&sourceid=chrome&ie=UTF-8&safe=active

2. https://www.sparkfun.com/products/8882

3.http://www.stanford.edu/class/ee122/Parts_Info/datasheets/ad620.pdf

4. http://www.stanford.edu/class/ee122/Parts_Info/datasheets/ad620.pdf

Please let me know if this helps.
 

gehan_s

Member level 3
Joined
Aug 31, 2012
Messages
62
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Location
Sri Lanka
Activity points
1,797
thank you very much both of you!!!!!!!!!!

@ albert22
i did match the 100k resistors when i breadboarded the circuit.

@ Fe(II)man
yes i did try it in the instrumental amplifier mode (with the 324) but it didn't help. for the AD620 what is the highest supply voltage and highest common mode voltage in your opinion ???? this is because i am using a 230 to 24Vrms step down transformer and i hope to power all the ICs with the voltage out of it.
i should also mention that when i put the 1ohm is in the ground path (after the load) it starts sensing current again (very accurately). it makes me wonder if it has anything to do with the -Vs voltage to the opamp (i am using single supply configuration). that is because every time the voltage at right end of the 1ohm resistor is 0V the current is sensed really fine.
 

albert22

Full Member level 6
Joined
Jul 20, 2004
Messages
333
Helped
68
Reputation
136
Reaction score
65
Trophy points
1,308
Activity points
5,005
I think that you need a -V supply on the op amp. Because if not the negative input of the op amp will not go to the voltage needed to zero the power supply output voltage at the op amp output.
Try with a -V of at least 12v to see if it works. Please tell me if it does.
Also I think that in this application you dont need to go for an expensive IA. And without -V supply it may work the same way as before.
If this is getting to complicated you may go for a "low side" current sensing that does not require a diff amp. That is, to place the shunt R1 in the negative output of the power supply.
 

crutschow

Advanced Member level 5
Joined
Feb 22, 2012
Messages
3,828
Helped
914
Reputation
1,826
Reaction score
898
Trophy points
1,393
Location
L.A. USA Zulu -8
Activity points
21,604
What is the output of the current sensor when the output voltage is above zero?

Does is not work even when the output is small, say 1V?
 

gehan_s

Member level 3
Joined
Aug 31, 2012
Messages
62
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Location
Sri Lanka
Activity points
1,797
@albert22
i supplied the op amp with a - supply but it didn't work
@crutschow
it says about 0.6V

i placed the 1ohm in the return path (just after the load) it is working perfectly. can someone tell me if there any disadvantages in doing that ?????????
 

albert22

Full Member level 6
Joined
Jul 20, 2004
Messages
333
Helped
68
Reputation
136
Reaction score
65
Trophy points
1,308
Activity points
5,005
gehan,
If it didnt work with a -V supply the problem is the CMRR. This can be the matching of the resistors or the op amp itself not capable of working with a common mode voltage of 10 volts.

I as I write this I checked the LM324 datasheet
http://www.ti.com/lit/ds/symlink/lm124-n.pdf
Common mode voltage seems to be ok if the +V is more than 12v. And so the offset.
At page 14 there is the same circuit and working with just one supply so I may be wrong about the -V supply.
And I bet now that the matching of the resistors should be better.
Placing a short over R1 you should get 0 volts at the output of the op amp, from 0 to 20v of the output of the power supply. You can swap resistors to see if anything changes.

The disadvantages of placing the shunt on the neg. (in your circuit) is that the output voltage will be reduced by the drop in the resistance. Max 1v and the power supply regulation will be less than optimal.
 

crutschow

Advanced Member level 5
Joined
Feb 22, 2012
Messages
3,828
Helped
914
Reputation
1,826
Reaction score
898
Trophy points
1,393
Location
L.A. USA Zulu -8
Activity points
21,604
............................................

The disadvantages of placing the shunt on the neg. (in your circuit) is that the output voltage will be reduced by the drop in the resistance. Max 1v and the power supply regulation will be less than optimal.
Since he had the shunt resistor at the output of the regulator the loss in regulation would be the same either way. To eliminate this loss the shunt resistor should be placed at the input to the regulator, not the output.
 

albert22

Full Member level 6
Joined
Jul 20, 2004
Messages
333
Helped
68
Reputation
136
Reaction score
65
Trophy points
1,308
Activity points
5,005
crutschow
Thanks for making me see that. I was focused on a power supply with voltage sense at the output.
Placing the current sense before the regulator will achive better regulation and the common mode voltage of the op amp will be almost constant. I would be a better choice.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top