Platenspeler.Com

 

Opamp Calculations

Page last modified: 31-oct-06

Adding from day to day...


Introduction

When building my first gainclone I stuck to the well known and published designs for a non-inverted GainClone. However, like everybody I like to know why I'm using a particular resistor or capacitor value and what the effect of other values will be on the amplifier output.

Just when I thought I understood some more about OpAmps I decided to build PhonoClone, a Phono equaliser with MM and MC input with OpAmps. Here I discovered that noise, drift and stability are difficult to master.

Some of the paragraphs on this page therefore refer to GainClones, some to preamps and some to both.

  1. General Opamp Background
  2. Gainclones
  3. Phonoclones (preamps)
  4. References and Links

What's the problem?

With Power OpAmps everybody uses the same designs, there is a inverted and a non-inverted configuration and basically I do not often read about real "new" designs for GainClones. Almost everybody is copying the Thorsten design for an inverted GainClone (which is a little strange since the original is said to have a non-inverted design) and there is no real innovation other than in component selection and housing.

But probably these people do it for good reasons (sound quality), and therefore I'm challenged to build my own version of an inverted OpAmp.

Also, I would like to get clear the pro's and con's of the inverted configuration for my projects. The original GainCard is said to have a non-inverted configuration but most people claim to get a better sound with the inverted configuration. Also, distortion is said to be less with the inverted setup, though I do not care about these figures as long as they are at a level I cannot hear them.

Well, if you encounter the same issues while building you own clone, then this page is for you. I hope that others learn from my experience. According to my wife I do not learn enough myself so at least someone else has the benefit ;-)


General Opamp Info

The 2 Big Rules

There are 2 big rules in OpAmp design, and these determine for a great deal what we can do with Opamps. The rules are:

  1. There is no current on the inputs of the OpAmp
  2. The voltage between both inputs of the OpAmp is 0.

From these two rules the equations for gain calculation result as well as some other important design considerations. Since there are inverted and non-inverted amps, what does this mean for the two amplifier designs?

Gain of the non-inverted configuration

OK, Lets look at the two ground rules as defined above. The is no current from/to both positive and negative input. Therefore, there must be the same current i in both R1 and R2. Let's assume the voltage Vx on the junction of R1 and R2, then
V_out - V_x = i * R2
and V_x - 0 = i * R1 (Ohms law).

Given Ground Rule number 2, V_x must be equal to V_in+ , we get for both equations above:

V_out - V_in- = i * R2
and V_in- = i * R1.

Since i is equal in both equations, we get:

(V_out-V_in-)/R2= V_in- /R1

where V_in- equals V_in+ (=the input for the amp) thus the gain, defined as the relation of the output voltage divided over the input voltage is:

V_out/V_in -V_in/V_in = R2/R1 and therefore V_out/V_in=1+R2/R1 and this relation between output voltage and input voltage is the gain we get with this amplifier.

In the non inverted mode, the following formula therefore defines the gain of the OpAmp:

Avc = 1 + R2/R1

Gain for inverted configuration

For inverted Gainclones, the same ground rules apply as described above. Therefore, the current through R1 is the same as the current through R2.

V_in- - V_in = i * R1 and V_out-V_in- = i * R2.

If we apply Ground rule 2, then V_in+ is grounded and therefore the voltage on the negative input V_in- must also be 0 Volts. Therefore,

V_in- - V_in = -V_in = i * R1 and V_out=i * R2.

And as a result, the gain is given by:

Avc = V_out/V_in = -R2 / R1

Not all OpAmps are stable at low gain. In most cases a gain of 5 or 10 is required to keep Opamps in stable operating conditions. There are unity-gain stable OpAmps though and these are easy to use since they have no special gain requirements.

If an Opamp is used in a filter, such as a RIAA reproduction filter, then make sure that the gain even in high-frequencies is high enough for that particular type of OpAmp. In my first phono-preamp I forgot this :-) In filter setup such as my RIAA preamp, R2 often has a parallel capacitor to reduce gain for higher frequencies. See for more info on filters the background pages on RIAA filtering, where simple and complex filters for Opamps are discussed.

Current Amplifier

There is another type of amplifier to be discussed: The current-to-voltage amplifier (or Transimpedance amplifier).

This type of amp is used for amplification of devices that behave more like a current source than a voltage source. The opamp is used to transform the current input in a voltage output. Since the non-inverting input of the opamp is grounded, at the inverting input the will be no current. The current coming from the input device will therefore go through the feedback circuit connected between the opamp output and the inverting input.

