Connect with us

Measuring VSWR in a Simulation?

Discussion in 'CAD' started by Stutzer, May 18, 2004.

Scroll to continue with content
  1. Stutzer

    Stutzer Guest

    I would like to measure the VSWR (or the small signal output impedance)
    of a circuit I simulate (using PSpice A/D by Cadence).
    What would a circuit look like, that indicates the VSWR of the circuit
    loaded with a given impedance, or how would I have to calculate it using
    measurable values?

    I don't konw if the concept of standing waves applies to infinitely
    small lenghts of the "transmission-lines" resp. wires (what is probabely
    assumed for simulation).
    My actual goal is to get a good matching of the circuits output and the

    So far thanks for reading, I hope you can help me.
    D. Stutzer
  2. Why?

    Off hand, I don't see why you would want to do this for most
    This is trivial to do. Simply feed in a signal and use the V/I feature
    that is present in most spices. In fact, in SS, you just tell a source
    its for measuring impedances, and its automatic.
    There is a standard formular, which I would have to go and look up:),
    but why?

    The background to using VSWR is geared around experimental
    practicalities. This is irrelevant for spice simulation tools. The only
    reason for even knowing the impedances, is to calculate the voltages.
    Again, this is not that relevant as spice simply produces the data all
    in the wash directly.
    Yep. How the voltage varies with x distance is not a factor in lumped

    (what is
    If your circuit are LCR type matching circuits, I don't see that VSWR is
    any use at all. VSWR is an intermediate calculation that is simply
    redundant with simulation tools.

    You need to ask the queston, what am I trying to do?

    Kevin Aylward
    SuperSpice, a very affordable Mixed-Mode
    Windows Simulator with Schematic Capture,
    Waveform Display, FFT's and Filter Design.
  3. Stutzer

    Stutzer Guest

    Hello Kevin,
    First: Congratulations and Thanks for SuperSpice.

    I already thought my question would be a little unprecise, but I thought
    my problem would become clear. Sorry.

    Well, I don't know. The circuit actually is a FM-oscillator. It has an
    audio (ac voltage) input, a dc voltage source to feed the oscillator and
    amp and one output port supposed to drive an antenna.
    The goal is to get a good match of the antenna to the output of the
    "oscillator" near it's resonance frequency.

    As far as I remember, the output impedance of a 2-port is calculated as:
    Zout=Vout/Iout , given Iin=0
    , where Vout (resp. Iout) are applied at the output port with an
    ac-voltage source (reps. current).

    How does this concept apply to the oscillator circuit? Does it at all?
    Or how can measure Zout?
    What sources must be "replaced with a wire" (the AC (audio) source, the
    DC (battery) source or both?)?

    One I knew the output impedance (at certain freqs) of the "antenna-port"
    I would know how to design an LC-matching-circuit to match the antenna.
    - But I don't want to build the circuit just to measure the

    So please tell me: What am I trying to do exactly? And how do I do it?

    Thank you for your help and best regards,
    D. Stutzer
  4. Tom Bruhns

    Tom Bruhns Guest

    A common way to evaluate the output impedance of a source, when
    turning the source off would alter the output impedance or when a load
    very far from the load for which the circuit was designed would cause
    trouble, is to load the source with two different resistances (both
    near the optimal load) and observe the change in voltage. If you wish
    to find the complex output impedance, things get more complicated; in
    doing the test for a real source, you can add a tuneable series
    reactance and adjust for peak output into a resistive load, and the
    reactance you have added will be equal in magnitude but opposite in
    sign from the source's reactance; you can then use the two resistors
    to do the "load pull" measurement of the resistive part. Then if e1
    and e2 are the output voltages associated with loads R1 and R2

    Rsource = (e2-e1)*R1*R2/(e1*R2-e2*R1)

    But your problem is that you'd have to do a sweep of the reactive
    element to use this method for a simulation, and that's a bit tedious.
    One should be able to do the same thing, assuming a linear,
    time-invariant system, by using at least three different known loads
    which vary both the resistance and the reactance. It may be
    computationally easier if you do it with + and - delta R from nominal,
    and + and - jX from nominal. You're looking for three unknowns
    (Vsource, Rsource and Xsource), so you need three equations; thus the
    minimum three loads.

  5. Jim Thompson

    Jim Thompson Guest

    See the Tools (and Macros) Page of my website, "Return Loss and

    ...Jim Thompson
  6. Stutzer

    Stutzer Guest

    Hi Tom,
    As I see the problem seems to have become clear now.
    I think your approach is surely correct but as you mentioned yourself it
    could take a lot of time as I don't have a good "starting point" for
    the "recursion".

    If I just had to match this single circuit this would not be too much of
    a problem. But I think I will come across this problem (of unknown
    output impedance) many moore times in the future.

    Thus I think there has to be some kind of "macro/script/test-load" that
    automizes this procedure or something else that pops out the output
    impedance (at best even for sevral freqs.)

    Anyway, so far, thanks very much for directing the discussion into this
    direction and for your ideas.
    Best regards,
    D. Stutzer
  7. By measuring an input impedance at the output node.

    Replace the load by an AC voltage source with a dc value exactly equal
    to the DC voltage at the circuit output node when the load is connected.
    This will be zero if ac coupled, if so, you will need a high value bleed
    resister to avoid a floating node at the source. Make sure all other ac
    sources are zero and do an ac run. Then plot V(source)/I(source).

    Kevin Aylward
    SuperSpice, a very affordable Mixed-Mode
    Windows Simulator with Schematic Capture,
    Waveform Display, FFT's and Filter Design.
  8. Stutzer

    Stutzer Guest

    Hello Jim,
    Thanks for the hint. Actually I already came accross your web-page while
    I was searching on the internet. Unfortunately I couldn't find the
    msim.prb file I found a pspice.prb which probabely has the
    same function in pspice.
    I will try out your macro this afternoon.

    Thank you very much
  9. Stutzer

    Stutzer Guest

    Allright! Now I see what you mean. Is it generally true, that the (small
    sig.) output-impedance of a port is equal to the input-imp. measured at
    that very same port if it is driven in the way you explained?
    Anyway thanks very much for the idea. I'm going to try it out this evening.

    D. Stutzer
  10. Rick

    Rick Guest

    If the o/p is ac coupled, it makes no difference what DC voltage you
    apply to your source - it doesn't HAVE to be zero.

    If the o/p is dc-coupled, it's probable that removing the original load
    will affect the quiescent voltage, so you'd want to determine what that
    voltage is WITHOUT the load, and then duplicate that.
    Is there a reason why you'd want to do this in preference of the usual
    "pump an AC Amp" into the output?
  11. Ho hummm...
    Nope. This will upset the bias condition as it is when it is in actual
    use. Suppose removing the load makes the output transistor clip of
    bottom out, what happens then? You want to measure the impedance at the
    same bias conditions as it is when operating normally. Anything else is

    It might even be preferable to keep the load in circuit and have the
    source in series with it.
    Yes. It highlights the fact that you don't have to do this in SS:),
    although its always a bit disconcerting to see mega volts on the
    schematic nodes.

    Kevin Aylward
    SuperSpice, a very affordable Mixed-Mode
    Windows Simulator with Schematic Capture,
    Waveform Display, FFT's and Filter Design.
  12. Hi,

    The measured value of the output impedance is not normally
    used to design a network to follow such a circuit - the 'source-Z
    MUST equal load-Z' theorem is not always applicable. Common
    practice is to offer a load impedance that will provide the
    required output power at the given collector voltage swing.
    Remembering that a class-C stage is very much like an on-off
    switch, the usual cookbook formula is -

    RL = (Vcc - Vb)^2 / 2.Po ; Vcc - Vb is the collector swing,

    where Vcc is the supply and Vb the DC base bias voltage.

    So if you set your sights on 100mW with a 12V supply and 3V of
    base bias, you are looking at 400 ohms or so.

    For true RF power devices, the manufacturer will specify an
    output impedance which is usually a few tens of ohms in series
    with a capacitive reactance of the same order. This 'Z' is then
    used to design the matching network. All of this is reminiscent
    of the 'optimum value' used in old tube power amps which was a
    compromise between power output and distortion and not the actual
    output impedance.

    Cheers - Joe
  13. Stutzer

    Stutzer Guest

    Hello Joe,
    Thanks a lot for your posting!
    It is really pointed towards the core of my problem. Probably your
    formula will satisfy my needs completely. It also helps a lot
    considering the question "what am I trying to do?".
    I will try it out later.

    Best regards
    D. Stutzer
  14. Rick

    Rick Guest

    Yep. I agree - I came to the same conclusion shortly after I'd posted
    my reply. My method produces the impedance of the unloaded circuit.
    I think the best bet is to leave the load in, but not fiddle around
    with this voltage source stuff - just pump 1 Amp AC in, an accept
    that the resulting impedance is the parallel combination of the
    circuit's output impedance and the load impedance. Working back
    to the circuit's o/p impedance is then trivial if the load is passive.

    I'd swap a bucket of "convenience" features if your software offered
    either of:
    1. Ability to temporarily disable any given components in the schematic
    without having to delete them.
    2. Override component model parameters from within the schematic without
    having to edit the part library first. I hate having components called
    "hi beta", "hi beta zero tempco" - I just want to change the damned

    Does SS do these?
  15. Jim Thompson

    Jim Thompson Guest


    Correct. I need to update my page. Since I did that page OrCAD
    bought MicroSim and then Cadence bought OrCAD. Fortunately only the
    file names have changed.

    ...Jim Thompson
  16. Tom Bruhns

    Tom Bruhns Guest

    Oh dear. That was an invitation for me to get on my soapbox.

    You should view Spice as an _ANALYSIS_ tool, NOT a "design" tool. I
    think Spice is dangerous in the hands of folk who don't have a basic
    understanding of the circuits they are trying to design. How does
    that apply in this situation? Well, I would hope that you have a
    pretty good idea about the source impedance of the circuit you are
    dealing with, and the optimal load as well. Is it an output from a
    feedback-controlled amplifier, or is it from something which is
    open-loop? Is it from the emitter circuit or the collector circuit?
    If you're trying to put a load on the oscillator itself, what will a
    heavy load do? (Hint: it's generally NOT good for frequency
    stability, because small percentage variations in the load can still
    be significant.) Fairly often, the optimal load for a circuit is an
    impedance which is far different from the circuit's output impedance:
    "optimal" is NOT always maximum power transfer.

    It's the philosophy of why you should do various things in the circuit
    that Spice generally won't help with, unless you are exceptionally
    observant about the simulation results, and try a wide range of

    In addition, having a good basic "feel" for the circuit will help you
    immeasurably in knowing when your simulation results are incorrect, as
    they often can be. That can happen because of Spice limitations, and
    because your model does not match reality sufficiently well.

    I trust this won't open too big a can of worms...I hope instead it's
    food for thought about the design process.


  17. Well, you can just move them to a blank piece of the page. (use the
    rubberband toolbar button to temporally disable the rube). However...

    You can do exactly what you wish. Double-click on the symbol to popup
    its set-up dialog. Use the PCB data tab, and lo and behold, check boxes
    to include in the spice and/or pcb netlist.
    Sort off. There is the docked preview window (top left main window)
    where you can edit the model directly (but it does via the lib), or you
    can edit the model from the symbol, set-up dialog. However, this effects
    all symbols with that model name. However...

    You can have 3 sets of models, easily *switchable*. The model tab of the
    set-up has checks for weak, nominal and strong. If you switch this from
    its default of normal, it will try and find that model variation, or
    copy the nominal model. You can then change those weak or strong model
    parameters and those parameters will only effect other models that are
    also connected to that specific model type. This allows quick check out
    of different model variations simply by clicking those buttons.
    However...Changing these weak and strong parameters will effect the
    automatic WC runs for that model type as it uses this data. However...
    you shouldn't really have to do what you suggest above, as that is what
    the auto WC (worst case) is *designed* to do for you already. It already
    has sensible WC values set-up, e.g. max/min hfe, etc. I have tried to
    anticipate what is required so that the user don't have to worry about
    these things. The WC reruns should give a pretty good (overestimate) of
    what variations will occur without the user having to manually do this.

    Oh.. I reduced the price a bit today...

    Kevin Aylward
    SuperSpice, a very affordable Mixed-Mode
    Windows Simulator with Schematic Capture,
    Waveform Display, FFT's and Filter Design.
  18. I posted an err.. "update" to this feature on this today. If the
    explicit WC model already existed, switching types would use and load
    that model. However, if they didn't exist, the buttons wouldn't use/load
    in the auto generated WC model version values that the WC reruns use for
    this condition. This is now fixed.
  19. Stutzer:

    Measuring VSWR with Spicees...

    The most direct way of doing this with any Spice is simply to build
    [simulate] a VSWR [Return Loss]
    bridge circuit as part of your simulation and include it in your simulation

    The output of the VSWR bridge is what you are looking for.

    In it's simplest form a VSWR bridge is simply a purely passive resistance
    Wheatstone bridge but you may
    get fancy with your simulations and create active bridges in Spice with Op
    Amps, etc... if you wish.
  20. Stutzer

    Stutzer Guest

    Hello Peter,
    First of all, thanks for your interest.
    I really don't want to offend you, but are you sure about this?

    I ask this, because this "natural approach" was my first as well. But it
    did not seem to work with the (very few and simple) circuits I tried.

    From a theoretical point of view: How can one distinguish between the
    part of the voltage (or power) that is due to the "backwards" travelling
    waves and the "foreward"-part when you have just one (infinitely small)
    point (resp. part of the transmission line/wire) where you can measure
    the (total) voltage? To me this seems impossible, in general.
    But I can imagine to implement such a circuit in a way appropriate for
    simulation, by use of "Transmission-Lines" to insert a delay.

    Please correct me where I'm wrong

Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day