Voltage-variable capacitor doesn't work in LTSpice

J

Joerg

Guest
Gentlemen,

Setting up voltage-controlled resistors is easy: R=(V(X)+0.01) or
whatever. Works, always did. Doing the same with a capacitor fails with
this error message:

Error on line 6 : c1 n002 0 c=(v(x)+0.01)
Unable to find definition of model "c"

* Unknown parameter "x"
WARNING: Less than two connections to node X. This node is used by V4.
Fatal Error: Missing capacitance value for "C1"

Both sims attached. What gives? Ideas how to make it work? Disregard the
values that wouldn't make sense for the cap here, this is just to find
the principal reason why the control method doesn't work with capacitors.


Variable resistor:

Version 4
SHEET 1 880 680
WIRE -80 -32 -256 -32
WIRE 64 -32 0 -32
WIRE 320 -32 64 -32
WIRE 64 0 64 -32
WIRE -640 16 -640 -48
WIRE -256 16 -256 -32
WIRE 320 16 320 -32
WIRE -640 112 -640 96
WIRE -256 112 -256 96
WIRE 64 112 64 80
WIRE 320 112 320 80
FLAG -256 112 0
FLAG -640 112 0
FLAG -640 -48 X
FLAG 64 112 0
FLAG 320 112 0
SYMBOL voltage -256 0 R0
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V2
SYMATTR Value 2.048
SYMBOL res 48 -16 R0
SYMATTR InstName R1
SYMATTR Value R=(V(X)+0.01)
SYMBOL res -96 -16 R270
WINDOW 0 32 56 VTop 2
WINDOW 3 0 56 VBottom 2
SYMATTR InstName R2
SYMATTR Value 2.49k
SYMBOL voltage -640 0 R0
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V4
SYMATTR Value PULSE(0 1 1n 1m 2m 1m 5m 1)
SYMBOL cap 304 16 R0
SYMATTR InstName C1
SYMATTR Value 1p
TEXT -472 -96 Left 2 !.tran 5m


Variable capacitor:

Version 4
SHEET 1 880 680
WIRE -80 -32 -256 -32
WIRE 64 -32 0 -32
WIRE 320 -32 64 -32
WIRE 64 0 64 -32
WIRE -640 16 -640 -48
WIRE -256 16 -256 -32
WIRE 320 16 320 -32
WIRE -640 112 -640 96
WIRE -256 112 -256 96
WIRE 64 112 64 80
WIRE 320 112 320 80
FLAG -256 112 0
FLAG -640 112 0
FLAG -640 -48 X
FLAG 64 112 0
FLAG 320 112 0
SYMBOL voltage -256 0 R0
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V2
SYMATTR Value 2.048
SYMBOL res 48 -16 R0
SYMATTR InstName R1
SYMATTR Value 100k
SYMBOL res -96 -16 R270
WINDOW 0 32 56 VTop 2
WINDOW 3 0 56 VBottom 2
SYMATTR InstName R2
SYMATTR Value 2.49k
SYMBOL voltage -640 0 R0
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V4
SYMATTR Value PULSE(0 1 1n 1m 2m 1m 5m 1)
SYMBOL cap 304 16 R0
SYMATTR InstName C1
SYMATTR Value C=(V(X)+0.01)
TEXT -472 -96 Left 2 !.tran 5m


--
Regards, Joerg

http://www.analogconsultants.com/
 
On Mon, 16 Mar 2015 17:26:44 -0700, Joerg <news@analogconsultants.com>
wrote:

Gentlemen,

Setting up voltage-controlled resistors is easy: R=(V(X)+0.01) or
whatever. Works, always did. Doing the same with a capacitor fails with
this error message:

Error on line 6 : c1 n002 0 c=(v(x)+0.01)
Unable to find definition of model "c"

* Unknown parameter "x"
WARNING: Less than two connections to node X. This node is used by V4.
Fatal Error: Missing capacitance value for "C1"

Both sims attached. What gives? Ideas how to make it work? Disregard the
values that wouldn't make sense for the cap here, this is just to find
the principal reason why the control method doesn't work with capacitors.


Variable resistor:

[snip]

See VVC.zip and VVR.zip on the Device Models & Subcircuits Page of my
website for the proper notation.

...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.
 
On Mon, 16 Mar 2015 17:26:44 -0700, Joerg <news@analogconsultants.com>
wrote:

Gentlemen,

Setting up voltage-controlled resistors is easy: R=(V(X)+0.01) or
whatever. Works, always did. Doing the same with a capacitor fails with
this error message:

