Electronic Load Build, Issues - Page 1
Forum section: electronics / beginners

author: Alex_Baker
author_rank: Frequent Contributor
timestamp: January 05, 2024, 05:38:57 pm
content: Hey folks,Over the last few weeks I have been working on building a DC electronic load based largely on this;https://www.instructables.com/DIY-Adjustable-Constant-Load-Current-Power/by Great Scott. I have attached my schematic and PCB design below, if they will be any help.I have incorporated a couple of other features such as a fan and an alarm, but that is not important at the moment. Everything is going ok except for a couple of key things. First is R4, the resistor for the low-pass that controls the mosfets, whenever I test the device R4 gets very hot very quickly. I understand why this happens, but I don't understand how this worked in the original design, as far as I can tell the gate driver IC I used is functionally identical to the original so I don't think that is the problem.The second problem I am having is that the current feedback seems quite noisy, the numbers that the atmega reads are all over the place when the actual current is steady(limited by other means). As a result the MCU tries to correct the current and it ends up as a mess.Tips regarding these problems would be much appreciated, I posted this in the beginners section because I figured there were things for me to learn here.

author: Jwillis
author_rank: Super Contributor
timestamp: January 05, 2024, 06:52:38 pm
content: Seems your attachment is not attached . Can't see the R4 you are referring to.

author: Alex_Baker
author_rank: Frequent Contributor
timestamp: January 05, 2024, 11:49:26 pm
content: Dang it, classic blunderSorry.

author: MarkF
author_rank: Super Contributor
timestamp: January 06, 2024, 12:57:51 am
content: At first look, LOAD- can not be floating. It must be tied to your circuit GND.The N-MOSFET gate voltage is referenced to it's source pin.I assume the Arduino is going to drive the MCP1407 with a PWM signal to control the load's current?Which in turn will switch the MOSFETs with the PWM signal. Yielding a pulsed load current.IMHO. Having a load current which pulses is not really ideal or desired.

author: Kim Christensen
author_rank: Super Contributor
timestamp: January 06, 2024, 01:02:00 am
content: Using a 470uF (C6) and a 10 ohm resistor (R4) as a lowpass PWM filter between the driver and the FET seems like a pretty stupid design to me.No wonder it gets hot. What was Scott thinking?

author: Alex_Baker
author_rank: Frequent Contributor
timestamp: January 06, 2024, 01:13:35 am
content: Right, that's what I figured.The digikey LPF calculator says that that filter has a cutoff frequency of 34Hz, assuming I want to keep that the same, I could change the RC combo to 1k and 4.7uF, or perhaps 470R 100uF Would making that modification cause any problems?

author: Jwillis
author_rank: Super Contributor
timestamp: January 06, 2024, 01:46:14 am
content: The resistor before the gate slows the inrush current associated with the capacitance of the gate. This stops ringing upon initial charge of the gate for the first few milli-seconds The 10 ohm resistor isn't necessary because you have a resistor tied to each MOSFET gate. With the capacitor and resistor your creating a low pass filter. Your essentially diverting the frequency of the PWM signal straight to ground through the 470uF capacitor. That's why the resistor is getting hot.

author: Jwillis
author_rank: Super Contributor
timestamp: January 06, 2024, 02:03:44 am
content: You don't need an low pass filter there at all. The driver is capable of driving a capacitive load up to 2700pF without a problem. What is the total capacitance of the MOSFETs ? If it's much higher than 2700pF then you may need some extra dampening. But you don't do that with a low pass filter. At 34Hz your driving the MOSFET in the DC safe operating area anyway. Practically in linear mode. Why used a PWM? Driving the MOSFETs in linear mode,with an op amp will do that much better.

author: Alex_Baker
author_rank: Frequent Contributor
timestamp: January 06, 2024, 02:11:05 am
content: This is PWM because it is controlled by a microcontroller, so I want to convert pwm to a DC voltage. I have built a DC load based on op-amps with great success, but that usually involves some big resistors as a shunt, besides this is a step in a different direction for me.