The op-amp provides the output voltage necessary to equalize these currents with the inverting input voltage held equal to the non-inverting input voltage (which is zero since it's connected to ground).

V_out = V_fb = - I_source * R2.

In case of a MC cartridge in the inverting input of an opamp, the cartridge is effectively shorted (zero impedance). As a result, the current is much higher than with the traditional voltage amp where the cartridge is loaded.

Avc

The above formula for gain is usable in most situations. But the gain of an Opamp does not follow the ideal line in all areas of it's frequency curve. The real gain for AC is a more complex formula:

A_vc = (-A_v*R2/(R1+R2))/SQRT{[A_v^2 + (1+R2/(R1+R2)]^2}

Here A_vc is the OpenLoop gain of the OpAmp ...


GAINCLONES

For a discussion on the gainclone goals, construction etc. read the pages on Geenkloon, Gainclown and Cyclone

Most, if not all rules for regular Opamps are also valid for Power Opamps used in Gainclones. But since the amplification of these Opamps is lower than for most regular ones and their purpose is to deliver power (current) for speaker systems in the audio frequency range, there are special considerations for Power Opamps.

Schematic of non-inverted configuration

The simplified GainClone design looks like this (or in any case mine does):


The capacitor C1 defines the -3dB point for the high-pass filter which ensures unity gain at DC and is defined by F_b=1/(2*pi*R_1*C_1). In the non-inverted design of GeenKloon the frequency pole is at 7.23 Hz which is good enough.

Schematic for inverted configuration

The schematics for the inverted amp are (simplified) as follows:

The Gain is calculated as follows: Avc = -R2/R1. In the figure above this would mean that the gain is 200,000/10,000=20 which is about 26dB.

The inverted configuration at first does seem to be the simpler of the two. However, there are a few things to keep in mind when building an inverted Gainclone:

Volume Control

It is important to remember that every resistance in series with the input resistor influences the gain according to the formula above. In the background article on a 12-step attenuator switch it is explained how the effective gain of an inverted configuration changes as a function of the input impedance of the switch or pot.

Input Bias

According to the literature, the resistor R3 in the inverted design should be chosen such that the Input Bias Current I_b is optimal. It is advised to choose R3 according to the following formula:
R_3 = (R_1*R_2)/(R_1+R_2), which is the value of R1 and R2 in parallel. In the inverted design of the picture above the ideal value for R3 would be 9,500 Ohms, which will probably result in a standard value of 9,100 or 10,000 Ohms.

Avoiding DC components

The capacitor of 2.2uF is to prevent DC components present on the input to be amplified to the output (destroying your speakers). Since the amplification of the inverted circuit is more critical than the non-inverted design, this cap is highly advised.

Power transformer Sizing

In case of the LM3875, there are some guidelines for designing your own power supply. The formula according to the datasheets is: Vdc=SQRT(2 * R_load * P_out) Where P_out is the desired Power rating for the given load R_load. In case of a 8 Ohms speaker and a 40Watts output power this would mean a Vdc voltage of 25.3 Volts. The datasheets calculate a 5Volts drop for the LM3875, a 15% regulation loss and a 10% overhead for Lo-Hi power line variation. This would lead to a maximum Vdc of 34.15 Volts.

The current requirements of the LM3875 are also found in the datasheets (and elsewhere. The formula for calculating the current is: I_max=SQRT(2*P_out/R_load). As shown below, the transformers used in my GeenKloon are sufficiently oversized to deal with the power requirements at 40Watts/8Ohms.

Formula: V_dcmax = (SQRT(2* R_load*P_out)+(5*115%))*110%

Hmm, I used an Amplimo 225VA transformer of +/- 22Volts. This means 5.11A per secondary. The 22Vac after the rectifying bridge results in a non regulated Vdc = 22*SQRT(2) is 31.11 Vdc.

This tells me that in any case my power supply is close to the ideal power/voltage rating for an 8 Ohms gainclone with 40Watts output. And since my speakers impedance might easily drop below the 8 Ohms impedance (4 or 6 Ohms) a lower value is OK anyway.

Power Rejection

One of the parameters that are important for power supply design is the Power Supply Rejection Ratio (PSRR) of the OpAmp chip. It is defined as follows: PSRR=V_io/V_cc (delta of the Input offset voltage divided by the delta in the Power supply voltage). That means that for the output of the OpAmp (which is defined by the Gain formula) the following is true (V_s is ripple on V_cc):

V_out=(1+R2/R1)*V_s*PSRR

If the Powersupply (non regulated) has a ripple of 2 Volts, and the Amp has a PSRR of 120dB (typical for LM3875) which equals a PSRR of 10e-6 in the formula. The ripple on the output as a result of the poor power supply regulation is:
V_out=(1+20000/1000)*2*10e-6 = 40uV.

Hmm, I recalculated this one, it's smaaallll. Nothing to worry about.


Phonoclones & Preamplifiers

Intro

Of-course OpAmps are often used in signal amplification, buffering etc. Manufacturers have Opamps in a wide variety to suit different kinds of application. There is high-precision, low-noise, wide-band etc. types available.

For my application, in particular the first stage of a phono amplifier, I'm looking for a stable Opamp with low-noise and preferably high-precision and high slew-rate.

Inverted or non-Inverted?

For preamps with a high gain and a high impedance, it is not simple to use the non-inverted design as the impedance will have it's effect on the amplification of the circuit. In non-inverted designs, the input impedance is handled by the positive input while the negative input handles the gain. This make the non-inverted design the most flexible of the two.

OpAmp Noise

When I started my PhonoClone project, I discovered that regular OpAmps when used in preamps for example as a MC cartridge amplifier suffer from noise. Noise comes from the OpAmps themselves and from resistors and other components used in the amplifier. And noise which is presents close to the input of the amp will be amplified with the amplifier just like the signal.

I made a few prototypes of the PhonoClone with the goal to reduce noise in every version. In order to have a more structured approach to noise I decided to look up the necessary background in literature.

Voltage Noise (V_n) is often specified in V/SQRT(Hz). This value is in datasheets specified for a specific frequency, therefore it's value is called spot-noise. In most datasheets the Voltage noise is specified at 1000 Hz. This by the way implies that a value of 0.9nV/SQRT(Hz) means that at 1kHz is equivalent to 0.9e-9= V_spot/SQRT(1000)=V_spot/31.62 and therefore V_spot = 0.9e-9/31.62 = 28.5pV hmmm....

The output Voltage noise V_onv resulting from equivalent noise generated by Vn is
V_onv = (R1 + R2)/R1 * V_n which is also the normal gain formula for a non_inverting OpAmp.

Apart from the Voltage noise there is current noise coming from the first stages inside the Opamp. The output noise from input current I_n is
V_oni = ( R2 * I_n ) where R2 may be substituted for Z_2 in case R2 is not a resistor.

The total resulting output noise (V_on) for the Opamp is the effective value given by:

V_on= SQRT( V_onv^2+ V_oni^2 )

The minimum value for V_on is when V_onv and V_oni are equal. And this after some rearrangements means that

V_n / I_n = ( R_1 * R_2 ) / (R_1 + R_2 )

 

Noise Minimization

The noise is minimal when Noise Resistance of the OpAmp is equal tot the parallel resistance of R1 and R2:

R_n = V_n/I_n = R1 * R2 / (R1 + R2)

For the AD797 the value of V_n is according to the datasheets 0.9 nV/SQRT(f) for 1kHz and I_n is 2.0 pA/SQRT(f). Therefore the Noise Resistance is given by: 0.9E-9/2.0E-12=900/2=450. Since the amplification, related to the division of R2 over R1, is high for a phono amp, R2 will be many times larger in value than R1. This means that in order to comply with the above formula, R1 will be close in value to R_n.

This probably means that I'll have to check my choice for R1 and R2 in the PhonoClone v3 designs where R1 is 20 and R2 is 2400 Ohms. In the equation this gives 20*2400/(20+2400) = 19.83

So therefore I'm doubting whether I made the right decision changing the resistors in the PhonoClone from 160k/1k to 2k4/20 Ohms. On the other hand, resistors add their own noise as well.

Opamps and Filtering

For those interested in reading more about Opamps and RIAA filter design, there is a separate section on the RIAA background pages on opamps including a page where PhonoClone design is explained.


References and Links

  1. My GeenKloon amplifier project (a GainClone), Non-Inverted LM3875.
  2. The Gainclown project: Inverted clone based on LM1875
  3. D.F. Stout - M. Kaufman: Handbook Micro Electronics, Kluwer 1984, ISBN 90-6215--675
  4. George Rose: Electronica Formules, Kluwer 1975, ISBN 90-2010-798-5
  5. On-Line introductionary course in opAmps (Geoff Martin)

© Maarten@platenspeler.com; 2002, 2003, 2004, 2006