Error on line 6 : c1 n002 0 c=(v(x)+0.01)
Unable to find definition of model "c"

* Unknown parameter "x"
WARNING: Less than two connections to node X. This node is used by V4.
Fatal Error: Missing capacitance value for "C1"

Both sims attached. What gives? Ideas how to make it work? Disregard the
values that wouldn't make sense for the cap here, this is just to find
the principal reason why the control method doesn't work with capacitors.

Here's one I did a while back... can't remember why.

https://dl.dropboxusercontent.com/u/53724080/Circuits/Caps/Nonlin_Cap_Sweep.asc

What's annoying is that Q is a function of voltage, not C.



--

John Larkin Highland Technology, Inc
picosecond timing precision measurement

jlarkin att highlandtechnology dott com
http://www.highlandtechnology.com
 
On 2015-03-16 5:48 PM, Jim Thompson wrote:
On Mon, 16 Mar 2015 17:26:44 -0700, Joerg <news@analogconsultants.com
wrote:

Gentlemen,

Setting up voltage-controlled resistors is easy: R=(V(X)+0.01) or
whatever. Works, always did. Doing the same with a capacitor fails with
this error message:

Error on line 6 : c1 n002 0 c=(v(x)+0.01)
Unable to find definition of model "c"

* Unknown parameter "x"
WARNING: Less than two connections to node X. This node is used by V4.
Fatal Error: Missing capacitance value for "C1"

Both sims attached. What gives? Ideas how to make it work? Disregard the
values that wouldn't make sense for the cap here, this is just to find
the principal reason why the control method doesn't work with capacitors.


Variable resistor:

[snip]

See VVC.zip and VVR.zip on the Device Models & Subcircuits Page of my
website for the proper notation.

