Output stage for a source&sink linear regulator adjustable from 0V to 40V - Page 1
Forum section: electronics / projects

author: shapirus
author_rank: Super Contributor
timestamp: January 28, 2024, 02:47:08 pm
content: I am making a simple (as it always seems in the beginning) device that measures the relative capacitance change in MLCCs when they are subjected to DC bias based on the idea described in Maxim Integrated'sAN6014.The oscillator+integrator part is next to trivial, it works just fine in both simulation and on a breadboard.The part that produces the DC bias voltage is more difficult to get done right:1) I want it to go from exactly (within a few mV) zero to as close to the upper rail, which is 40V coming from a boost converter, as possible -- worst case, I'll be satisfied with say 35 V;2) it must be as stable as possible, i.e., keep the bias voltage at the set level with little deviations induced by the AC component in the capacitor being tested, because otherwise it can have a significant effect on the device's readings.I will explain how I approached it to answer some possible questions.My first thought was to use LM317, but a) 35-40V is at its limits; b) it can only source, but not sink current, and sinking current is required to maintain good load regulation.I don't want to search for and get a fancy part that can do this out of the box (but if it exists, please let me know!), because it will make it less fun, and I want to make use of my stockpile of generic parts instead of acquiring yet more stuff.So I decided to use an op amp that would drive some transistors, for which I have a conveniently unused fourth unit of LM324 whose other three units do the rest of the job in the circuit.The desired output voltage is set by a potentiometer that goes from ground to the reference voltage provided by e.g. TL431, which is then amplified by the op amp and the push-pull output stage.Adjusting zero output to be exactly at ground level (required because LM324 doesn't shine in the input offset voltage department) is done by biasing the feedback voltage as shown in TI'sAN-31on page 12.Since the op amp cannot output 35-40V directly, a voltage (and, to an extent, current, even if low, to respond quickly to the changing output voltage) amplifier is needed.Here's how I did it:This works in both simulation and real circuit. Even though it's on a solderless breadboard, load regulation remains pretty good: output voltage stays within ±10 mV of the set point, when C3=200μF, and it can further be improved by adding more wires in order to additionally connect ground points in various locations of the breadboard, so I guess it's going to be better on a proper PCB.When the set voltage is reached, current through R5 and R10 does not exceed ~±15 mA peak (with a little bit of an undershoot of ~-25 mA on the bottom one) and there is no cross conduction; there is a ~50μs dead time when switching occurs.Amplitude of the AC component across DUT is 200mV (400mV p-p).C2 is required to reduce output noise seen across both R5 and R10 with OUT used as reference point. I believe it is some parasitic oscillation in the low-MHz range, but its amplitide is too low for my scope to properly see what's going on there -- I only see that it's reduced when C2 is inserted. The value of the cap is picked experimentally and it works in both real circuit and simulation.R4 and R6 were picked experimentally: I started with R4=2k and without R6 at all, but ended up with the values shown, that's where the noise/oscillations mentioned above went to a minimum.D1 and D2 are zeners that prevent Vbe breakdown, which in the real circuit may potentially be reached in the turn-on transient (and if the user manages to rotate the bias adjustment pot fast enough).Support for DUT capacity higher than 100μF is not planned.There are things I don't like about this design.Firstly, output regulation begins to fail when the set voltage reaches about ~4.2V below the upper rail. This apparently happens because voltage drop across R1 is too high to keep the base of Q3 at a required level, thereby reducing its maximum possible emitter voltage. Reducing R1 helps, but not much, and there is a limit to how low it can go, because of power dissipation.Secondly, even without C1 (DUT), a pretty big C3 is required. Without it, the op amp begins to oscillate wildly, I mean, not just become a little noisy, but the operation is screwed altogether. It happens in simulation just as well. Why is that? From my experience, when a classic push-pull stage (class B amp) bases are driven directly by an op amp, it is stable even when there is no compensation cap across the upper feedback divider resistor. It only begins to oscillate with considerable capacitive loads.In this case, however, a voltage amplifier stage is added, which, apparently, makes all the difference.Getting rid of C3 and instead letting the op amp quickly compensate the disturbance caused by the oscillation in DUT would sure be nice, but is it possible?I have tried to simulate some other circuits, for example, one with PNP on the top and NPN on the bottom, which should allow the output voltage to almost reach the upper rail, and indeed it works that way (in simulation -- I didn't build it). However, there is a significant cross-conduction: hundreds of mA when set voltage is reached, and several amps when it's changing following a fast rise or fall of the input voltage. This isn't acceptable.Here's the circuit. I am sure that I did something wrong here. Is the basic idea viable or this isn't the way to do it at all?What are other ways to do this? Can my first circuit be improved to address the concerns I expressed above? Any ideas are welcome. Note, however, that the 40V rail is only the voltage that my current boost converter goes to -- that's an MC34063A (yes), and after playing with this one I might want to make a second revision that can go up to, say, 60 or 100 volts, so I need a design that will work for a general case, rather than cheating by e.g. finding an op amp that works with 45V.

