Maker Pro
Maker Pro

basic question on SPICE

B

Boris Feinbrand

Jan 1, 1970
0
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
 
Q

qrk

Jan 1, 1970
0
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

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
 
C

Christoph R.

Jan 1, 1970
0
What I need know is a kind of voltage(or current) controlled
You can make your own voltage controlled resistor. See
http://www.ecircuitcenter.com/Circuits/vc_resistor1/vc_resistor1.htm
for some ideas.

Mark

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
 
J

Jim Thompson

Jan 1, 1970
0
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

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
 
Q

qrk

Jan 1, 1970
0
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


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
 
M

Michael Bohlender

Jan 1, 1970
0
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


[email protected] (Christoph R.) wrote in
Any hint appriciated ...

*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
^^^^^^^^^^
Add VCRES1 here

Regards and good luck with your sims
Michael
 
C

Christoph R.

Jan 1, 1970
0
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


[email protected] (Christoph R.) wrote in

^^^^^^^^^^
Add VCRES1 here

Regards and good luck with your sims
Michael

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
 
Top