How can I cascade op-amps to decrease noise?  - Page 1
Forum section: electronics / beginners

author: LooseJunkHater
author_rank: Frequent Contributor
timestamp: June 26, 2023, 05:47:28 pm
content: This is essentially a followup post tohttps://www.eevblog.com/forum/beginners/what-is-the-measurement-sensitivity-of-an-op-amp/My current circuit in question:https://www.falstad.com/circuit/circuitjs.html?ctz=CQAgjCAMB0l3BWEBmAHAJmgdgGzoRmACzICcpkORKpISCkdApgLRhgBQyWjRcILZOhB9GYHOChQuPEfypyxRahEaQOfWmFwjUIdKj1E9yKNAlrY6ZGHh37kYeg7bqLUhIUtjA8ZNvwZpDEtABKTADOAJYRAC4AhgB2AMZMHADu4GDCQuA6ueoAZnQ6qIx41GUowmDQSM6ZBkYmCMI+6pmi4BJdBRwA5gIeIF7DVWoD+ujUw+jTWcITg13okEb8c9QTAE6K4Mp7q3qWnKFDEoLC7hfZx1J84GpSMAgZeZ4qOsRbb9oS33sAR0ppVGJsQMN1LEUK1dHt2pIWFhzMQwMhjKRuNkiDoYFRkDhcLYEIScHAiP9+AATJiFeIAVwANrEXHg9iwql1LvoQDS6UzYixGUwqZIxCM4BwzlzOfw2AZnnJHoqXhwAA4wtp6cHDUxidW6JTUYxgtYoKScTr8AEm-Y-K2m5qO6SaAQ+XIKXJ68zPKw2BwBpxSlW+BVPB62FV1SblLYgcbSTKe4QKSFvbzNN16NOZDMQj756S7dg5GrZQuMHjqQYlwu12s7BbVEbUAqPOzB8F+cHyu68MRPSyvIAIf you look at my previous post, you'll see that I previously used a 1M ohm resistor on the + inverting input, but now I'm thinking of changing that up because I recently learned that it isn't recommended for op-amps to use such large resistors (because of noise problems?) but instead I should use resistors in the 1k-100k region.After watching *EEVblog #102 - DIY Constant Current Dummy Load for Power Supply and Battery Testing*I see that Dave makes a DIY constant current power supply by cascading some op-amps. I've tried doing the same (Falstad link above) and I really don't understand what exactly is happening for the cascaded op-amps, as well as how exactly the "panel meter" is measuring current (@ time 7:00)? I further don't think I'm using optimal resistor values for the first op-amp (has a 100k and 700 ohm resistor).Could I get some help and guidance on this?Notice: The current sense resistor on the BJT is 0.1ohm to decrease voltage drop. I'm thinking of going even lower resistance to decrease voltage drop further, but I don't think that would be advisable when using a 1M ohm resistor, right?

author: Kleinstein
author_rank: Super Contributor
timestamp: June 26, 2023, 06:07:19 pm
content: Resistors add some noise, but in the circuit shown it is not the 1M or similar higher resistor that is relevant, but the impedance seen by the OP amp (some 10 K or less from the pot).The 10 K add some noise but not a real lot - so the old circuit may be OP, though not ideal.There is not need to use the extra OP-amp as a buffer, unless a linear scale is important. The extra OP-amp does not reduce the noise, it only adds a little.The circuit still has the BJT as power stage and for this reason limited accuracy (~0.1-1%) as the transistor gain changes with temperature and voltage.The other point to watch is stability against oscillation - this should be handled in Dave's video and plenty of other threads on current sinks.The circuit need a single supply OP-amp that works well near it's negative supply (= GND) or an extra negative supply.

