File: 18_opamp_ac.html

package info (click to toggle)
sch-rnd 1.0.10-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 17,696 kB
  • sloc: ansic: 119,120; awk: 1,502; makefile: 1,421; sh: 1,404; yacc: 905; lex: 172; xml: 160
file content (67 lines) | stat: -rw-r--r-- 2,307 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<html>
<body>
<h1> 18_opamp_ac: 2 slot opamp </h1>

<h2> Scope </h2>
<p>
A notch filter built with two opamps: this filter passes signals between DC
and 100 kHz but filters out 1 kHz signals. Demonstrated using a slotted
opamp with simulation.

<h2> The schematics </h2>
<p>
<center>
<a href="18_opamp_ac.rs"><img src="18_opamp_ac.svg" width=600px></a>
<br>Click the image to get the sch-rnd sheet</center>
<p>
More info on the circuit: <a href="https://www.electronics-tutorials.ws/filter/band-stop-filter.html"> www.electronics-tutorials.ws </a>

<h2> Preparing for simulation </h2>
<p>
The lm358 contains two opamps in a single physical package. For the PCB
workflow this is going to be a single footprint with 8 pins. For spice
simulation, two separate components are exported, one per slot. The problem is:
only slot 1's power terminals are connected! This is no problem for the
PCB workflow, where a physical connection between slots exists within the package.
For simulation, the trick is to set spice/shared on the power terminals on both
slots (4 terminals total). This tells sch-rnd to share the connection between
the same numbered terminals of different slots of the same symbol.
<p>
Other than this, everything else is pretty much the same as in
<a href="12_bjt_amp_ac.html">12_bjt_amp_ac</a>.

<h3> Raw spice commands </h3>
<p>
Same as in <a href="12_bjt_amp_ac.html">12_bjt_amp_ac</a>.

<h2> Export and run ngspice </h2>
<p>
Running ngspice the usual way on the export yields the following graphs:
<p>
<img src="18_opamp_ac1.png">
<p>
<img src="18_opamp_ac2.png">

<h2> Using other implementations </h2>
<h3> gnucap </h3>
<p>
<b>Gnucap throws errors: open circuit: internal node ...</b>
<p>
Gnucap uses a different command syntax. Modify the spice command symbol's
spice/command attribute to:
<pre>
print ac vdb(out) zp(out)
op
ac dec 10 1 1000k > plot.txt
</pre>
<p>
After the export, write the single word <b>spice</b> in the first line of the
file (e.g. using a text editor), otherwise gnucap won't know the file is in spice
syntax. Then run <i>gnucap 16_omapm_dc.cir</i> and it will dump a text
table to plot.txt that can be plotted using a suitable utility, e.g. gnuplot.
<p>
The <a href="gnucap/18_opamp_ac.rs">gnucap-modified schematic is also available.</a>

<h3> xyce </h3>
<p>
TODO