Keyboard Shortcuts
Лайки
Пошук
microphone capsule capacitance
Trying to simulate a microphone capsule, which capacitance varies
sinusoidally. |
On 04/12/2024 19:17, Jerry Lee Marcel
via groups.io wrote:
Trying to simulate a microphone capsule, which capacitance varies sinusoidally.That's because you tried to make its value time-dependent. Only certain elements allow that, and the normal capacitor isn't one of them. You need to be using the charge model capacitor. This is described in: Help > LTspice > LTspice® > Circuit Elements > C. Capacitor ..down near the bottom of the page -- Regards,
Tony |
On Wed, Dec 4, 2024 at 01:18 PM, Jerry Lee Marcel wrote:
There is no syntax of the form ".C2=<value>" for the value of a capacitor. Technically, you could use similar formulas for a capacitor, by changing that line to {<formula>}, i.e., {75p+2pcos 1kt}. But I think your formula has missing pieces, like multiply operators and parentheses. Should it be 75p+2p*cos(1*k*t)? Does "t" represent time, or temperature? If it's a microphone, it probably means time, and I believe the correct term for time is "time". That would make it something like {75p+2p*cos(1*k(time)} - which still might not be proper. It might be necessary to generate the capacitance argument as a voltage, from a B-source, and then refer to it with something like {V(n010)}.
HOWEVER - and this is the big problem - it does not do the right thing. Even if you get that formula to be accepted, what you end up with is a capacitor whose static (DC) capacitance follows the formula, but its dynamic capacitance does not, making it violate the conservation of charge. It would not behave like a capacitor should.
The remedy for that is to use LTspice's charge model, as Tony said.
Andy
|
Also, even from a logic point of view, .C2=75p+2pcos 1kt wouldn’t do what I imagine you want.
“75p + 2*PI*cos(1k * time)” is adding Farads to picoFarads
From: LTspice@groups.io <LTspice@groups.io> On Behalf Of
Tony Casey
Sent: Wednesday, December 04, 2024 10:37 AM To: LTspice@groups.io Subject: EXTERNAL: Re: [LTspice] microphone capsule capacitance
On 04/12/2024 19:17, Jerry Lee Marcel via groups.io wrote:
That's because you tried to make its value time-dependent. Only certain elements allow that, and the normal capacitor isn't one of them. Regards, |
I didn't mean 2*pi*cos (1k*time), I meant 2p*cos(1k*time). 2pF
mulitplied by cos() .That would have resulted in a frequency of
159Hz, but at the time I didn't care. Le 04/12/2024 à 20:13, Bell, Dave via
groups.io a écrit :
|
As I said, you will not get the correct results by simply changing the capacitance on-the-fly. That "works" (or it can "work"), but it does not simulate how either the voltage or the capacitor's charge must simultaneously change along with the capacitance. Only by using the charge model, can you get the desired result.
Andy
|
I've looked at the Help, and I'm none the wiser. 2p is the maximum excursion from the rest value of 75p. Le 04/12/2024 à 20:15, Andy I via
groups.io a écrit :
|
On Thu, Dec 5, 2024 at 06:16 AM, Jerry Lee Marcel wrote:
I take it you have never looked at the Help before. That is how every element is described - in Netlist form.
When you put a component on a schematic, and then press Run, LTspice turns it into a line of SPICE Netlist. It includes (a) the element name, (b) the nodenames to which you connected it, and (c) its value and optional parameters. For a capacitor, the normal value would be just a number. For the charge model, you would use a formula such as "Q=100p*x" in place of the capacitor's value.
Like many components, there are two if not three ways to do that.
If I remember correctly, you have to do some differentiation first, to turn voltage into charge, or vice-versa. For me, it is not intuitive.
I'm not sure that you understood what I wrote before about missing operators. What is "2p(cos(...)"? Is 2p a pre-defined function, or is it 2p times the cos() function? The same thing with k(time). I don't think you meant for k() to be a function; I think you wanted 1k*(time), or just 1k*time.
Be prepared to work on this a while. I have always needed to do that with the charge model until I got it right. Maybe that's just me and my stupid little brain.
Andy
|
Le 05/12/2024 à 14:35, Andy I via
groups.io a écrit :
Actually I did, many times. Had I not, I wouldn't hav efound references to "Cnnn n1 n2 Q=100p*x" If you say so. Actually I use a GUI that saves me having to type a netlist. Does it mean that, by seeing this formula, LTspice recognizes the fact that it should not expect a capacitance value, but a charge value that is interpreted differently? I see no mention of that in the Help. Maybe you should read the Help?... 2p is two pico. I thought it would be understood tha same as k (or Meg, or G). So yes, it was meant to be a cos function of amplitude 2p Farad. This is exactly what I meant. |
On Thu, Dec 5, 2024 at 11:57 AM, Jerry Lee Marcel wrote:
Actually I did, many times. ...Yes, I am quite sure you do. I apologize. That was my very bad attempt at some light humor. If you say so. Actually I use a GUI that saves me having to type a netlist. Yes, we all do. But this is one of the weaknesses of LTspice's Help. All of the descriptions of each element, are stated as if we were writing netlists.
Everything there that describes each element, is described as if we were writing netlists. It is up to us to interpret what that means.
If it showed graphical examples of each and every component type, it would be much longer. I think Mike E. wanted to keep it compact.
Does it mean that, by seeing this formula, LTspice recognizes the fact that it should not expect a capacitance value, but a charge value that is interpreted differently? I see no mention of that in the Help. Indeed, that is what happens. Using the Charge formula with Q=<expression> is an alternate way of using capacitors. There is no capacitance value as such, because you are specifying Charge, not Capacitance.
You might have missed that it states it this way: "There is also a general nonlinear capacitor available. Instead of specifying the capacitance, one writes an expression for the charge." Note it says "Instead of specifying the capacitance" in that sentence.
And then the Help lists the syntax (netlist) line this way:
Syntax: Cnnn n1 n2 Q=<expression> [ic=<value>] [m=<value>] LTspice does not understand that "2p(cos(1k(time))" means 2p times cos(), nor 1k times (time). On a blackboard we can write 2p(cos()) and the humans around us understand what we mean, but computers do not. Computers need explicit multiply operators. Without them, they misinterpret what we write. By writing 2p(anything), LTspice would think that 2p() is supposed to be a function, not two values multiplied together.I'm not sure that you understood what I wrote before about missing operators. What is "2p(cos(...)"? Is 2p a pre-defined function, or is it 2p times the cos() function?2p is two pico. I thought it would be understood tha same as k (or Meg, or G). So yes, it was meant to be a cos function of amplitude 2p Farad. (By the way, in your schematic yesterday, where you wrote "cos 1kt", I had incorrectly thought that the "k" was the Boltzmann constant. I guess I came to that conclusion because it was next to "t", so my mind went in that direction. Of course 1k will be 1000. But it needed a "*" between the "1k" and "(time)".)
Andy |
Le 05/12/2024 à 18:50, Andy I via
groups.io a écrit :
Indeed, you're pardoned. 🙂 And many thanks, anyway. To say the least. There is a problem when concision verges towards deficiency. OK, I'll try to accomodate that.
|
On Thu, Dec 5, 2024 at 06:35 AM, Andy I wrote:
Be prepared to work on this a while. I have always needed to do that with the charge model until I got it right. Maybe that's just me and my stupid little brain.It's actually fairly simple. The charge model is based on the relationship between current and voltage in a capacitor: I = C dV/dt
and the fact that the total charge on the capacitor is the integral of the current:
Q = integral ( I dt )
Therefore
Q = integral ( C dV/dt dt ) = integral ( C dV )
If the capacitance C is not a function of V then it can be moved outside the integral, and Q is simply C times V since the integral of dV is just V.
Q = C integral ( dv ) = C V
If C is a function of V, i.e. C(V), then you must take the anti-derivative of C(V).
Q = integral ( C(V) dV )
In the LTspice charge expressions, the voltage across the capacitor is the variable x.
In the case of the OP, his capacitance is not a function of voltage so his charge expression is:
Q= (75p+2p*cos(2*pi*1k*time))*x
HTH |
Повідомлення
Більше