author: LooseJunkHater
author_rank: Frequent Contributor
timestamp: June 26, 2023, 06:42:34 pm
content: Quote from: Kleinstein on June 26, 2023, 06:07:19 pmOkay, so just to clarify, this circuit with the 1M ohm resistor probably won't be problematic, and that there's no need for me to cascade two opamps?https://www.falstad.com/circuit/circuitjs.html?ctz=CQAgjCAMB0l3BWEBmAHAJmgdgGzoRmACzICcpkORKpISCkdApgLRhgBQyWjRcILZOhB9GYHOChQuPEfypyxRahEaQOfWmFwjUIdKj1E9yKNAlrY6ZGHh37kYeg7aVE1IwVjwds+QYO9hAASkwAzgCWYQAuAIYAdgDGTBwA7iCkEkLgOtnqAGZ0Oh4geNQl2WDQSM7pBkYmCMLG0umi4BLteRwA5h0gJeIZFtJ96OjUmfoT4GDCar2K+pBG-OPUCwBOS8TU7egrUjCcwdPUbDiM6wLaI7yMSGpmCGk5Egq34Mqtb197-LsftcStcpupoigmroli1vCxMI48JAiAcEHhkMgcHoYFgECj0NpcE1UKRAbZGAATJj5WIAVwANtFXtcLlcZkN1G1+KyliwSupxM1uSV2oInCAqTSGdEWPSmBTJN5LupTqLxPdGGwdE8+HQjs8ONsWiwpsaOdM7BwAA6-BSDAwoKScPr2vSDb5bYYoYRTFheZaWvq+j5zAT+9QAZW9N0u0ZNIwgNPpYSYUmc3DZ53Vcezqmk2yG8f6FydDlehaGZosrym2QU3RtteErsdYg4UZYVc1xrBUiTKbTHCAAQuote from: Kleinstein on June 26, 2023, 06:07:19 pmEven if the transistor gain changes with temperature/voltage, shouldn't the circuit ensure that the same current is passed? I would have thought it would be pretty stable, independent of temperature on the trasistor?Quote from: Kleinstein on June 26, 2023, 06:07:19 pmOscillations can happen with BJT's, not just FET's? Where can I probe with my oscilloscope to see this, and how would I cause the oscillations to see them with my scope?Quote from: Kleinstein on June 26, 2023, 06:07:19 pmI was thinking of simply using LM324's/LM358's for now until my knowledge grows, and then I'll likely most to more precise op-amps. I assume the LM324's/LM358's will work without issue?

author: Kleinstein
author_rank: Super Contributor
timestamp: June 26, 2023, 07:24:10 pm
content: The current that is regulated is the output current plus the base current. So of the gain changes the error due to the base current would also change. For most BJTs the gain goes up with temperature (AFAIR about like the square root of the absolute temperature). So for good accuracy one would use a MOSFET or maybe a MOSFET and BJT combined (not common). For a less demanding task (e.g. power to LEDs in most cases) the BJT can still be OK.The cicuit can also oscillate with a BJT though it may be a little less likely. A condition favoring oscillation is an inductive load on the collector side / output. A relatively slow transistor (e.g. 2N3055) with a small current (which make the transistor even slower) can also lead to oscillation.One would see the oscillation at the OP-amps output and in the ouput current.The LM358 are single supply and working in this respect, but they are not low noise and also tend to have quite some drift. So they are not a good choice for a really small voltage at the shunt.With the LM358 there is no need to worry about the noise of a 10 K resistor as the OP-amp has quite a bit more noise. So the old circuit would be OK.The other point with the LM358 is the offset voltage of some 5-10 mV. So with an 100 mOhm resistor this translates to some 50-100 mA that may be lower lower limit to adjust too.

author: LooseJunkHater
author_rank: Frequent Contributor
timestamp: June 26, 2023, 07:35:16 pm
content: Quote from: Kleinstein on June 26, 2023, 07:24:10 pmIn previous posts that I made, it was recommended to not use a MOSFET because of oscillation. How can I ensure that oscillilations don't occur with a FET; simply a 10k resistor between gate and ground?Quote from: Kleinstein on June 26, 2023, 07:24:10 pmSo if my understanding is correct the LM358 will likely have problems adjusting current from 0-100mah, is that correct? I'd need a higher precision op-amp to use a lower value current sense resistor?Edit:Would the NE5532 be more accurate at providing a constant current in the 0-100mah region? It also only needs a single supply rail I think (?) and I have quite a few of them.

