Author Topic: S-parameter measurement simulation  (Read 3257 times)

0 Members and 1 Guest are viewing this topic.

Offline promachTopic starter

  • Frequent Contributor
  • **
  • Posts: 875
  • Country: us
S-parameter measurement simulation
« on: September 22, 2017, 04:52:49 pm »
I am having some problem with s-parameter measurement procedure
Please refer to my question at the bottom of this post.

The following plots are obtained by running s-param.cir
As far as I can see, the S-parameters look good, maximum transmission/reflection at 0dB makes sense for low pass filter.





s-param.cir  Retrieved from http://ngspice.sourceforge.net/docs/ngspice-27-manual.pdf#page=364

Code: [Select]
Test for Scattering Parameters
** Two ports
** Examples: Bipolar,  Tschebyschef, RC

.param Rbase=50 Vbias_in=0 Vbias_out=0

*** The two-port circuit:
** port 1: in 0
** port 2: out 0
** Bias on both ports through resistor Rbase (to obtain operating point)

** Example RF Bipolar mrf5711
** VCE 1 V, IE = 5mA
** QXXXXXXX nc nb ne
** model obtained from
** http://141.69.160.32/~krausg/Spice_Model_CD/Vendor%20List/Motorola/Spice/RFBJT/
*.include MRF5711.lib
*XMRF5711 out in e  MRF5711
*Ie e 0 5m
*Ce e 0 1

** Example Tschebyschef Low Pass filter
C1 in 0 33.2p
L1 in 2 99.2n
C2 2 0 57.2p
L2 2 out 99.2n
C3 out 0 33.2p

** Example RC
** see
** http://www.allenhollister.com/allen/files/scatteringparameters.pdf
*R2 in out 10
*C1 out int5 30p
*R1 int5 0 10

*** End of circuit


** The following subcircuit to be changed only by an experienced user!

*** Driver and readout
X1 in out S22 S12 S_PARAM

.SUBCKT S_PARAM 22 66 5 7
* Resistors emulate switches with Ron=0.001 and Roff=1e12
* to switch driver to input and readout to output (and vice versa, see below)
RS1 22 2 0.001
RS2 66 6 0.001
RS3 22 6 1e12
RS4 66 2 1e12
*Driver
Vacdc 1 0 DC 'Vbias_in' AC 1 $ ac voltage and dc bias at input (applied through load resistor)
R1 1 2 'Rbase'
E1 3 0 2 0 2       $ amplify in port ac voltage by 2
Vac 3 4 DC 0 AC 1  $ subtract driving ac voltage
R_loop 4 5 0.001
R3 5 0 1           $ ground return for measure node 5
*Readout
E2 7 0 6 0 2       $ amplify out port ac voltage by 2
R4 6 8 'Rbase'     $ load resistor at output (ac)
Vdc 8 0 DC 'Vbias_out' AC 0 $ dc bias at output (applied through load resistor)
.ends

** Check the two ac lines below for being equal!
.control
set noaskquit
set filetype=ascii
*** measurement for s11 and s21
op
** save bias voltages to vector
let Vdcnew=V(X1.1) $ former Vacdc
let Vacdcnew=v(X1.8) $ former Vdc
** first ac measurement (change this line only together with following ac line)
*ac lin 20 0.1G 2G $ use for bip transistor
ac lin 100 2.5MEG 250MEG $ use for Tschebyschef
*ac lin 101 1k 10G $ use for RC
**
** switch input and output
alter R.X1.RS1=1e12
alter R.X1.RS2=1e12
alter R.X1.RS3=0.001
alter R.X1.RS4=0.001
** switch bias voltages between in and out
alter V.X1.Vacdc DC=op1.Vacdcnew
alter V.X1.Vdc DC=op1.Vdcnew
*** measurement for s12 and s22
op
** second ac measurement (change this line only together with ac line above)
*ac lin 20 0.1G 2G $ use for bip transistor
ac lin 100 2.5MEG 250MEG $ use for Tschebyschef
*ac lin 101 1 10G $ use for RC
**
let s11=ac1.s22
let s21=ac1.s12
settype s-param S11 S21 S22 S12

let S11db = db(s11)
let S12db = db(s12)
let S21db = db(s21)
let S22db = db(s22)
settype decibel S11db S21db S22db S12db

let P11=180*ph(s11)/pi
let P21=180*ph(s21)/pi
let P22=180*ph(S22)/pi
let P12=180*ph(S12)/pi
settype phase P11 P21 P22 P12

let Rbase=@R.X1.R4[Resistance]
settype impedance Rbase

*plot s11db s21db S22db S12db ylimit -50 0 xlog $ used with RC
plot s11db s21db S22db S12db ylimit -0.5 0 $ used with Tschebyschef 
plot P11 P21 P22 P12
plot smithgrid S11 S12
*wrdata s3046 mag(S11) P11 mag(S21) P21 mag(S22) P22 mag(S12) P12 $ write simple table
wrs2p s3046.s2p $ write touchstone vers. 1 file s3046.s2p
.endc

.end


Quote
R1 1 2 'Rbase'
this 50 ohm Rbase is connected to the netlabel 2 in the screenshot below.

Or did I misread the s-param.cir netlist ?


 

Offline bson

  • Supporter
  • ****
  • Posts: 2270
  • Country: us
Re: S-parameter measurement simulation
« Reply #1 on: September 22, 2017, 09:48:11 pm »
The comments say it's used to apply a bias to set the operating point.  Otherwise this would be undefined and spice can't find it.
 

Offline promachTopic starter

  • Frequent Contributor
  • **
  • Posts: 875
  • Country: us
