Electronics-Related.com
Forums

Voltage-variable capacitor doesn't work in LTSpice

Started by Joerg March 16, 2015
On 2015-03-18 1:46 PM, John Larkin wrote:
> On Wed, 18 Mar 2015 13:36:27 -0700, Joerg <news@analogconsultants.com> > wrote: > >> On 2015-03-18 11:54 AM, Syd Rumpo wrote: >>> On 17/03/2015 00:26, Joerg 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. >>>> >>> <snip> >>> >>> This is what I did for a time-varying capacitance. In the component >>> 'Value' field, I put Q=(4p/(0.25 +(time*5)))*x which swept the >>> capacitance from 16pF downwards controlled by the internal variable 'time'. >>> >>> I can't remember why you need the Q and the x, but you do, and it took a >>> good while to find out - it seems you can't just vary the capacitance >>> directly. Replace time with a voltage and the appropriate scaling and >>> you should be good to go. >>> >> >> Tried it and that completely bungled the linearity when the cap is >> inside a resonant circuit. At least no more error messages which is >> good. Well, maybe I just do it in hardware then, firing up the old >> Weller. I'd have to buy a bag of varicaps but those are cheap. > > Are you trying to sim a VCO? Simulating oscillators is always tedious. >
No, it's a circuit where a capacitive sensor is employed and I want to mimic the sensor output. The capacitor itself will be inside a somewhat resonant circuit so it has to behave like a real and clean capacitor.
> You could use a diode model, which does include variable capacitance. > > https://dl.dropboxusercontent.com/u/53724080/Circuits/Caps/Cap_Sweep.asc >
But that's a voltage-controlled voltage source. I'd need a real cap.
> Try to get the Skyworks sample kit. It has a lot of varicaps, and many > other cool things. >
I'd need the old AM tuning diodes, tons of capacitance. What I need is a variable range of several hunded pF around a base of 1000pF or slightly above. Or I have to make Jim's method work but so far no luck. Could have to do with the durn Windows 7 restrictive file writing "privileges". If we had all our hardware going I wouldn't need this. It is intended to give a SW engineer a fake signal in file format that he can plug into his algorithms so he doesn't have to wait for HW to be done. I can somehow kludge it with a voltage-variable resistor because in contrast to capacitors that works in LTSpice. But it won't be pretty. -- Regards, Joerg http://www.analogconsultants.com/
Den onsdag den 18. marts 2015 kl. 21.36.27 UTC+1 skrev Joerg:
> On 2015-03-18 11:54 AM, Syd Rumpo wrote: > > On 17/03/2015 00:26, Joerg 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. > >> > > <snip> > > > > This is what I did for a time-varying capacitance. In the component > > 'Value' field, I put Q=(4p/(0.25 +(time*5)))*x which swept the > > capacitance from 16pF downwards controlled by the internal variable 'time'. > > > > I can't remember why you need the Q and the x, but you do, and it took a > > good while to find out - it seems you can't just vary the capacitance > > directly. Replace time with a voltage and the appropriate scaling and > > you should be good to go. > > > > Tried it and that completely bungled the linearity when the cap is > inside a resonant circuit. At least no more error messages which is > good. Well, maybe I just do it in hardware then, firing up the old > Weller. I'd have to buy a bag of varicaps but those are cheap. >
http://powerelectronics.com/site-files/powerelectronics.com/files/archive/powerelectronics.com/mag/504PET07.pdf -Lasse
On Wed, 18 Mar 2015 14:03:07 -0700, Joerg <news@analogconsultants.com>
wrote:

[snip]
>> > >No, it's a circuit where a capacitive sensor is employed and I want to >mimic the sensor output. The capacitor itself will be inside a somewhat >resonant circuit so it has to behave like a real and clean capacitor. > >
[snip] I take it you haven't tried my subcircuit? ...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 Wed, 18 Mar 2015 14:13:02 -0700 (PDT), Lasse Langwadt Christensen
<langwadt@fonz.dk> wrote:

