Poor man's constant current resistive load - Page 1
Forum section: electronics / projects

author: Axk
author_rank: Regular Contributor
timestamp: May 16, 2020, 10:32:05 pm
content: Making a resistive load constant current.I have my DIY power meter board with a 12 bit adc and I need to calibrate the current measurement.I have a resistive load (a nichrome wire) drawing around 3 amps when connected to the 48V e-bike battery.When I measure the current with a multimeter the first 3 digits are constant (short time of course after the temperature of the load has stabilized, it changes over time as it discharges the battery).I would like to get to a stable current with constant 4 or 5 digits for the calibration so that I can have a constant reading on the multimeter and compare it to the values from the ADC.I thought I could do an NPN with an opamp as on the attached screenshot, but I'm not sure it will work in practice to this precision.I don't have an electronic load, so this would be my poor man's constant current load and I don't need to set the exact current as long as it stays constant.It works in simulation but I'm not simulating the temperature coefficient of the shut and probably other things so I'm not sure if it's gonna work in practice.Is this gonna work? Are there better simpler way of achieving this?

author: bob91343
author_rank: Super Contributor
timestamp: May 17, 2020, 12:30:14 am
content: The circuit holds the voltage across the sensing resistor to equal that across the 100 Ohm. So if the gain and offset of the amplifier are suitable, the only remaining parameters are the values of the resistors, especially of the shunt. Low value shunts need four wire connection but the temperature coefficient of resistance can be a problem. If the duty cycle is short enough that won't be too bad.So really, more information could help us help you.The emitter current will be held constant but the collector current will be less due to the base current. So it depends on which current is impotant to you.

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: May 17, 2020, 12:50:33 am
content: Quote from: Axk on May 16, 2020, 10:32:05 pmAre you trying to make a constant current load or a resistive load?As you have drawn it, the circuit is a resistive load.The effective value of the resistor is R5 * (R3/R4)= 23.48If you want a constant current, you need a reference.Look at this thread:https://www.eevblog.com/forum/projects/dynamic-electronic-load-project/Regards,Jay_Diddy_B

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: May 17, 2020, 01:05:23 am
content: Hi,Here is the simulation to confirm that:and the resultsThe error is caused by base current.The error can be reduced by making Q1 a Darlington or eliminated by using a Power MOSFET.Regards,Jay_Diddy_B

author: Axk
author_rank: Regular Contributor
timestamp: May 17, 2020, 01:34:19 pm
content: @bob91343, @Jay_Diddy_B, thanks for your help!I talking about a constant current load I suppose. I mentioned resistive load because of the resistive component of the constant current load which should dissipate most of the power (around 150W), I don't have transistors and radiators to dissipate that much power.Thanks for bringing up the difference between the emitter and collector currents, didn't think about that.I need a constant collector current so I'll use a power MOSFET instead.

author: ahbushnell
author_rank: Frequent Contributor
timestamp: May 17, 2020, 03:55:25 pm
content: If V2 changes the current will change. I assume V2 is your battery. Use a voltage reference instead of the divider.

author: Axk
author_rank: Regular Contributor
timestamp: May 17, 2020, 05:08:45 pm
content: I'm not sure what other limiting factors might be but based on my simulation it looks like to get constant current within 4 or 5 digits I would need a low temp-co shunt resistor and a low temp-co refrence or divider resistors.The temp co should be on the order of 25ppm/C from what I see.I'm not worried about current stability long term, just short term on the order of several seconds to allow me to take my multi-meter current measurement and my ADC output readings to the calibration.So I suppose I might go with low-temp co resistors. Don't have these at hand so will need to order.

author: Axk
author_rank: Regular Contributor
timestamp: May 17, 2020, 05:18:54 pm
content: As I need to order parts for this constant current load anyway I might order a better than I jelly bean op-amp.What OP-amp parameters should I be looking at for this task?Temperature coefficients? Open-loop gain?Or probably any jelly bean op-amp will do not being the bottleneck in the design?

author: nctnico
author_rank: Super Contributor
timestamp: May 17, 2020, 05:40:29 pm
content: The bottle-neck will be stability. But why not order one of the million readily built DC loads from Ebay or Aliexpress?

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: May 17, 2020, 09:34:59 pm
content: Hi,I think what you need is this circuit:I have used the 16nichrome wire resistor that you have to dissipate most of the power around 100W.The Power transistor dissipates around 20W.The op-amp stabilizes the current at 2.5AA common TL431 is used as the reference.I have attached the LTspice model.Regards,Jay_Diddy_Btest load 2A5.asc(2.8 kB - downloaded 44 times.)

author: magic
author_rank: Super Contributor
timestamp: May 19, 2020, 06:53:39 am
content: Quote from: Axk on May 17, 2020, 05:18:54 pmOpen loop gain isn't a big deal. The opamp is essentially a unity gain follower with external unity gain output stage, so the usual calculation applies. With merely 100k gain, input offset voltage variation will be 1/100k of the output, a 6th digit error.Offset voltage and offset voltage thermal drift are important. The former produces a constant error (which can be calibrated out within reason), the latter causes drift. The exact drift is easy to predict: for each 1µV of offset, you get 1µV/Rs of current, where Rs is the current sense resistance. Higher Rs reduces drift, but then it causes the circuit to heat up more in the first place.I used a TT Electronics OAR resistor for a similar project. Not terribly expensive, 1% tolerance, 20ppm/°C drift, good power dissipation characteristics. With 10mΩ resistance and 10A of current, heat from the resistor and leads of the power transistor increased opamp temperature by some 40°C IIRC.If you find you need something better than the usual 741/358 and friends, OP-07 is a jellybean precision opamp which may be good enough.

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: May 19, 2020, 03:12:51 pm
content: Hi,If you place a meter in series with load so you can read the current, you only need short term stability.You don't have to consider offset and offset drift in the op-amp because you only require a stable current.The thermal stability of the 20mcurrent sense resistor is important.It is dissipating 125mW at 2.5Aso a resistor rated for 1W with four wire and a low temperature coefficient will be good.Jay_Diddy_B

author: magic
author_rank: Super Contributor
timestamp: May 19, 2020, 05:22:19 pm
content: Quote from: Jay_Diddy_B on May 19, 2020, 03:12:51 pmIt makes life easier when the current stays stable despite the board heating up from the sense resistor and power transistor. My dummy load uses a crappy 2.4V zener as reference and it takes a noticeable time to completely stabilize to 3rd digit. That was an oops which I didn't expect while fitting in that zener. Arguably it runs at higher power, though.

author: Yansi
author_rank: Super Contributor
timestamp: May 19, 2020, 06:15:35 pm
content: Quote from: Jay_Diddy_B on May 17, 2020, 09:34:59 pmJust note as it may not be obvious: This holds the emitter current constant, not the collector one that is likely needed to be constant. A neat trick to subtract the base current is to ground reference the emitter node and measure the current as a negative voltage sensed on the shunt.Base current of the darlington combo may or may not be of significance, depending on application. But it can definitely be easily improved upon, as per above.

author: magic
author_rank: Super Contributor
timestamp: May 19, 2020, 08:32:16 pm
content: Quote from: Yansi on May 19, 2020, 06:15:35 pmIndeed, here's a schematic in case it isn't obvious how that works. It actually is almost exactly the circuit I built, except I used a PNP darlington so the whole thing was upside down.The weakest point was the zener, for two reasons: its breakdown voltage decreases with temperature and base current of Q1 flows through it which also decreases with temperature (Q1 beta increases). I should probably replace it with some TL431, LM285 or LM336 but there is no space on my board so meh, I can live with minor warmup drift.If further improvement is required, one could use separate references to generate the virtual ground and the IN+ voltage for the opamp and perhaps make some effort to keep them away from heat.editOpamp inputs need to be swapped, sorry. I won't bother correcting it.

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: May 19, 2020, 09:33:56 pm
content: Hi,That circuit should be like this:Not a big fan of this technique. If a MOSFET is used, there is no gate current, Id = Is.Regards,Jay_Diddy_B

author: magic
author_rank: Super Contributor
timestamp: May 20, 2020, 08:23:22 am
content: This requires a precision positive regulator for V2 and some additional regulator to create the virtual ground. Or a true bipolar PSU.If one manages to use a virtual ground regulator of sufficient precision (hint: not a zener), R3 could be connected to a voltage derived from the negative rail and R5,V2 removed. IOW, the solution I posted + bandwidth limiting (which I didn't include).

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: May 20, 2020, 11:21:34 am
content: Quote from: magic on May 20, 2020, 08:23:22 amHi,This is not true. V2 was the reference. But you don't need bipolar or a virtual ground (rail splitter).Let me expand my model into a more practical circuit:The reference shown as TL431 can be replaced by any reference that will work from the 9V battery.The circuit requires an op-amp that includes 0V in its common mode range. LM324, LT1013, LT1014 etc are examples of op-amps with this property.The non-inverting input of the op-amp is a summing node. The positive reference is summed with the negative feedback.The device M1 can be a MOSFET or a Darlington Transistor.Regards,Jay_Diddy_B

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: May 20, 2020, 11:30:19 am
content: Hi,In addition, in this circuit, the base current for the transistor flows through the reference. This is the path:The reference has to be a shunt reference. It has to sink current.The reference current varies with transistor base current.Regards,Jay_Diddy_B

author: magic
author_rank: Super Contributor
timestamp: May 20, 2020, 09:42:12 pm
content: Quote from: Jay_Diddy_B on May 20, 2020, 11:21:34 amOkay, I get it now, you avoided the negative rail altogether. That's a nice circuit.Quote from: Jay_Diddy_B on May 20, 2020, 11:30:19 amYep, one of the reasons why my load drifts

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: May 20, 2020, 10:16:07 pm
content: Hi,The circuit has a few issues:It requires either power supply under test or the load circuit to be floating with respect to mains ground.If you try and build a multi-channel version you run into the issue that each channel requires its own floating power supply.You have to be careful about connecting a scope to the power supply under test (grounding issue again)If you want to drive Vref with a function generator again you have the grounding problem.Etc …Jay_Diddy_B

author: Axk
author_rank: Regular Contributor
timestamp: May 21, 2020, 07:23:47 pm
content: Thanks guys! I'm a bit overwhelmedAfter you pointed out that I needed a MOSFET to have a constant collector (drain) current I modified my model to look like the attached (I've attached the LTSpice model as well).Assuming 25PPM resistors for the divider and the shunt and +/- 2C short term temperature variation the simulation gives me a constant current to within 4 digits.I think I can leave with 2 separate supplies (or even find a single supply op-amp as I don't need negative voltages for the MOSFET) for the op-amp if necessary, just use a bunch of AAA batteries for this.Gonna draw a board and order the parts and hopefully it all works in the physical world as well as in the simulation

author: MarkF
author_rank: Super Contributor
timestamp: May 21, 2020, 09:09:42 pm
content: I used a 12VDC power supply because it NEEDS a fan.Also allows a 0V to 5V external signal to set the current.Capable of 2.5A to about 50W. Limited by heat dissipation.

author: Axk
author_rank: Regular Contributor
timestamp: May 21, 2020, 09:52:18 pm
content: Just tried simulating with a different MOSFET model (STP75NF75FP) low resistance power transistor and it got into high frequency oscillations.I guess the MOSFET's capacitances in the feedback loop produced a resonator.Added the 2 resistors and a capacitor in the feedback loop like @Jay_Diddy_B did in this circuit and it helped.Thanks @Jay_Diddy_B!Could have been "come a gutser" in the real circuit like Dave says

author: Axk
author_rank: Regular Contributor
timestamp: September 16, 2020, 11:48:31 pm
content: So finally the load is done.Does what I initially planned it to do, the (short term) stability is within the precision of GW121 (the 5th digit is occasionally changing by 1 or 2 max).Ended up adding a 16 bit DAC (DAC8562SDGSR) with a 10ppm/C 12.5 resistive divider to get 0.2V on a 20mR (25ppm/C) shunt for 10A full scale + Atmega 328P and an LCD module to set the current.The op-amp I used is AD8638ARZ.One thing that didn't work as expected is out of my 3 parallel power N-MOSFETS most of the current goes through one of them while I expected it to be more or less evenly distributed (based on what I saw in the Wikipedia article).

author: ledtester
author_rank: Super Contributor
timestamp: September 17, 2020, 12:38:41 am
content: Quote from: Axk on September 16, 2020, 11:48:31 pmAre you using one op-amp per MOSFET?

author: Axk
author_rank: Regular Contributor
timestamp: September 17, 2020, 12:39:27 am
content: One other thing that I'm puzzled about is that the output of the DAC stays at 1mV up to 38 LSB and it's linear as expected from 38 LSB up.Is this a common behavior of a DAC? Some sort of offset?Or could this be because of the opamp it's connected to?

author: ledtester
author_rank: Super Contributor
timestamp: September 17, 2020, 12:53:33 am
content: Can you post a PDF or hi-res pic of your latest schematic?

author: Axk
author_rank: Regular Contributor
timestamp: September 17, 2020, 01:35:31 pm
content: ledtester, 1 opamp - all MOSFET gates, drains and sources in parallel.

author: ledtester
author_rank: Super Contributor
timestamp: September 17, 2020, 02:22:24 pm
content: Every MOSFET is slightly different, so it is advisable to have each MOSFET controlled by its own op-amp to get equal current sharing.

author: Vovk_Z
author_rank: Super Contributor
timestamp: September 17, 2020, 03:28:15 pm
content: Yes, the Mosfets itself don't want to divide current equally. That is usual situation. That is why we use at least additional source resistors with every Mosfet (but this is not the best way). The best way is to use one opamp with a one Mosfet. Of cause, and individual shunt for every mosfet-opamp sell.Example is in an attachment.

author: Axk
author_rank: Regular Contributor
timestamp: September 17, 2020, 10:38:36 pm
content: I guess my confusion was that Wikipedia (or wherever it was) was talking about parallel MOSFETs in the linear/triode region when the current is "automatically" equally distributed and I'm operating in the active region when I see the unequal current distribution.

author: magic
author_rank: Super Contributor
timestamp: September 18, 2020, 07:09:43 am
content: Wikipedia is always wrongThis might be true in switching, because RDS(on) increases with temperature and applied Vgs is overkill so Vth doesn't matter. But Vth decreases with temperature, which makes paralleling FETs in linear applications very dangerous.Many datasheets have Id vs Vgs curves for different temperatures. You can see yourself that drain current tempco becomes negative only at currents which are useless for most linear applications.