Extending Circuit Design and Simulation
Capabilities through User Defined Equations and Variables

By Dale D. Henkes, ACS

Though taken for granted now, the ability to routinely enter
almost any kind of complex circuit schematic into a circuit simulator program
and get circuit performance data accurately representing the physical hardware
is truly remarkable.  However, one
of the greatest values of computer aided engineering software is provided, not
by the simulation of a static circuit of unchanging components, but by the
ability to change the value of any number of circuit components interactively
(in real time) while immediately observing the changes in circuit performance.  Most circuit simulators provide the
ability to change a circuit component value via some kind of variable so that
the effect on circuit performance can be immediately observed without altering
the original circuit.  The
variable(s) can be changed manually or through the program’s optimizer
where they are adjusted in an algorithm design to automatically achieve a user
specified performance goal.

Another asset related to variables, that is available in
more advanced circuit simulators, is the ability for the user to construct
mathematical models (from variables) that uniquely characterize component
parameters or circuit behavior in new ways.  These mathematical models are entered by
the user and captured on the schematic page (and retained in the schematic
file) as user defined equations.  In
the following paragraphs, the usage of variables and equations in circuit
simulation will be examined for examples of ways to enhance the simulations and
provide greater insight into the design and analysis of circuits.  The LINC2 Pro circuit simulator from
Applied Computational Sciences (ACS) will be used to work out the examples.

Type and Scope of Variables

There are at least two different kinds of variables through
which the user (or optimizer) can modify circuit component parameters in real
time.  The difference is primarily
in the scope of the variable.  The
scope can be local or global.  A
variable with scope local to only a single component can only give its value to
a single parameter of that component.
Whereas a global variable can be assigned to transfer its value to any
parameter within any component in the entire schematic.  A global variable can also be assigned
to any number of parameters in any number of components.  The process whereby a variable is set up
to control two or more circuit component parameters simultaneously is referred to
as Gang Tuning.  For example, in a
tunable filter capacitors (implemented by varactor diodes) in each filter
section can be ganged or tuned together (by a common control voltage) so that
the frequency of each section tracks correctly [1].

A global variable can be directly assigned to a component
parameter or indirectly through an equation.  When equations are used, the value of
the variable(s) is modified in some way (according to a user defined and
supplied function) and then it is the resulting functional value that is
assigned to the component parameter.  A LINC2 equation is made up of one or
more global variables combined into a mathematical expression.

Yet another type of global variable is the Swept Variable.  The most common type of circuit simulation
output is some rendering of the frequency response of a circuit quantity such
as gain or return loss etc. (i.e. as a function of frequency).  However, a Swept Variable allows for a
rendering of the circuit response as a function of the swept variable (at a
specific frequency).

When the swept variable is assigned to a circuit component
parameter then the result is referred to in LINC2 as a Variable Parameter
Sweep.  Another way of saying this
is that the variable parameter sweep replaces the usual frequency sweep (as the
independent variable on the horizontal axis) with a sweep of a component
parameter of an individual component in the circuit.  For example, using tuning voltage as the
swept variable, the frequency of oscillation of a voltage-controlled oscillator
(VCO) can be plotted as a function of the varactor tuning voltage [2].  Executing a variable parameter sweep
answers the question “what influence does this particular component or
circuit parameter exert on circuit performance at a given frequency?”.

Example of Local,
Component Level, Variables

Figure 1 is a schematic of a simple notch filter with L and
C values set to resonate at the notch frequency of 1000 MHz.  Checking the Tune check box next to the part’s Inductance and Capacitance
values creates local variables L and C for tuning and/or optimization.

Figure 1, Local Variables L and C

Different values of L and C can achieve the same notch
center frequency while changing the notch filter’s bandwidth.  If the objective is to observe the
changes in filter bandwidth due to various ratios of  the L and C values (for a fixed center
frequency) then we would have to vary the value of L in one direction while
varying the value of local variable C in the opposite direction (to bring the
center frequency back to 1000 MHz).

For example, selecting the local variable L and tapping the
down arrow key decreases the inductance, sending the resonate frequency higher
as shown in the light curves of Figure 2A.

Then, selecting the local variable C and tapping the up
arrow key increases the capacitance, bringing the resonate frequency back to
1000 MHz as shown by the light curve of Figure 2B.  Notice that the light curve (in Figure
2B) has greater bandwidth than the original baseline (heavy) curve.

