¿ªÔÆÌåÓý

Date

Re: Loudspeaker model

 

¿ªÔÆÌåÓý

Sanzha, in addition to what yoyu can find in the all_fils.htm, this link may give you some info on making your own model.


Regards, Steve

Sent: Tuesday, November 20, 2018 4:08 AM
Subject: [LTspice] Re: Loudspeaker model
?
?

sanzha.shabdarov asked if there are SPICE models for loudspeakers.

There are.

One of the things that you saw when you joined this group (but probably did not pay attention to), is the fact that the group has a sizable Files area with models that have been collected over more than 15 years. The "Table of Contents" file (all_files.htm) is your best index into those files, but it's not a perfect index.

Download that file. Then open it in your web browser. I suggest doing a search for "speaker", but be aware that some of them are different, such as piezoelectric and electrostatic speaker elements. Just check the files and see what you find. Some might be what you're looking for; others not.

Also be aware that loudspeakers come in all shapes and sizes and types. Any one model is good for only one speaker, and it's probably not the one you really wanted. Many models would be for complete loudspeakers with one or more drivers inside an enclosure. The enclosure makes a big difference to portions of the speaker's impedance.

Some good places to search for SPICE models are (a) our group's Files area, (b) a manufacturer's website (esp. for ICs and some transistors), and (c) Google -- e.g., the open Internet. Some judgment is always required, along with willingness to use a similar model when the one you're looking for doesn't exist.

Regards,
Andy


Virus-free.


Re: Is there any good 8 Ohm 0.5W loudspeaker model?

 

¿ªÔÆÌåÓý

First, please don't put your question only in the subject line; it needs to be in the message body, like this:

Subject: Loudspeaker model

Message: Is there any good 8 Ohm 0.5W loudspeaker model?

There is information on loudspeaker models in the list archives. Go to the web site and download and save? all_files.htm. Open in in your browser and search (CTRL-F) for speaker and loudspeaker (separately).? 8 ohm is relevant to the modelling, but 0.5 W isn't. The power rating (which is a very vague thing and is related to things like voice-coil temperature and cone excursion that electrical models do not cover) is only weakly related to the model - a 0.5 W loudspeaker is likely to be a small one and therefore have a main resonance in the frequency range 250 Hz to 450 Hz.

John Woodgate OOO-Own Opinions Only
J M Woodgate and Associates 
Rayleigh, Essex UK
On 2018-11-20 07:30, sanzha.shabdarov@... [LTspice] wrote:
?



Re: Loudspeaker model

 

sanzha.shabdarov asked if there are SPICE models for loudspeakers.

There are.

One of the things that you saw when you joined this group (but probably did not pay attention to), is the fact that the group has a sizable Files area with models that have been collected over more than 15 years. The "Table of Contents" file (all_files.htm) is your best index into those files, but it's not a perfect index.

Download that file. Then open it in your web browser. I suggest doing a search for "speaker", but be aware that some of them are different, such as piezoelectric and electrostatic speaker elements. Just check the files and see what you find. Some might be what you're looking for; others not.

Also be aware that loudspeakers come in all shapes and sizes and types. Any one model is good for only one speaker, and it's probably not the one you really wanted. Many models would be for complete loudspeakers with one or more drivers inside an enclosure. The enclosure makes a big difference to portions of the speaker's impedance.

Some good places to search for SPICE models are (a) our group's Files area, (b) a manufacturer's website (esp. for ICs and some transistors), and (c) Google -- e.g., the open Internet. Some judgment is always required, along with willingness to use a similar model when the one you're looking for doesn't exist.

Regards,
Andy


Re: How to include component values in LTSpice trace formulas

 

Doug, you probably realized this already, but I had completely misunderstood your original question.? When you asked about "traces", I thought you meant PCB traces, A.K.A. "wires" or nets.? Silly me, I didn't realize that you meant traces in the waveform window.

Probably the easiest way to get a parameter (.PARAM) value from a schematic into the waveform section of LTspice, is to use a voltage source with value equal to the parameter, as you outlined, and as "hevans" described.? Voltage sources are cheap in SPICE.

Just be aware that .PARAMeters are evaluated only before simulation begins, so not only do their values not change over time, but they can't depend on any voltages or currents elsewhere in your circuit.

But Tony's approach of using .MEAS statements, then plotting their results from the .LOG file, is very powerful.