One is Altium and on PSpice. I checked the VVC for Altium in Notepad
(can't open it in the viewer) but it seems it's only a LUT version. I
need a real voltage control.

--
Regards, Joerg

http://www.analogconsultants.com/
 
On 2015-03-16 5:54 PM, John Larkin wrote:
On Mon, 16 Mar 2015 17:26:44 -0700, Joerg <news@analogconsultants.com
wrote:

Gentlemen,

Setting up voltage-controlled resistors is easy: R=(V(X)+0.01) or
whatever. Works, always did. Doing the same with a capacitor fails with
this error message:

Error on line 6 : c1 n002 0 c=(v(x)+0.01)
Unable to find definition of model "c"

* Unknown parameter "x"
WARNING: Less than two connections to node X. This node is used by V4.
Fatal Error: Missing capacitance value for "C1"

Both sims attached. What gives? Ideas how to make it work? Disregard the
values that wouldn't make sense for the cap here, this is just to find
the principal reason why the control method doesn't work with capacitors.



Here's one I did a while back... can't remember why.

https://dl.dropboxusercontent.com/u/53724080/Circuits/Caps/Nonlin_Cap_Sweep.asc

What's annoying is that Q is a function of voltage, not C.

Yes, I'd rather control C directly with a voltage. Why does LTSpice
refuse this? Maybe I'll have to ask over at the Yahoo forum, after
figuring out the dreaded login there. With that was a NG as well.

--
Regards, Joerg

http://www.analogconsultants.com/
 
On Tue, 17 Mar 2015 07:30:53 -0700, Joerg <news@analogconsultants.com>
wrote:

On 2015-03-16 5:54 PM, John Larkin wrote:
On Mon, 16 Mar 2015 17:26:44 -0700, Joerg <news@analogconsultants.com
wrote:

Gentlemen,

Setting up voltage-controlled resistors is easy: R=(V(X)+0.01) or
whatever. Works, always did. Doing the same with a capacitor fails with
this error message:

Error on line 6 : c1 n002 0 c=(v(x)+0.01)
Unable to find definition of model "c"

* Unknown parameter "x"
WARNING: Less than two connections to node X. This node is used by V4.
Fatal Error: Missing capacitance value for "C1"

Both sims attached. What gives? Ideas how to make it work? Disregard the
values that wouldn't make sense for the cap here, this is just to find
the principal reason why the control method doesn't work with capacitors.



Here's one I did a while back... can't remember why.

https://dl.dropboxusercontent.com/u/53724080/Circuits/Caps/Nonlin_Cap_Sweep.asc

What's annoying is that Q is a function of voltage, not C.



Yes, I'd rather control C directly with a voltage. Why does LTSpice
refuse this? Maybe I'll have to ask over at the Yahoo forum, after
figuring out the dreaded login there. With that was a NG as well.

I used to use ECA under DOS, a great netlist-based simulator. It
always converged and cruised through divide-by-zero and other errors.
It let you express any voltage, current, or R/L/C value as a simple
expression of anything else.


--

John Larkin Highland Technology, Inc
picosecond timing laser drivers and controllers

jlarkin att highlandtechnology dott com
http://www.highlandtechnology.com
 
On Tue, 17 Mar 2015 07:29:15 -0700, Joerg <news@analogconsultants.com>
wrote:

On 2015-03-16 5:48 PM, Jim Thompson wrote:
On Mon, 16 Mar 2015 17:26:44 -0700, Joerg <news@analogconsultants.com
wrote:

Gentlemen,

Setting up voltage-controlled resistors is easy: R=(V(X)+0.01) or
whatever. Works, always did. Doing the same with a capacitor fails with
this error message:

Error on line 6 : c1 n002 0 c=(v(x)+0.01)
Unable to find definition of model "c"

* Unknown parameter "x"
WARNING: Less than two connections to node X. This node is used by V4.
Fatal Error: Missing capacitance value for "C1"

Both sims attached. What gives? Ideas how to make it work? Disregard the
values that wouldn't make sense for the cap here, this is just to find
the principal reason why the control method doesn't work with capacitors.


Variable resistor:

[snip]

See VVC.zip and VVR.zip on the Device Models & Subcircuits Page of my
website for the proper notation.


One is Altium and on PSpice. I checked the VVC for Altium in Notepad
(can't open it in the viewer) but it seems it's only a LUT version. I
need a real voltage control.

Sorry. I had forgotten that "VVC" is a varicap model.

"Real" voltage control is trivial to do. Tell me the desired
expression... C = f(V) and I'll knock it for you in a few minutes ;-)

...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.
 
On 2015-03-17 8:22 AM, John Larkin wrote:
On Tue, 17 Mar 2015 07:30:53 -0700, Joerg <news@analogconsultants.com
wrote:

On 2015-03-16 5:54 PM, John Larkin wrote:
On Mon, 16 Mar 2015 17:26:44 -0700, Joerg <news@analogconsultants.com
wrote:

Gentlemen,

Setting up voltage-controlled resistors is easy: R=(V(X)+0.01) or
whatever. Works, always did. Doing the same with a capacitor fails with
this error message:

Error on line 6 : c1 n002 0 c=(v(x)+0.01)
Unable to find definition of model "c"

* Unknown parameter "x"
WARNING: Less than two connections to node X. This node is used by V4.
Fatal Error: Missing capacitance value for "C1"

Both sims attached. What gives? Ideas how to make it work? Disregard the
values that wouldn't make sense for the cap here, this is just to find
the principal reason why the control method doesn't work with capacitors.



Here's one I did a while back... can't remember why.

https://dl.dropboxusercontent.com/u/53724080/Circuits/Caps/Nonlin_Cap_Sweep.asc

What's annoying is that Q is a function of voltage, not C.



Yes, I'd rather control C directly with a voltage. Why does LTSpice
refuse this? Maybe I'll have to ask over at the Yahoo forum, after
figuring out the dreaded login there. With that was a NG as well.

I used to use ECA under DOS, a great netlist-based simulator. It
always converged and cruised through divide-by-zero and other errors.
It let you express any voltage, current, or R/L/C value as a simple
expression of anything else.

ECA224 was a great little simulator. I loved it. When starting
self-employed in 1989 I bought a PSpice license. I still have the
cloth-covered binders, IBM-style. Those were the days when I entered a
SPICE schematic in ASCII, pounding out the netlist in IBM EasyWriter. It
felt real manly just like cooking over wood fire. Scared clients though
because they couldn't see the schematic.

--
Regards, Joerg

http://www.analogconsultants.com/
 
On Tue, 17 Mar 2015 10:14:30 -0700, Joerg <news@analogconsultants.com>
wrote:

On 2015-03-17 8:22 AM, John Larkin wrote:
On Tue, 17 Mar 2015 07:30:53 -0700, Joerg <news@analogconsultants.com
wrote:

On 2015-03-16 5:54 PM, John Larkin wrote:
On Mon, 16 Mar 2015 17:26:44 -0700, Joerg <news@analogconsultants.com
wrote:

Gentlemen,

Setting up voltage-controlled resistors is easy: R=(V(X)+0.01) or
whatever. Works, always did. Doing the same with a capacitor fails with
this error message:

Error on line 6 : c1 n002 0 c=(v(x)+0.01)
Unable to find definition of model "c"

* Unknown parameter "x"
WARNING: Less than two connections to node X. This node is used by V4.
Fatal Error: Missing capacitance value for "C1"

Both sims attached. What gives? Ideas how to make it work? Disregard the
values that wouldn't make sense for the cap here, this is just to find
the principal reason why the control method doesn't work with capacitors.



Here's one I did a while back... can't remember why.

https://dl.dropboxusercontent.com/u/53724080/Circuits/Caps/Nonlin_Cap_Sweep.asc

What's annoying is that Q is a function of voltage, not C.



Yes, I'd rather control C directly with a voltage. Why does LTSpice
refuse this? Maybe I'll have to ask over at the Yahoo forum, after
figuring out the dreaded login there. With that was a NG as well.

I used to use ECA under DOS, a great netlist-based simulator. It
always converged and cruised through divide-by-zero and other errors.
It let you express any voltage, current, or R/L/C value as a simple
expression of anything else.


ECA224 was a great little simulator. I loved it. When starting
self-employed in 1989 I bought a PSpice license. I still have the
cloth-covered binders, IBM-style. Those were the days when I entered a
SPICE schematic in ASCII, pounding out the netlist in IBM EasyWriter. It
felt real manly just like cooking over wood fire. Scared clients though
because they couldn't see the schematic.

Here's an ECA netlist. I may have the hand-drawn schematic around here
somewhere. It would be a nuisance to reverse-engineer it from the
netlist.


' VARIAN L701 GRADIENT DRIVER MODEL L701.CKT
'
' BY JOHN LARKIN
' HIGHLAND TECHNOLOGY, INC
' SAN FRANCISCO
'
' SEPTEMBER 15, 1993
'
' THIS VERSION INCLUDES...
'
' 3 AMP PEAK DRIVE
' SIMPLE TRANSCONDUCTANCE OUTPUT STAGE
' WITH THERMAL TAILS
'
' FIRST, DO THE AD1862 20-BIT DAC...
'
VDAC 0 0 -3
RDAC 1 0 1u
'
' HERE'S THE SHUNT AND PREAMP...
' SHUNT .05R X GAIN 20 = 1V/AMP
'
R10 10 0 .05
U2 10 12 OP278
* 11 0
R11 11 12 1900.013
R12 12 0 100
'
' AND THE ERROR AMP...
'
U3 0 15 OP278
* 20 0
R5 1 15 2K
R13 11 15 2K
'
' LOOP COMPENSATION PARTS...
'
RZ 15 16 10K
CZ 16 20 1.5N
'
' THIS IS THE OUTPUT TRANSCONDUCTANCE AMP...
' R21:C21 IS 15 KHZ ROLLOFF
' TRANSCONDUCTANCE IS 3 AMPS/10 VOLTS = 0.3 SIEMENS
'
R21 20 21 1K
C21 21 0 15N
IAMP 21 0 0.3
RAMP 30 0 10K

' SIMULATE THE THERMAL HOOK OF THE OUTPUT
' DARLINGTON. ASSUME...
'
' CHIP THERMAL TAU = 20 mSEC
' THETA = 2 DEGC/WATT
' POWER PULSE = 25 WATTS
' EMITTER RESISTOR = 1 OHM
' TRANSISTOR VBE 5 mV/DEGC
' THERMAL HOOK 250 mV/3V = 1/12

R90 21 90 12K
C90 90 0 2U

'
' AND THE GRADIENT COIL LOAD...
'
LM 30 31 15U
RM 31 10 1.2





--

John Larkin Highland Technology, Inc
picosecond timing precision measurement

jlarkin att highlandtechnology dott com
http://www.highlandtechnology.com
 
On Tue, 17 Mar 2015 10:14:30 -0700, Joerg <news@analogconsultants.com>
wrote:

[snip].
ECA224 was a great little simulator. I loved it. When starting
self-employed in 1989 I bought a PSpice license. I still have the
cloth-covered binders, IBM-style. Those were the days when I entered a
SPICE schematic in ASCII, pounding out the netlist in IBM EasyWriter. It
felt real manly just like cooking over wood fire. Scared clients though
because they couldn't see the schematic.

I started out with Berkeley Spice on a VAX, pencil-drawn schematics,
number the nodes, write the netlist with a text editor... my son
Aaron, while still a teenager (now 45 :), wrote me a netlist version
control so I could back up to a previous netlist easily if I made a
change that malfunctioned.

When PSpice first came out I continued that procedure until MicroSim
Schematics arrived, which I still use to this day. I absolutely hated
OrCAD Crapture.

...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.
 
On Mon, 16 Mar 2015 17:26:44 -0700, Joerg <news@analogconsultants.com>
wrote:

[snip]

Here you go...

..SUBCKT VControlledCap CAP+ CAP- VC+ VC- PARAMS: C1=1nF C2=100pF
C_C1 CAP+ N_1 {C1}
R_NOF1 VC+ 0 1G
R_NOF2 VC- 0 1G
V_IM1 N_1 CAP- 0
G_G2 CAP+ CAP- VALUE {C2/C1*V(VC+,VC-)*I(V_IM1)}
..ENDS VControlledCap

When VC=,VC1 is zero, cap value is C1

When VC=,VC1=+1, cap value is C1+C2

When VC=,VC1=-1, cap value is C1-C2

I'll post this to my website in a few days... honey-do projects abound
;-)

...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.
 
On Tue, 17 Mar 2015 13:06:35 -0700, Jim Thompson
<To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> wrote:

On Mon, 16 Mar 2015 17:26:44 -0700, Joerg <news@analogconsultants.com
wrote:

[snip]

Here you go...

.SUBCKT VControlledCap CAP+ CAP- VC+ VC- PARAMS: C1=1nF C2=100pF
C_C1 CAP+ N_1 {C1}
R_NOF1 VC+ 0 1G
R_NOF2 VC- 0 1G
V_IM1 N_1 CAP- 0
G_G2 CAP+ CAP- VALUE {C2/C1*V(VC+,VC-)*I(V_IM1)}
.ENDS VControlledCap

When VC=,VC1 is zero, cap value is C1

When VC=,VC1=+1, cap value is C1+C2

When VC=,VC1=-1, cap value is C1-C2

I'll post this to my website in a few days... honey-do projects abound
;-)