author: Jwillis
author_rank: Super Contributor
timestamp: January 06, 2024, 02:47:47 am
content: If you want to control MOSFETs in linear mode from a micro controller, you need to convert the digital signal from the micro controller with a DAC. The output analog signal can then be used to drive an Op amp for the mosfets. The usual feed back is still required to control the current across the MOSFET. The voltage difference across the resistor gives feed back to the op amp. You don't need huge bulky resistors for that. Depending on the op amp used all that is needed in a small current shunt of a few milliohms. Most integrated current sensors use the same method.Whether you operate the mosfets in linear or a PWM for an electronic load, the controller still needs feed back in the form of a voltage from either a shunt resistor or induction.

author: Alex_Baker
author_rank: Frequent Contributor
timestamp: January 06, 2024, 03:30:19 am
content: Take a look at the schematic I attached to my second post. Feedback is provided by a hall-effect current sensor, and the "DAC" is a mosfet gate driver with a low-pass filter on the output. As was discussed earlier this approach works but my source material has a couple of flaws.

author: Kim Christensen
author_rank: Super Contributor
timestamp: January 06, 2024, 04:09:26 am
content: Quote from: Alex_Baker on January 06, 2024, 01:13:35 amI don't see any additional problems caused by changing it to 1k and 4.7uF, or perhaps 470R10uF.The circuit will be fairly slow to respond to load changes, but maybe that's not a problem for your application. Your code is going to have to take into account the delay / phase shift introduced by the LPF so it doesn't oscillate or become unstable. Look into PI, PD, or full PID code for stability.

author: Alex_Baker
author_rank: Frequent Contributor
timestamp: January 06, 2024, 04:12:21 am
content: Quote from: Kim Christensen on January 06, 2024, 04:09:26 amRight, perhaps that also contributes to the "noise" I am seeing on the current feedback, the system could be oscillating a little.

author: Kleinstein
author_rank: Super Contributor
timestamp: January 06, 2024, 09:41:34 am
content: This is stupid circuit - maybe one to show on the april 1st.The original circuit at least had one 1 MOSFET and the fuse at the source side to have at least a little added resistance there.It looks like R4 and the capacitor from a kind of PWM DAC to control the gate voltage. This is at best working crude with a single MOSFET but usually not with a parallel combination as the current would not be shared (at least not well). The hottest FET will likely get all the current and then get away with even less gate voltage. The µC has to regulate against a thermally unstable system. With the extra low pass fitler from the PMW DAC this is a hard task and oscillation is likely. This is more like a challanging problem for those trying to excercise control theory - not a practial solution.I would very much perfer the more classical solution with a source resistor and OP-amp to do the control.

author: Andy Chee
author_rank: Super Contributor
timestamp: January 06, 2024, 10:39:58 am
content: Quote from: Alex_Baker on January 06, 2024, 01:13:35 amI don't think the cutoff frequency needs to be that low. What is your PWM frequency? 5kHz? In which case a 500Hz cutoff should be more than adequate (i.e. a decade below your PWM frequency).

author: Kleinstein
author_rank: Super Contributor
timestamp: January 06, 2024, 11:31:31 am
content: The ripple from the PWM part directly translates to current sipple and with a low current (e.g. 100 mA or so) one would need rather low ripple. So a low low filter cross over is kind of needed. 1/10 the PWM frequency would still be quite some ripple (may be 1 A) - much slower may be a bit sluggish for the control.Ideally the PWM frequency should be high - but if the SW side is as bad as the HW side I am afaid it could be the stupid slow Arduino standard version.

author: Jwillis
author_rank: Super Contributor
timestamp: January 06, 2024, 11:21:20 pm
content: When you apply a pulse to a mosfet the parasitic capacitance causes ringing. Damping can reduce that ringing but won't negate it completely . That ring propagates out the drain straight into the sensor which then amplifies it. That amplified noise goes straight into the MCU. That driver is not a DAC. It is a mosfet driver that pulses the gate to keep the mosfet from staying in the linear region so it can be driven at high current. Look at the applications of the MCP1407.A DAC(Digital to Analog Convertor) will take the MCU data and convert to an analog signal. So if you send a DAC a digital value the DAC will output an analog value in the form of a 0hz DC voltage. By trying to filter the PWM signal you are trying to defeat the purpose of the driver.If you use a DC linear output from a DAC you don't need to worry about any capacitance of the mosfet gate or any parasitic capacitance across the gate to source or gate to drain.