Most everywhere in LTspice, numbers are just numbers.? When you combine things into formulas, LTspice doesn't care that Volts really mean Farads.? I think it never complains about combining or mixing up units.? However, LTspice's plotting window is moderately intelligent about interpreting units, in order to attach helpful units to your displayed axes, but otherwise it also doesn't care.? So, for example, if your formula uses Volts as the analog of capacitance, you can try multiplying it by (1000mF/1V) and LTspice might recognize that you wanted Farads.? I'm not entirely sure that it knows Farads, Joules, or whatever, but it might.? (You'd have to do it this way instead of "1F/1V" because "1F" likely would be interpreted as 1 femto and that would scale things rather incorrectly.)

It should also be noted that there are a few situations where LTspice's waveform viewer treats units and multipliers differently than the rest of LTspice (and SPICE).? For example, I BELIEVE (not certain) that the waveform viewer lets you use MHz to mean megahertz, whereas in SPICE and in the simulation engine in LTspice, MHz is always interpreted as milli (or milliHertz but without the Hertz).? I haven't looked to see if the waveform viewer knows anything special about "Farads" when spelled out; or for that matter, if it even knows that Farads exist.? I'm sure it has a limited set of units that it understands.? This part of LTspice is not well documented.

Regards,
Andy



Loudspeaker model

 

I am quite new for all of LTSpice stuff, so, I don't know where to search necessary models. Thus, I just wanted to ask does somebody have properly working ltspice model for 8 Ohm 0.5W loudspeaker?


Is there any good 8 Ohm 0.5W loudspeaker model?

 



Re: DN3545 N-Channel, Depletion-Mode Mosfet Model Possible in LTSpice?

 

Jan wrote:

? ? "Does this imply that I can turn a suitable enhancement mode N-chan VDMOS into a depletion mode device by just inverting VTO?"

I think that depends on what you mean by "suitable".

? ? "Sounds so easy ;-) !"? You know what they say -- if it sounds too easy, it probably is.

Certainly the value of the Vto parameter (along with whether it's an N or P channel device) defines whether a MOSFET is enhancement or depletion mode, since that is more or less the definition of the electrical difference between them.? If the MOSFET conducts when Vgs=0, then it's a depletion-mode MOSFET.? If it doesn't conduct at Vgs=0, then a gate voltage is needed to form a conducting channel and it is an enhancement-mode MOSFET.

Having a SPICE model for a depletion model MOSFET doesn't mean there is a part made that matches the model.? Kludging up another transistor's model might need more than one tweak to make it semi-realistic.? The presence/absence of a physical channel probably means some significant changes otherwise to the model.

I'd recommend choosing a part number of a few popular deplstion mode MOSFETs, then see if there are LTspice models for them.

Regards,
Andy



Re: How to include component values in LTSpice trace formulas

 

> If anyone knows a clean, direct way to get param values into the formula for a trace, I'd love to know what it is <
Just create a voltage source and assign its value the parameter name.? You can now use the voltage of that source in your formula to access the parameter value.? If you desire, you can also divide the expression by 1V to make the parameter dimensionless.


Re: How to include component values in LTSpice trace formulas

 

Thank you, Tony - that's even better than what I was looking / hoping for. I'll be studying what you've done to become more adept at it. I wasn't even aware of the measurement subsystem before, and I had only used stepping a couple of times, so I've got some studying and practicing to do - Doug :-)


Re: DN3545 N-Channel, Depletion-Mode Mosfet Model Possible in LTSpice?

 

Hello Donald,

Thanks for the pointer. Does this imply that I can turn a suitable enhancement mode N-chan VDMOS into a depletion mode device by just inverting VTO? Sounds so easy ;-) !

Jan Didden


Re: How to include component values in LTSpice trace formulas

 

0cab7709201904469fc4e9d8929c0f93?
wrote:

"To answer a question in one of the responses about what I'm trying to do, it's to try various values of C, L and other parameters for an LC tank circuit for a Tesla coil to see which values result in the greatest energy being stored."

The cleanest way to do achieve this is by means of .measurements.

.Params are not available in the waveform viewer as you have discovered, but they are to the .measurement sub-system. Since you have already defined your "figure of merit", i.e. the energy stored in the capacitor, you can create a .measurement that calculates just that. The results of .measurements are written to the logfile after the simulations runs. If you have .stepped any parameters, you then plot the defined .measurements versus your swept parameter, which directly achieves your objective.

To plot these .measurements, firstly you must open the logfile after the simulation runs (Ctrl-L), and then right-click within the logfile window and select "Plot .step'ed .meas data". Then, another waveform window pops up and you can select which .measurements to plot.

I've uploaded an example that plots the energy in a tuned circuit versus capacitance with real a inductor and capacitor with finite and defined Qs. This might not be exactly what you want, but it'll get you started,

Files > Temp > Energy.zip

Regards,
Tony


Re: How to include component values in LTSpice trace formulas

 

... I forgot to clarify that the capacitance value does not change over time - I just want to try different values to figure out what works best. But I don't want to have to remember to put the changed value in the trace formula as well as changing it in the schematic - I'd like to be able to change it only one place on the schematic and then have that value automatically used in the trace formula ...


Re: How to include component values in LTSpice trace formulas

 

Oooops - just found a problem with using .PARAM statements to do what I wanted. To briefly summarize my objective, it is to plot a trace of the energy stored in a capacitor over time. I want to use the formula E = 1/2 * C * V**2.?

So here's the problem I ran into: the .PARAM statement works fine on the schematic for all sorts of purposes, but I am unable to access .param values in trace formulas. For example, I can easily define a trace like "v(nodeA)*I(resistorB)*100". But LTSpice does not let me access .params like r(resistor1) as part of the trace formula - or, at least, I can't find anything in the program or documentation that lets me do that.

> If anyone knows a clean, direct way to get param values into the formula for a trace, I'd love to know what it is <

But in the meantime, here's an outline of the hack that I think should work, in case anyone is interested, and in case there isn't a way to get the .param value directly into the trace formula:

1. Enter a directive, .param MyCapValue=<desired_cap_value> on the schematic.

2. Set the value of the capacitor in question to {MyCapValue}

3. If necessary, also use MyCapValue to manipulate other values in the circuit. In my case, I will set MyInductanceValue to <desired_product_of_L*C> / {MyCapValue}, in order to make sure the resonant frequency? of the LC tank circuit stays the same regardless of the chosen capacitance value.

4. Set up a grounded DummyDCVoltageSource separate from the main circuit and set it's output voltage to {MyCapValue}.

5. Stick a label on the dummy source output, say "D".

6. Stick labels on both sides of the capacitor, say C1 and C2

7. Then the trace formula for energy stored in the capacitor would be (v(C1)-v(C2))**2*0.5*v(D)

I haven't actually tried this yet, so I don't know whether LTSpice will give me grief about misusing units (e.g., using Volts to represent Farads), but I figure that can be worked.



Re: Funny problem in simulation with .option gshunt=1.5e-7

 

Hello Alan,

I just tried again with gshunt to check that it really has been used inside the subcircuit.
I got +25% more supply current even with only gshunt=1e-11.
?
The more interesting option is gmin which is much less critical. It's applied across all PN-junctions in a simulation.I often try with gmin=1e-10, if a circuit doesn't converge.

Best regards,
Helmut
?


Re: Funny problem in simulation with .option gshunt=1.5e-7

 

¿ªÔÆÌåÓý

Now you node better.

John Woodgate OOO-Own Opinions Only
J M Woodgate and Associates 
Rayleigh, Essex UK
On 2018-11-18 18:09, alan.revera@... [LTspice] wrote:

?

I thought this only add to the external circuits, not the inside of the opamp.


Re: Funny problem in simulation with .option gshunt=1.5e-7

 

Thanks guys, I thought this only add to the external circuits, not the inside of the opamp. Now I know. I notice the Ti models don't work as well as the LT models, The LT models don't need to play around with all these.

Thanks

Alan


Re: Funny problem in simulation with .option gshunt=1.5e-7

 

I thought this only add to the external circuits, not the inside of the opamp.


Re: How to include component values in LTSpice trace formulas

 

Thanks so much Andy, and the other folks who responded. That's the approach I'll use. To answer a question in one of the responses about what I'm trying to do, it's to try various values of C, L and other parameters for an LC tank circuit for a Tesla coil to see which values result in the greatest energy being stored.

... and thanks for the other info, like using ** instead of ^ - that would explain the weird results I got when I used ^ :-)


