Simulating op-amp circuits using Multisim/Matlab

12 replies · 5K views · last reply
Fatima Hasan
Messages
315
Reaction score
14
Homework Statement
Find Vo for figure 1 & figure 2.
Find Vo, Vo1,Vo2 for figure 3
Figures are attached below.
Simulate using Multisim, MATLAB, or any Electrical software.
Relevant Equations
-
I tried to simulate the circuit shown in fig 1 using Multisim and here's my work:
Multisim schematic of an op-amp summing circuit with 741 op-amp U1, resistors R1 and R3 at 10kΩ and 20kΩ, R2 at 10kΩ, two function generators XFG1 and XFG2, +5V and -5V supplies, and an oscilloscope XSC1.

Multisim Function generator XFG1 settings dialog showing 1 kHz frequency, 50% duty cycle, 1 Vp amplitude and 0 V offset, beside its schematic symbol.
The result:
Function generator XFG2 settings dialog with square waveform selected, frequency 10 kHz, duty cycle 50 %, amplitude 400 mVp, offset 0 V, beside a schematic symbol labelled XFG2.
Screenshot of the Multisim Oscilloscope-XSC1 panel showing a flat trace at zero volts on a black grid, with Timebase 10 ms/Div and Channel A and Channel B both at 5 V/Div.


I do not know where is my mistake, could someone help me figuring out the problem?
Any help would be greatly appreciated!
 
Attachments
  • Circuit schematic of an op-amp summing amplifier using an LM 741: sine source v1 and square source v2 feed 10 kΩ resistors R1 and R2 into the inverting input, with 20 kΩ feedback resistor Rf and output vo.
    prob1.JPG
    47.1 KB · Views: 269
  • Circuit schematic of two LM 741 op-amp stages with a 10nF capacitor C1, a 10KΩ feedback resistor R1, a sine source vin, and outputs vo1, vo2 and vo3 labelled, with a diode and resistor at the output.
    prob2.JPG
    25.1 KB · Views: 257
Last edited:
In the SPICE simulators that I use, those input sources would need explicit ground connections. Otherwise they would just be floating...
 
berkeman said:
In the SPICE simulators that I use, those input sources would need explicit ground connections. Otherwise they would just be floating...
Here's my second attempt:
Multisim schematic of an op-amp circuit using a 741 op-amp U1 with VEE at -5V and VCC at 5V, two function generators XFG1 and XFG2, resistors R1 10k, R2 10k and R3 20k, and an oscilloscope XSC1 on the output.

Oscilloscope screenshot in Multisim showing a red periodic waveform with sharp jumps and slowly sloping segments around the zero line, with a Channel A scale of 2 V/Div and a timebase of 50 us/Div.


However, the result is not as expected to be.
 
It looks like in this version you shorted the opamp -VEE supply input to its output? I guess there is no connection dot at the intersection, so maybe they are not shorted. You should still move the -VEE power symbol off of the feedback wire, though.

Can you expand the oscilloscope trace out more so that the overall character of the startup transient can be seen? Maybe go out about 10x in timebase. Also, can you invert the colors of the oscilloscope display? It's hard to read the red trace on the black background. Thanks.
 
berkeman said:
It looks like in this version you shorted the opamp -VEE supply input to its output? I guess there is no connection dot at the intersection, so maybe they are not shorted. You should still move the -VEE power symbol off of the feedback wire, though.

Can you expand the oscilloscope trace out more so that the overall character of the startup transient can be seen? Maybe go out about 10x in timebase. Also, can you invert the colors of the oscilloscope display? It's hard to read the red trace on the black background. Thanks.
Multisim schematic of a 741 op-amp summing circuit with two function generators XFG1 and XFG2 feeding inputs through R1 10kΩ, R2 10kΩ and R3 20kΩ, output to oscilloscope XSC1, with VEE -5V and VCC 5V supplies.


Here's what I got:
Oscilloscope screenshot of Channel A showing a sine-like waveform with stepped, staircase segments, about four cycles across the 500 us/Div timebase, at 2 V/Div.
 
Thank you, much easier to see the 'scope output! That looks pretty reasonable if the two sources are configured as sin and square wave sources, which was your original problem statement, right? What are your settings for XFG1 and XFG2?
 
berkeman said:
Thank you, much easier to see the 'scope output! That looks pretty reasonable if the two sources are configured as sin and square wave sources, which was your original problem statement, right? What are your settings for XFG1 and XFG2?
Yes, XFG1: sine wave
Screenshot of the Multisim Function generator-XFG1 settings dialog showing sine waveform selected, frequency 1 kHz, duty cycle 50 %, amplitude 1 Vp, offset 0 V, beside the XFG1 symbol in the schematic.


XFG2: square wave
Function generator settings dialog showing the square wave waveform selected, 10 kHz frequency, 50% duty cycle, 400 mVp amplitude, 0 V offset, with the XFG2 block beside it on a schematic.


I am trying to get a result similar to this:
Oscilloscope screenshot in green on a grid: a square-wave envelope with bursts of triangle-like oscillations, alternating between higher and lower levels. Scope reads Tr:CH2 1 AC, pp(Tr):5.62V, time base 200 µs, CH2 1V.
 
Looks like you are close. Just adjust the frequency and amplitude of the two generators to get you that desired waveform...
 
berkeman said:
Looks like you are close. Just adjust the frequency and amplitude of the two generators to get you that desired waveform...
The amplitude and frequency are mentioned in the question.
Is this result acceptable or I have to adjust the scales?
Oscilloscope screenshot showing a green waveform of a rectified-looking periodic signal with timebase 2 ms/div and Channel A at 1 V/div in AC coupling; the trace has repeated positive and negative peaks with a dense, choppy shape.
 
Last edited:
From the picture in your Post #7 it looks like you have the frequencies and amplitudes of the square and sine backwards? Double-check the original problem statement and match those settings...
 
  • Like
Likes   Reactions: Fatima Hasan
berkeman said:
From the picture in your Post #7 it looks like you have the frequencies and amplitudes of the square and sine backwards? Double-check the original problem statement and match those settings...
I solved all the parts, can you please check my results?
figure 1:
Oscilloscope trace of a periodic waveform with a square-wave-like envelope, switching between a high segment and a low segment, each filled with fast oscillations, on a grid with dashed gridlines.

Figure 2 & Figure 3:
Two Multisim op-amp circuit schematics with function generator panels. Figure 2: XFG4 feeds R5 10k into a 741 inverting-style stage with C1 10nF feedback to XSC2. Figure 3: XFG3 drives a 741 stage, C2 10nF couples to a second 741 with R4 10k feedback, then diode S1 and R6 1k to ground, monitored by XSC3, XSC4 and XSC5.


Result of fig2 :
Oscilloscope screenshot showing a red triangular waveform oscillating about zero, with a timebase of 1 ms/Div and Channel A at 10 V/Div; cursor readings show -4.116 V at 9.000 ms.

Results of Figure 3 (Vo1,Vo2, & Vo, respectively):
Oscilloscope screenshot showing a square wave on a 500 us/Div timebase with Channel A at 5 V/Div DC; the trace alternates between a high level and a low level, with a time readout of T1 and T2 at 0.000 s and Channel_A reading 4.115 V.

Oscilloscope screenshot showing a red trace of a waveform: flat plateaus with decaying oscillations between them, on a grid with the channel A scale at 5 V/div and timebase 100 us/div.

Oscilloscope screenshot with a green trace showing a series of decaying spikes and two flat-topped pulses on a dashed grid; Channel A at 5 V/Div, timebase 100 us/Div, cursor readings 1.801 ms and 2.087 V.


I am not sure about Vo in figure 3, because the value of the rightmost resistor in figure 3 is not written. I assume it's 1k,. This is the color code of it, I did a search but did not get the right value:
Close-up photo of a beige axial resistor with four colour bands, reading from left to right: brown or red-brown, red, red, and a fourth band, mounted on a white perforated board.


Thanks,
 
Attachments
  • Oscilloscope screenshot of a red waveform on a grid: a decaying oscillation, then a flat-topped plateau, then a larger oscillation that decays again, with a measurement table reading 1.801 ms and 2.788 V.
    3_vo2.JPG
    64.2 KB · Views: 245
For Figure 1 -- does your simulator let you adjust the phase of your sources? If so, I'd play with the phase (or delay) of the sine wave to get your simulation to better match the 'scope picture. You can see how the relative phase of the sine and square waves is causing an initial offset of the sine that appears to droop across the plateaus of the square wave. Adjusting the phase of the sine so that it is mid-waveform at the square wave transitions should get rid of that.

Figure 2 is an integrator, so getting a tri wave out for the square wave input seems right.

Figure 3 has a differentiator as the 2nd stage, so the tri wave input giving a square wave output looks right. I'm not understanding the final waveforms yet, though...
 
berkeman said:
For Figure 1 -- does your simulator let you adjust the phase of your sources? If so, I'd play with the phase (or delay) of the sine wave to get your simulation to better match the 'scope picture.
In the function generator, I can change the amplitude, frequency, and the offset, if I use it as sine wave. If I use it as square wave, I can change the duty cycle too.
berkeman said:
Figure 3 has a differentiator as the 2nd stage, so the tri wave input giving a square wave output looks right. I'm not understanding the final waveforms yet, though...
As our instructor said, the 1st stage is comparator, so the result would be a square wave ( Vo1). The 2nd stage is a differentiator, so the result would be as follows:
Oscilloscope screen showing a cyan trace of alternating square-wave sections: rapid triangular zigzags alternating with flat plateaus at two levels, with a final step up near the right edge.

The 3rd stage is a rectification and the result should be as follows:
Oscilloscope screen showing a waveform with a series of narrow positive and negative spikes alternating with flat segments, the flat levels near the middle of the grid and the spikes reaching the top and bottom of the display.

(No negative pulses)
which is the output of the time-maker.