...Jim Thompson

Typos galore, lagging/leading shift key, text should say...

When VC+,VC- is zero, cap value is C1

When VC+,VC- = +1, cap value is C1+C2

When VC+,VC- = -1, cap value is C1-C2

...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.
 
On 2015-03-17 1:24 PM, Jim Thompson wrote:
On Tue, 17 Mar 2015 13:06:35 -0700, Jim Thompson
To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> wrote:

On Mon, 16 Mar 2015 17:26:44 -0700, Joerg <news@analogconsultants.com
wrote:

[snip]

Here you go...

.SUBCKT VControlledCap CAP+ CAP- VC+ VC- PARAMS: C1=1nF C2=100pF
C_C1 CAP+ N_1 {C1}
R_NOF1 VC+ 0 1G
R_NOF2 VC- 0 1G
V_IM1 N_1 CAP- 0
G_G2 CAP+ CAP- VALUE {C2/C1*V(VC+,VC-)*I(V_IM1)}
.ENDS VControlledCap

When VC=,VC1 is zero, cap value is C1

When VC=,VC1=+1, cap value is C1+C2

When VC=,VC1=-1, cap value is C1-C2

I'll post this to my website in a few days... honey-do projects abound
;-)

...Jim Thompson

Typos galore, lagging/leading shift key, text should say...