Re: Funny problem in simulation with .option gshunt=1.5e-7

 

Ala,

Gshunt should probably be no larger than 1e-10.

Your value (1.5e-7) is a thousand to a million times too large.? Side-effects like the ones you observed should be expected.

Andy



Re: Problems using Pspice fet model for infineon BSR202N.

 

Richard,

TRTOL is not very well understood, by most of us.? Almost all SPICE programs set TRTOL to 7, which is a slightly odd number.? Most SPICE users don't change that.? LTspice's default is 1, and there is some commentary about it in the LTspice Help pages, but it's not exactly clear.

I would not necessarily assume that smaller TRTOL improves accuracy.? In principle, with the default settings, SPICE simulations should be pretty accurate anyway, since everything was optimized at those settings.? It's those odd cases that require special tweaking, and then there is no certainty that smaller *TOL always equates to greater accuracy.? What TRTOL affects is LTspice's truncation error estimate, which is not the same thing as the inaccuracy of the simulated waveforms.? (My recollection is that the truncation error is a separate calculation on the side of the regular circuit calculations, which doesn't affect the simulated waveforms, but is used only to decide when to discard the current time point, back up a little, and set the timestep smaller.)

The Help page says that a larger TRTOL value (greater than 1) is "usually a better overall solution" for transistor level circuits (compared to SMPS circuits??), but it doesn't say what "better" means.? Faster?? More accurate?? Less likely to do something unexpected with certain third-party models?? Helmut has recommended never setting TRTOL greater than 1, which differs from Mike Engelhardt's suggestion.

If TRTOL affects how often LTspice needs to back up, then there is probably a "sweet spot" where that happens least often and the simulation proceeds fastest.? If so, then setting TRTOL larger might make it back up more often, causing the simulation to run slower rather than faster.? But I might misunderstand how it works.

Regards,
Andy