# simple ltspice help

Discussion in 'CAD' started by chapmjw, Feb 16, 2007.

1. ### chapmjwGuest

How can I set a voltage source based on a measured voltage?

For example, take 2 simple loops.
I'd like to set V3 to 5 times V2
Loop 1: V1(10 volts) to V2(0 volts) to R1(100ohm) to ground.
Loop 2: V3(V2 * 5) to R2(100 ohm) to ground.

V1 N002 0 10
V2 N003 N002 0
R1 N003 0 100

V3 N001 0 V2 5 <---tried many different combinations here
R2 N001 0 100

..tran 0 1 0 .01 startup
..backanno
..end

thanks
jim

2. ### Jim ThompsonGuest

LTspice is reading "V3 N001 0 V2 5" as "V2" is a node. Since you then
have too many nodes LTspice is probably giving you an error message.

I think it's the same in LTspice as in PSpice...

V3 N001 0 {V(N003)*5}

I don't know if...

V3 N001 0 {V2*5}

will work in LTspice or not. PSpice would require a .PARAM statement.

...Jim Thompson

3. ### Helmut SennewaldGuest

Hell Jim,

There are voltage controlled voltage and current sources and current
controlled voltage and current sources.
(VCVS=E, VCCS=G, CCVS=H, CCCS=F)

You can solve your problem with a E-source.
It has two inputs for the control voltage and two output nodes. You have to
set the gain to 5 in your case.
These sources are available for schematic drawings of course.

Syntax: Exxx n+ n- nc+ nc- <gain>
The final netlist will look like the following.
E1 N001 0 N003 N002 5

All this is pure SPICE. I recommend to read about the devices of SPICE or at
least the help of LTspice.

Best regards,
Helmut

4. ### john jardineGuest

I'm not sure what V2 is there for but lose it and label the 10V source to
resistor wire as (say) Fred. That fred node can be referred to elsewhere
using the very handy "bv" component.

V1 Fred 0 10
R1 Fred 0 100
R2 N001 0 100
B1 N001 0 V=v(fred) * 5
..tran 1
..backanno
..end

5. ### john jardineGuest

My nodes number up slightly different, so clarify by the diagram ...

Version 4
SHEET 1 480 164
WIRE 48 -304 -96 -304
WIRE -96 -208 -96 -304
WIRE 48 -160 48 -304
WIRE 336 -144 176 -144
WIRE 336 -96 336 -144
WIRE 176 -80 176 -144
WIRE -96 -48 -96 -208
WIRE 48 32 48 -80
WIRE 176 32 176 0
WIRE 336 32 336 -16
FLAG -96 32 0
FLAG 48 32 0
FLAG 176 32 0
FLAG 336 32 0
FLAG -96 -208 Fred
SYMBOL voltage -96 -64 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V1
SYMATTR Value 10
SYMBOL res 32 -176 R0
SYMATTR InstName R1
SYMATTR Value 100
SYMBOL res 320 -112 R0
SYMATTR InstName R2
SYMATTR Value 100
SYMBOL bv 176 -96 R0
SYMATTR InstName B1
SYMATTR Value V=v(fred) * 5
TEXT -210 44 Left 0 !.tran 1