Keeping the resonant frequency set at 1000 MHz while
manipulating the local variables for different ratios of L and C can be a bit
tedious since you have to continually readjust one variable to compensate for
the frequency shift caused by changing the other variable.  Doing this with global variables is much
easier since one of the global variables can be used in an equation to compute
the other (for maintaining a fixed frequency) as will be demonstrated next.

Figure 2, A) Decreasing L Increases the Resonate
Frequency (top curves), B) Restoring Resonance by Increasing C (lower light
curve)

Figure 3, Use of Global Variables in Equation for C

Figure 4, Tuning Resonator L while Automatically Recalculating
Resonator C for 1000 MHz Resonance

Example of Global Variables

The schematic of Figure 3 adds two global variables and an
equation to the simple notch filter schematic of Figure 1.  Variable 1 (reference designator Var1 on
the schematic) is named L_IND and is assigned to the inductance parameter for
the series LC resonator component SLC1.
Var2 is the frequency variable, Fre = 1000 MHz (in this example we treat
the Fre variable as a constant and use it only to make the equation more
readable).

For any value of the inductance variable L_IND, the capacitance
(C_Cap) in pF required to resonate the series LC component at the specified
frequency (Fre) is C_Cap = 10^(12)/((2 pi Fre 10^6)^2 L_IND 10^-9).  Using scientific notation for numerical
constants (i.e. 1E12 = 10^12) and pi = 3.141592654, the equivalent LINC2
equation (Figure 3) is C_Cap = 1E12/((2*3.141592654*Fre*1E6)^2*L_IND*1E-9).

With the schematic set up with variables L_IND, Fre and
equation C_Cap as in Figure 3, we can simply click Analyze and View > Plot
to get the frequency response plots of Figure 4.  Notice that as L_IND is tuned in Figure
4, all the corresponding notch response plots remain steadfastly fixed about
the 1000 MHz center frequency (Fre).
This is a direct result of the equation C_Cap continuously recalculating
the corresponding capacitance value required to maintain the frequency.

In this example we chose L as the independent variable for
which to calculate C.  If we wanted
to be non-prejudicial on the choice of L or C as the independent variable, we
could have made the reactance (X) the independent variable from which both L
and C could be calculated according to the formulas L = X/(2 pi Fre) and C =
1/(2 pi Fre X).  Reactance is a more
natural choice for investigating matters of loaded Q and bandwidth but it
requires an additional equation.

This analysis provides insight into how the loaded Q (and
thus notch bandwidth) can be controlled by the inductance (which determines the
reactance to load resistance ratio or Q = X/R).  Moreover, for a specific application we
may need to determine how much impact the notch has on the adjacent pass-band
(from marker 1 through marker 2, for example, in Figure 4).  In this case we will want to pick an
inductance value corresponding to one of the higher Q curves (higher and
narrower plots in Figure 4).

Using Equations to Design Circuit Components –

Design Template for
the Lumped Element 3 dB Quadrature Coupler

Figure 5, LINC2 Schematic Setup for Designing the Lumped
Element 3dB Quad Coupler

Figure 5 shows a design template for designing lumped
element 3 dB quadrature couplers.
The schematic is made up of two identical tightly coupled inductors
(coupling coefficient K approaching 1) and two identical capacitors.  Variables Zc and Fre allow the user to
design a 3 dB coupler for any practical port impedance and frequency
respectively.  In this example the
variables are set to design the coupler for operation at 1000 MHz into 50 ohm
ports.

Equations LVal and CVal implement the design formulas for
automatically calculating all the component values [3].  In the simulation, the result of
equation LVal is assigned to inductors L1 and L2 while the equation value for
CVal is assigned to capacitors C1 and C2.
Running the simulation produces the results shown in Figure 6.  Clicking Analyze not only starts the
simulation running but also updates the equation values on the schematic page.  Figure 6 verifies that exactly half of
the input power (-3 dB) appears at ports 2 and 3 and that the phase difference
between these ports is almost exactly 90 degrees at the design frequency of
1000 MHz.  An excellent input match
is indicated by dB[S(1,1)] less than -110 dB over the entire simulation band.

Figure 6, LINC2 Simulation of the 3 dB Lumped Element Quad Coupler

Design Template for
the Lumped Matching BALUN Design

