Connect with us

basic question on SPICE

Discussion in 'CAD' started by Boris Feinbrand, May 12, 2004.

  1. Hello group,

    I'm trying to simulate a wheatstone bridge as it is used in several sensors.
    My intention is the simulation of the physical effect by using a voltage or
    current
    source. In my case I've a current sensing application using a GMR AA004-02
    (nve)
    which is sensing AC. For that reason the use of a param sweep won't bring
    the
    results I need.

    What I need know is a kind of voltage(or current) controlled
    resistor/impedance.
    I tried to mange that issue with a JFET but since that's quite tricky to get
    the desired range
    and dynamic range I hope there's an easier way to do it.

    thank you in advance

    regards
    Christoph
     
  2. Read about 'Non-linear Dependent Sources':

    http://newton.ex.ac.uk/teaching/CDHW/Electronics2/userguide/sec3.html#3.2.3


    Charles.
     
  3. qrk

    qrk Guest

    Some versions of Spice support a voltage-controlled switch. The
    resistance will vary with input voltage. Unfortunately, it isn't a
    linear relationship.

    You can make your own voltage controlled resistor. See
    http://www.ecircuitcenter.com/Circuits/vc_resistor1/vc_resistor1.htm
    for some ideas.

    Mark
     
  4. Christoph R.

    Christoph R. Guest

    What I need know is a kind of voltage(or current) controlled
    Thank you Mark,

    I tried to use the implementations from the provided link and
    poorly failed. My colleges nor I know whats going wrong. I built
    a little circuit with a resistor in series to the VCR and tried
    to simulate that using Protel 99SE SP6. The generated netlist is
    shown below. The netlist failed to simulate unless I delete the
    comments at the top of the file. As far as I remember the first
    line of a SPICE file is treated as comment anyway so that it's no
    wonder that the simulator accepts the file after having comments
    deleted.
    The error the simulator is reporting is:

    Error: Unknown subckt: xr1 out 0 vctrl 0 vcres1 res=1k

    As far as I can see there's no reason for that message! Have you
    got an idea what's going wron?

    Any hint appriciated ...

    regards and thanks in advance

    Christoph

    ============================
    *SPICE Netlist generated by Advanced Sim server on 14.05.2004 09:07:48
    *for: VCR1.nsx

    *Schematic Netlist:
    XR1 OUT 0 VCTRL 0 VCRES1 RES=1k
    R2 VCC OUT 1k
    V3 VCTRL 0 DC 0 PWL(0 0.5 12.5m 1.5)
    VCC VCC 0 1V

    *Selected Circuit Analyses:
    ..TRAN 5E-5 0.0125 0 5E-5
    ..OP

    *Models and Subcircuit:
    ..SUBCKT VCRES1 1 4 5 6 RES=1K
    RS 1 2 1U
    ERES 2 3 VALUE = I(VSENSE)*RES*V(5,6)
    VSENSE 3 4 DC 0V
    ..ENDS

    ..END
     
  5. Jim Thompson

    Jim Thompson Guest

    See...

    "VOLTAGE VARIABLE RESISTOR SYMBOL/SUBCIRCUIT"

    On the Subcircuits & Symbols Page of my website.

    You may need to edit the subcircuit to conform to your particular
    flavor of Spice.


    ...Jim Thompson
     
  6. qrk

    qrk Guest


    Your subckt syntax might be bad. In PSpice, your subckt line should
    read:
    ..SUBCKT VCRES1 1 4 5 6 PARAMS: RES=1K
    ^^^^^^^
    You may need to use some curly brackets for your equations. See the
    documentation for your flavor of Spice as it could be different from
    what I'm used to.

    The better solution is to use the voltage-controlled current source
    soulution. Less parts and some say it converges better.

    Mark
     
  7. Hi Guys,

    If you are using Protel keep in mind that its syntax is a little
    bit different from the often used Pspice syntax. Protel uses a
    modified version of Berkely Spice (Kernel 3f5 I think)

    Subcircuits in Protel are defined as follows:

    SUBCKT NAME {params}
    command line 1
    command line 2
    ...
    ENDS. NAME
    ^^^^^ that's what is misssing in your model!

    See below


    (Christoph R.) wrote in
    ^^^^^^^^^^
    Add VCRES1 here

    Regards and good luck with your sims
    Michael
     
  8. Christoph R.

    Christoph R. Guest

    Thank you Michael but I already checked that out. No effect!
    I don't know if Protel does support the VALUE-directive. So I tried
    to use the 3rd methode pointed out by the link provided from Mark.
    I don't have it present by now but the try also failed poorly.

    So, has anybody implemented that SUBCKT on Protel99SE ?

    regards Christoph
     
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

-