Dave's Constant Current Load; traps for young players... - Page 1
Forum section: electronics / beginners

author: icon
author_rank: Regular Contributor
timestamp: May 18, 2012, 08:47:27 pm
content: And old farts alike.I'm building Dave's constant current load device. Easy enough - an afternoon's work. What could go wrong?1. Input Common-Mode Voltage RangeI made the mistake of assuming that 'rail to rail output' somehow implied 'rail to rail input' too. I'm using an LMC662 dual op-amp, though only half of it. Luckily I checked what happened if you simply connect the wiper of a pot to the + input. On a 5V supply, when the input approaches about 3.6V, the output jumps to 5V. Oops. I have to include a resistor in series with the pot, so that the input never exceeds 3.6V. In hindsight, this information is obvious on page 1 of the datasheet, where it says, under 'Features'; " Input Common-Mode Voltage Range includes V-". This can now be interpreted as saying " Input Common-Mode Voltage Range doesn't include V+". I will always read these sections in future, inverting the statements to find the true meaning.2. GainSo now the input swing is limited to 3.6V, I presumably need to introduce some gain, so that I get a full 5V output swing? I hope so, because that's what I've done. If I ever get it working, and need to dial it down a bit, I suppose I could.3. Oscillation"The output attempts to do whatever is necessary to make the voltage difference between the inputs zero". Well it does, up to some strangely shifting voltage where the two part company. You already know what the problem is, but I didn't, so it took me a while to connect an oscilloscope to it. Oscillation. Suddenly the hysteresis is explained - once it's oscillating, the voltage needs to drop back appreciably below the voltage where the oscillation started, in order to calm down.Glancing at my circuit, how can I fix the oscillation? I have a spare half-an-opamp, if that helps. I substituted an STP36NF for the MOSFET.CheersJohn

author: free_electron
author_rank: Super Contributor
timestamp: May 18, 2012, 08:58:29 pm
content: Ah yes.. the rail-to-rail myth .... has claimed another victim.There is NO such thing as a rail to rail opamp. Despite all the claims made.They can get within a couple 100mV from the rails but that's it. And yes, you need to look at both input and output. Some opamps are 'rail to rail' on the output but not on the input. You have to look at common mode.The easiest way to find out what for beast you have is to look at the internal diagram. if the current source sits on top : common mode includes v-. if the current source sits at the bottom : common mode does include v+. there are very few opamps that are rail-to-rail on the input. those that do employ an input scaling mechanism and have a totally separate current pump that uses current mirror techniqies in the input transistors. since this is very hard to do ( to get it balanced and linear ) these opaps are expensive. they need individual laser trimming during production...3: oscillation : put a 1nF cap across your 3k6. That will collapse the gain if this thing starts 'singing'.oscillation is notorious in current sinks. i designed one a couple of days ago that uses an extra gain stage for the current measuring ( chopper opamp ) because my current sense resistor is 20milliohms ( i use an ohmite 4 wire resistor in SMD package ). that thing was a bitch to tame ... without capacitors... ( i needed a 5A/1uS step response) the solution was to mak the current sense amplifier high bandwidth and the driver opamp low bandwidth.

author: Kremmen
author_rank: Super Contributor
timestamp: May 18, 2012, 09:11:13 pm
content: The cap gives a pole to the response and should smooth at least that oscillation. I noticed that there was no gate resistor. Maybe a bit of that would do good as well, in case the op amp drives the gate heavy enough to induce oscillation. Usually that is more a problem for switchers that tend to ring badly if driven too hard, but i guess it couldn't hurt here either?

author: free_electron
author_rank: Super Contributor
timestamp: May 18, 2012, 11:19:14 pm
content: correct. you can isolate the opamp output from the gate cap with 47 ohm or so..You can also add some 'feed forward' to the regulator loop by placing a resistor of , let's say 1 megaohm, between opamp out and - input ... that will reign in the opamp a bit if it starts janking too hard on that gate .... Slap a few pf across that one and it will get really tame ...