Figure 7A shows a design template for designing lumped
element BALUNS.  The schematic is made
up of two identical inductors and two identical capacitors.  Variables R_Source and R_Load allow the
BALUN to operate into any desired port impedances.  The frequency variable, Fre, provides for
the specification of any practical operating frequency.  In Figure 7 the design has been set for matching
a 50 ohm unbalanced source to a 200 ohm balanced load at 1000 MHz.

Equations LVal and CVal implement the design formulas for
automatically calculating all the component values [3].  In the simulation, the result of
equation LVal is assigned to inductors L1 and L2 while the equation value for
CVal is assigned to capacitors C1 and C2.
Running the simulation produces the results shown in Figure 7B.  Invoking Analyze starts the simulation and updates the equation values on
the schematic page.

Figure 7, A) LINC2 Design Template for Matching BALUN
Circuit, B) Smith Chart Display of Matching

Using LINC2 Equations
to Design Lumped Directional Couplers

Figure 8 shows a design template for designing lumped
element directional couplers.  Variable
Zc specifies the port impedances, Fre specifies the operating frequency (MHz)
and C_F sets the coupling coeffienct in dB.

Equations LVal, CVal and Cc_Val implement the design
formulas for automatically calculating all the component values [3].  In the simulation, the result of
equation LVal is assigned to inductors L1 through L4 while the equation value
for CVal is assigned to capacitors C1 and C2.  Equation Cc_Val calculates the value in
pF for the remaining components, C3 and C4.

The Analyze button
starts the simulation and View > Plot
produces the simulation results shown in Figure 9.  The simulation indicates that the
coupled port produces coupling very close to the desired 20 dB value (at 19.96
dB).  With the level down 40 dB on
the isolated port, 20 dB of directivity is achieved.  Although the simulation was run from a
schematic employing ideal components, the LINC2 capacitor and inductor models
used here are capable of simulating the non-ideal aspects of the actual parts
that they represent.  When the
component Q values for all the inductors and capacitors are reduced to
practical values (around 100) the results are still very close to those
displayed in Figure 9.  With
component Qs of 100, the insertion loss degrades by less than 0.25 dB and there
is only 1 dB loss in directivity.

Figure 8, LINC2 Directional Coupler Design Template

Figure 9, LINC2 Simulation of the 20 dB Directional Coupler

Using Equations with
the LINC2 Optimizer to Design Broadband Distributed Matching Networks

A result of Fano’s bandwidth limit formulation [4] is
that an exact match into a complex load can only occur at precisely one
frequency point.  There are many
circuit topologies derived from closed form equations that yield an exact match
at exactly one frequency point.
These are termed “narrowband matching” networks because,
although they match at only one point, the quality of the match continues to be
good (though not perfect) throughout a narrow band of frequencies about the
match frequency.  For simple lumped
element networks, the loaded Q of the network generally determines the
bandwidth of the match.

For wideband matching into a complex load, the Fano limit
indicates that the quality of a uniformly constant match over a given bandwidth
must necessarily be less than some maximum return loss value imposed by the
constraint formula.  Since the
constraint formula can be expressed as an integral involving the reflection
coefficient (integrated over all positive frequencies) it can be understood
that the match can exceed the uniform limit over some frequencies at the expense
of a lesser match over other parts of the band.  Unfortunately, for complex loads, closed
form formulas for wideband matching networks (yielding constant quality of
match anywhere near the theoretical maximum) do not exist.  What does exist are methods of
determining approximate matching solutions based on optimization or iterative
calculations.

On the other hand, there are closed form solutions for
wideband matching networks that can match between purely real (resistive)
terminations.  These can also be
used to approximate wideband matching networks operating into complex loads if
the load reactance is cancelled at the network port with an appropriate
reactive element.  Figure 10 shows a
LINC2 synthesis program for broadband matching with quarter-wave TRL sections
using this technique.

Figure 10, LINC2 Broadband Matching
Network Synthesis

Figure 11, LINC2 Broadband Matching
Network Schematic

The matching problem of Figure 10 is defined as matching a
50 ohm source to a complex load of 5 + J 3.5 ohms over a band centered at 1000
MHz.  The fact that we are
attempting a broadband match to a complex load implies that the load will not
stay constant at 5 + J 3.5 ohms over the band.  Practical loads do not present a
constant reactive component over a significant band of frequencies.

