Author Topic: current sense with LM324D  (Read 1028 times)

0 Members and 1 Guest are viewing this topic.

Offline bogdantTopic starter

  • Regular Contributor
  • *
  • Posts: 80
  • Country: ro
current sense with LM324D
« on: May 17, 2020, 05:41:46 pm »
I did a high side current measurement, a differential amplifier. But it measure 250mV with no load at all, Vcc = 32V, Vee =0; If I set the voltage to Vcc=25V still I have on the output 180mV.
https://github.com/bogdan-tirzioru/Powersupply/blob/master/factory/sampleB/Job2.PDF
Do you have any idea why is not working ?
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3240
  • Country: gb
Re: current sense with LM324D
« Reply #1 on: May 17, 2020, 07:07:45 pm »
Poor common mode rejection is often caused by poor matching between your gain setting resistors, even 1% resistors will limit performance and if you are using unbranded Chinese 1% resistors the chances are they don't meet 1% tolerance.
 
The following users thanked this post: bogdant

Offline Alti

  • Frequent Contributor
  • **
  • Posts: 404
  • Country: 00
Re: current sense with LM324D
« Reply #2 on: May 17, 2020, 07:55:54 pm »
I did a high side current measurement, a differential amplifier. But it measure 250mV with no load at all, Vcc = 32V, Vee =0; If I set the voltage to Vcc=25V still I have on the output 180mV.

This opamp as the current sink capabilities in the range of 50uA in the range 0V to 0.7V so if you are loading it more there, it won't work. Avoid this range when sinking.
Uout = 3.3*UR1
It should output 0V at Ushunt=0 only if inputs and output and supply pins are within the operating range. And clearly output is not, not sure about the rest.

One option I'd suggest is to measure:
Uout = 3.3*UR1 + 0.5*Vcc
Then at UR1=0 you should get 0.5*Vcc on the output.
 
The following users thanked this post: bogdant

Online xavier60

  • Super Contributor
  • ***
  • Posts: 2834
  • Country: au
Re: current sense with LM324D
« Reply #3 on: May 17, 2020, 11:04:23 pm »
Measuring its input voltage difference will indicate if the opamp is operating closed loop or not.
When a power supply design has a large output capacitor, it can be an indication of inherent instability.
HP 54645A dso, Fluke 87V dmm,  Agilent U8002A psu,  FY6600 function gen,  Brymen BM857S, HAKKO FM-204, New! HAKKO FX-971.
 
The following users thanked this post: bogdant

Offline bogdantTopic starter

  • Regular Contributor
  • *
  • Posts: 80
  • Country: ro
Re: current sense with LM324D
« Reply #4 on: May 18, 2020, 04:33:18 am »
I remove the output capacitor C3=470uF and I have the same result. The voltage input difference on the opamp is 0V for no load. I also measure each resistor and the value is spot on. 
 

Offline bogdantTopic starter

  • Regular Contributor
  • *
  • Posts: 80
  • Country: ro
Re: current sense with LM324D
« Reply #5 on: May 18, 2020, 04:40:30 am »
I did a high side current measurement, a differential amplifier. But it measure 250mV with no load at all, Vcc = 32V, Vee =0; If I set the voltage to Vcc=25V still I have on the output 180mV.

This opamp as the current sink capabilities in the range of 50uA in the range 0V to 0.7V so if you are loading it more there, it won't work. Avoid this range when sinking.
Uout = 3.3*UR1
It should output 0V at Ushunt=0 only if inputs and output and supply pins are within the operating range. And clearly output is not, not sure about the rest.

One option I'd suggest is to measure:
Uout = 3.3*UR1 + 0.5*Vcc
Then at UR1=0 you should get 0.5*Vcc on the output.
Vcc = 32V => Uout = 0.5*32V= 16V, I do not have this value. But it seems that there is a correlation to the load. If I disconnect the next stage it is better, but no so much(10mV). Can you recommend another opamp for this job ?
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21698
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: current sense with LM324D
« Reply #6 on: May 18, 2020, 04:44:02 am »
Connect pin 11 to a slight negative supply, or connect a pull-down resistor from the output pin(s) to a negative supply.

The latter is probably the better option, as to bias the output stage into class A conduction.  LM324 is a terrible opamp, with enough distortion to be noticeable even in control applications such as this.  It needs all the help it can get (like by biasing the output).

Speaking of bad things being bad, and component paranoia -- mind that even the lowly 324 can and will be counterfeited by cheap suppliers.  You might get salvaged parts, you might get dust, you might get something unexpectedly much better -- who knows?  The same goes for every semiconductor; buy from authorized distributors if possible.

Tim
« Last Edit: May 18, 2020, 04:45:55 am by T3sl4co1l »
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 
The following users thanked this post: wraper, bogdant

Online xavier60

  • Super Contributor
  • ***
  • Posts: 2834
  • Country: au
Re: current sense with LM324D
« Reply #7 on: May 18, 2020, 05:20:10 am »
I did a high side current measurement, a differential amplifier. But it measure 250mV with no load at all, Vcc = 32V, Vee =0; If I set the voltage to Vcc=25V still I have on the output 180mV.
https://github.com/bogdan-tirzioru/Powersupply/blob/master/factory/sampleB/Job2.PDF
Do you have any idea why is not working ?
According to TI's data sheet, their part has a 50uA current sink to ground so it should go very close to 0V so long as there is very little external pull-up current. With the PSUs output set to 5V, the pull-up current should only be 12uA from R4 and R10 .
With the PSUs output set to 0V there should be no pull-up current.
Have you disconnected the opamp's output from the rest of the circuit?
HP 54645A dso, Fluke 87V dmm,  Agilent U8002A psu,  FY6600 function gen,  Brymen BM857S, HAKKO FM-204, New! HAKKO FX-971.
 
The following users thanked this post: bogdant

Offline bogdantTopic starter

  • Regular Contributor
  • *
  • Posts: 80
  • Country: ro
Re: current sense with LM324D
« Reply #8 on: May 18, 2020, 01:21:05 pm »
Connect pin 11 to a slight negative supply, or connect a pull-down resistor from the output pin(s) to a negative supply.

The latter is probably the better option, as to bias the output stage into class A conduction.  LM324 is a terrible opamp, with enough distortion to be noticeable even in control applications such as this.  It needs all the help it can get (like by biasing the output).

Speaking of bad things being bad, and component paranoia -- mind that even the lowly 324 can and will be counterfeited by cheap suppliers.  You might get salvaged parts, you might get dust, you might get something unexpectedly much better -- who knows?  The same goes for every semiconductor; buy from authorized distributors if possible.

Tim
I do not have in the project a negative rail, seems that I need it one, in the end. Any simple way to obtain this in my case ?
 

Offline bogdantTopic starter

  • Regular Contributor
  • *
  • Posts: 80
  • Country: ro
Re: current sense with LM324D
« Reply #9 on: May 18, 2020, 01:26:37 pm »
I did a high side current measurement, a differential amplifier. But it measure 250mV with no load at all, Vcc = 32V, Vee =0; If I set the voltage to Vcc=25V still I have on the output 180mV.
https://github.com/bogdan-tirzioru/Powersupply/blob/master/factory/sampleB/Job2.PDF
Do you have any idea why is not working ?
According to TI's data sheet, their part has a 50uA current sink to ground so it should go very close to 0V so long as there is very little external pull-up current. With the PSUs output set to 5V, the pull-up current should only be 12uA from R4 and R10 .
With the PSUs output set to 0V there should be no pull-up current.
Have you disconnected the opamp's output from the rest of the circuit?
The 250mV is with the output disconected from the comparator and the micrcontroller measurement line. If I add them I have 500mV output for 0 current measured! I do not undestand, there are only inputs for other opamp. Any recomandation for an alternative solution for high side current. I search on INA variants but it has very large gain 25 as minim.
 

Offline StillTrying

  • Super Contributor
  • ***
  • Posts: 2850
  • Country: se
  • Country: Broken Britain
Re: current sense with LM324D
« Reply #10 on: May 18, 2020, 01:55:37 pm »
The output of the differential amp will struggle to sink the ~70uA coming through R10 330k down to 0V - I think.

Other than a small -Ve voltage for the LM324's supply I can't think of an easy fix.

I do not have in the project a negative rail, seems that I need it one, in the end. Any simple way to obtain this in my case ?

It would help if you showed us the AC - DC rectification, a diode capacitor voltage inverter might do, just a -Ve volt or 2 would do if the LM324's already have +32V.
« Last Edit: May 18, 2020, 02:06:25 pm by StillTrying »
.  That took much longer than I thought it would.
 
The following users thanked this post: bogdant

Offline Alti

  • Frequent Contributor
  • **
  • Posts: 404
  • Country: 00
Re: current sense with LM324D
« Reply #11 on: May 20, 2020, 05:33:32 pm »
Vcc = 32V => Uout = 0.5*32V= 16V, I do not have this value.
To make 16V out of 32V you can use voltage divider.
Remove R5 (330k) and put two 660k resistors in series. One end goes to 32V, the other to 0V (AGND in your schematic) and the middle of the divider to TP6. This will be a 330K tied to 16V source, instead of 330K tied to 0V that you have. Then the result is going to be:

Uout = 3.3*UR1 + 16V
 

Online xavier60

  • Super Contributor
  • ***
  • Posts: 2834
  • Country: au
Re: current sense with LM324D
« Reply #12 on: May 21, 2020, 01:27:48 am »
I did a high side current measurement, a differential amplifier. But it measure 250mV with no load at all, Vcc = 32V, Vee =0; If I set the voltage to Vcc=25V still I have on the output 180mV.
https://github.com/bogdan-tirzioru/Powersupply/blob/master/factory/sampleB/Job2.PDF
Do you have any idea why is not working ?
According to TI's data sheet, their part has a 50uA current sink to ground so it should go very close to 0V so long as there is very little external pull-up current. With the PSUs output set to 5V, the pull-up current should only be 12uA from R4 and R10 .
With the PSUs output set to 0V there should be no pull-up current.
Have you disconnected the opamp's output from the rest of the circuit?
The 250mV is with the output disconected from the comparator and the micrcontroller measurement line. If I add them I have 500mV output for 0 current measured! I do not undestand, there are only inputs for other opamp. Any recomandation for an alternative solution for high side current. I search on INA variants but it has very large gain 25 as minim.
Although you didn't say what happens when the PSU output is 0V, it seems that the part you have is off spec, possible fake.
To be fully certain, I would test it on a bread-board setup,
HP 54645A dso, Fluke 87V dmm,  Agilent U8002A psu,  FY6600 function gen,  Brymen BM857S, HAKKO FM-204, New! HAKKO FX-971.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf