D to A circuit puzzle

AnalogKid

Joined Aug 1, 2013
12,162
I missed your post. oops.

Never been a big fan of the MFB topology. My fave is a 3-pole Sallen-Key Butterworth with a gain of 2 because it works out to equal component values for both the R's and C's, but still is only 3 dB down at the corner frequency. EDN had a Design Idea on this (03-17-1983) and I still use it.

ak
 

Ian0

Joined Aug 7, 2020
13,158
MFBs have their uses, but they don't sit well with single supply applications, and I don't like the high-pass version because of the capacitive load it presents.
They are great for differential inputs.
This is the problem with the Sallen & Key.
Blue trace is the Sallen & Key, Red trace is the simple RCRC.
Screenshot from 2026-02-23 18-36-01.png
 

ronsimpson

Joined Oct 7, 2019
4,709
Thanks for the files.
I did not have the same op-amp so I switched to a slow 1.3mhz low power amp. At high frequencies the amp has a high output impedance.
At high frequencies, first circuit, the signal passes through R1, C2 and to the output. The amp cannot hold the output from moving. Above 15khz C2 is causing trouble.
In circuit two there is C7 on the output of the amp. C7 makes the amp look like it has low impedance at HF.
On the graph the Red trace shows that C2 causes strong outputs at HF. The Green trace heads down hill because C7.
I cannot remember exactly what to do with C7. I think there was a law about its value, but many years have passed.
1771879099435.png
To get better HF response use a faster amp and/or add capacitance to the output. When I first saw this problem, I moved to a 10mhz amp but the cost was too much. Then I just added the cap.
Years ago, I designed an IC that had 32 PWMs in it. We sold tens of millions of them. Back then DACs coat money!
 

Ian0

Joined Aug 7, 2020
13,158
That's rather neat.
There's something interesting going on as the HF phase response for a 2nd order filter should only get to 180° and your reaches 450°
I normally use Microchip op-amps, but none of their SPICE models works for me, so I picked the first one that worked.
 

MrAl

Joined Jun 17, 2014
13,720
Looking for a simple as it gets D/A and tried this one
shows OK with LTspice, but actual build ramps right up to the power level(20vdc). ???
Hi,

Not sure if you solved this yet...

The circuit looks sound as long as the power supply to the op amp is at least around 12v as someone pointed out.

The mechanism is fairly simple...
The output voltage is divided by 2 and fed back to the inverting input, so with an output of 2vdc the inverting input has just 1vdc on it.
That means the input to the noninverting terminal must also be 1v because when the op amp is in linear mode the two inputs must be equal (or nearly so).
Now just turn it around so we can look at the input first and output second instead of the other way around as above.
If we input 1v to the noninverting input we get 2v out, and that is because 2v divides by 2 to get just 1v at the inverting input. The two inputs are equal so we must have the right solution.
Now with 2v at the noninverting input if we have 4v out then 4v divided by 2 equals 2v and that appears at the inverting input. Since the two inputs are equal we must have the right solution for the 2v input.
In a similar manner, we input 3v we get 6v out, we input 4v we get 8v out, we input 5v we get 10v out. The op amp could drop 1.5v at the output from the power supply voltage, so the max output would be about 10.5 volts.

The two RC input stages are just low pass filters which also function as an averaging circuit. The first RC stage averages the input, then the second RC stage averages the output of the first RC stage, so we get a somewhat smoother average out of the second RC stage. If we added a third RC stage it would get even smoother.
The reason it is not perfectly smooth DC is because the pulses on the input do not get perfectly smoothed by R's and C's alone. That's because the C's are discharging for some time after they are charged through the resistors. This improves with a larger value for both R and/or C, but the startup time will get longer (that's the time where the first output is dependably accurate).

There are a few catches here though.
First, the input offset of the op amp comes into play. Since the input offset of an LM358 is typical 2mv or less, when we multiply that by 2 we get 4mv, so the output could be off by as much as that just because of the input offset, and it could be plus or minus, although with a single positive power supply I think it's always positive.
Second, the input signal MUST go from the positive peak of the pulse to a nearly perfect zero volts at the low part of the cycle. That means if the input is a perfect 5v PWM, the bottom must be 0v exactly. If the bottom part is 1v, we don't get an average of that 5v PWM we get an average of a 4v PWM plus 1 volt. With a 0v to 5v PWM 50 percent duty cycle, the average is exactly 2.5v, and multiplied by 2 that's 5v output. If the signal goes from 1v to 5v PWM 50 percent duty cycle, then the average is 2v plus 1 volt (the offset) whic equals 3 volts, and multiplied by 2 that's 6v output.
So the difference is 5v vs 6v outputs depending on what the low state voltage of the input is.
Luckily, this is normally 0.1v to maybe 0.2v, so we don't get as much error. With 0.2v we end up with a 0.2v to 5v input, which averages to 2.4 volts, and then adding that 0.2v offset we end up with 2.6 volts output. So not the error is not too bad, 2.6v vs 2.5v. It's something to keep in mind though, and there are ways to correct for that error.
 

MisterBill2

Joined Jan 23, 2018
27,679
Looking back at the circuit in post #1, whatI see is a charge pump. What is "sort of implied" is that the voltage source is only pulses of voltage from an infinite impedance voltage source, so that the capacitors eventually charge to the pulse voltage amplitude and since there is nothing draw current, except the op-amp input current, they hold that charge. To function as intended the pulsesource must have a ZERO internal resistance in both the high and low states.
 
Top