author: Kleinstein
author_rank: Super Contributor
timestamp: January 07, 2024, 07:29:34 am
content: The MCP1407 is a gate driver for fast switching, but is looks like it is used to drive a low impedance RC filter to make it a kind of PWM DAC. 10 ohm and 470 µF give a time constant for 4.7 ms and thus hopefully large compared to the PWM freqency. Anyway the circuit is stupid - better start from scratch with the usual OP-amp and shunt resistor on the source side to do the regulation.

author: Andy Chee
author_rank: Super Contributor
timestamp: January 07, 2024, 08:47:57 am
content: Quote from: Alex_Baker on January 05, 2024, 05:38:57 pmThe biggest thing to learn here is; feedback loop.There are many things to consider when designing a feedback loop, but inserting a (slow, relatively speaking) Arduino calculation into the feedback loop is not good!Consider this alternative circuit for an electronic load:You could have the Arduino adjust a digital potentiometer P1 instead, there's no need to have the Arduino within the feedback loop.

author: Jwillis
author_rank: Super Contributor
timestamp: January 07, 2024, 08:53:28 am
content: Quote from: Kleinstein on January 07, 2024, 07:29:34 amOK agreed. But if He used something like a MCP4725 instead, at 12 bits it would give 4095 1.2mV steps. It works with I2C communication and hooks up to the SDA. That can go into a op amp to drive the Mosfets lineally. Heck of a lot easier to control with an arduino without the extra aggravation.Now I understand the idea of pulsing the mosfet for high current. That's what makes SMPSs and high frequency inverters so efficient. But in this application I only see problems.

author: Kleinstein
author_rank: Super Contributor
timestamp: January 07, 2024, 10:57:10 am
content: Even with 1 mV steps to control the gat voltage this would not give very fine control. depending on the FETs used likely some 2-5% of the current.The suggested RFP50N06 are also not good choice: This are switching type FETs for a relatively low voltage and chances are high that the SOA shown is not valid. I would not trust them for more than some 10 W at more then 15 V. As current sharing would not work this also applies to 4 FETs in parallel.The IRF540 suggested in the analog circuit is already a little better, but still not a good choice.More suitable FETs would be IRFP250 (higher voltage old type with a larger case). The choice of the FET is especially a factor for higher voltage use (e.g. 20 V and more), less critical with something like a single battery cell.For the FB loop the limiting part is not just the the math and ADC in the Arduino, there is also the low pass filtering with a 4.7 ms time constant - though the regulator could compensate for this, if the the 470 µF capacitor is stable with temperature.The analog current sink circuit should include an extra R and C at the OP-amp to set the speed via local feedback / integrator action. It may work with the rel. slow Lm358, but better safe than having it oscillate.The 1 µF cap at the output should have a series resistor of some 10 Ohm or so, to not rely on the ESR that can vary between types.With more FETs in parallel use 1 OP per FET and have complete such current regulators in parallel.The LM358 may need a bit more than 5 V supply to drive on some FETs. With a different OP it can work with 5 V.

author: Kim Christensen
author_rank: Super Contributor
timestamp: January 07, 2024, 06:06:32 pm
content: Quote from: Kleinstein on January 07, 2024, 10:57:10 amIf you're talking about Andy's circuit posted above, then simply connecting pin 8 of the LM358 to the input side of the 7805 regulator, instead of the 5V side, should solve that problem. (Assuming DC_IN is 9-12V as stated)

