Home > Community > Forums > PCB Design > PSPICE tolerance a passed parameter

Email

* 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: *

 PSPICE tolerance a passed parameter 

Last post Thu, Jul 1 2010 4:30 AM by oldmouldy. 3 replies.
Started by jake65892 29 Jun 2010 02:35 PM. Topic has 3 replies and 4028 views
Page 1 of 1 (4 items)
Sort Posts:
  • Tue, Jun 29 2010 2:35 PM

    • jake65892
    • Not Ranked
    • Joined on Tue, Jun 29 2010
    • Posts 2
    • Points 40
    PSPICE tolerance a passed parameter Reply

    I have 2 questions I have ran into while trying to run a monte carlo analysis:

    1. How can I tolerance a parameter passed into a sub-circuit such that it will vary over a monte-carlo run?

    For instance, a 3 or 4 resistor values getting passed into a suckt as a parameter, but i would like it to vary one +/- 10%, one 5%, one 7%, and another 3%.  Is it possible to pass these values into the subckt as voltages that get varied as the result of a current source and a resistor with a tolerance?

     2. Also, if I tolerance an inductor value, how can I pass the value of the inductor for that particular monte carlo run into a parameter that is passed into a subcircuit. 

    For instance, I would like to vary an inductor (nominal = 10uH) 10%.  For a particular monte carlo run, lets assume it gets set to 10%, or 11uH.  I would then like to pass that 11uH into a parameter to be multiplied in a subckt.  On the next monte carlo run, lets say it gets set to -10%, or 9uH.  I would then like to pass that 9uH into the same parameter to be multiplied in that same subckt.

    • Post Points: 20
  • Wed, Jun 30 2010 9:32 AM

    • oldmouldy
    • Top 10 Contributor
    • Joined on Tue, Jul 15 2008
    • Woking, Surrey
    • Posts 1,268
    • Points 21,735
    Re: PSPICE tolerance a passed parameter Reply

    You could have parts with "DEV=10%", "DEV=5%", DEV="7%", "DEV=3%" and so on to get the differing tolerances. I am pretty sure that you canot get this parameter from a circuit note since the "%" is required for the evaluated parameter.

    You probably need to look at parametric analysis to get these values passed into circuits / sub-circuits.

    Monte Carlo is going to randomly vary the value of any devices with DEV (and LOT) tolerances applied, so any two components are unlikely to have the same value, Parametric Analysis might get you what you want.

    • Post Points: 20
  • Wed, Jun 30 2010 11:03 AM

    • jake65892
    • Not Ranked
    • Joined on Tue, Jun 29 2010
    • Posts 2
    • Points 40
    Re: PSPICE tolerance a passed parameter Reply

     The problem is that these are not parts in the subckt.  These are simply constants that are being passed parameters.

    I'm not sure what you are suggesting in the last paragraph, but I need to be doing monte carlo analysis. I'm not sure how parametric analysis would work unless I could vary multiple parameters to multiple values.

    • Post Points: 20
  • Thu, Jul 1 2010 4:30 AM

    • oldmouldy
    • Top 10 Contributor
    • Joined on Tue, Jul 15 2008
    • Woking, Surrey
    • Posts 1,268
    • Points 21,735
    Re: PSPICE tolerance a passed parameter Reply

    OK, take a look at these netlists, you can pass parametric values into the DEV parameters, I have one parameter and two resistors but the same would apply to different tolerance parameters to each resistor:

    ## calling circuit

    V_V1         IN 0 DC 0Vdc AC 1Vac
    R_R1         0 OUT  1G TC=0,0
    X_U1         IN N1 RC_CIRCUIT PARAMS:  DEVTOL={TOL1}
    X_U2         N1 N2 RC_CIRCUIT PARAMS:  DEVTOL={TOL2}
    X_U3         N2 N3 RC_CIRCUIT PARAMS:  DEVTOL={TOL3}
    X_U4         N3 N4 RC_CIRCUIT PARAMS:  DEVTOL={TOL4}
    X_U5         N4 OUT RC_CIRCUIT PARAMS:  DEVTOL={TOL5}
    .PARAM  tol1=1% tol2=2% tol3=3% tol4=4% tol5=5%


    ## subcircuit definition

    .SUBCKT RC_Circuit IN OUT PARAMS: DEVTOL=5%
    R_R2         OUT IN R_R2 1k TC=0,0
    .model        R_R2 RES R=1 DEV={DEVTOL}TC1=0 TC2=0
    R_R3         0 OUT R_R3 1k TC=0,0
    .model        R_R3 RES R=1 DEV={DEVTOL}TC1=0 TC2=0
    C_C1         0 OUT  1n  TC=0,0
    .ENDS

    This at least netlists and runs, you would need to check the results to ensure that the tolerances were being processed correctly.

    The other point was that, the Monte Carlo run will independently apply the random tolerance to each component with a DEV (or LOT) tolerance, so one value could be 9.1uH but another value could be 9.2uH (or any other value in the tolerance range specified), parameters, and parametric analysis, would allow you to specify the actual value of circuit elements.

    • Post Points: 5
Page 1 of 1 (4 items)
Sort Posts:
Started by jake65892 at 29 Jun 2010 02:35 PM. Topic has 3 replies.