author: Andy Chee
author_rank: Super Contributor
timestamp: January 28, 2024, 02:52:56 pm
content: What about using a LM1875 amp as a "big" opamp?

author: shapirus
author_rank: Super Contributor
timestamp: January 28, 2024, 03:10:29 pm
content: Quote from: Andy Chee on January 28, 2024, 02:52:56 pmThis one might work and settle the "single IC that does the job" suggestions category. It's actually available for purchase locally and it's not overly expensive, so I guess I'll grab a few and see how it performs, even though I really hate to order yet another electronics part. But it looks sweet enough to have it in the parts box.However (and it goes straight to the crappy datasheets collection!) what is its max output voltage swing? How close does it go to the Vcc rail? The only information its datasheet has is the brilliant "large output voltage swing" statement. How large is large? Will it go to 35V when powered by Vee=-5, Vcc=40 (or, more realistically, ~38)?Regardless of whether it'll work, however, the questions related to designing this with discrete parts (plus a generic op amp) remain.p.s. typical supply current = 70 mA doesn't look so sweet. That's almost 3W at 40V supply with no load. This thing will require a heat sink and will almost reach the current limit of MC34063A boosting from 5V (I want to power the whole thing from USB) to 40V.

author: dobsonr741
author_rank: Frequent Contributor
timestamp: January 28, 2024, 03:11:06 pm
content: I wonder if there is a simpler way to measure the capacity degradation. Would a DMM with a series 10x foil capacitor relative to DUT and a regular power supply be sufficient? So the DMM measures the capacity over the series capacitor, and the capacitor blocks the DC vial, while big enough the smaller DUT cap contributes to the series capacitance.

author: shapirus
author_rank: Super Contributor
timestamp: January 28, 2024, 03:18:25 pm
content: Quote from: dobsonr741 on January 28, 2024, 03:11:06 pmSurely there are ways, but the whole idea is to build a nice self-contained device that won't require additional tools and will both satisfy the DIY itch and be useful for (even if infrequent) practical application.In other words, I don't just want to measure a capacitor or two, instead I want to build that device.

author: Andy Chee
author_rank: Super Contributor
timestamp: January 28, 2024, 03:30:45 pm
content: Quote from: shapirus on January 28, 2024, 03:10:29 pmGet the "proper" datasheet from TI.https://www.ti.com/lit/ds/symlink/lm1875.pdfLM1875 absolute maximum voltage is 60V. In other words +/-30V when using bipolar power supply.

author: dobsonr741
author_rank: Frequent Contributor
timestamp: January 28, 2024, 03:39:04 pm
content: The identical twin, LM675 real opamp has the output swing specified on the data sheet.

author: shapirus
author_rank: Super Contributor
timestamp: January 28, 2024, 03:43:04 pm
content: Quote from: Andy Chee on January 28, 2024, 03:30:45 pmI'm talking aboutoutputvoltage swing, not supply voltage.btw, another potentially suitable IC is TDA7294. Can be supplied with +/- 40V, but, again, output voltage swing isn't specified. I guess it's just not an important characteristic of an audiopoweramplifier.

author: shapirus
author_rank: Super Contributor
timestamp: January 28, 2024, 03:52:26 pm
content: Quote from: dobsonr741 on January 28, 2024, 03:39:04 pmYeah, specified at 8- and 4-Ohm load: roughly within ~2.5V of the positive supply rail at 8 Ohm, and my expected equivalent load is much lower, so it might work. Quiescent current, though... However the LM675's datasheet gives a much lower figure: 18 mA typical. This is almost acceptable, but may require a more powerful DC-DC converter that I use to create the -5V rail (current one is rated for 1W, and that's Chinese Watts). Worth trying anyway, even if it will turn out unsuitable for this project.

author: shapirus
author_rank: Super Contributor
timestamp: January 28, 2024, 05:56:34 pm
content: Actually... MC34063A has no problem going above 40V: I have just simply changed the feedback divider's resistor values, and it went to 45V just fine, and I guess it can go much higher than that. This leaves plenty of margin to adjust the output voltage reliably to 35V and above, if I want, so the circuit shown in my first schematics will do the job (and it's energy-efficient, too). I still wonder, however, if there is anything that can be improved in it. For example, whether it's worth it to bias the transistors to make it a class AB output stage; however that may require careful manual tuning, which I'm not a big fan of (and a mistake at this voltage will fry the transistors quickly).

author: iMo
author_rank: Super Contributor
timestamp: January 28, 2024, 06:30:01 pm
content: What about the 34063's output ripple? This chip is not the best choice when chasing the millivolts, imho..

author: PCB.Wiz
author_rank: Super Contributor
timestamp: January 28, 2024, 06:39:00 pm
content: Quote from: shapirus on January 28, 2024, 02:47:08 pmThere are two broad approachesa) how much current does the test section inject ? Is it always 100Hz ?You just need an opamp good enough to have a low impedance at 100Hz and that current.b) If you have made the test oscillator+integrator, why not make the voltage offset, part of that design.Then you skip needing a matching current sink entirely.You just move the schmitt thresholds accurately over your test range.

author: shapirus
author_rank: Super Contributor
timestamp: January 28, 2024, 06:58:59 pm
content: Quote from: iMo on January 28, 2024, 06:30:01 pmYeah, I'm actually looking at it this very moment. It's terrible!However, since the only thing it will be powering is the linear regulator with a good voltage margin between its max output and the output of the boost converter, it does not matter much, if at all, since it's going to have a very decent PSRR. The millivolts for the zero bias setting will be chased after the regulator, not before. Besides, these millivolts are more or less cosmetic: I just want the bias voltmeter indicator to show a nice "0.000" when the pot is turned to the minimum position. The effect on the actual measurement will be negligible even if will be off by 0.1V, since noticeable degradation of MLCC capacity starts a good bit above that.I have just verified it: even with a very quick and dirty build, two separate solderless breadboards, one containing the boost converter, another the linear reg. and the rest of the circuitry, that are connected by jumper wires, output voltage looked quite good on the scope. No sorry, I cannot characterize "quite good" in numbers with this equipment :). Yes, it had some higher frequency spikes here and there, but that is most likely because of all sorts of ground loops and whatever. With a proper PCB layout and some RC filtering, which I will probably add if I have some voltage drop to spare, there should be nothing to worry about.

author: shapirus
author_rank: Super Contributor
timestamp: January 28, 2024, 07:13:04 pm
content: Quote from: PCB.Wiz on January 28, 2024, 06:39:00 pmI'm actually going to set it at 200Hz target frequency, just because. I don't have anything that would back this choice. Higher than that, and I need more current both for the oscillator and the bias regulator part. Less than that... Maybe possible. Either way it's going to be a fixed frequency at zero bias, I can pick any reasonable value. But of course frequency will rise as the DUT's capacitance drops when DC bias is applied.Quote from: PCB.Wiz on January 28, 2024, 06:39:00 pm...and the one that can output 35-40V. Why this voltage? Because it will allow to see if an unmarked unknown cap is most likely rated for 50V, which is a common case.Quote from: PCB.Wiz on January 28, 2024, 06:39:00 pmThis is an interesting idea, but again I'm afraid I would need an op amp that can work in the 40V region. If the comparator part can be tricked by dividing the threshold and input voltages (but then noise may become an issue, as the thresholds are currently only +/- 180 mV), the oscillation driving part will still have to output full range to the cap being tested.I'll need to review my schematics carefully, though, I think it may work. It may be a combination: use low-voltage power for the logic and make a high voltage push-pull driver just to drive the cap under test. This will allow to get rid of the bias voltage regulator. But then I may again run into the issue of the op amp going unstable when it's driving a voltage amp + push-pull output stage, and this time adding a 100uF cap on its output to suppress oscillation won't be an option. Anyway, need to try and simulate it, thanks for the idea.(and it will need a short circuit protection against user error: DUT terminals will be exposed to the user, and can easily be shorted... but then again, I need this protection already, although to a lower extent, as there is a resistor between DUT and its oscillation driver)

author: PCB.Wiz
author_rank: Super Contributor
timestamp: January 29, 2024, 12:42:33 am
content: Quote from: shapirus on January 28, 2024, 07:13:04 pmYou do not even really need a main opamp.The CUT driver can be precision MOSFET current source/sinks, and they are flipped at the Voffset +/- 180mV limits.You can get > 40V opamps, but they certainly thin out.As you say, a simple divider on the voltage (can be matched resistors for 2:1 or 3:1) can drop the voltage into mainstream parts region.

author: David Hess
author_rank: Super Contributor
timestamp: January 29, 2024, 01:54:50 am
content: Quote from: shapirus on January 28, 2024, 02:47:08 pmThere is a problem and a large C3 fixes it, but poorly.Q1 has voltage gain, which is fine by itself, however it is within the feedback loop of the operational amplifier so it is reducing the gain margin, likely to the point of instability. Fixing this normally requires lowering the gain at high frequency and that is what C3 is doing. C3 combined with the output resistance of Q2 in parallel with Q3 makes a low pass filter which lowers the gain, but it also adds more phase delay so it has to cut the gain at higher frequency even more. This method comes up under the title of "dominant mode compensation" and while it can work, it is the lowest performance option.Q1 has another problem; its voltage gain is its transconductance times its load resistance, but its transconductance varies with collector current, so its voltage gain is varying with its operating point and its load. This can be largely solved by adding a resistor in series with its emitter which will make it transconductance more stable, or even almost constant. R6 would be reduced or even removed.Further stability is available by adding a capacitive feedback network directly from the output of U1A to its non-inverting input, which will allow C3 to have a lower value, or even be removed. This also requires adding a resistance between the controlling source and the inverting input so that the added capacitor has something to work against. A more complicated design would add another series resistor and capacitor pair in parallel with the feedback capacitor.Another way to boost the output voltage is shown below. In this design the operational amplifier's supply pins drive a pair of current mirrors to boost the output, and current feedback is applied to the operational amplifier's output. The R1 and R2 divider at the output sets the fixed gain of the current feedback stage, which unlike your Q1 does not vary, and the R6 and R7 divider controls the overall gain. Add a zener in series with the positive supply to the operational amplifier to raise the positive operating voltage.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: January 30, 2024, 10:46:25 pm
content: Quote from: PCB.Wiz on January 29, 2024, 12:42:33 amI did a quick sim of opamp + MOSFET precision current source/sink.The current reference voltage can be quite low, I chose 200mV for 'ordinary' opamps, but precision opamps can lower that further.OpAmp supply needs to be only large enough to drive the MOSFETS so even a 5V part is OK. For PFET drive, a RRIO opamp helps.I also tested avoiding cutoff, so the current ref swings 5mV-200mV, and that works well to keep the gate swings in the linear region.The P&N FET gate swings are only 10's of mV larger than the ref change, which also means slower opamps can be tolerated.At 100Hz, there is no pressure on opamp speed, but I was curious to leave some frequency head room.The main output stage is then 1 PFET, 2 NFETS and 3 opamps. One NFET + opamp is precision level shift, and the other two are driver stages, probably slightly larger FETs for the 40V/10's mA indicated.High side opamp can be SOT23 with a simple shunt regulator.lcsc have opamps like Gainsil GS321A/358A, RRIO and slightly better on Vos, but still low cost.https://www.lcsc.com/product-detail/Operational-Amplifier_Gainsil-GS358A-SR_C5179651.htmlSuch a design can easily scale above 40V, as the P&N FETs do the level shifting.

author: shapirus
author_rank: Super Contributor
timestamp: January 30, 2024, 11:10:08 pm
content: That sounds interesting. Can you share schematics?BTW thinking of this, the original idea is based on RC timing and constant +/- voltage being applied to the RC circuit where R is adjustable and C is DUT; as C changes, so does frequency, proportionally. R is adjusted at zero bias to set the frequency to one where the integrator will output exactly 1 volt, indicating 100% capacity.I wondered for a few seconds whether constant current charging and discharging will still work. It will: since q=CU (assuming C=const at a very low delta of U) and q=tI (at a constant I), we have tI=CU, and, because I=const, U=const (+- threshold), we have C=const*t, therefore, the change of f=1/(2t) will be proportional to the change of C as DC bias is applied. And the integrator's output voltage is inversely proportional to the oscillation frequency. So constant current can be used just fine here, and it may have its benefits in implementation. Calibration before measurement will be done just the same, with a pot to adjust the current to set the target frequency for 1 volt output.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: January 30, 2024, 11:30:16 pm
content: Quote from: shapirus on January 30, 2024, 11:10:08 pmAttached are my rough LTspice scribbles, testing various level shifters and response times and PSRR.Quote from: shapirus on January 30, 2024, 11:10:08 pmYou can generate quite accurate currents, so calibration should not be needed, unless you want to always test at (eg) 1V ripple.

author: shapirus
author_rank: Super Contributor
timestamp: January 30, 2024, 11:46:55 pm
content: Quote from: PCB.Wiz on January 30, 2024, 11:30:16 pmTo keep frequency constant instead, and measure the ripple amplitude? This will allow testing only a small range of capacitances, because for lower values this ripple will go well beyond the region where capacitance of DUT may be assumed constant. My idea is to keep the oscillation amplitude fixed and very low (say 400mV p-p) where it has negligible effect even on the 6.3V-rated caps. That means the frequency will change as C changes, and we use that integrator proposed in the original article to measure this change.p.s. idea for revision 2: ditch the potentiometers, use a microcontroller. Set the required charge/discharge current at zero bias (to get a sane starting frequency), then gradually increase bias voltage and keep measuring frequency until it hits say 500% of the starting one. The bias voltage at this point is the cap's working voltage, plus we can build a characteristic curve of C vs Ubias using the intermediate values.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: January 31, 2024, 12:11:23 am
content: Quote from: shapirus on January 30, 2024, 11:46:55 pmThat seems sensible, and you can measure the period with a MCU, if you want accurate C readout.There are soundcard oscilloscopes/frequency counters, that could be pressed into service here.I think the freqctr on this one, is still included in the free version ?https://www.daqarta.com/dw_freq.htmor this ?https://www.qsl.net/pa2ohh/11freqcnt1.htm

author: shapirus
author_rank: Super Contributor
timestamp: January 31, 2024, 09:19:22 am
content: Quote from: PCB.Wiz on January 31, 2024, 12:11:23 amYeah these could be used, but if we begin using external devices, then what's the point? I have a DMM that can measure frequency, for example, so there's no need to use a soundcard and a computer. And the whole idea is to have a self-contained device. And with an MCU it's easy to measure frequency (in this range anyway) on a raw input GPIO pin -- just need to condition the input signal to bring it to proper digital i/o levels.

author: Andy Chee
author_rank: Super Contributor
timestamp: January 31, 2024, 10:56:46 am
content: Quote from: shapirus on January 31, 2024, 09:19:22 amA soundcard can still form part of a self-contained device, if it is paired with a Raspberry Pi, for example.

author: shapirus
author_rank: Super Contributor
timestamp: January 31, 2024, 11:28:45 am
content: Quote from: Andy Chee on January 31, 2024, 10:56:46 amCorrect. But what's the benefit comparing to feeding the oscillator output directly into a digital I/O pin of a (generally) smaller and less complex controller?