author: Jwillis
author_rank: Super Contributor
timestamp: January 07, 2024, 09:21:43 pm
content: When driving MOSFETS in linear mode, the lower the Gate-source threshold voltage isn't important as much as people think. The Gate-source threshold voltage is the point as to which the mosfet turns on with 250uA across drain to source. You need to use the full range from Gate-source threshold voltage to near maximum Gate-source voltage to get the full range of current transfer (Ids)So if the Gate-source threshold voltage of the IRF540 is 2V and the maximum Gate-source threshold voltage is ±20, the range you would use is 2V to near 20V to get the full current range transferring across drain to source. That's a range of 18V. Since the Ids is proportional to Vgs , with a driver at 5V max, the mosfet only opens 1/5.5. So the current transfer from drain to source is also 1/5.5 or 5.45A. So it won't matter how many mosfets are in parallel the electronic load will only sink 5.45A. Not the expected 36A. Even if pulsed at 5v the Ids is only 5.45A and not the expected 120A. Not taking account the derating of the mosfet due to temperature increase.So regardless of the design, driving a IRF540 mosfet with only 5V will not take advantage of the Max Ids. In the case of the IRFP250 that may be even lower. The RFP50N06 would do no better.The gate driven at 5V is to low to achieve any significant Ids.

author: Kleinstein
author_rank: Super Contributor
timestamp: January 07, 2024, 11:18:15 pm
content: With most electronic loads it is not about getting the full specified Ids. That number is more like a theoretical thing anyway, calculated form R_on for the cold FET and the theroretical cooling capacity with the case held at a fixed 25 C. So a cooling level that may be reached with water cooling at best.The upper limit for the get voltage is purely a destruction limit. There is usually not much gained from increasing the gate voltage to higher than some 10 V even if many fets allow 20 V. This only gives a marginal reduction in R_on.There is usually curve for Id vs gate voltage. E.g. a typical IRF540N (infineon DS) would need some 4.5 V to reach 10 A and some 5.1 V to reach 30 A which is close to the specified limit (33A).The Id vs gate voltage curve is not linear, but more gradual at the start (more like (Vgs-Tth)² ) and than get again shallower at high currents, as part of R_on *I is subtraced from the effective gate voltage.It depends on the use of the electronic load. For low voltages, like a single NiCd cell one may indeed be limited by R_on and want thus high current, low voltage types.For higher voltages, like > 5 V and maybe already with a single Li cell one is more limited by the heat. Here in addition to the DS Ptot limit there is a more practical limit for the cases, e.g. some 30-40 W for a TO220. So with 4 V this would be some 8-10 A max. for the TO220.Especially beyond some 20 V the SOA can be limiting and R_on or the maximim Id is not that relevant. Especiall lower voltage MOSFETs are usually optimized for hard switching and can not withstand as much power if the voltage is high (e.g. >20 V). There is a chance that they fail due to internal thermal instabiltiy similar to the 2nd breakedown in BJTs. A problem here is that there are quite some false SOA curves out there, especially those that show just a power limit and not an extra reduction at some voltage, like 1/2 the rated voltage. The get a reasonable good real SOA one usually goes for higher voltage (e.g. 200-600 V) types even of the actual votage used is only some 20-40 V. There are special type tested for linear operation, but these are quite expensive and usually also higher voltage types.

author: Andy Chee
author_rank: Super Contributor
timestamp: January 08, 2024, 01:25:46 pm
content: And here's one more design, including a 10 part video series covering its research & development!(source code)

author: trilerian
author_rank: Regular Contributor
timestamp: January 09, 2024, 03:20:58 pm
content: I haven't read all the other replies... But I am in the process of building an electronic load for discharging 1s and 2s lipo batteries at up to 45A. Also using the 328P mcu. We differ in that I am truly using the pwm and an external load instead of sinking the current to the fets. But I am using a low pass on the output of my current sensor, which is the big brother of what you are using.So in you design you are using the lowpass on the gate to get a dc line, but I use the same cutoff lowpass on my current sensor out. I use a 5k1 resistor and a 1uF ceramic cap. I also have implemented a PID (really just PI) controller in my code to ramp up to the discharge rate faster and help with the oscillation. Also I am averaging the output of my current sensor. For me this keeps the oscillation to within +/- 0.2A and the oscillation has slowed down quite a bit. Before implementing the PID and averaging it was pretty bad, would oscillate a couple of amps and rapidly.Tuning the PID was fun, and I could probably get it a bit better, but it was neat seeing what the different settings did to the response.