[snip]
> >http://powerelectronics.com/site-files/powerelectronics.com/files/archive/powerelectronics.com/mag/504PET07.pdf > >-Lasse
Same way I did my varicap models and Joerg's voltage variable one. (The varicap model uses a Table to handle the non-linearity of a varicap.) ...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-18 2:15 PM, Jim Thompson wrote:
> On Wed, 18 Mar 2015 14:03:07 -0700, Joerg <news@analogconsultants.com> > wrote: > > [snip] >>> >> >> No, it's a circuit where a capacitive sensor is employed and I want to >> mimic the sensor output. The capacitor itself will be inside a somewhat >> resonant circuit so it has to behave like a real and clean capacitor. >> >> > [snip] > > I take it you haven't tried my subcircuit? >
I have not given up yet but so far I got all kinds of error messages. The next step would be to try it on an XP machine where I'd have to get LTSpice going again. XP was IMHO the last known good OS and I've had error message in other software caused by Windows 7 (meaning they didn't happen on an XP machine). -- Regards, Joerg http://www.analogconsultants.com/
On Wed, 18 Mar 2015 14:44:39 -0700, Joerg <news@analogconsultants.com>
wrote:

>On 2015-03-18 2:15 PM, Jim Thompson wrote: >> On Wed, 18 Mar 2015 14:03:07 -0700, Joerg <news@analogconsultants.com> >> wrote: >> >> [snip] >>>> >>> >>> No, it's a circuit where a capacitive sensor is employed and I want to >>> mimic the sensor output. The capacitor itself will be inside a somewhat >>> resonant circuit so it has to behave like a real and clean capacitor. >>> >>> >> [snip] >> >> I take it you haven't tried my subcircuit? >> > >I have not given up yet but so far I got all kinds of error messages. >The next step would be to try it on an XP machine where I'd have to get >LTSpice going again. XP was IMHO the last known good OS and I've had >error message in other software caused by Windows 7 (meaning they didn't >happen on an XP machine).
What kind of error messages? If you use the LTspice _symbol_ I made, you need to open the .ASY file with a text editor and change the path to wherever you've located the subcircuit definition library. The latest version, on the website, shows how more clearly. ...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 Wed, 18 Mar 2015 14:03:07 -0700, Joerg <news@analogconsultants.com>
wrote:

>On 2015-03-18 1:46 PM, John Larkin wrote: >> On Wed, 18 Mar 2015 13:36:27 -0700, Joerg <news@analogconsultants.com> >> wrote: >> >>> On 2015-03-18 11:54 AM, Syd Rumpo wrote: >>>> On 17/03/2015 00:26, Joerg 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. >>>>> >>>> <snip> >>>> >>>> This is what I did for a time-varying capacitance. In the component >>>> 'Value' field, I put Q=(4p/(0.25 +(time*5)))*x which swept the >>>> capacitance from 16pF downwards controlled by the internal variable 'time'. >>>> >>>> I can't remember why you need the Q and the x, but you do, and it took a >>>> good while to find out - it seems you can't just vary the capacitance >>>> directly. Replace time with a voltage and the appropriate scaling and >>>> you should be good to go. >>>> >>> >>> Tried it and that completely bungled the linearity when the cap is >>> inside a resonant circuit. At least no more error messages which is >>> good. Well, maybe I just do it in hardware then, firing up the old >>> Weller. I'd have to buy a bag of varicaps but those are cheap. >> >> Are you trying to sim a VCO? Simulating oscillators is always tedious. >> > >No, it's a circuit where a capacitive sensor is employed and I want to >mimic the sensor output. The capacitor itself will be inside a somewhat >resonant circuit so it has to behave like a real and clean capacitor.
Would something like this work? https://dl.dropboxusercontent.com/u/53724080/Circuits/Caps/Modulated_Cap_1.asc The cap is modulated by voltage ZZ, which in this case makes the cap ramp from 1F to 20F. That in turn sweeps the LC ringing frequency down. -- John Larkin Highland Technology, Inc picosecond timing precision measurement jlarkin att highlandtechnology dott com http://www.highlandtechnology.com
On Wed, 18 Mar 2015 14:55:54 -0700, John Larkin
<jlarkin@highlandtechnology.com> wrote:

[snip]
> >Would something like this work? > >https://dl.dropboxusercontent.com/u/53724080/Circuits/Caps/Modulated_Cap_1.asc > >The cap is modulated by voltage ZZ, which in this case makes the cap >ramp from 1F to 20F. That in turn sweeps the LC ringing frequency >down.
<http://www.analog-innovations.com/TankTest_Greenshot_2015-03-18_16-10-12.jpg> ...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 Wed, 18 Mar 2015 16:14:44 -0700, Jim Thompson
<To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> wrote:

>On Wed, 18 Mar 2015 14:55:54 -0700, John Larkin ><jlarkin@highlandtechnology.com> wrote: > >[snip] >> >>Would something like this work? >> >>https://dl.dropboxusercontent.com/u/53724080/Circuits/Caps/Modulated_Cap_1.asc >> >>The cap is modulated by voltage ZZ, which in this case makes the cap >>ramp from 1F to 20F. That in turn sweeps the LC ringing frequency >>down. > ><http://www.analog-innovations.com/TankTest_Greenshot_2015-03-18_16-10-12.jpg> > > ...Jim Thompson
It would be trivial to add tabular data to this model to characterize a non-linear transducer. I just need to scratch my head and remember how to have a subcircuit call external tabular data so I can make it a generalized transducer model ;-) ...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-18 2:50 PM, Jim Thompson wrote:
> On Wed, 18 Mar 2015 14:44:39 -0700, Joerg <news@analogconsultants.com> > wrote: > >> On 2015-03-18 2:15 PM, Jim Thompson wrote: >>> On Wed, 18 Mar 2015 14:03:07 -0700, Joerg <news@analogconsultants.com> >>> wrote: >>> >>> [snip] >>>>> >>>> >>>> No, it's a circuit where a capacitive sensor is employed and I want to >>>> mimic the sensor output. The capacitor itself will be inside a somewhat >>>> resonant circuit so it has to behave like a real and clean capacitor. >>>> >>>> >>> [snip] >>> >>> I take it you haven't tried my subcircuit? >>> >> >> I have not given up yet but so far I got all kinds of error messages. >> The next step would be to try it on an XP machine where I'd have to get >> LTSpice going again. XP was IMHO the last known good OS and I've had >> error message in other software caused by Windows 7 (meaning they didn't >> happen on an XP machine). > > What kind of error messages? > > If you use the LTspice _symbol_ I made, you need to open the .ASY file > with a text editor and change the path to wherever you've located the > subcircuit definition library. >
And there is the first problem. Windows 7 no longer allows writes to the program directories. Well, it does but secretly stashes them some place else but then access become an issue. I'll get to the ground of that, hav to for my CAD as well, just not right now. The usual, swamped in work plus honey-do stuff. And, we had to get a Mexican Burger at one of our favorite watering holes. Along with an Old Republic red ale.
> The latest version, on the website, shows how more clearly. > > ...Jim Thompson >
-- Regards, Joerg http://www.analogconsultants.com/