Re: S-parameter measurement simulation
« Reply #2 on: September 23, 2017, 04:21:30 am »
Is the bias resistor, RBase at the wrong place in the netlist ?

Should it be at 'in' instead of at '2'  ?
 

Offline tec5c

  • Frequent Contributor
  • **
  • Posts: 423
  • Country: au
Re: S-parameter measurement simulation
« Reply #3 on: September 23, 2017, 06:35:23 am »
I think that you may be a little confused with the SPICE file.

There are three separate examples and one subcircuit given in the file.

You have a screenshot of the chebyshev filter posted yet you are talking about the subcircuit. If you look at the netlist file, you will see that 2 of the 3 examples are commented out (denoted by *) therefore when you run the s-param.cir netlist file only the filter response will be given, as you have shown in your post.

However, it appears that the link for the .lib file for the MRF5711 given in the netlist file does not work (at least it didn't for me) and a quick google search yielded no results.
« Last Edit: September 23, 2017, 06:56:50 am by tec5c »
 

Offline promachTopic starter

  • Frequent Contributor
  • **
  • Posts: 875
  • Country: us
Re: S-parameter measurement simulation
« Reply #4 on: September 23, 2017, 02:42:40 pm »
OK. Now I am trying to understand the subcircuit before proceeding to the measurement section.
How should E1 and E2 be interpreted ?

Quote
X1 in out S22 S12 S_PARAM

.SUBCKT S_PARAM 22 66 5 7
* Resistors emulate switches with Ron=0.001 and Roff=1e12
* to switch driver to input and readout to output (and vice versa, see below)
RS1 22 2 0.001
RS2 66 6 0.001
RS3 22 6 1e12
RS4 66 2 1e12
*Driver
Vacdc 1 0 DC 'Vbias_in' AC 1 $ ac voltage and dc bias at input (applied through load resistor)
R1 1 2 'Rbase'
E1 3 0 2 0 2       $ amplify in port ac voltage by 2
Vac 3 4 DC 0 AC 1  $ subtract driving ac voltage
R_loop 4 5 0.001
R3 5 0 1           $ ground return for measure node 5
*Readout
E2 7 0 6 0 2       $ amplify out port ac voltage by 2
R4 6 8 'Rbase'     $ load resistor at output (ac)
Vdc 8 0 DC 'Vbias_out' AC 0 $ dc bias at output (applied through load resistor)
.ends
 

Offline promachTopic starter

  • Frequent Contributor
  • **
  • Posts: 875
  • Country: us
Re: S-parameter measurement simulation
« Reply #5 on: September 25, 2017, 06:08:06 am »
I am stucked at visualizing E1 which purpose is to amplify in port ac voltage by 2

Any idea ?

 

Offline promachTopic starter

  • Frequent Contributor
  • **
  • Posts: 875
  • Country: us
Re: S-parameter measurement simulation
« Reply #6 on: October 10, 2017, 08:50:50 am »
Quote
E1 3 0 2 0 2       $ amplify in port ac voltage by 2

This line means multiply the node voltage at #2 by a factor of two and the resultant voltage appears at node #3


Quote
Vac 3 4 DC 0 AC 1  $ subtract driving ac voltage

I do not understand this line though. Anyone ?
 

Offline promachTopic starter

  • Frequent Contributor
  • **
  • Posts: 875
  • Country: us
Re: S-parameter measurement simulation
« Reply #7 on: February 06, 2018, 03:25:14 pm »
Quote
By implementing the 2-volt generator as two 1-volt generators—VG1A and VG1B in series with the generator resistance RG1 as shown—we achieve the particularly simple result that the voltage at node 11 is the reflected or scattered wave b1. Since a1 equals one, this is S11 itself

I do not understand the above statement.

Why must RG1 be between S11 and VG1A ?

 

Offline promachTopic starter

  • Frequent Contributor
  • **
  • Posts: 875
  • Country: us
Re: S-parameter measurement simulation
« Reply #8 on: March 01, 2018, 03:49:36 pm »
I am using the S11 equations for input impedance to calculate the inductance value as described in https://ieee.li/pdf/essay/s_parameters_of_passive_components.pdf#page=5



Could anyone tell me why I am not getting Leq to be 1nH ?







The following is the netlist for the test circuit :

Code: [Select]
* gnetlist -g spice-noqsi -o test_active_inductor.net test_active_inductor.sch
* SPICE file generated by spice-noqsi version 20130710
* Send requests or bug reports to jpd@noqsi.com
RZ1 Vtest Ltest 50     
Vtest Vtest GND dc 1
+ac 1
.GLOBAL Vdd Vss
.PARAM SUPPLY=3.3v
.options TEMP=25
.MODEL n1 NMOS
.MODEL p1 PMOS
.INCLUDE CMOS_Inverter.net
.INCLUDE Gm2.net
Vd Vdd GND 'SUPPLY'
Vs Vss GND 0V
Ltest Ltest GND 1n 
.control
set noaskquit
AC LIN 1000 100Meg 200Meg
run
let S11=(2*v(Ltest)/v(Vtest)-1)
settype s-param S11

let S11db=db(S11)
settype decibel S11db

let P11=180*ph(s11)/pi
settype phase P11

plot s11db ylimit -0.5 0
plot P11

print S11 > S11.log
*plot smithgrid S11
*wrs2p s3046.s2p $ write touchstone vers. 1 file s3046.s2p
.endc
« Last Edit: March 01, 2018, 03:55:47 pm by promach »
 

Offline promachTopic starter

  • Frequent Contributor
  • **
  • Posts: 875
  • Country: us
Re: S-parameter measurement simulation
« Reply #9 on: March 02, 2018, 10:31:22 am »
Found the root cause for the miscalculation.

I forgot to multiply by Zo which is 50ohm
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf