Author Topic: LM358 in Consant Current Circuit Problem  (Read 12040 times)

0 Members and 1 Guest are viewing this topic.

Offline Yansi

  • Super Contributor
  • ***
  • Posts: 3930
  • Country: 00
  • STM32, STM8, AVR, 8051
Re: LM358 in Consant Current Circuit Problem
« Reply #25 on: January 01, 2017, 02:09:56 pm »
No it is not, as it will complicate the current sensing, as you can not then simply use a shunt in the emittor. You would be measuring emitter current, not the collector one.   Emitter current is Ic+Ib and Ib being significant (remember that high power BJTs have low current gain typical) compared to the Ic.
 
The following users thanked this post: TheInfernoMan

Offline TheInfernoManTopic starter

  • Contributor
  • Posts: 27
  • Country: de
Re: LM358 in Consant Current Circuit Problem
« Reply #26 on: January 01, 2017, 02:14:27 pm »
Ok, thanks for the tip regarding to the offset voltage.
Would the following schematic would work now ?

There are a lot of things I had not known, but I learned a lot now.
But I want to build the PCB now, but there a lot of mistakes in my schematic  |O sorry
 

Offline Yansi

  • Super Contributor
  • ***
  • Posts: 3930
  • Country: 00
  • STM32, STM8, AVR, 8051
Re: LM358 in Consant Current Circuit Problem
« Reply #27 on: January 01, 2017, 02:21:18 pm »
Add a cap accross R10. Value not critical.  100nF for example. Will work as a small noise filter.  Will come handy, if you wire the potentiometer on long leads, that would pick up RF noise.

Also, when making the layout, make sure that the you know  signal wire/trace from pin2 (inverting input) is a high impedance and can accept interference - keep it short as possible, place both C1 and R12 close to the pin2.

Place another 100nF decoupling cap close between pins 4 and 8 of the opamp. (The 10uF on the input already might be enough, but aswell might not, depending on the layout. )
« Last Edit: January 01, 2017, 02:34:35 pm by Yansi »
 
The following users thanked this post: TheInfernoMan

Offline Richard Head

  • Frequent Contributor
  • **
  • Posts: 685
  • Country: 00
Re: LM358 in Consant Current Circuit Problem
« Reply #28 on: January 01, 2017, 03:11:01 pm »
Yansi

Yes, you are correct. sorry.
 

Offline Yansi

  • Super Contributor
  • ***
  • Posts: 3930
  • Country: 00
  • STM32, STM8, AVR, 8051
Re: LM358 in Consant Current Circuit Problem
« Reply #29 on: January 01, 2017, 03:50:06 pm »
But to be fair, it can be done with the BJT too, even with similar simplicity: but the constant current load won't be ground terminal referenced then. But that is really no problem, if the supply for the control circuitry is floating.


Note: TheInfernoMan: Now for this circuit, the buffer will come handy, as the output current is proportional to the current flowing through R1. The circuit also can be designed so that the effect of offset voltage of the buffer will play insignificant role, as the offset voltage of the buffer is effectively divided by the ratio of R1 and R2.

Also good to note, that the formula for Iload works only when R2 is significantly higher, than Rsense, which for most cases is fulfilled (Rsense some tenths of ohm, R2 hundreds ohms or few Kohms)

« Last Edit: January 01, 2017, 03:56:08 pm by Yansi »
 

Offline orolo

  • Frequent Contributor
  • **
  • Posts: 352
  • Country: es
Re: LM358 in Consant Current Circuit Problem
« Reply #30 on: January 01, 2017, 09:11:17 pm »
I have built the circuit and tested it, and it works (tested the load with an ammeter), at least up to 1 amp @ 40V. I have used your parameters, 40V for the source, an MC7812 regulator for the opamps, one LM358, etc.

The schematic is attached below. If you are interested, I can post some images and probe the circuit with an oscilloscope to see how it behaves. The load current increases in an apparently linear way with the pot, but I haven't checked the precision.

Some obvious points:

-> If you connect the current sink directly to 40V, the mosfet will dissipate a lot of power (about 40W at 1 amp). If you are planning to go into the multiamp range, you'll need a massive heatsink and probably a fan. Study carefully the thermal aspect of the project. A quick look at the IRFZ44 datasheet tells it manages up to 50 Watts, so without source resistance that's 1.25 amps per transistor. Without a good heatsink, your mosfets will die very quickly.

-> I designed the voltage divider thinking in very high currents, and used a low quality potentiometer. Design the divider carefully for the desired current range, and use a quality pot. The current is controlled by a voltage divider, which is buffered by one half of the 358, then divided by 5, and sent to the regulator.

-> In my circuit I used an alleged IRF1405 bought from ebay, who knows what's really inside. It works, though. The 358 is also an ebay cheapy, bought in a lot of 50.

-> Don't forget to load the 7812 with at least 5mA for it to regulate reliably. I used an LED for that.

To increase stability, I thought of using the opamp to drive a 2N7000 (from the 12V supply!), which in turn drives the bigger mosfet. The 2N7000 has much lower capacitance. The idea worked in simulation, but seemed to give no real advantage. Simulating some more, I got oscillations for very light load currents with no gate resistor: with a gate resistor, the oscillations went away.
« Last Edit: January 01, 2017, 09:16:14 pm by orolo »
 
The following users thanked this post: TheInfernoMan

Offline TheInfernoManTopic starter

  • Contributor
  • Posts: 27
  • Country: de
Re: LM358 in Consant Current Circuit Problem
« Reply #31 on: January 01, 2017, 09:26:43 pm »
Thanks for your work on your schematic, it is near to my current schematic I think  :)
I will solder my PCB tomorrow and test it out, I think i will post my results as an answer.

Temperature is not the problem in my case. The MOSFET is not directly on the PCB it is mounted to a CPU Cooler which is capable of dissipating to 100W heat. The limitation comes from the MOSFET (IRFZ44N) which can only dissipate around ~90W maximum (Infineon Datasheet). So the CC Load would be rated to 60W at the End (to go safe).

I used the L7805 for a voltage reference and I included a minimum load in my schematic, so it would be not the problem.

Precision is not the most important point, important is that the current is constant, so that I can record a nice decharging graph of a battery for example.

With kind regards, TheInfernoMan  :)
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 15156
  • Country: de
Re: LM358 in Consant Current Circuit Problem
« Reply #32 on: January 01, 2017, 09:38:51 pm »
To ensure stability with an inductive source, one might need a snubber (R and C in series) at the output. Something like 1-10 µF and 10 Ohms should be about the right size.

Also a fuse in series is a good idea - just in case the FET fails with a short, which more like the normal mode of failure.

The permissible power at the MOSFETs is not only limited by there Ptot rating and thus the chip temperature. There usually also is a SOA limit, that can be significantly lower if the voltage is relatively high. This especially true for relatively modern MOSFETs made for lower voltage (e.g. < 200 V). So if you need 40 V operation, look for FETs specified for 200 V switching. Something like a IRFP250 is such an older type. Different from switching applications you want types with a low trans-conductance compared to the rated power, and not the lowest R_on.  For the IRFZ44 mentioned here 1.5 A at 40 V could already be too much - the DS I found has no curve specifying a DC SOA, so no guarantee it works.


With MOSFETs of a dubious source, like Ebay, be prepared that there might be a smaller FET inside and thus sudden failure is possible. You would be lucky if you get an old sucker instead - but this is possible too.
 
The following users thanked this post: orolo, TheInfernoMan, salami738

Offline TheInfernoManTopic starter

  • Contributor
  • Posts: 27
  • Country: de
Re: LM358 in Consant Current Circuit Problem
« Reply #33 on: January 02, 2017, 04:30:52 pm »
So I've built the schematic up on a pice of perfboard and it works very well. One improvement possibility is that it is hard to set a good Current with the help of the potentiometers (also because I used a 100k and a 25k (for fine adjustment), but it looks like its not a linear adjustment (can that be?)).

So at the End, I am really thankful for the help of all here and from my side the topic is closed  :) ;D
Regards, TheInfernoMan
 

Offline Seekonk

  • Super Contributor
  • ***
  • Posts: 1966
  • Country: us
Re: LM358 in Consant Current Circuit Problem
« Reply #34 on: January 02, 2017, 10:52:04 pm »
Did you by the pots as linear or are they out of some audio equipment. Those are not linear.  Set pot midway and measure resistance.
 
The following users thanked this post: TheInfernoMan

Offline orolo

  • Frequent Contributor
  • **
  • Posts: 352
  • Country: es
