Electronics-Related.com
Forums

Voltage-variable capacitor doesn't work in LTSpice

Started by Joerg March 16, 2015
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.