17
\$\begingroup\$

There seems to be no shortage of circuits like this that attempt to use an R2R as a DAC and an op. amp. as an output buffer. These make sense to me so I decided to try and construct one.

enter image description here

I constructed a slightly simpler circuit

schematic

simulate this circuit – Schematic created using CircuitLab

This circuit uses a single op amp from an LM324 operating at unity gain. The other 3 in the package are left unconnected. It is driven from +12 VDC on the positive rail which comes from a bench power supply.

The "4.4k" (2R) resistors are really just two 2.2k resistors in series.

D1-D4 are running on an atmega328p using a wavetable direct digital synthesizer I wrote. I'm not going to talk about that much, but the microcontroller runs from +5 VDC so each line is either 0 or 5 VDC.

R13, Q1, and R14 were just so the circuit was driving some sort of real world load. The transistor is acting as an inverting amplifier.

I originally omitted R10 and R12. I got output like this.

enter image description here

  • CH1 - yellow - output of DAC
  • CH2 - blue - output of op. amp.

At this frequency it was pretty reasonable. enter image description here

  • CH1 - yellow - output of DAC
  • CH2 - blue - output of op. amp.

This rather unexpectedly produces a phase shifted triangular wave.

At this point I added R10 and R12.

  • CH1 - yellow - non inverting input of op. amp.
  • CH2 - blue - output of op. amp.

This cut the output voltage in half, but resulted in a more accurate output. That difference can theoretically be made up using gain in the op. amp.

However it still doesn't work at higher frequencies.

enter image description here

  • CH1 - yellow - non inverting input of op. amp.
  • CH2 - blue - output of op. amp.

In this case not only does it produce a phase triangular wave, it actually doesn't ever make it to +2.5 VDC or back to ground.

Here is a physical shot of the setup:

enter image description here

Since I am using jumper wires and breadboards there should be some upper limit to the practical frequency my DAC can produce. However the ~60 KHz my scope indicates shouldn't be much of an issue. The data sheet for the LM324 seems to suggest that 1 MHz is the practical upper limit for the op. amp. at unity gain. The output waveform shown seems like the transistors inside the op. amp. are saturated or a similar effect. I don't know enough about operational amplifiers.

Is there a change I can make to my circuit to get accurate reproduction of the input signal at the op amp output from DC to 60 kHz?

Datasheet I was looking at for the LM324:

http://www.ti.com/lit/ds/snosc16d/snosc16d.pdf

\$\endgroup\$
0

5 Answers 5

42
\$\begingroup\$

It seems like you are running into Slew Rate Limitations, and your output is presenting what is called 'Slew-Induced Distortion' - the Op-Amp's Output Swing is limited by the Slew Rate, so as frequency increases the limit for maximum output swing without 'Slew-Induced Distortion' decreases - typically Op Amps Datasheet have an 'Output Swing vs Frequency' plot.

Have a take a look at Figure 6 of the LM324 Datasheet, and where your signal is in the plot according to the scope captures you shared (see below). Ideally you'd want to stay "under the curve".

If you want to learn more about Slew Rate take a look at the 'Slew Rate' series in the Precision Labs for Op Amps training.

enter image description here

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Nice thorough answer. Brief and to the point. +1 \$\endgroup\$
    – user105652
    Commented Aug 1, 2018 at 22:27
14
\$\begingroup\$

The LM324 is an old and slow OPA. It has limited "slew rate", no more than 0.5 V/us, which doesn't allow to follow large amplitude signal changes faster than 1 MHz, as you found this in your own experiment.

enter image description here

There is nothing you can do to improve the slew rate. You need to procure a faster operational amplifier.

\$\endgroup\$
9
\$\begingroup\$

Try this datasheet instead.
Refer to Table 6.8 - Operating Conditions on page 7.
The 1st parameter in the table is the "Slew rate at unity gain".
This tells you how fast the opamp's output can move, and for this LM324 it's 0.5V/μs - and that's with almost no load (1MΩ || 30pF).

From your scope measurements it looks like you're seeing about 0.2 to 0.25V/μs - not entirely unreasonable with a load.

\$\endgroup\$
0
4
\$\begingroup\$

The general rule of thumb is that an op-amps full power bandwidth (upper limit) is about 10% or less of the unity gain frequency. Think about it.

Unity gain means you have reached a frequency where the gain is equal to one at best, under whatever test conditions the manufacture specifies. This is NOT a full strength output either. It simply means Vout = Vin at some value far less than full power.

A transistor with a hFE of 100 at 100 KHZ and full voltage swing may output 1 volt p-p at 1 MHZ, with a 1 volt p-p input. That's the best it can do.

The term "Unity gain" is a bit misleading because it implies usable gain, but in truth its gain has reached its limit. For full power output with stated gain take 10% of unity gain as a starting point.

Some manufactures go into elaborate details with charts for gain vs. frequency and load, etc. Read those details if they are on the datasheet and they will help make it clear where you can expect usable gain at full power - or not.

\$\endgroup\$
2
  • \$\begingroup\$ I would say that the useful frquency range for an opamp is about 1% of the gain-bandwidth. 1.5% for low accuracy applications. \$\endgroup\$ Commented Aug 1, 2018 at 3:51
  • 1
    \$\begingroup\$ @RobertEndl. If you include full gain and full bandwidth then yes, just a few percent of unity gain is all you will get. This is assuming low THD as well. \$\endgroup\$
    – user105652
    Commented Aug 1, 2018 at 22:31
4
\$\begingroup\$

Try this transistor circuit

schematic

simulate this circuit – Schematic created using CircuitLab

With a standard 10X scope probe on Vout (13pF or so), you'll have about 3 nanosecond (50,000,000 Hertz) bandwidth. Adjust R9 to control the output voltage baseline.

You can increase R3 to 220 or 330 or 430 ohms; at the higher resistance values, the Collector-base capacitance will rise when Vout is near 1.0v and you'll see slower settling. Thus a high-frequency non-linear behavior results (2nd harmonic distortion) and you'll get sum/difference intermodulation. With only 4 bits, I doubt this will be a problem for you. But you might scale up a few more resistors, to 6 or 8 bits, and feed with pre-canned sum-of-sin waveforms and then examine the FFT on a scope or Spectrum analyzer.


Performance Enhancement: if you can bias the bottom of the 2 resistors: R1 and R9, to -0.2 volts, then your linearity will improve, likely detectable for large #bits. Note the loading on the Logic Input lines is not consistent, and this also produces NonLinearities.

Using differential current steering, perhaps with bipolar current sources and diode-switches used to steer, reduces the Nonlinearity. At some point, you have expensively built a DAC08 from Precision Monolithics Corp, but with 20MHz to 50MHz bandwidth. Examine that datasheet.

http://www.ti.com/lit/ds/symlink/dac0800.pdf

\$\endgroup\$
2
  • \$\begingroup\$ Do Q1 and Q2 need to be matched or not (current gain, etc.)? How does a 20% difference in current gain (βF / hFE) affect this circuit? \$\endgroup\$ Commented Aug 1, 2018 at 20:35
  • \$\begingroup\$ Unless you require extreme temperature stability, this circuit is unperturbable---- the 4mA/10mA ratio permits ignoring Beta errors. And the 0.4 volt drop across R9 at maximum resistance allows random transistors to be inserted, even power devices versus small signal. If you do want temperature stability, consider the Harris/Intersil CA4046 or similar transistor arrays, with 5 devices on the same die. \$\endgroup\$ Commented Aug 2, 2018 at 3:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.