Re: LM358 in Consant Current Circuit Problem
« Reply #35 on: January 03, 2017, 12:30:54 am »
My own version is quite linear, and fairly accurate, considering the design and components involved. I have tested various currents for several positions of the potentiometer: being a low quality thing, I had to wait some time for the wiper to stabilize. The measurements were:

Code: [Select]
  OHMS               CURRENT
    0                0.01uA
   72.7              68.0mA
  109               109.9mA
  114.8             113.5mA
  167.6             176.9mA
  237                0.24A
  440                0.48A
  513                0.56A
  620                0.68A
  745                0.81A
 1018                1.11A

I tried to use the more precise mode of the multimeter for each measurement, hence the variations in precision. Anyway, it looks pretty linear, and very precise in some of the ranges.

I attach a photograph of the circuit at work in one of the measurements (sorry for the size). I was running out of space in the perfboard, so the mosfet drain is fed via the heatsink  :P . The measurements were made at 40V, as in your description.

 
The following users thanked this post: TheInfernoMan

Offline TheInfernoManTopic starter

  • Contributor
  • Posts: 27
  • Country: de
Re: LM358 in Consant Current Circuit Problem
« Reply #36 on: January 03, 2017, 09:48:07 am »
Thanks for your Version  :)

Yeah I think my Potentiometers are not linear, but at the End I think this is not so bad,
because at the End I use the Range between 0-1A and upwards I only need (in most cases) 2,3,4A which I can achieve with the non-linear pots.
 

Offline orolo

  • Frequent Contributor
  • **
  • Posts: 352
  • Country: es
Re: LM358 in Consant Current Circuit Problem
« Reply #37 on: January 03, 2017, 12:18:53 pm »
One thing of note is that the output current of the circuit (my version) follows the formula I =  12·R / (10k + R), so it is clearly nonlinear for high currents. I wanted to see how well the circuit followed this curve, so I plotted it. The matching is pretty good  :) .

Another thing I would test is transient stability under a change of load. What happens if a load resistance is switched on and off, does the circuit ring, and for how long. In simulation there is a bit of ringing, but it dies down rather fast.
 
The following users thanked this post: TheInfernoMan

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 15156
  • Country: de
Re: LM358 in Consant Current Circuit Problem
« Reply #38 on: January 03, 2017, 01:53:02 pm »
Ringing and possibly oscillation at the output is expected with a source that is inductive. So for the hard test, add an inductor between the voltage source and the load.

To ensure stability usually an RC element in parallel to the electronic load is used or needed.
 
The following users thanked this post: orolo

Offline orolo

  • Frequent Contributor
  • **
  • Posts: 352
  • Country: es
Re: LM358 in Consant Current Circuit Problem
« Reply #39 on: January 03, 2017, 06:16:57 pm »
A final detail: to test the transient behavior, I put a 270 ohm, 10 Watt resistor in parallel with a power mosfet, and used a 555 timer to switch between both in periods of about 0.5s. Then I connected this source to the current sink, after adding a fuse and the RC snubber, just as Kleinstein proposed. I programmed the current to sink 110mA, and made sure that the mosfet and resistor were alternatively conducting the current. Neither the scope nor the multimeter could discern any ringing, and the current stayed stable. If I disconnected the resistor, I could see the square wave as the mosfet switched on and off.

I took a  shot of the mosfet turning on wihtout the resistor, this should give an idea of how the current source starts up. My oscilloscope is not good at all, and the 555 couldn't drive the mosfet to act as a complete switch (the 555 was connected to the 12V supply). The shot is the voltage at the switching mosfet source, with 2V/100us per division, DC coupled. There is a brief peak, and then the voltage stabilizes very quickly.

I think that, with the snubber, the current sink is quite stable. The fuse seems to me also an indispensable idea.

« Last Edit: January 03, 2017, 06:21:31 pm by orolo »
 
The following users thanked this post: n6rob

Offline salami738

  • Contributor
  • Posts: 11
  • Country: de
Re: LM358 in Consant Current Circuit Problem
« Reply #40 on: July 13, 2019, 01:45:46 pm »
Hi, i used the schematics from this post for my electronic load and got oscillations above a certain current.
Maybe someone from this thread could look into this: https://www.eevblog.com/forum/beginners/oscillations-with-lm358-electronic-load/msg2544855/#msg2544855 ?
Thanks for your help.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf