06.pdf

(1825 KB) Pobierz
Contents
6.1 Circuit Simulation Overview
6.1.1 Hobby Circuit Simulation versus
Circuit Simulation in Industry
6.1.2 Real Circuits versus Simulations: The
Difference
6.2 Computer-Aided Design Examples
6.2.5 Example 5: Simulating the
Simulator
6.2.6 Example 6: SPICE and
Intermodulation Modeling
6.2.7 Circuit CAD in the Radio
Amateur’s Toolbox
6.3 From CAD to CAM: Using Circuit
CAD Tools for Circuit Board
Production
6.3.1 From Pins and Wires to Pads,
Traces and Vias
6.4 References and Further Reading
6.2.1 Example 1: A Two-JFET VFO and
Buffer
6.2.2 Example 2: Modeling a Phase-Lead
RC Oscillator
6.2.3 Example 3: Exploring Issues of
Modeling Gain, Link Coupling and
Q with a 7-MHz Filter
6.2.4 Example 4: Checking Reality with a
10-dB Attenuator
752932119.105.png
Chapter 6
Computer-Aided
Circuit Design
6.1 Circuit Simulation Overview
That computers are now used wherever information is generated, communicated and used
is everyday knowledge. We expect, or at least can infer if we take a moment to think, that a
computer was used to type and typeset these words, and to compose the pages of this book
and to design its cover. Thinking a bit more deeply, we realize that computers are used in just
about every phase of product design and process design and control, including the electronic
devices we use at work and play. The widespread application of computers is possible because
computers are, at base, generic math machines. The TV set you watch, the radio transceiver
which with you talk to the world, is a math machine — math put to work in the form of a
kinetic sculpture built from copper, carbon, plastic, silicon and steel. You feed radio (or audio)
and ac-line energy — both of which can be readily described numerically — in. The TV or
radio performs mathematical operations on those inputs, and a desired, quantifiable result
comes out: a sound, a moving picture, a Field Day contact, a declaration of rook to queen’s
bishop three from a chess opponent in Spain.
Because radio-electronic circuitry “just does math,” math can predict and analyze the action
of electromagnetic signals and the radio-electronic circuitry we build to produce and process
them. Program an electronic computer — which, at base, is a generic math machine — to do
radio/electronics math in practically applicable ways, and you’re ready to do computer-aided
design (CAD) of radio and electronic circuits. (Program a computer to do radio-electronics
math in real time , and you’re ready to replace radio-electronics hardware with software, as
this book’s DSP and Software Radio Design chapter describes.)
This chapter, by David Newkirk,
W9VES, introduces Amateur Radio
builders and experimenters to fun-
damentals of using computer-aided
design (CAD) tools for RF design.
These tools enable the hobbyist
to harness the circuit-simulation
power employed by professional
electronic and RF engineers work-
ing in large-scale electronic and RF
design and production for industry.
This chapter is about generic
circuit CAD tools capable of
handling arbitrary circuit topologies.
Software to aid design and analysis
in specialized areas, for example
RF filters, switchmode power
supplies, transmission lines and
RF power amplifiers, is covered in
other chapters.
6.1.1 Hobby Circuit Simulation versus Circuit Simulation in
Industry
Professional-grade circuit simulation software exists to facilitate the construction of tightly
packaged, highly integrated, no-tweaking-required modern electronics/RF products. These
products work predictably well even when reproduced by automated processes in large
quantities — quantities that may, with sufficient marketing success and buyer uptake, exceed
millions of units.
Manufacturers of specialized electronic design automation ( EDA ) software serve the engi-
neering needs of this industry. Through comprehensive CAD suites, one may proceed from
graphical component-level circuit and/or IC design ( schematic capture ), through simulation of
circuit and IC behavior (often using a variant of the simulator called SPICE , but increasingly
with non- SPICE simulators more fluent in issues of RF and electromagnetic design), through
design of PC board and IC masks suitable for driving validation, testing and production.
Comprehensive EDA CAD reduces costs and speeds time to market with the help of features
that can automatically modify circuits to achieve specific performance goals ( optimization );
predict effects of component tolerances and temperature on circuit behavior across large
populations of copies ( Monte Carlo analysis ); and generate bills of materials (BOMs) suitable
for driving purchasing and procurement at every step of the way.
Free demonstration versions are available for some EDA CAD products (see Table 6.1 ),
and a subset of these are especially useful for hobby purposes. Although these demoware
tools come to us with a large-scale-production pedigree, they are greatly (and strategically)
Computer-Aided Circuit Design
6.1
752932119.116.png 752932119.127.png 752932119.138.png
Table 6.1
Some Sources of Freeware/Demoware Simulation, Schematic and Layout CAD Software
Source
Address
Resource
Ansoft
www.ansoft.com/
Ansoft Designer SV 2 (schematic, linear RF simulator, planar
electromagnetic simulator, layout [PCB] design), more
Cadence Design Systems
www.cadence.com/
OrCAD 16 (schematic, SPICE simulator, layout [PCB] design)
CadSoft
www.cadsoft.de/
EAGLE schematic and layout design
www.cadsoftusa.com/
gEDA
www.gpleda.org/
GPLed suite of electronic design automation tools
Kicad
iut-tice.ujf-grenoble.fr/kicad/
GPLed full-function schematic and layout design
Linear Technology Corp
www.linear.com/
LTSpice (schematic, SPICE simulator enhanced for power-system
design)
SPICE: What’s in a
Name?
SPICE — Simulation Program with
Integrated-Circuit Emphasis — origi-
nates from the Electrical Engineering
and Computer Sciences Department of
the University of California at Berkeley
and irst appeared under its current
name as SPICE1 in 1972. “SPICE” ,
write the maintainers of the oficial
SPICE homepage at bwrc.eecs.
berkeley.edu/Classes/icbook/SPICE/ ,
“is a general-purpose circuit simulation
program for nonlinear dc, nonlinear tran-
sient, and linear ac analyses. Circuits
may contain resistors, capacitors, induc-
tors, mutual inductors, independent volt-
age and current sources, four types of
dependent sources, lossless and lossy
transmission lines (two separate imple-
mentations), switches, uniform distribut-
ed RC lines, and the ive most common
semiconductor devices: diodes, BJTs,
JFETs, MESFETs, and MOSFETs.”
That SPICE is “general-purpose”
does not mean that its usefulness is
unfocused, but rather that it is well-
established as a circuit-simulation
mainstay of comprehensive power. A
wide, deep SPICE ecosystem exists
as a result of decades of its daily use,
maintenance and enhancement by
industrial, academic and hobby users.
Many excellent commercial versions of
SPICE exist — versions that may be
improved for workhorse use in particular
subdisciplines of electronics, power and
RF design.
Throughout this chapter we will use
a particular commercial variant of the
SPICE simulator: PSpice as embodied
in Cadence Design System’s OrCAD
16.0 EDA CAD demonstration software
suite. With those particulars declared,
we will usually refer to the underlying
simulator merely as SPICE , expecting
and intending that simulations pre-
sented in this chapter will be duplicable
with any modern commercial SPICE
variant. Only details associated with
value-added features, such schematic
and layout editing and simulation-results
reporting, will vary.
CAD Software and Your Computer’s Operating
System
The OrCAD 16.0 and Ansoft Designer SV 2 demoware packages used in this
chapter, and most other CAD products you’re likely to use, are compiled to run under
Microsoft Windows . So what if you want to run RF and electronics CAD software
under Linux or on the Mac?
You’re in luck. EAGLE schematic and layout software is available in native versions
for Windows , Linux , and the Macintosh. The GPLed EDA application suite, gEDA , are
primarily developed on Linux , but are intended to run under, or at least be portable to,
POSIX -compliant systems in general. The GPLed schematic and layout editor Kicad
runs natively under Windows and Linux , and has been tested under FreeBSD and
Solaris . Further, the great strides made in the Wine translation layer ( www.winehq.
com/ ) allow many applications written for Windows to run well under the operating
systems supported by Wine , including Linux and the Macintosh.
In your writer’s experience, MicroSim DesignLab 8 (a widely distributed precursor
to OrCAD 16 that can run all of the SPICE examples described in this chapter) and
Ansoft Serenade SV 8.5 (a precursor to Ansoft Designer SV 2 ) can be run in Wine
under Linux with few artifacts and their expected schematic-capture and simulation
capabilities intact. Cursor handling in OrCAD 16 installs under Wine readily enough.
but cursor-handling artifacts in its schematic editor, at least in the computers tried,
seems to preclude its use under Wine for now. Ansoft Designer SV 2 installs but does
not properly start.
All things considered, however, especially as Wine and CAD applications continue
to strengthen and mature, running your favorite Windows -based applications under
Wine is well worth a try.
feature-limited. Only a relatively few com-
ponents, often representing only a subset of
available component models, may be used per
simulation. Monte Carlo analysis, optimiza-
tion, BOM generation and similar enhance-
ments are usually unavailable. Demoware is
intended to drive software purchasing de-
cisions and serve as college-level learning
aids — learning aids in college study toward
becoming electronics/RF professionals who
will each day work with the unlimited, full
versions of the demoware.
The radio hobbyist’s circuit-simulation
needs are much simpler. Most of us will build
only one copy of a given design — a copy that
may be lovingly tweaked and refined to our
hearts’ content far beyond “good enough.”
Many of us may build as much with the intent
of learning about and exploring the behav-
ior of circuits as achieving practical results
with them. A demoware circuit simulator can
powerfully accelerate such self-driven explo-
ration and education in electronics and RF.
6.1.2 Real Circuits versus
Simulations: The Difference
Having just finished stuffing and soldering
the PC board for a binaural CW receiver, you
find yourself in need of a 7-MHz local oscil-
lator (LO) to drive it. The receiver designer
has provided just such a circuit: a junction
field-effect transistor (JFET) Hartley oscil-
lator driving a JFET amplifier to an output
power of +10 dBm. You obtain the parts,
perhaps substituting components with close-
enough values here and there as your junk box
suggests and your experience allows. Having
completed its construction, you interconnect
it, the main receiver board, a power supply,
headphones and an antenna. You power up
the receiver, hear 40-meter signals, and —
6.2
Chapter 6
752932119.001.png 752932119.012.png
 
perhaps with the aid of a frequency counter
or second receiver — adjust the tuning range
of your new LO to cover your favorite part
of the band. Another project done, another
success achieved — what could be simpler?
Certainly not modeling the same circuit in
circuit-simulation software — precisely be-
cause all actions in the real world are always
maximally and unimaginably complex .
The components we use to build real cir-
cuits always operate to the full robustness of
their intrinsic properties, their simplicity to
our mind’s eye notwithstanding — regardless
of our relative ignorance of what those proper-
ties may be and how and why they operate the
way they do. No real-world component oper-
ates ideally. Nothing — excepting, perhaps,
events in the realm of quantum physics — is
sketched in, so far as science has been able to
determine. So it is that we may set out to build
an amplifier only to discover at power-up that
we have instead built a persistent oscillator. So
it is that we may design, successfully build,
and publish a circuit intended to be an oscil-
lator only to discover that for 3 out of every
100 subsequent reader-builders it does not
oscillate at all!
When we take the “just build it” approach
with circuit simulation software — that is,
when we expect components to “just work”
as they do in real-world circuits — we may
run into trouble rapidly. This can happen be-
cause the electrical and electronic compo-
nents available in circuit simulators are only
mathematical models of real-world compo-
nents — because every modeled behavior of
every modeled component is only sketched
in relative to the behaviors of its real-world
counterpart. Simulated component character-
istics and behaviors approach those of real-
world components only as closely as science
may allow and only as closely as the simula-
tor’s designers, engineers and users need its
simulations to mirror real-world behaviors to
meet their design goals. Once a design works
well enough, reproducibly enough, cheaply
enough, it goes into production, ultimately to
ship in the hundreds, thousands or millions.
Finalizing an Amateur Radio circuit design
is less spectacular in comparison. Even if the
designer of our figurative VFO provided a
quantitative specification for its performance
— +10 dBm output — we very likely will
not ultimately confirm whatever numbers
we have before happily putting the project
into service. We’re hearing signals and mak-
ing radio contacts — the likely object of the
exercise, after all — and so we consider our
construction project successful.
Were this chapter a textbook, or part of a
textbook, on computer-aided circuit design,
we might begin our CAD explorations by re-
viewing the basics of what electronic circuits
are and do, following this with a discussion
of what computerized circuit simulation is
and how it works. An excursion into the ar-
cane world of active-device modeling — the
construction and workings of mathematical
electrical equivalents to the transistors, di-
odes and integrated circuits that await us at
our favorite electronics suppliers and in our
junk boxes — might follow. Finally, we might
systematically proceed through a series of
simulation examples from the basic to the
more complex, progressively building our
store of understood, trustworthy and appli-
cable-to-future-work circuit-CAD concepts
as we go.
But this is a chapter in a handbook, not a
textbook, and following a sequence of abstract
basics to concrete practice very likely does not
reflect the process most of us have followed,
and follow yet, in learning and using what
we know about electronics and radio. More
realistically, our approach is more like this:
We find ourselves in need of a solution to a
problem, identify one, and attempt to apply it.
If it works, we move on, likely having learned
little if we have not had to troubleshoot. If
the solution does not work, we may merely
abandon it and seek another, or — better, if
we are open to learning — we may instead
seek to understand why, with the happily re-
vised aim of understanding what we need to
understand to make the solution work. Even
if we must ultimately abandon the solution
as unworkable in favor of another, we do not
consider our time wasted because we have
further accelerated our deepening intuition by
taking the initiative to understand why.
This chapter introduces circuit CAD in
exactly that spirit: Especially at first, we will
learn about circuit simulation through “just
building,” and simulating with CAD, build-
able circuits we know should work in quanti-
fied and quantifiable ways that we also know
well. If they don’t work as they should, we will
investigate why, fix them and review what we
have learned — just as we do when building
and learning from real-world hardware.
6.2 Computer-Aided Design Examples
6.2.1 Example 1: A Two-JFET
VFO and Buffer
In introducing this chapter, we “just built”
— in our mind’s eye — a receiver LO that “just
worked,” as real-world projects are intended
and expected to do. Building and simulating
the same two-JFET design in the circuit simu-
lator called SPICE transports us right to the
heart of fundamental circuit-modeling prob-
lems and their solutions. If we build through
graphical schematic entry — through sche-
matic capture — its oscillator-buffer circuit
exactly according to its electrical schematic,
it cannot possibly work!
Fig 6.1 shows the circuit for real-world du-
plication. In it, a J310 JFET Hartley oscillator
drives a J310 buffer amplifier, which drives
a 50-Ω load at +10 dBm via a trifilar broad-
band transformer that provides an impedance
step-down ratio of 9:1. Any experimenter ac-
customed to building and using such circuits
needs more no information than that provided
in the Fig 6.1 schematic and its caption to
make the circuit work as expected.
Fig 6.2 shows the same circuit successfully
modeled in OrCAD 16.0 , SPICE based simu-
lator software from Cadence Design Systems.
To understand the differences between Fig 6.1
and Fig 6.2, we’ll examine the simulation’s
components type by type.
in SPICE -speak — differs from what we are
generally accustomed to seeing in electrical
schematics, and that we have multiple options
for specifying values numerically using inte-
ger and decimal floating-point numbers. The
scale factors available in SPICE include:
• F — 1E–9
• G — 1E9
• K — 1E3
• M — 1E–3
• MEG — 1E6
• MIL — 25.4E–6
• N — 1E–9
• P — 1E–12
• T — 1E12
• U — 1E–6
Specifying the value of R1 as 1M would
declare its value as 1 milliohm (0.001 Ω),
short-circuiting the JFET’s gate to common
and breaking our simulation. Specifying the
RESISTORS
The designer’s output power specification
(+10 dBm) assumes that the VFO is connected
to the 50-Ω load afforded by the mixer system
in the receiver it was designed to drive. To
simulate this mixer load, we have added R5.
The value of R1, specified as 1 MΩ in the
original circuit, is now specified as 1E6 — sci-
entific/engineering notation for one million.
We have done this to remind ourselves that
SPICE ’s use of unit suffixes — scale factors
Computer-Aided Circuit Design
6.3
Fig 6.1 — Standard electrical representation of a 7-MHz VFO with buffer ampliier. JFET Q1 operates as a Hartley oscillator; D1, as
a limiter that improves frequency stability by keeping Q1’s gate voltage from going more positive than about 0.6 V; and Q2, as an
ampliier that increases the oscillator output — obtained from the feedback tap on the oscillator inductor by capacitive coupling
(C57) — to +10 dBm. The tapped inductor (L9), is 1.2 µH (22 turns of #28 wire on a T-30-6 toroidal core); the triilar output transformer
(T2), 10 triilar turns of #28 wire on an Amidon FB-43-2401 ferrite bead).
Using Your Computer to Draw Schematics
The art of drawing circuit schematics predates electronic computers; the art of drawing schematics and PC-board layouts
with computers predates the art and science of simulating circuits with computers. What if you only want to draw a circuit’s
schematic and design a PC board without simulating it? What computerized tools are available to you ?
Almost any circuit-simulation program or electronic design automation (EDA) suite that uses schematic circuit capture can,
within functionality limits imposed on the demoware version, serve as a irst-rate schematic editor. Although demoware compo-
nent library limitations usually restrict the types of components you can use — in CAD-speak, place — in a design, part- count
limitations usually operate only at simulation time. Restrictions in physical size and layer count, and in the materials and metal-
lizations available for substrate speciication, will likely apply to whatever layout-design facilities may be available. After all, the
main purpose of demoware is to let students and potential buyers taste the candy without giving away the store.
Excellent simulation-free schematic-capture and layout-design products exist, of course. The schematic style long standard
in ARRL publications comes from the use of Autodesk AutoCAD , a fully professional product with a fully professional price.
Long popular with radio amateurs and professionals alike is CadSoft EAGLE , a schematic-capture and layout-design product
available in freeware and affordable full-version forms. You can even export EAGLE schematics to a SPICE simulator and back
with Beige Bag Software’s B2 Spice . The full-function freeware schematic and PCB-layout application Kicad and the EDA suite
gEDA come to us from the open-source community.
Do-it-yourself schematic CAD can be as close as the basic drawing utility included with your computer’s operating system.
Some hobbyists ind that cutting, copying, moving and pasting components snipped from favorite graphical schematic iles into
new conigurations and adding new wires as graphical lines is enough for what they want to do. The connection between the
world of modern EDA tools and this seemingly primitive approach to schematic creation can be as close as the operating sys-
tem’s clipboard: Some CAD schematic-capture programs represent circuit elements as metaile data during copying, cutting
and pasting operations. Copying a schematic to the clipboard with such a program and then pasting the clipboard contents to
a suitable drawing program creates a picture of the copied schematic — give it a try with Windows Paint and the schematic
editor in the free demoware version of OrCAD 16 .
6.4
Chapter 6
752932119.033.png 752932119.044.png 752932119.055.png 752932119.061.png 752932119.062.png 752932119.063.png 752932119.064.png 752932119.065.png 752932119.066.png 752932119.067.png 752932119.068.png 752932119.069.png 752932119.070.png 752932119.071.png 752932119.072.png 752932119.073.png 752932119.074.png 752932119.075.png 752932119.076.png 752932119.077.png 752932119.078.png 752932119.079.png 752932119.080.png 752932119.081.png 752932119.082.png 752932119.083.png 752932119.084.png 752932119.085.png 752932119.086.png 752932119.087.png 752932119.088.png 752932119.089.png 752932119.090.png 752932119.091.png 752932119.092.png 752932119.093.png 752932119.094.png 752932119.095.png 752932119.096.png 752932119.097.png 752932119.098.png 752932119.099.png 752932119.100.png 752932119.101.png 752932119.102.png 752932119.103.png 752932119.104.png 752932119.106.png 752932119.107.png 752932119.108.png 752932119.109.png 752932119.110.png 752932119.111.png 752932119.112.png 752932119.113.png 752932119.114.png 752932119.115.png 752932119.117.png 752932119.118.png 752932119.119.png 752932119.120.png 752932119.121.png 752932119.122.png 752932119.123.png 752932119.124.png 752932119.125.png 752932119.126.png 752932119.128.png 752932119.129.png 752932119.130.png 752932119.131.png 752932119.132.png 752932119.133.png 752932119.134.png 752932119.135.png 752932119.136.png 752932119.137.png 752932119.139.png 752932119.140.png 752932119.141.png 752932119.142.png 752932119.143.png 752932119.144.png 752932119.145.png 752932119.146.png 752932119.147.png 752932119.148.png 752932119.002.png 752932119.003.png 752932119.004.png 752932119.005.png 752932119.006.png 752932119.007.png 752932119.008.png 752932119.009.png 752932119.010.png 752932119.011.png 752932119.013.png 752932119.014.png 752932119.015.png 752932119.016.png 752932119.017.png 752932119.018.png 752932119.019.png 752932119.020.png 752932119.021.png 752932119.022.png 752932119.023.png 752932119.024.png 752932119.025.png 752932119.026.png 752932119.027.png 752932119.028.png 752932119.029.png 752932119.030.png 752932119.031.png 752932119.032.png 752932119.034.png 752932119.035.png 752932119.036.png 752932119.037.png 752932119.038.png 752932119.039.png 752932119.040.png 752932119.041.png 752932119.042.png 752932119.043.png 752932119.045.png 752932119.046.png 752932119.047.png 752932119.048.png 752932119.049.png 752932119.050.png 752932119.051.png 752932119.052.png 752932119.053.png 752932119.054.png 752932119.056.png 752932119.057.png 752932119.058.png 752932119.059.png 752932119.060.png
Zgłoś jeśli naruszono regulamin