Connect with us

basic question on SPICE

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

Scroll to continue with content
  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
    source. In my case I've a current sensing application using a GMR AA004-02
    which is sensing AC. For that reason the use of a param sweep won't bring
    results I need.

    What I need know is a kind of voltage(or current) controlled
    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

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

  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
    for some ideas.

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


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

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

    *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

  5. Jim Thompson

    Jim Thompson Guest



    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
    ..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.

  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
    ^^^^^ that's what is misssing in your model!

    See below

    (Christoph R.) wrote in
    Add VCRES1 here

    Regards and good luck with your sims
  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