| eCircuit Center |
|
|
About SPICE |
SPICE Basics | Running SPICE
| CIRCUIT COLLECTION |
SPICE Commands | SPICE Demos and Downloads |
Op Amp Summing AmplifierCIRCUIT
OPSUM.CIR Download the SPICE file The summing amplifier is a handy circuit enabling you to add several signals together. What are some examples? If you're measuring temperature, you can add a negative offset to make the display read "0" at the freezing point. On a precision amplifier, you may need to add a small voltage to cancel the offset error of the op amp itself. An audio mixer is another good example of adding waveforms (sounds) from different channels (vocals, instruments) together before sending the combined signal to a recorder. Although, there are many ways to make a summer, this one is nice because it keeps the interaction between inputs at a minimum. What does that mean for you the designer? You can change the gain or add another input without messing with the gains of the other inputs. Just remember that the circuit also inverts the input signals. Not a big deal. If you need the opposite polarity, put an inverting stage before or after the summer.
SUMMING ACTION The summing action of this circuit is easy to understand if you keep in mind the main "mission" of the op amp. It's a simple one: keep the potential of the negative terminal very close to the positive terminal. In this case, keep the negative terminal close to 0V (virtual ground). The op amp essentially nails one leg of R1, R2 and R3 to a 0V potential. This makes it easy to write the currents in these resistors.
So what's the current I flowing in RF? According to our friend Kirchoff, we get
Finally, notice that one leg of RF is also kept at 0V. So the output becomes Vo = -RF x I. Combining these pieces of information, we have a simple description of the amplifier
As you can see, the gain for each input can be controlled by a single resistor.
SUMMING AMPLIFIER In this circuit, there's three waveform - sine, square, and triangle- you can add any way you like. Initially, only R1 is in the circuit. R2 and R3 are commented (*) out. But, you can add the other resistors by removing the * at the beginning of the R statement. CIRCUIT ANALYSIS Run a simulation of OPSUM.CIR. Plot the output V(11) to see the output due to V1 only. What is the gain of V1 input? Because R1=RF=10k, the gain is - 10k / 10k = -1V/V. Now, add R2 to the circuit by removing the * and rerun the simulation. Can you see the single cycle of the square wave added to the output V(11)? Add in R3 to sum the triangle wave with the others. To look at the input sources themselves, add traces V(1) sinewave, V(2) square wave and V(3) triangle wave. HANDS-ON DESIGN Suppose you need to add different amounts of each input. For example, to increase the square wave level by a factor of 10, decrease R2 to 1k making the gain GAIN_V2 = - RF/R2 = -10k/1k = -10. Check out your new output. Likewise, increase or decrease R1-R3 to see their effect on the output waveform.
FOURIER SERIES - SAWTOOTH WAVEFORM GENERATOR You can create a basic sound synthesizer by adding a number of sinewaves to generate various waveforms (saw-tooth, square-wave, violin sound, clarinet, etc.) What is the exact recipe for a particular waveform? Fourier Analysis is a magical tool that takes a waveform (sound for example) and breaks it down into some basic ingredients: a sinewave at some fundamental frequency fo, plus, other sinewaves at harmonic frequencies 2 x fo, 3 x fo, and so on. For example, to cook up a saw-tooth waveform at 100Hz, Fourier Analysis tells us the ingredients are as follows V(t) = sin( 2π 100Hz t ) + (1/2) sin( 2π 200Hz t ) + (1/3) sin( 2π 300Hz t ) + ... Only the first three terms of Fourier Series are shown here. To simulate them, you'll need three voltage sources, one at the fundamental and two harmonics.
Next, the precise amount of each component has to be added together. From the Fourier Series, we see we need gains of 1, 1/2 and 1/3. These can easily be designed with R values like
HANDS-ON DESIGN Copy the above voltage sources and Rs into the summing circuit (Comment out the initial voltage sources and resistors.) Then, take your home-grown saw-tooth waveform out for a spin. To get a better view, extend the Transient Analysis to 20 ms to see two cycles of the output. As you can see, with only three components of the Fourier Series, the waveform actually starts looking like a saw-tooth. Want a better looking saw-tooth? Add some more sinewave components following the pattern: V4 at 400Hz with R4=40k, V5 at 500 Hz with R5=50k, and so on.
SQUARE-WAVE GENERATOR For a square wave, the Fourier Series looks like
What's different about this recipe? Only the odd harmonics are needed (100 Hz, 300 Hz, 500 Hz,...) To simulate the square wave, take your saw-tooth generator and place a comment * at the beginning of the even numbered voltage sources and resistors, leaving only the odd ones. How many components do you need for a decent looking square-wave?
SPICE FILE Download the file or copy this netlist into a text file with the *.cir extention. OPSUM.CIR - OPAMP SUMMING AMPLIFIER
*
* SINEWAVE 4KHZ
V1 1 0 SIN(0V 1VPEAK 4KHZ)
* SQUARE WAVE 100HZ
V2 2 0 PWL(0MS 1V 5MS 1V 5.01MS -1V 10MS -1V)
* TRIANGLE WAVE 500HZ
V3 3 0 PWL(0MS -1V 1MS 1V 2MS -1V 3MS 1V 4MS -1V
+ 5MS 1V 6MS -1V 7MS 1V 8MS -1V 9MS 1V 10MS -1V)
*
* INPUT Rs
R1 1 10 10K
*R2 2 10 10K
*R3 3 10 10K
* FEEDBACK R
RF 11 10 10K
*
* OPAMP
XOP 0 10 11 OPAMP1
*
*
* OPAMP MACRO MODEL, SINGLE-POLE
* connections: non-inverting input
* | inverting input
* | | output
* | | |
.SUBCKT OPAMP1 1 2 6
* INPUT IMPEDANCE
RIN 1 2 10MEG
* GAIN BW PRODUCT = 10MHZ
* DC GAIN (100K) AND POLE 1 (100HZ)
EGAIN 3 0 1 2 100K
RP1 3 4 1K
CP1 4 0 1.5915UF
* OUTPUT BUFFER AND RESISTANCE
EBUFFER 5 0 4 0 1
ROUT 5 6 10
.ENDS
*
* ANALYSIS
.TRAN 0.05MS 10MS
* VIEW RESULTS
.PLOT TRAN V(11)
.PRINT TRAN V(11)
.PROBE
.END
© 2002 eCircuit Center |