author: Kleinstein
author_rank: Super Contributor
timestamp: June 26, 2023, 08:02:35 pm
content: It would need a better OP-amp or a larger current sense resistor, so more like 1 Ohm or even a little more.For the 100 mA a resistor of 1 ohm should be OK as it still only give 100 mA and 100 mW. Many DMMs (specially the old ones with 2000 counts) use a shunt with a 200 mV burden. It would be mainly with a much higher current (e.g. 10 A) that one would aim for less than 100 mV and than a higher grade amplifier instead of a higher power resistor.The BJT anyway has some minimal collector to emitter voltage of some 50-100 mV. So the BJT based circuit has a minimum drop of some 100 mV anyway.With a darlington transistor the base current is much less of an issue, but more voltage is lost.A 10 K resistor from the gate to ground does not help against oscillation - it may help with the off state.The way to suppress oscillation is an extra resistor in the feedback path and a capacitor directly at the OP-amp from the output to the inverting input. So a local fast feedback.Another element is an RC series combination at the output to dampen an inductive load. Another point with MOSFETs is not too have too large a load capacitance to the OP-amp and if needed have a gate resistor in series so that the OP-amp does not see to large a capacitive load.Finding the right values for the additional elements is a thing that can be done in the simulation.

author: LooseJunkHater
author_rank: Frequent Contributor
timestamp: June 26, 2023, 08:09:13 pm
content: Quote from: Kleinstein on June 26, 2023, 08:02:35 pmCould you draw this for me (whether with Falstad or some other software) as I'm quite novice and having difficulty visualizing/understanding this.

author: Zero999
author_rank: Super Contributor
timestamp: June 26, 2023, 09:05:37 pm
content: To reduce the noise, the op-amps need to be connected in parallel, not series.

author: LooseJunkHater
author_rank: Frequent Contributor
timestamp: June 26, 2023, 09:09:12 pm
content: I tried to create an RC filter usinghttps://www.digikey.com/en/resources/conversion-calculators/conversion-calculator-low-pass-and-high-pass-filterto provide me some guidance, but I think I'm doing it all wrong. Whenever I'd try to create the filter it would oscillate quite bad in the simulation (ex. 10k resistor, 1uf cap) and the FET would take quite some time to start up. When the cap at gate/ground isn't in circuit, it doesn't appear to oscillate. Help?https://www.falstad.com/circuit/circuitjs.html?ctz=CQAgjCAMB0l3BWEBmAHAJmgdgGzoRmACzICcpkORKpISCkdApgLRhgBQyWjRcILZOhB9GYHOChQuPEfypyxRahEaQOfWmFwjUIdKj1E9yKNAlrY6ZGHh37kYeg7bqbHIwVsww95NvwZuQMDvYQAEpMAM4AllEALgCGAHYAxkwcAGYoCMLGirooeeAcAO4F4gVC0gDmAuKebg0gqGq1+ujUpBLoneA+Uup1ovqQRvy91GocAE4VygXoY4PQnOXaEgob4Avq6zrE1COH0uWTLYzn3dLiefwsrQWCTiAAJkyZiQCuADbxLD8mK9JGIQB51OEno8RmwdG0+OA2pYEBwAA45PJ6K4SUxiNG6JRHR5LExSNbzImE06LZbGS7LdSaeoDaqMaq48wrRw2UIOJwcOosBReBSPablNnCRjXPbMzFykAysoKmWKiyzQqsopSIg8OAcSHndyXPqwiw6sRIswo7hiFnCbbVVTSObeXz5N3gc26+AChUsD3XAN6aZ1djCa7h-pSl3R7VR1U4Voa40CR6p55kuwyXgmB32kHSW10AwCBQIUi+LaDZUZqNCpoDWUNhVGqPqYttjwdRsOmud01R86VZ0d2Qtz0t0HTYt1gYZx6jjUGIwmXKFS2+1IYzXr1UwMI1urIPc49ft6QAe3ASGdmj0tjMzs4QA