Making the assumption that the load reactance is constant
over the band is not very realistic.
There are two ways to address this problem.  One way is to model the load with some
combination of lumped RLC elements.
Another method uses measured load data in the form of a one-port impedance
(z1p) file assigned to the simulation load port.  The schematic of Figure 11 employs the
later method of making the load port (Port 2) a file based port.  The LoadZFile.z1p file assigned to the
load port for this example has impedance varying over frequency according to
the following z-parameters:

# MHz Z RI R 1

750      4.75     1

900      4.9       2.5

1000    5.0       3.5

1100    5.1       4.5

1250    5.25     6

The load impedance data from this file is plotted on the
left of each Smith Chart (Figures 13 and 14) near the tail of the red
arrow.  The arrow points to the
matched impedances transformed by the matching network.

The schematic in Figure 11 was automatically created from
the LINC2 Network Synthesis program (by clicking the Schematic button in Figure 10).  Conversion of the quarter-wave (TRL)
lines produced in the network synthesis program to physical microstrip (lines
MLI 1-3) was performed automatically using the LINC2 Auto > Convert To > Microstrip feature.  Variables Len1, Len2 and Len3 were subsequently
set up and assigned to the length parameter of each microstrip section.  The equation Total_Len was added to sum
up the total physical length of the matching network (Total_Len = Len1 + Len2 +
Len3).  Since each quarter-wave line
is approximately 1.5 inches (1500 mils) on 30 mil FR4 board material at 1 GHz,
the total length comes to about 4.5 inches.

Figure 12, Optimized LINC2 Broadband
Matching Network

Most circuit simulators have optimizers that will take selected
circuit component parameters and optimize their values towards one or more user
specified circuit performance goals.
An optimization goal is usually an electrical circuit response such as
gain, return loss or electrical isolation.
The user specifies the profile of the selected response over frequency
or at some number of specific frequencies.  A new capability of the LINC2 optimizer
is the ability to optimize the value of equations (via user specified goals) in
the same way that electrical circuit responses are optimized.  The optimized equation may represent
something other than an electrical property of the circuit.  In fact, the equation can represent a
collective physical property (such as overall physical size) as will be shown
next.

Optimizing Dimensions
with LINC2 Equations to Reduce the Size of the Physical Circuit

The total length of the matching network (Figure 11) at
4,493 mils almost exactly equals the entire length of the author’s
personal cell phone (which measures 4.5 inches along its longest
dimension).  This matching network
is not a compact design.  In order
to reduce the physical size while improving the electrical performance, an
optimizer will allow the user to constrain the range (upper and lower bounds)
of the physical microstrip dimensions during optimization.

Optimizer constraints (though necessary to enforce practical
values) will almost always result in making it more difficult for the optimizer
to achieve the desired goals.
Unconstrained variables obviously give the optimizer the greatest
freedom to find the best solution at the expense of the optimizer possibly
generating some impractical component values.  However, optimizing this circuit without
constraints on the microstrip dimensions could possibly lead to a design that is
electrically superior but even longer than the initial 4.5 inches!

Figure 13, Broadband Matching from
Direct (closed-form) Synthesis (before optimization)

Figure 14, LINC2 Optimized Broadband
Matching Performance

The ability of the LINC2 simulator to optimize equations, as
well as electrical circuit responses, yields an uncommon power over the
optimization process.  For example,
the original circuit in Figure 11 was optimized in Figure 12 without placing
any constraints on the lengths of the
individual microstrip sections.
Yet, through the use of the Total_Len equation, it resulted in a design
exactly half the size of the original!
This result was accomplished using the LINC2 optimizer by constraining
only the value of the equation and not its constituent variables (Len1, Len2
and Len3).  Thus, the optimizer had
complete freedom to make each section any length necessary to achieve optimum
performance as long as the overall length of the three sections combined
didn’t exceed 2,250 mils.

Figure 15, LINC2 Optimization Goals

Figure 16, Microstrip Length Comparison
Before and After Optimization

Figures 13 and 14 show the network’s matching
performance before and after optimization respectively.  The network’s insertion loss and
return losses are plotted over a 50% bandwidth centered at 1000 MHz.  Note in Figure 15 that the optimization
goals include the network’s total physical length in addition to network
insertion loss (M21) and return loss (M22).  The aggressive goal of cutting the total
length in half was enforced by applying an optimization weight several times
larger than the other goals.  All of
the network’s component values were allowed to vary except elements of
the substrate definition.