When VC+,VC- is zero, cap value is C1

When VC+,VC- = +1, cap value is C1+C2

When VC+,VC- = -1, cap value is C1-C2

Thanks, Jim. Couldn't make a go of it yet, it errors with "Port(pin)
count mismatch between the definition of subcircuit "vcontrolledcap" and
instance: "xc1" ... The instance has fewer connection terminals than the
definition"

--
Regards, Joerg

http://www.analogconsultants.com/
 
On Tue, 17 Mar 2015 17:04:42 -0700, Joerg <news@analogconsultants.com>
wrote:

On 2015-03-17 1:24 PM, Jim Thompson wrote:
On Tue, 17 Mar 2015 13:06:35 -0700, Jim Thompson
To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> wrote:

On Mon, 16 Mar 2015 17:26:44 -0700, Joerg <news@analogconsultants.com
wrote:

[snip]

Here you go...

.SUBCKT VControlledCap CAP+ CAP- VC+ VC- PARAMS: C1=1nF C2=100pF
C_C1 CAP+ N_1 {C1}
R_NOF1 VC+ 0 1G
R_NOF2 VC- 0 1G
V_IM1 N_1 CAP- 0
G_G2 CAP+ CAP- VALUE {C2/C1*V(VC+,VC-)*I(V_IM1)}
.ENDS VControlledCap

When VC=,VC1 is zero, cap value is C1

When VC=,VC1=+1, cap value is C1+C2

