Problem with too sensitive electronic load current control

Thread Starter

tesla000

Joined Jun 12, 2021
12
I made an electronic load using 4 irl540n and lm358 opamp, schematic is as in the picture, on the input i placed an rc filter, that should filter frequencies above 200hz, the pwm frequency from the uc is around 900hz, but the output of the rc filter that's connected to input of the opamp isn't clean, it has a sawtooth shape and it's peaks reach around 800mV, any idea why's that and another problem that it's too sensitive, if i set 0.5% duty cycle the voltage on the gate of the mosfets already reaches 2v, how can i lower the gain of the opamp? by changing values of R15 and R18?

2021-06-11_19-41.png

Would really appreciate some help
 

Thread Starter

tesla000

Joined Jun 12, 2021
12
Where do the terminals labelled "Vin", "Current" and "load" connect?
Thanks for the reply

Vin is a voltage divider that goes to adc pin of the uc for measuring load voltage, current is measuring voltage drop on the resistors and the uc then calculates current flowing, load connects to pwm output pin of the uc, i tried a couple more things since i posted, increased the frequency to 62.5 kHz which now provides a clean analog voltage to the input of the opamp, also tried changing values of R15 and R18 to lower or higher values, which didn't change anything, the problem is that the opamp is way too sensitive, with no output on the uc the voltage on the gate of the mosfets is already 2V and with a 8 bit pwm i get 255 values, if i set pwm to 1 (from 255) the current already increases by 700mA!!!, so yeah that's way too much, only thing i have in mind to try is changing the gate resistors to 10k or higher, replacing the mosfets with something like irfz44n which have higher gate threshold voltage or changing the voltage on the opamp to 5V, i based my circuit from this design

http://www.kerrywong.com/2013/10/24/building-a-constant-currentconstant-power-electronic-load/
 

Ian0

Joined Aug 7, 2020
9,667
With the circuit values you have, you should get 2xVcc/R25 at full PWM.
Assuming Vcc=3.3V, and with R25 at 0.1Ω, then the output current should be 66A. Is that what you wanted?

Changing the gate resistors won't make any difference as there is no DC current through them
Changing R15/R18 won't make any difference either, as the only current through them is the op-amp input bias current (50nA maximum, which will make 29uV difference across a 680Ω resistor) R15 and R18 are just there to protect the op-amp inputs from transients.
I'm not sure that an LM358 particularly enjoys a 1nF load, so I'd consider removing C10/C11.
If you want to get rid of the PWM frequency, then place another RC network like R13/C7 immediately after R13/C7.
 

Thread Starter

tesla000

Joined Jun 12, 2021
12
Thanks fot the reply,

No 66A is way too much, i intended for max 15A, aren't R15 and R18 also for fedback from the current shunt? (vcc is 5v btw)

So what can i do to reduce max current?, increase the resistance of R25?

Also don't understand why there is always around 2V on the opamp output even when the uc pin is LOW
 

Ian0

Joined Aug 7, 2020
9,667
LOW is probably not 0V. Only a few mV would be enough to give the 2V output that you have.
But that is the MOSFET gate voltage, and 2V would be about what would be expected - it is below Vgs(th) so the MOSFETs won‘t be passing a significant amount of current.
With the input at 0V, even if it were really zero, there would be an output due to the op-amp’s input offset voltage. If you want zero current at zero input voltage, then buy a better op-amp. What do you expect from an op-amp than only costs 7p?
 

Alec_t

Joined Sep 17, 2013
14,280
With the input at 0V, even if it were really zero, there would be an output due to the op-amp’s input offset voltage.
A respective pull-up resistor from each inverting input of the LM358 could be used to bias the inverting input voltage to 10mV or so to overcome the offset.
 

Ian0

Joined Aug 7, 2020
9,667
A respective pull-up resistor from each inverting input of the LM358 could be used to bias the inverting input voltage to 10mV or so to overcome the offset.
Works out at 820k, and makes some use of that 680Ω resistor (R15/R18), which otherwise doesn’t do much, but it still may end up with a random voltage <Vgs(th) on the MOSFET gates, but it is nothing to worry about.
 
Top