author: LooseJunkHater
author_rank: Frequent Contributor
timestamp: June 26, 2023, 09:12:14 pm
content: Quote from: Zero999 on June 26, 2023, 09:05:37 pmI thought they should be connected in series so that I could decrease the + inverting inputs resistor? I previously needed a 1.6M resistor? From my reading, using anything larger than 1M resistor is really bad (in terms of noise) for an OP-AMP?https://www.falstad.com/circuit/circuitjs.html?ctz=CQAgjCAMB0l3BWEBmAHAJmgdgGzoRmACzICcpkORKpISCkdApgLRhgBQyWjRcILZOhB9GYHOChQuPEfypyxRahEaQOfWmFwjUIdKj1E9yKNAlrY6ZGHh37kYeg7aVE1IwVjwds+QYO9hAASkwAzgCWYQAuAIYAdgDGTBwA7iCkEkLgOtnqAGYoCMLGirooJfpp+oblyMXl6umi4BIteRwA5q0gHj2ZUurd6OjUAyMqYMJqXWXokEb8E4McAE5lxNQt83qWnMH6owLijMtsOmpyPoNmCNXaEgoP4MrS6c+bG69Nh9R9ywMfmcTr8ej8WmwcLx+Cw+upxCUYX0IdlhAATJj5WIAVwANtEWLimGjJN4oeoDhCQVSLlI+NdLjA7gAHHKPP5iAwoKScbp9KZ6fnfaTrAbZAYsLw+OyzCVPKYCKXqbinI6QsQSdWkkU9LXiY4WVr2api4QKDqs029TkmHkcIA

author: Kleinstein
author_rank: Super Contributor
timestamp: June 26, 2023, 09:14:06 pm
content: The simulation looks like it is oscillating, though with a relatively small amplitude and the number shown does not update fast enough to show it properly.

author: Zero999
author_rank: Super Contributor
timestamp: June 26, 2023, 09:16:19 pm
content: Quote from: LooseJunkHater on June 26, 2023, 09:12:14 pmThe lower side of the potential divider is a 10k potentiometer, so the 1M6 resistor is irrelevant.

author: LooseJunkHater
author_rank: Frequent Contributor
timestamp: June 26, 2023, 09:21:56 pm
content: Quote from: Zero999 on June 26, 2023, 09:16:19 pmSo if I wanted to use an even lower-value sense resistor, could I just simply change my op-amp to something like an NE5532 and use a few more large Megaohm resistors? Would that be fine?Further, maybe you can help me out @Zero999 with the gate filter/stabilizer for the FET?

author: Zero999
author_rank: Super Contributor
timestamp: June 26, 2023, 09:55:26 pm
content: Quote from: LooseJunkHater on June 26, 2023, 09:21:56 pm1) The output impedance of a potential divider is equal to the values of the resistors connected in parallel. What op-amp were you using originally? BJT input op-amps are lower noise with low impedance inputs and J-FET input better with high impedances. The offset voltage is going to be more of an issue than noise.2) It's normally an RC circuit and something you'll have to play with.

author: LooseJunkHater
author_rank: Frequent Contributor
timestamp: June 26, 2023, 10:13:50 pm
content: 1. LM324/LM358. Was thinking of switching to the NE5532 for the lower noise, but not sure if that's required?2. Do you have any rough estimates or anything that can put me on the right track?

author: Kleinstein
author_rank: Super Contributor
timestamp: June 26, 2023, 10:47:31 pm
content: A first point is the question what level of error is acceptable or what the current sink is used for.For low demands the LM358 is OK, it just needs a larger shunt resistor.

author: Yuu
author_rank: Regular Contributor
timestamp: June 28, 2023, 11:05:31 am
content: Quote from: Kleinstein on June 26, 2023, 06:07:19 pmWhy would the circuit oscillate? Assuming the op-amp is internally compensated, the emitter follower BJT will just decrease your open loop gain. Surely it would be fine right? Do you mean the BJT would sort of self-resonate with an LC circuit made up of device inductance and device capacitance like base-emitter capacitance or base-collector capacitance? If so wouldn't that be in the GHz range? What would you do to stop that?

author: Zero999
author_rank: Super Contributor
timestamp: June 28, 2023, 11:48:11 am
content: Quote from: Yuu on June 28, 2023, 11:05:31 amThe BJT introduces another delay in the loop, which increases the chance of oscillation. For a small transistor and slow op-amp, it's unlikely to be an issue.

author: LooseJunkHater
author_rank: Frequent Contributor
timestamp: June 30, 2023, 06:16:28 pm
content: Bump?I was also looking further into the datasheet of both the TIP142 & FDP047AN. I saw that the gate capacitance of the FDP047AN is ~6600pf, while the TIP142 doesn't list any sort of capacitance on the base. For the FDP047AN, does that mean I won't need a gate capacitor, and I'll only need a resistor between the output of the op-amp and the FET gate?Also I assume the TIP142 (high power darlington BJT) won't be too slow for this application?

author: Kleinstein
author_rank: Super Contributor
timestamp: June 30, 2023, 06:33:04 pm
content: 6600 pF of gate capacitance is quite a lot. In addition to this there is feddback from the gate to drain capacitance, that can also be relevant if the DUT is higher impedance.This would need a gate resistor to the OP-amp in most case and make the FET part relatively slow. This could than need a slow compensation setting.Unless one really needs so much power one may want a smaller / less powerful MOSFET.AFIAK the TIP142 transistor contain extra base to emitter resistors. This makes them rather low accuracy despite of the high gain. There is also some capacitance, but this depends on the current. There is also collector to base capacitance that is multiplied by the voltage gain (depends on the load).The TIP142 is not super fast. It need quite some time (a few µs) to come out of saturation.Even with a very slow transistor one can always slow down the compensation (capacitor in direct FB and series resistor from the shunt sense). A low overall circuit needs a large capacitance in the RC element to keep it stable and would cause a longer current peaks when coming out of saturation or on some voltage transients. We don't know how fast the current sink needs to be.

author: LooseJunkHater
author_rank: Frequent Contributor
timestamp: June 30, 2023, 06:45:23 pm
content: Quote from: Kleinstein on June 30, 2023, 06:33:04 pmI have two main use ideas (both of which are slow); controlling the current of LED's, as well as controlling the current of devices charged via USB (5V).

author: Kleinstein
author_rank: Super Contributor
timestamp: June 30, 2023, 06:59:14 pm
content: Neither a LED drive (for normal light) nor the charger needs to be accurate. Both are normally relatively low power and can thus use smaller transistors that make things a bit easier.With low accuracy needs it is also OK if the sense resistor is a little larger and gets a little warm and thus no need for a very low noise / drift OP amp.The question is if one needs protection against a current peak when connecting the DUT with the circuit already powered on. Not all current sinks include this or need this.The point is avoiding the circuit to try to turn on fully if the voltage at the output is small (e.g. < 100 mV).

author: Zero999
author_rank: Super Contributor
timestamp: June 30, 2023, 08:59:33 pm
content: Start from the beginning.Please provide the following information:LED forward voltage.LED current: does it need to vary?Minimum power supply voltage.Maximum power supply voltage.That will make it much easier to design an LED current regulator circuit.

author: LooseJunkHater
author_rank: Frequent Contributor
timestamp: June 30, 2023, 09:45:20 pm
content: Quote from: Kleinstein on June 30, 2023, 06:59:14 pmI'm hoping to get about 1ma accuracy as some devices I would like to charge at around 5ma (such as devices with a 50mah battery).Quote from: Kleinstein on June 30, 2023, 06:59:14 pmI need to use a low value sense resistor to reduce the amount of voltage drop as I plan to vary the current needs from 5ma to 1.5A, depending on the device plugged in. I plan to charge 5V USB devices. For small current, sure the resistance won't matter much but at 1.5A, 1ohm would create a significant voltage drop.Quote from: Kleinstein on June 30, 2023, 06:59:14 pmI'd absolutely love protection against a current/voltage spike, but I have no idea how I'd implement this.https://www.falstad.com/circuit/circuitjs.html?ctz=CQAgjCAMB0l3BWEBmAHAJmgdgGzoRmACzICcpkORKWISCkdApgLRhgBQyWjRcILZOhB9GYHOChQuPEfypyxRahEaQOfUuFwjUIdKj1E9yKNAlrY6ZGHh37kYeg5gs1YyFSNSFybfhm5AwO9hAASkwAzgCWkQAuAIYAdgDGTBwA7iA+KMKuEkLSWQZGJgjCHupZouASNYXqAOa6nrx6OWoczejo1Dk9KmDCnc016JBG-ANS6gBOiuDKC+N6Yhxh+r0C4ozTbDpqcuCHlgiZ2hIK+YvUVRc3C8S359Nem30WHHEo5S01lZJBDhoGQiFhSOx0KQsIYKBZsHhxDgEENSMgqHhjowACZMABmCQArgAbOIvLZsHC7LbiIrvbZUlqUzrVfjMhYsN7qcQVNlvGqCJwgXEEklxFjEpjYyRiEBU9QbAU7DnXQ58I4naBneYedm62lKHhwDhAAWhen testing my circuit with these exact values above, there was delay of a few us (microseconds) before the op-amp would intitiate current/voltage limiting. I tried to think about how I could implement this but I have no idea.Quote from: Zero999 on June 30, 2023, 08:59:33 pmVoltage: 36-39V, current:600mA+600mA (but I want to limit the current to vary brightness), the circuit will be fed by a 40v boost converter (powered from batteries).This project essentially goes all the way back to this posthttps://www.eevblog.com/forum/beginners/driving-this-dual-coloured-cob-led/, except that now I want to use a similar circuit to charge 5V USB devices very slowly (at minimum 5ma). I'm also trying to use a low-resistance current-sense resistor because from that original post that you helped me with @Zero999 , the 1ohm resistor that I used was getting very hot (70C) under a 600ma load. I want to minimize power loss and the need to dissipate heat, hence why I want to use a 0.1ohm resistor (or potentially even smaller).

author: Eraldo
author_rank: Regular Contributor
timestamp: July 01, 2023, 10:51:20 am
content: Quote from: LooseJunkHater on June 30, 2023, 09:45:20 pmOk let's start from the begining. You need 2 op amps to create the electronic load because 1 is used as a buffer of the potentiometer which is then followed by a voltage divider and the second one is comparing the voltage drop of the power resistor with the voltage obtained from the voltage divider.The 2nd opamp is self explanatory but the first opamp is badically essential becauseif you were to connect the voltage divider directlyto the potentiometer, it wouldn't produce a linear current regulation.You could also go about and use one opamp to amplify the resisor voltage drop and then compare it with the potentiometer using another opamp. So however you spin ot you need 2 opamps.Second, the reason you don't want a high resistance in that voltage divider is because of the offset current at the inputs of the op amp, and in the case of lm358 it would be quite huge. If you were to multiply the resistor value (1 meg) with the offset current (say 1 uA) you would get a voltage offset of 1 volt which is huge. So use as small of a resistor as possible.Next regarding your last comment that i quoted above, it's better to just use a 1 ohm 5w power resistor with some kind of heatsink on top of it or something. Or in case you want it a bit cooler, put 2 1ohm resistors in parallel for 0.5ohm.Aslo your comment "I want to minimize power loss and the need to dissipate heat, hence why I want to use a 0.1ohm resistor (or potentially even smaller)" doesn't make sense. The job of an electronic load like the one you want to make (even if you are gonna use it as a constant current regulator) is to dissipate as much current as necessary for the current passing through the led to be the value you want. You could imagine it as a variable resistor adjusting its resistance to where the current will be the value you set. When you are using constant current, the voltage is the unit that changes (assuming the load resistance of the led in this case is constant).Let's say that a led (or a fillament lamp since they have more linear input resistance) uses 1A when powered from 5v. This means that the input resistance is 5 ohm. If we want to limit the current to 500mA, the constant curent load would do this basically : 5v /0.5 A = 10 ohm. 10 ohm - 5 = 5. So the electronic load would adjust its internal impedance to 5 ohm and in doing that it would dissipate 2.5w and the voltage across the led would be 2.5 volt (so a drop of 2.5v)Now this whole example was to say that the power resistor value to be as low as possible in the circuit is not as critical as you think. It would only cause you more trouble. I'd say the sweet spot for your case would be .5 ohm but 1 ohm is completely fine for your case. The cases where it would matter would be when your supply voltage is very small (1v or less) and you're trying to draw a lot of current (like 1A or more). In these cases you need a low impedace (low resistance) electronic load so it doesn't interfere with the device you're trying to power.Also a higher power resistor value gives you more control on the lower current levels (like 5 mA). You could also use a relay to switch on different modes, like high curent mode and low current mode (100-0mA) or build a second one just for low current. (But if you're using a relay take into consideration the dc switching voltage and current rating.(Funnily enough I'm also making an electronic load and I'll propably be making a post about it when I'm finished)Here's a sneak peek