When VC=,VC1=-1, cap value is C1-C2

I'll post this to my website in a few days... honey-do projects abound
;-)

...Jim Thompson

Typos galore, lagging/leading shift key, text should say...

When VC+,VC- is zero, cap value is C1

When VC+,VC- = +1, cap value is C1+C2

When VC+,VC- = -1, cap value is C1-C2


Thanks, Jim. Couldn't make a go of it yet, it errors with "Port(pin)
count mismatch between the definition of subcircuit "vcontrolledcap" and
instance: "xc1" ... The instance has fewer connection terminals than the
definition"

Read the help files about how to make a symbol in LTspice by
highlighting the .subckt line.

...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.
 
On Tue, 17 Mar 2015 17:04:42 -0700, Joerg <news@analogconsultants.com>
wrote:

On 2015-03-17 1:24 PM, Jim Thompson wrote:
On Tue, 17 Mar 2015 13:06:35 -0700, Jim Thompson
To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> wrote:

On Mon, 16 Mar 2015 17:26:44 -0700, Joerg <news@analogconsultants.com
wrote:

[snip]

Here you go...

.SUBCKT VControlledCap CAP+ CAP- VC+ VC- PARAMS: C1=1nF C2=100pF
C_C1 CAP+ N_1 {C1}
R_NOF1 VC+ 0 1G
R_NOF2 VC- 0 1G
V_IM1 N_1 CAP- 0
G_G2 CAP+ CAP- VALUE {C2/C1*V(VC+,VC-)*I(V_IM1)}
.ENDS VControlledCap

When VC=,VC1 is zero, cap value is C1

When VC=,VC1=+1, cap value is C1+C2

When VC=,VC1=-1, cap value is C1-C2

I'll post this to my website in a few days... honey-do projects abound
;-)

...Jim Thompson

Typos galore, lagging/leading shift key, text should say...

When VC+,VC- is zero, cap value is C1

When VC+,VC- = +1, cap value is C1+C2

When VC+,VC- = -1, cap value is C1-C2


Thanks, Jim. Couldn't make a go of it yet, it errors with "Port(pin)
count mismatch between the definition of subcircuit "vcontrolledcap" and
instance: "xc1" ... The instance has fewer connection terminals than the
definition"

I bet you could build a variable c-multiplier with a capacitor and a
multiplier, or an e source with the right expression.


--

John Larkin Highland Technology, Inc
picosecond timing laser drivers and controllers

jlarkin att highlandtechnology dott com
http://www.highlandtechnology.com
 
John Larkin <jlarkin@highlandtechnology.com> wrote:
On Tue, 17 Mar 2015 17:04:42 -0700, Joerg <news@analogconsultants.com
wrote:

On 2015-03-17 1:24 PM, Jim Thompson wrote:
On Tue, 17 Mar 2015 13:06:35 -0700, Jim Thompson
To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> wrote:

On Mon, 16 Mar 2015 17:26:44 -0700, Joerg <news@analogconsultants.com
wrote:

[snip]

Here you go...

.SUBCKT VControlledCap CAP+ CAP- VC+ VC- PARAMS: C1=1nF C2=100pF
C_C1 CAP+ N_1 {C1}
R_NOF1 VC+ 0 1G
R_NOF2 VC- 0 1G
V_IM1 N_1 CAP- 0
G_G2 CAP+ CAP- VALUE {C2/C1*V(VC+,VC-)*I(V_IM1)}
.ENDS VControlledCap

When VC=,VC1 is zero, cap value is C1

When VC=,VC1=+1, cap value is C1+C2

When VC=,VC1=-1, cap value is C1-C2

I'll post this to my website in a few days... honey-do projects abound
;-)

...Jim Thompson

Typos galore, lagging/leading shift key, text should say...

When VC+,VC- is zero, cap value is C1

When VC+,VC- = +1, cap value is C1+C2

When VC+,VC- = -1, cap value is C1-C2


Thanks, Jim. Couldn't make a go of it yet, it errors with "Port(pin)
count mismatch between the definition of subcircuit "vcontrolledcap" and
instance: "xc1" ... The instance has fewer connection terminals than the
definition"

I bet you could build a variable c-multiplier with a capacitor and a
multiplier, or an e source with the right expression.

If you dynamically change the value of a capacitor, do you end up with
discontinuities in the stores charge on that cap?
 
On Wed, 18 Mar 2015 02:22:11 GMT, Ralph Barone
<address_is@invalid.invalid> wrote:

