PSpice Parametric Sweep

A

Active8

Guest
hi:

there's nothing about this in the manuals. is there a way to specify two
parameters to be swept? for instance, the capacitive divider in a
oscillator feedback loop, sweep both.

alternately, is there a way to specify a component value as a function
of another parameter or another component (e.g., an R-2R ladder where
you could just specify R1 and have the others calculated from that value
which would be handy in a param sweep.)

i can't delete properties from the PARAMETER properties (ORCAD thing)
either. and PSpice docs, refer to "NAME=" and "VALUE=", neither of which
show up in Orcad's property sheet, rather you see "Reference", "Value",
and any user defined properties which are the ones i can't get rid of.

thanks,
mike
 
Active8 wrote:
hi:

there's nothing about this in the manuals. is there a way to specify
two parameters to be swept? for instance, the capacitive divider in a
oscillator feedback loop, sweep both.

alternately, is there a way to specify a component value as a function
of another parameter or another component (e.g., an R-2R ladder where
you could just specify R1 and have the others calculated from that
value which would be handy in a param sweep.)

i can't delete properties from the PARAMETER properties (ORCAD thing)
either. and PSpice docs, refer to "NAME=" and "VALUE=", neither of
which show up in Orcad's property sheet, rather you see "Reference",
"Value", and any user defined properties which are the ones i can't
get rid of.

thanks,
mike
Er... no idea...but, I recently added an any number of parameters to
SuperSpice:)

e.g, my treble and bass example, uses the following file as input.

..ReRun MinTrebleBass
r1 90k
r2 10k
r3 90k
r4 10k
..RREnd
..ReRun 30%TrebleBass
r1 70k
r2 30k
r3 70k
r4 30k
..RREnd
..ReRun 70%TrebleBass
r1 30k
r2 70k
r3 30k
r4 70k
..RREnd
..ReRun MaxTrebleBass
r1 10k
r2 90k
r3 10k
r4 90k
..RREnd

Each set will be run automatically in turn, with everything plotted in
one go. You can include other parameters such as:

..ReRun Run1
r1 25k
..temp 50
qq2n3904 250 bf
v3 1.5 amplitude
..RREnd


Kevin Aylward
salesEXTRACT@anasoft.co.uk
http://www.anasoft.co.uk
SuperSpice, a very affordable Mixed-Mode
Windows Simulator with Schematic Capture,
Waveform Display, FFT's and Filter Design.
 
On Sat, 09 Aug 2003 03:22:00 GMT, Active8
<mcolasono@earthlink.net.invalid> wrote:

alternately, is there a way to specify a component value as a function
of another parameter or another component (e.g., an R-2R ladder where
you could just specify R1 and have the others calculated from that value
which would be handy in a param sweep.)
That is the way you do it. Note I'm writing this from schematics
point of view since IMO is better than OrCAD. Hence you'll either have
to use schematics or work out what this means in OrCAD.

Drop in a parameter component and create say X, value 1. Set the
analysis to sweep this, say 0.01 to 1. Enter component values as say
{X*10k} and {(1-X)*10k} for a 10K pot. You must have the {} in the
component value. Alternately you can define parameters R1val, value
{X*10k} and R2val, value {(1-X)*10k} and then set component values to
{R1val} and {R2val} which is what I normally do.

For more complex schemes you can use the IF function, i.e. parameter
R1val, value {IF(X==1, 10k, 11k)}. In these case you probably will
set X to be 0, 1, 2, 3 etc. and then use IF statements to set
individual values as required. On one simulation I built a digital
set of IF statements i.e. 0-255 steps through all combinations of 8
components.

For more complex requirements you could consider .cir stuffing. You
can include a file with .Param lines to set component values. Hence
you can use Excel or MathCAD+Excel (the way I do it) to generate
component values. I used this recently to calculate and optimise
active filters.

You could extend that to generating a series of .cir files
concatenated together. The .cir file is very simple, all the detail
is in the .net file which gets included. If you join .cir files and
then run the one file it produces a multi pspice run. You lose the
link to the schematic so naming your nodes is useful. I have used
this technique in the past for runs with loads of different component
variations, although as PC are faster now I might tend to use the
brute force approach of monte carlo to get the extremes.





--

....malcolm

Malcolm Reeves BSc CEng MIEE MIRSE, Full Circuit Ltd, Chippenham, UK
(mreeves@fullcircuit.com, mreeves@fullcircuit.co.uk or mreeves@iee.org).
Design Service for Analogue/Digital H/W & S/W Railway Signalling and Power
electronics. More details plus freeware, Win95/98 DUN and Pspice tips, see:

http://www.fullcircuit.com or http://www.fullcircuit.co.uk

NEW - Desktop ToDo/Reminder program (free)
 
In article <itc9jv89e4t2gbflpamst4upsv5v1666fc@4ax.com>,
mreeves@fullcircuit.com says...
On Sat, 09 Aug 2003 03:22:00 GMT, Active8
mcolasono@earthlink.net.invalid> wrote:

alternately, is there a way to specify a component value as a function
of another parameter or another component (e.g., an R-2R ladder where
you could just specify R1 and have the others calculated from that value
which would be handy in a param sweep.)

That is the way you do it. Note I'm writing this from schematics
point of view since IMO is better than OrCAD. Hence you'll either have
to use schematics or work out what this means in OrCAD.
it's easier to say in spice than in some cads unfortunately, but we seem
to be in sync with our cad speak in this case :)

Drop in a parameter component and create say X, value 1. Set the
analysis to sweep this, say 0.01 to 1. Enter component values as say
{X*10k} and {(1-X)*10k} for a 10K pot. You must have the {} in the
component value.
ok, i forgot about putting the WHOLE expression inside the {} for the
part value, duh!

Alternately you can define parameters R1val, value
{X*10k} and R2val, value {(1-X)*10k} and then set component values to
{R1val} and {R2val} which is what I normally do.
that's what i'm talking about. being able to organize that stuff in the
..PARAM lines and since it seems i can only sweep one param, a generic
param like X would solve the prob. thanks.

it looks like my transient response goes to hell for certain minor
variations in component values i.e. as insignificant as choosing
standard values. we'll see what it looks like now.

all below is useful info, also. thanks, again. i'm shady on how separate
spice runs work, though. i know you get output for all runs somehow, but
that's about it. no info in the spice manual about using .STEP more than
once or for multiple params, either.

br,
mike

For more complex schemes you can use the IF function, i.e. parameter
R1val, value {IF(X==1, 10k, 11k)}. In these case you probably will
set X to be 0, 1, 2, 3 etc. and then use IF statements to set
individual values as required. On one simulation I built a digital
set of IF statements i.e. 0-255 steps through all combinations of 8
components.

For more complex requirements you could consider .cir stuffing. You
can include a file with .Param lines to set component values. Hence
you can use Excel or MathCAD+Excel (the way I do it) to generate
component values. I used this recently to calculate and optimise
active filters.

You could extend that to generating a series of .cir files
concatenated together. The .cir file is very simple, all the detail
is in the .net file which gets included. If you join .cir files and
then run the one file it produces a multi pspice run. You lose the
link to the schematic so naming your nodes is useful. I have used
this technique in the past for runs with loads of different component
variations, although as PC are faster now I might tend to use the
brute force approach of monte carlo to get the extremes.
 
On Sat, 09 Aug 2003 10:48:48 GMT, Active8
<mcolasono@earthlink.net.invalid> wrote:


i'm shady on how separate
spice runs work, though. i know you get output for all runs somehow, but
that's about it. no info in the spice manual about using .STEP more than
once or for multiple params, either.
AFAIK you can't do multiple steps, the exception is DC analysis where
you can step the DC level and a parameter.

What you can do is join multiple .cir files i.e.

copy 1.cir + 2.cir + 3.cir all.cir

then run all.cir directly with the pspice engine. You can open the
resulting DAT file in probe and it looks like a stepped run file.
AFAIR it uses the 1st comment line as the title so it is useful if
this varies. The advantage of this approach is total control of the
cir file, disadvantage is loss of link to schematic for probing.

If you have a look at a .cir generated by schematics if pretty simple
to see what you need to produce. Pretty easy with perl or basic, or
excel basic.

--

....malcolm

Malcolm Reeves BSc CEng MIEE MIRSE, Full Circuit Ltd, Chippenham, UK
(mreeves@fullcircuit.com, mreeves@fullcircuit.co.uk or mreeves@iee.org).
Design Service for Analogue/Digital H/W & S/W Railway Signalling and Power
electronics. More details plus freeware, Win95/98 DUN and Pspice tips, see:

http://www.fullcircuit.com or http://www.fullcircuit.co.uk

NEW - Desktop ToDo/Reminder program (free)
 

Welcome to EDABoard.com

Sponsor

Back
Top