Forums

How measure differential current in SPICE ?

Started by Unknown July 17, 2014
Could some SPICE guru please help ? 
I use HSPICE and Ngspice, both text 
input based. I wish to measure differential 
current output from a test circuit. 
For each output node, I can add a 
zero voltage output voltage source 
as for example
VTST 3 4 DC 0.0 AC 0.0
And then measure the current at each 
output node as 
.TRAN PRINT I(VTST1) ; and so on
But how do I combine the output from 
these two zero voltage voltage sources 
to get the actual differential current ? 
Any hints, suggestions would be of immense
help. Thanks in advance.

On Wed, 16 Jul 2014 21:44:36 -0700 (PDT), dakupoto@gmail.com wrote:

>Could some SPICE guru please help ? >I use HSPICE and Ngspice, both text >input based. I wish to measure differential >current output from a test circuit. >For each output node, I can add a >zero voltage output voltage source >as for example >VTST 3 4 DC 0.0 AC 0.0 >And then measure the current at each >output node as >.TRAN PRINT I(VTST1) ; and so on >But how do I combine the output from >these two zero voltage voltage sources >to get the actual differential current ? >Any hints, suggestions would be of immense >help. Thanks in advance.
In PSpice it would be... .PRINT (I(V1:1)-I(V2:1)) Where the "colon 1" indicates which terminal of the voltage source. ...Jim Thompson -- | James E.Thompson | mens | | Analog Innovations | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | San Tan Valley, AZ 85142 Skype: skypeanalog | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food.
wrote in message 
news:6a4724cf-75cd-41f6-a168-4445155ba409@googlegroups.com...

>Could some SPICE guru please help ? >I use HSPICE and Ngspice, both text >input based. I wish to measure differential >current output from a test circuit.
Two 0V voltage sources to extract the two currents and a "B" source to subtract the currents, and generate a voltage proportional to the diff current. e.g. feed currents into nodes 1, 2 and 3,4, into a subckt. .subckt diff_i_tester 1 2 3 4 out v1 1 2 dc 0 v2 3 4 dc 0 b1 4 0 v=i(v1)-i(v2) .ends plot (vout) from the calling circuit. the b source can have complicated expression, so is quite useful. Look it up in the manual! Kevin Aylward www.kevinaylward.co.uk www.anasoft.co.uk - SuperSpice
"Kevin Aylward"  wrote in message 
news:QNednQ9tBPnYlVXOnZ2dnUVZ8uqdnZ2d@bt.com...

wrote in message
news:6a4724cf-75cd-41f6-a168-4445155ba409@googlegroups.com...

>Could some SPICE guru please help ? >I use HSPICE and Ngspice, both text >input based. I wish to measure differential >current output from a test circuit.
.subckt diff_i_tester 1 2 3 4 out v1 1 2 dc 0 v2 3 4 dc 0 b1 4 0 v=i(v1)-i(v2) .ends ho hum...typo... b1 out 0 v=i(v1)-i(v2) Kevin Aylward www.kevinaylward.co.uk www.anasoft.co.uk - SuperSpice Kevin Aylward www.kevinaylward.co.uk www.anasoft.co.uk - SuperSpice