John Larkin <jlarkin@highlandtechnology.com> wrote:
On Tue, 17 Mar 2015 17:04:42 -0700, Joerg <news@analogconsultants.com
wrote:

On 2015-03-17 1:24 PM, Jim Thompson wrote:
On Tue, 17 Mar 2015 13:06:35 -0700, Jim Thompson
To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> wrote:

On Mon, 16 Mar 2015 17:26:44 -0700, Joerg <news@analogconsultants.com
wrote:

[snip]

Here you go...

.SUBCKT VControlledCap CAP+ CAP- VC+ VC- PARAMS: C1=1nF C2=100pF
C_C1 CAP+ N_1 {C1}
R_NOF1 VC+ 0 1G
R_NOF2 VC- 0 1G
V_IM1 N_1 CAP- 0
G_G2 CAP+ CAP- VALUE {C2/C1*V(VC+,VC-)*I(V_IM1)}
.ENDS VControlledCap

When VC=,VC1 is zero, cap value is C1

When VC=,VC1=+1, cap value is C1+C2

When VC=,VC1=-1, cap value is C1-C2

I'll post this to my website in a few days... honey-do projects abound
;-)

...Jim Thompson

Typos galore, lagging/leading shift key, text should say...

When VC+,VC- is zero, cap value is C1

When VC+,VC- = +1, cap value is C1+C2

When VC+,VC- = -1, cap value is C1-C2


Thanks, Jim. Couldn't make a go of it yet, it errors with "Port(pin)
count mismatch between the definition of subcircuit "vcontrolledcap" and
instance: "xc1" ... The instance has fewer connection terminals than the
definition"

I bet you could build a variable c-multiplier with a capacitor and a
multiplier, or an e source with the right expression.



If you dynamically change the value of a capacitor, do you end up with
discontinuities in the stores charge on that cap?

I guess the only way to change the voltage across a voltage-dependant
capacitor is to apply current, which takes power, so energy is
conserved. A varicap doesn't violate conservation of energy.

If a c value depended on something independent of the terminal
voltage, you could apparently violate COE. Imagine a charged
parallel-plate capacitor connected to nothing. If you yank (yank!) the
plates apart, c goes down, Q is conserved, V goes up, and more energy
is stored in the cap. Pulling the plates apart took mechanical work,
which is where the added energy came from.

In my proposed c-multiplier, the e source can do work.


--

John Larkin Highland Technology, Inc
picosecond timing laser drivers and controllers

jlarkin att highlandtechnology dott com
http://www.highlandtechnology.com
 
On Wed, 18 Mar 2015 10:30:44 -0700, John Larkin wrote:

On Wed, 18 Mar 2015 09:28:57 -0700, Jim Thompson
To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> wrote:

Voltage-Controlled Capacitor Spice Model now on my website.

See VControlledCap.zip on the Device Models & Subcircuits Page.

Includes Library File (.LIB), LTspice Symbol (.ASY), and a JPEG showing
how it was developed.

...Jim Thompson

I don't have time to play with this just now, but one quick question:

Given that C is a variable capacitor, set C to 1F and charge it to 1
volt. Now change C to 0.5F. What is the new voltage?

How many 1 farad capacitors are you aware of?

Oh and would not a 1F charged cap dump into a 0.5F cap and fully charge
it? If that answer is yes, then the voltage would be the same...
slightly less even, all elements considered.

You thought it would morph the EMF into something else?
 
On 2015-03-17 7:44 PM, John Larkin wrote:
On Wed, 18 Mar 2015 02:22:11 GMT, Ralph Barone
address_is@invalid.invalid> wrote:

John Larkin <jlarkin@highlandtechnology.com> wrote:
On Tue, 17 Mar 2015 17:04:42 -0700, Joerg <news@analogconsultants.com
wrote:

On 2015-03-17 1:24 PM, Jim Thompson wrote:
On Tue, 17 Mar 2015 13:06:35 -0700, Jim Thompson
To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> wrote:

On Mon, 16 Mar 2015 17:26:44 -0700, Joerg <news@analogconsultants.com
wrote:

[snip]

Here you go...

.SUBCKT VControlledCap CAP+ CAP- VC+ VC- PARAMS: C1=1nF C2=100pF
C_C1 CAP+ N_1 {C1}
R_NOF1 VC+ 0 1G
R_NOF2 VC- 0 1G
V_IM1 N_1 CAP- 0
G_G2 CAP+ CAP- VALUE {C2/C1*V(VC+,VC-)*I(V_IM1)}
.ENDS VControlledCap

When VC=,VC1 is zero, cap value is C1