The LINC2 Network Synthesis program provided an excellent
seed circuit for the optimizer.
Even before optimizing, Figure 13 indicates that direct circuit
synthesis produced a capable matching network with return loss greater than 20
dB over 40% of the band and 14 dB or more over 90% of the band.  Yet the power of the optimizer is
demonstrated by the improved match displayed in Figure 14.  Return losses are maintained between
approximately 20 and 25 dB across the band with additional flattening of the
insertion loss response - all while at the same time meeting the aggressive
goal of reducing the overall physical length by 50%.

Figure 17, Varactor Tuned Notch Filter

Swept Variables

Figure 1 shows the schematic for a simple fixed frequency
notch filter, while Figure 2 displays the frequency response as discussed
earlier.  Now, consider the similar
schematic in Figure 17 where we have replaced the fixed value capacitor with a
variable capacitor in the form of a varactor tuning diode.  We have thus changed the fixed frequency
notch filter into a voltage variable (tuned) notch filter.  The equation CVar models the voltage to
capacitance characteristics of the varactor diode.  The capacitance, CVar, is calculated as
a function of the varactor tuning voltage (variable Varactor_V) and assigned to
the capacitance element in the series LC (SLC1) component.

For the variable Varactor_V, the Variable Parameter Sweep check box is checked in the
variable’s Part Parameters dialog box.  This action changes the variable from an
ordinary variable to a swept variable.
The range of values over which the variable sweeps is defined by start
and stop values (ST and SP respectively).
The resolution of the value steps is controlled by the number of points
(PT).  In this case, the varactor
voltage is swept from 0.5 to 5.5 volts at a resolution of about 0.1 volts per
step (PT = 51).

Figure 17 plots the tuning performance of the filter.  It should be noted that the varactor
voltage (Varactor_V) is the independent swept variable here (as displayed on
the horizontal axis in Figure 17), not the usual frequency sweep (with
frequency on the horizontal axis as in Figure 2).  This allows us to focus on the
filter’s tuning performance (left axis in Figure 17); the span of
frequencies tuned relative to the varactor’s tuning range.  The varactor’s voltage to
capacitance transfer function is also displayed in Figure 17 (plotted against
the right axis).  References [1] and
[2] give in depth details on the applications of swept variables for the design
and analysis of tunable RF circuits.

Summary

Variables and equations can be placed on the schematic page
along with the actual circuit schematic.
When these equations are formulated to calculate the circuit component
values from variables who’s values are input by the user to capture the
design specifications or operational aspects of the circuit (such as frequency
of operation, port impedances, circuit Q etc.) then the result is a complete
design template that can be used over and over again.  Simply changing the input variables
instantly creates a circuit uniquely adapted to the new application!  The equations and variables help to
document the design and become a record of how the circuit’s component
values are calculated.  This kind of
self documenting schematic will be better understood when the schematic file is
later reloaded.

This article also demonstrated the power of a new optimizer capability,
having the ability to control the physical size of the circuit in addition to
optimizing electrical circuit responses.  It is a powerful new capability that the
same optimizer that optimizes RF circuit performance can also be simultaneously
directed to restrain or reduce physical size, seemingly independent from any
direct relationship to electrical performance.

The LINC2 Pro software used in these examples is a high
performance RF and microwave design and simulation program from ACS (Applied
Computational Sciences, Escondido,
CA).  In addition to circuit simulation,
optimization and statistical yield analysis, LINC2 Pro includes many
value-added features for automating design tasks, including circuit synthesis
and equation based modeling and optimization.  The same techniques presented here for
modeling discrete circuit component parameters through the use of user defined
equations are also available in the ACS Visual System Architect (VSA) for
uniquely modeling system components at the system level.  For more information about LINC2 Pro and
LINC2 VSA visit the ACS website at www.appliedmicrowave.com.

References

1.
Henkes, Dale D., “Software Enhances the Design
and Analysis of Tunable Circuits”, High Frequency Electronics Magazine
July 2008.

2.
Henkes, Dale D., “LINC2 Software Enhances the
Design and Analysis of VCOs and Other Tunable RF and Microwave Circuits”,
Microwave Product Digest Magazine July 2008.

3.
Vizmuller, Peter “RF Design Guide: Systems,
Circuits and Equations”, Artech House Publishers, 1995, ISBN:
0-89006-754-6.

4.
Fano, R. M., “Theoretical limitations on the
broadband matching of arbitrary impedances”.  J. Franklin Inst., Vol. 249, Jan./Feb.
1950: pp. 57-83, 139-154.