Home > Community > Forums > PCB Design > Using Parameters in Pspice models


* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Using Parameters in Pspice models 

Last post Thu, Jun 27 2013 9:29 PM by alokt. 2 replies.
Started by AndyK1 20 Jun 2013 08:15 AM. Topic has 2 replies and 1084 views
Page 1 of 1 (3 items)
Sort Posts:
  • Thu, Jun 20 2013 8:15 AM

    • AndyK1
    • Not Ranked
    • Joined on Mon, Jun 17 2013
    • Posts 11
    • Points 175
    Using Parameters in Pspice models Reply

    Is this possible? As an example I set R1VAL to 10 using a parameter block. Then I edit the model of an Rbreak resistor and type

    .model Rbreak RES R={2*5} dev=1%

    I set the value of the resistor to  {R1val*10} and it behaves like 1k 1% resistor. No problems up to here. 

    The problems starts when I try to use the R1val parameter in the dev statement. My goal is to be able to set up parameters that can be changed which would in turn effect the dev values for the resistors. This is to be able to quickly simulate different mission enviroments with different amounts of radiation and temperature.

    So here is what I try, I type dev={R1val*2} and then run worst case analysis and the resistor does not behave like a %20 resistor. Even when I take the "math" away and just use dev={R1val}, it does not look like a %10 resistor. One of the worst case lines actually go down below zero and show negative voltage at a node that needs to be somewhere around 5V.

    On top of all this, if I use too small of a value for R1val such as 1 or 2 and then use dev={R1val}, simulation gets aborted due to " can't divide by zero" error.

    I have no idea what is going on, can some one help?



    • Post Points: 20
  • Thu, Jun 20 2013 12:20 PM

    • oldmouldy
    • Top 10 Contributor
    • Joined on Tue, Jul 15 2008
    • Woking, Surrey
    • Posts 1,446
    • Points 24,610
    Re: Using Parameters in Pspice models Reply

    I guess you mean R1VAL to 100 for the 10x result to be 1k?

    DEV and LOT are expecting <number>% as the parameter value, from a quick test, a parameter from a PARAM will be substituted into a DEV expression of {mytol}%, where the mytol is a number, but it doesn't look to be too happy about calculating the "mytol" from an expression and then going with that. "mytol" can be the variable for a secondary, or parametric sweep. For later versions, the passive parts have a TOLERANCE property which goes to the netlist as DEV so you don't need the Breakout library parts as in past. My "will this make a netlist" test attached.

    • Post Points: 20
  • Thu, Jun 27 2013 9:29 PM

    • alokt
    • Top 25 Contributor
    • Joined on Fri, Aug 22 2008
    • Noida, Uttar Pradesh
    • Posts 243
    • Points 3,495
    Re: Using Parameters in Pspice models Reply

    You can try the following

    At the resistance instance define it's value = 1. In the .model use following syntax

    .MODEL RMOD RES R = {VAL} Dev={TOL*0.01*VAL}

    Where VAL is actual resistance value ; TOL is resistance tolerance in % terms ; You may notice above expression converts the %tolerance in absolute number for a given resistance value

    Take the following example

    if my circuit has following statements

    R1 1 0 RMOD 1
    .MODEL RMOD RES R = {VAL} Dev={TOL*0.01*VAL}
    .PARAM TOL=4.5 VAL=120


    R1 1 0 RMOD 1
    .MODEL RMOD RES R = 120 Dev=4.5%

    These are two different ways to simulate 120 Ohm resistance with 4.5% tolerance. Both of these will give me same results if I run Worstcase analysis. The first syntax allows me to define tolerance as expression. I believe this is what you are looking for.



    • Post Points: 5
Page 1 of 1 (3 items)
Sort Posts:
Started by AndyK1 at 20 Jun 2013 08:15 AM. Topic has 2 replies.