author: amspire
author_rank: Super Contributor
timestamp: May 19, 2012, 12:33:02 am
content: First - choice of MOSFET. I am not sure if the mosfet you have chosen has any specified SOA (safe operating area). It will work fine in switching mode when it is either hard off or hard on, but as discussed in another thread, in may not be rated for safe operation in the linear mode in between. It is usually safer picking a higher resistance mosfet, but better still, pick one with a fully specified SOA like the IRFP460.I am puzzled by what you are trying to do. Your amplifier has a gain of 10K/13.6K = 0.735, and so when the input is 3.6V, your current will be 4.89A. That is 24W of power in your 1 ohm resistor.What maximum current are you aiming at?I would reduce the current sense resistor to something like 0.1 ohms or lower, and make sure it can handle the peak current. 0.1 ohms means at 5A, the maximum input voltage to your opamp is less then 1V, so your 3.6V problem goes away.I am not sure why you have the 10K. 3k6 divider, but you can probably get rid of it - instead have a 10K resistor from the negative input to the sense resistor, and put a 1nf cap from the negative input to the opamp output. Add another 10K resistor from the positive input to the potentiometer wiper just to minimize effects of offset current. For stability, you need a resistor from the opamp output to the mosfet gate. It also helps protect the opamp from Miller effect voltages from the MOSFET gate. It can be fairly high - 1K is OK. To stop the mosfet gate breaking down when the sink is suddenly attached to a high voltage source, add a zener from the gate to ground - 5V6 or more if your opamp supply is 5V. This is only necessary if the input voltages can be over 100V.In terms of opamp output voltage, the opamp is regulating the voltage across the sense resistor and so the opamp output will be several volts higher then the input to turn on the mosfet. If the mosfet needs 3V to conduct 1A, then with a 0.1 ohm sense resistor, the opamp output will be about 3.1v when the input is about 0.1V. To me, if the input was 3.5V, the opamp output probably should be at 5V with your current circuit. You want less input voltage, not more.Richard.

author: M. András
author_rank: Super Contributor
timestamp: May 19, 2012, 09:22:05 am
content: http://www.ixys.com/PartSearchResults.aspx?searchStr=IXTK90N25L2&SearchSubmit=Godamn expensive but its designed for programmable loads and linear applications

author: Rerouter
author_rank: Super Contributor
timestamp: May 19, 2012, 10:10:51 am
content: that is a 1KW mosfet though :/ that would make for one hell of a programmable load,actually providing its rs(on) doesnt vary, it would be dissipating 300W for its 90A rating, add any voltage drop from linear mode, and its not that hard to reach :/more realistically it would make for a very good 0-25A 0-40V constant current load,

author: M. András
author_rank: Super Contributor
timestamp: May 19, 2012, 12:03:55 pm
content: i picked this one cos i was cross referencing the stock at farnell and the specific case types on this mosfet series, didnt check digikey i bet they have more from this type, but yeah would be better to get them as sample from ixys, big package big metal surface area=good contact to the heatsink

author: jimmc
author_rank: Frequent Contributor
timestamp: May 19, 2012, 12:31:13 pm
content: Looking at page 6 of the LMC662 data sheet (http://www.ti.com/lit/ds/symlink/lmc662.pdf,the device is unstable at unity gain for capacitive loads greater than about 100pF.Turning to the ST36NF06 data sheethttp://datasheetz.com/data/Discrete%20Semiconductor%20Products/MOSFETs%20-%20Single/497-3186-5-datasheetz.htmlthe input capacity is very roughly 900pF(For the purists this ignores feedback through the source resistor and drain gate capacity).To remove this instability you need to isolate the high frequency feedback path from the MOSFET.How to do this is shown in fig 3 on page 7 of the LMC662 data sheet.Rx and Cx are the components you need to add (The 100k is the is replaced by your 10k /3k6 feedback path)Jim

author: SeanB
author_rank: Super Contributor
timestamp: May 19, 2012, 12:44:18 pm
content: To dissipate 1kW with that package you will need to cool it with lN2.

author: M. András
author_rank: Super Contributor
timestamp: May 19, 2012, 12:48:20 pm
content: Quote from: SeanB on May 19, 2012, 12:44:18 pmhttp://www.ixys.com/ProductPortfolio/PowerDevices.aspxsame applies to this package too?

author: SeanB
author_rank: Super Contributor
timestamp: May 19, 2012, 01:34:55 pm
content: The TO247 package is rated in this device for a dissipation of 960W if you can keep the case at 25C. I doubt you will find a heatsink at any ambient other than -193C that can do that other than as a pulsed load.

author: Rerouter
author_rank: Super Contributor
timestamp: May 19, 2012, 01:52:33 pm
content: the main factor would be the thermal junction, getting heatsinks capable of 10's of watts per degree C is rather easy :/for 0.85 cubic meters of airflow per second, if the junction is low enough, a sufficient heatsink could handle a continuous load of 1KW for a 1 degree rise, with a 10 degrees rise dropping it to a far more reasonable 5.1 cubic meters per minute, what a number of 140mm fans are easily capable of,

author: SeanB
author_rank: Super Contributor
timestamp: May 19, 2012, 01:59:16 pm
content: Yes, but they are not cheap, and tend to be made of copper and have multiple heat pipes in them. Will not be able to keep the junction at 25C when the ambient is 30C or the unit is on a bench and is recirculating the air in the shop which will be in the range of 20 - 30C. Either you start with a block of copper, mill a serpentine path into it and seal it to allow a refrigerant to circulate as a cold block ( I assume that is how most of these devices are used in continuous applications) or you use multiple devices and derate a lot.

author: Rerouter
author_rank: Super Contributor
timestamp: May 19, 2012, 02:07:25 pm
content: well there is the better side of the airflow tradeoff, if the heatsink can get the heat out, the airflow will take it, now per 0.85 cubic meters of air, it will absorb roughly 1KW second per degree, and do this freely as long as the air is moving and the item its cooling is of a higher temperature (still air will saturate) obviously if your running a pourer heatsink you can generally beat it will an increase in airflow, however the tradeoff is to the end designer to make, and the heatsink at a minimum must still be able to pass along the heat, and the room must contain sufficient air to hold this heat, and radiate it elsewhere,

author: Rerouter
author_rank: Super Contributor
timestamp: May 19, 2012, 02:12:42 pm
content: on reflection, you guys can now take better guestimations on how much lab gear you can pack in a room for you to start feeling the heat, and how much air needs to move to keep it cool

author: BravoV
author_rank: Super Contributor
timestamp: May 19, 2012, 02:45:21 pm
content: Regarding dissipating the heat, why not parallel with multi cheaper mosfets ? Any major disadvantage ? Apart from the cost and bigger area/volume of course.PS :Made a thread while ago asking and discussing the "hot spot" side effect on ordinary switching mosfet when working in linear zone ->https://www.eevblog.com/forum/beginners/question-on-mosfet-in-linear-mode-does-'hot-spotting'-a-serious-problem/

author: T4P
author_rank: Super Contributor
timestamp: May 19, 2012, 04:00:53 pm
content: Quote from: BravoV on May 19, 2012, 02:45:21 pmYou need to make sure to have some parallel balancing mosfetswhen i just reminded myself i am replying to the guy who keeps claiming i don't know my sh*t

author: icon
author_rank: Regular Contributor
timestamp: May 19, 2012, 04:55:05 pm
content: HiThanks for all the suggestions - esp. to jimmc for pointing out which bits of the datasheets I should have read (though without the explanation, it wouldn't have conveyed anything to me, I'm afraid).Armed with these suggestions, and a handful of capacitors, I've tried to fix the oscillation. Sadly, it seems very resistant to the proposed fixes. I can make it *worse*, but that's not very helpful. Just to prove I'm taking the problem seriously; there's an op amp under those wires, somewhere:The data sheet suggest a 10pF cap between inverting and output pins; the smallest I have to hand is 22pF but I've tried that. I've tried putting a capacitor across the output > -input resistor. I've also gone back to a simple unity gain configuration and repeated the above - but still it oscillates above a few mV. I could call it a "0-30mA constant current load"...Maybe I should go for a less touchy op amp?And I haven't even got as far as exploring whether the MOSFET is suitable for the job...John

author: jimmc
author_rank: Frequent Contributor
timestamp: May 19, 2012, 06:25:14 pm
content: Try slugging it harder, try Rx = 1k, Cx = 1n, if it's not stable with these values something else is going on.By the way the input doesn't have to be rail-rail...The gate threshold of the FET (VGS(th)) is given as 2 - 4V for ID= 250uA so even with the Op-Amp output hard against the positive rail, the source will be at least 2v below the positive rail for all currents >250uA.Of course with a VGS(th)max of 4v, a 5v supply to the Op-Amp doesn't leave much headroom,worst case you could get <1A max (1v drop across sense resistor leaves 4v for the MOSFET).With a large MOSFET a beefier Op-Amp would be better, but all Op-Amps have reduced stability margins when driving a capacitive load. It's just that some are worst than others.Jim

author: IanB
author_rank: Super Contributor
timestamp: May 19, 2012, 07:17:18 pm
content: A rule of thumb to try from a non-EE (and let's wait for the EE's on the forum to tell me I'm totally barking up the wrong tree)However: capacitance on the output, regulating side of a feedback amplifier/controller is bad and will reduce stability. Capacitance on the input, error detection side of a feedback amplifier/controller is good and will increase stability.If you can't control the capacitance on the output side, you can try to compensate by putting more capacitance in suitable places on the input side. First on the power supply rails--make sure you have adequate bypassing there, at high and low frequencies. Secondly on the feedback path. Use capacitance as a filter to damp out higher frequencies (aka "noise"). Also, make sure you don't introduce an integrating element into the feedback loop when the output has a lot of capacitance. Putting integrating feedback regulation on an integrating system is a sure recipe for cycling.There are mathematical analysis tools to describe these things, but that would take a treatise. Some general operating principles often help before you try to crunch the math.

author: SeanB
author_rank: Super Contributor
timestamp: May 19, 2012, 07:23:45 pm
content: I would also add not to use too fast an opamp, you are not needing MHz response here, slow is better. A low pass filter on the output, some heavy feedback around the opamp, and you should get it stable without making a good transmitter. A higher supply voltage for the opamp allowing the output stage to run near the middle would not go amiss.

author: vxp036000
author_rank: Regular Contributor
timestamp: May 19, 2012, 07:40:43 pm
content: You're on the right track. Capacitance on the output degrades the phase margin. To stabilize the circuit, we can add a series capacitor and resistor in the negative feedback path. Choosing the correct value capacitor and resistor pushes the 180 degree phase crossing out beyond the unity gain frequency.My suspicion is that the feedback or output impedance do not comply with the datasheet specs in his circuit; designing the circuit with the recommended values of feedback and output impedance will ensure stability.Quote from: IanB on May 19, 2012, 07:17:18 pm

author: free_electron
author_rank: Super Contributor
timestamp: May 19, 2012, 10:51:28 pm
content: QuoteNot really. mosfets are ptc.. as they heat up their rds increases... so two paralle mosfets become self balancing ( as opposed to bipolar where the hottest one eats the most current ...If you want to get good operation : give that opamp a negative rail .. that way the system keeps working for very low currents as well. measurng cose to the 0 volt is 'hairy'

author: amspire
author_rank: Super Contributor
timestamp: May 20, 2012, 01:15:14 am
content: Quote from: free_electron on May 19, 2012, 10:51:28 pmThe self balancing of parallel mosfets applies to switching mode, but not necessarily linear mode. It only works if you choose mosfets with a high enough channel resistance so that the resistance increases will dominate over the increases of gate sensitivity with temperature. If I pick a random device - I just happen to be looking at the FDPF12N50T mosfet right now - this only happens at a gate voltage typically above 7V and a current above 11A (it is only a 6A continuous rated mosfet). Below this, the current increases quickly with temperature at a constant gate voltage, swamping out the effect of the rising channel resistance. This means that in a constant current load, if I put these devices in parallel, one device would have thermal runaway and end up conducting most of the current.Where you see mosfets in parallel in a linear circuit (such as linear amplifier outputs), they are mosfets carefully chosen to properly share the current. You will probably find they have a large Rds.If you want the constant current load to be rated for a constant maximum power (eg 5v at 20A and 100v at 1A), it will probably be impossible to find mosfets that will share power properly over the whole voltage range.My favourite way of building a a constant current load with multiple mosfets is to have a separate regulator circuit for each mosfet. The opamps cost nothing, and you get an exact equal share of power.Richard.

author: T4P
author_rank: Super Contributor
timestamp: May 20, 2012, 06:00:03 am
content: ... DOH!

author: electroguy
author_rank: Regular Contributor
timestamp: May 20, 2012, 01:54:52 pm
content: Quote from: jimmc on May 19, 2012, 12:31:13 pmsorry if this is a silly question, can you use a LPF on the output of the opamp going into the gate of the mosfet. ie: a 100k resistor, then a cap to gnd.Obviously this would limit the response time? but would it stop the oscillations?

author: jimmc
author_rank: Frequent Contributor
timestamp: May 20, 2012, 02:42:17 pm
content: Yes that is possible, if you introduce a dominant pole (I'm old enough to call it a dominant lag) into the control loop then the system should be stable.Rule of thumb is the time constant of the dominant lag should be 4 times that of any other in the loop.(On a practical note 100k is a bit high, 1 to 10k would be more reasonable.)Jim

author: free_electron
author_rank: Super Contributor
timestamp: May 20, 2012, 03:12:31 pm
content: Quote from: amspire on May 20, 2012, 01:15:14 amah yes, that part is of course key. use mosfets made for linear operation. throwing in a mosfet that goes from off to on in 1 microvolt is always a bad idea for these kind of things.. damned i forgot what the y call this.. i know the symbol is S and in dutch it is called 'steilheid' ( steepness ). its basically the relation between vgs and rds. aargh .. can't remember the english word .. transconductance ! eh no .. that's gm , but that is Ids vs Vgs ..drat drat drat ..-2 minutes later- Transfer Admittance !Quoteand that is how it SHOULD be done !

author: LEECH666
author_rank: Frequent Contributor
timestamp: May 21, 2012, 11:10:19 am
content: Quote from: free_electron on May 20, 2012, 03:12:31 pmThat's what I am plan to do here (link below) with my dummy load implementation.https://www.eevblog.com/forum/beginners/derpy-load-is-this-dummy-load-design-any-good/msg103974/#msg103974I have too many projects running at the same time ...

author: icon
author_rank: Regular Contributor
timestamp: May 21, 2012, 10:52:42 pm
content: Quote from: amspire on May 19, 2012, 12:33:02 amYour puzzlement is understandable. I don't know what I was trying to do either. Of course it doesn't need that resistor network - I was misunderstanding what was going on.Built on a vero-board with a capacitor between -input and output, it seems to work OK, leading me to wonder whether the breadboard is a bit dicky. The only thing is a residual wobble at 2Xmains frequency.It turns out that the MOSFET doesn't start turning on until about 3.5V (seems to vary - perhaps with temperature?) and it maxes out at about 0.85A at the maximum op-amp output of 5V. I could up the supply, but then I'd need a regulator for the panel meter - I'm not sure the heatsink would like either.Anyway, thanks for all the help; I learned a lot more about op-amps than I would have if it had worked!RegardsJohn

author: electroguy
author_rank: Regular Contributor
timestamp: May 22, 2012, 12:34:54 pm
content: you are most likely correct saying the 100hz is coming from your mains. Have you got capacitors as close as you can to the power supply pins of your op amp? (try 100nf and 10uf in parallel, put the 100nf as close as you can to the chip, then the 10uf as close as you can to the 100nf).What input power supply are you using? switchmode or linear? have you tried a regulator such as 78L05 (make sure you have enough output capacitance and also the 100nf near the op amp IC) to see if the 100hz ripple is reduced?

author: icon
author_rank: Regular Contributor
timestamp: May 23, 2012, 12:18:40 pm
content: HiIt has a 3.3uF cap soldered directly to the power supply pins on the op amp, but no 100nF - might root through the box and see what I can find.It's a linear supply, with a 7805 and all the usual output caps.ThanksJohn