When VC=,VC1=+1, cap value is C1+C2

When VC=,VC1=-1, cap value is C1-C2

I'll post this to my website in a few days... honey-do projects abound
;-)

...Jim Thompson

Typos galore, lagging/leading shift key, text should say...

When VC+,VC- is zero, cap value is C1

When VC+,VC- = +1, cap value is C1+C2

When VC+,VC- = -1, cap value is C1-C2


Thanks, Jim. Couldn't make a go of it yet, it errors with "Port(pin)
count mismatch between the definition of subcircuit "vcontrolledcap" and
instance: "xc1" ... The instance has fewer connection terminals than the
definition"

I bet you could build a variable c-multiplier with a capacitor and a
multiplier, or an e source with the right expression.



If you dynamically change the value of a capacitor, do you end up with
discontinuities in the stores charge on that cap?

I guess the only way to change the voltage across a voltage-dependant
capacitor is to apply current, which takes power, so energy is
conserved. A varicap doesn't violate conservation of energy.

If a c value depended on something independent of the terminal
voltage, you could apparently violate COE. Imagine a charged
parallel-plate capacitor connected to nothing. If you yank (yank!) the
plates apart, c goes down, Q is conserved, V goes up, and more energy
is stored in the cap. Pulling the plates apart took mechanical work,
which is where the added energy came from.

In my proposed c-multiplier, the e source can do work.

Guys, I do not want to change the capacitance by changing the voltage at
the cap terminals. I want to change the capacitance by a mathematical
expression where the control function is a rail (or a voltage) in some
other distant land in the schematic. I still do not understand why this
works perfectly for a resistor value but it does not for a capacitor
value. For the resistor I do not have to make some other model with more
terminals, I can just key in expressions such as "R=V(X)" in the value
field where X is a rail somewhere else that I assign the label "X".

--
Regards, Joerg

http://www.analogconsultants.com/
 
On Tue, 17 Mar 2015 17:04:42 -0700, Joerg <news@analogconsultants.com>
wrote:

On 2015-03-17 1:24 PM, Jim Thompson wrote:
On Tue, 17 Mar 2015 13:06:35 -0700, Jim Thompson
To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> wrote:

On Mon, 16 Mar 2015 17:26:44 -0700, Joerg <news@analogconsultants.com
wrote:

[snip]

Here you go...

.SUBCKT VControlledCap CAP+ CAP- VC+ VC- PARAMS: C1=1nF C2=100pF
C_C1 CAP+ N_1 {C1}
R_NOF1 VC+ 0 1G
R_NOF2 VC- 0 1G
V_IM1 N_1 CAP- 0
G_G2 CAP+ CAP- VALUE {C2/C1*V(VC+,VC-)*I(V_IM1)}
.ENDS VControlledCap

When VC=,VC1 is zero, cap value is C1

When VC=,VC1=+1, cap value is C1+C2

When VC=,VC1=-1, cap value is C1-C2

I'll post this to my website in a few days... honey-do projects abound
;-)

...Jim Thompson

Typos galore, lagging/leading shift key, text should say...

When VC+,VC- is zero, cap value is C1

When VC+,VC- = +1, cap value is C1+C2

When VC+,VC- = -1, cap value is C1-C2


Thanks, Jim. Couldn't make a go of it yet, it errors with "Port(pin)
count mismatch between the definition of subcircuit "vcontrolledcap" and
instance: "xc1" ... The instance has fewer connection terminals than the
definition"

To learn how to do this, search LTspice Help for "automatic symbol"...

VControlledCap.asy

Version 4
SymbolType BLOCK
RECTANGLE Normal -64 -40 80 40
WINDOW 0 8 -40 Bottom 2
WINDOW 3 8 40 Top 2
WINDOW 39 8 64 Top 2
SYMATTR Prefix X
SYMATTR Value VControlledCap
SYMATTR ModelFile C:\Projects\Expments\BehavioralComponents\ASY Copy
of VControlledCap.net
SYMATTR SpiceLine C1=1nF C2=100pF
PIN -64 -16 LEFT 8
PINATTR PinName CAP+
PINATTR SpiceOrder 1
PIN -64 16 LEFT 8
PINATTR PinName CAP-
PINATTR SpiceOrder 2
PIN 80 -16 RIGHT 8
PINATTR PinName VC+
PINATTR SpiceOrder 3
PIN 80 16 RIGHT 8
PINATTR PinName VC-
PINATTR SpiceOrder 4

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

Welcome to EDABoard.com

Sponsor

Back
Top