How to Feed an Audiofile Into Ltspice




John Woodgate


An MHTML file probably contains unprintable characters. You might do better to display the web page, then select and copy the text from the page. You may be able to use CTRL-a instead of 'selecting'.

But what do you mean by 'no luck'? What happened? Did your computer sprout little legs or did you get an error message?

toggle quoted messageShow quoted text



Agreed.  An MHTML file is definitely wrong.  I don't know why Littelfuse provides that kind of file, but it's wrong.

If you have a .txt model or library, as your subject line suggests, then it is a plain, readable text file that doesn't have HTML code, and then it should be good for LTspice.  There is no need to "import" a .txt library into LTspice, because it works as-is, as long as it is plain text.

For the .mht file that you referred to, do you have a different link to the model, something that doesn't go to that .mht file?  Perhaps they have a copy of the model that is plain text?  Alternatively, can you open the .mht file in Internet Explorer, then copy-and-paste the text from the IE screen?  (I don't touch Internet Explorer anymore so I can't do that.)

Andy


John Woodgate


The file is an MHT file and doesn't need IE to open it; Firefox works.

toggle quoted messageShow quoted text

On 2020-01-13 17:59, Andy wrote:

Agreed.  An MHTML file is definitely wrong.  I don't know why Littelfuse provides that kind of file, but it's wrong.

If you have a .txt model or library, as your subject line suggests, then it is a plain, readable text file that doesn't have HTML code, and then it should be good for LTspice.  There is no need to "import" a .txt library into LTspice, because it works as-is, as long as it is plain text.

For the .mht file that you referred to, do you have a different link to the model, something that doesn't go to that .mht file?  Perhaps they have a copy of the model that is plain text?  Alternatively, can you open the .mht file in Internet Explorer, then copy-and-paste the text from the IE screen?  (I don't touch Internet Explorer anymore so I can't do that.)

Andy



I won't use Firefox either.  Sorry.  Yes, I'm stubborn about some things.

Some versions of Microsoft Word also can open them, but they look odd.

What I'm saying is, hopefully Littelfuse has that model (those models) in another format, not only as an MHTML file.  Try to find that other file.  If they don't have it in a plain text file, respectfully ask that they make one available.

Andy



This was the only file type they had. I was able to open the MHTML file and save is as a text and attempted to put that in the library folder but i was unable to link a symbol to the library.



You don't need to "link a symbol to the library."

If you have the model as a text file, you can bring it into your LTspice simulation by adding this line anywhere to the schematic:

     .lib filename.ext

where filename.ext is the actual filename of the text (library) file.  If that file is in the folder with the schematic, or in LTspice's cmp library folder (being careful to use the right one!), then you don't need to include the "path" (the directories) before the filename.

There are ways to make the library file included automatically without adding the above line, but it's not always straight-forward.  What kind of device is this for, and what symbol are you using?  What kind of model is it (.MODEL or .SUBCKT)?  Is it a symbol you created, one you downloaded, or are you using one of LTspice's existing symbols?

Andy



Also, you do have the option of pasting the model itself directly onto your schematic, as a SPICE Directive.  Then there is no need to use a ".lib" or ".inc" statement, or anything special in the symbol.

Clearly this works best when the model is not too large.  A big model takes up a lot of space on the schematic.

Andy



Hello jfisher,
I have helped with this problem sometimes ago in another forum. At that time, I maually corrected the file.
Basically I had to remove all text strings 3D and =20 and I had to fix some line breaks and comments.

Heres the link for the file:
https://www.littelfuse.com/~/media/electronics_technical/spice_models/varistors/varistors_ml_spice_model_lib.mht

Today I tried with different browsers. The only good choice has been the Internet Explorer due to its capability to export this file as text.
Open this link with the IE. Then "Save As" -> Text(*.txt) and select the Coding:West Europe.
You will get a correct text file in PSPICE-Format. Now only the exponent-character ^ has to replaced with ** .
I named this new file with the ending .lib to distinguish it from the file saved from the Internet  Explorer.

I have uploaded an example to the folder Temp.
Varistor_test_ML-series.zip

 Helmut



Helmut,
That all worked perfectly!

Thank you all for your help on this topic, I was really puzzled by this problem



Guess there still is an issue with something i am doing. I am running a lightning simulation for RTCA-DO160 purposes for an aerospace program.

My circuit design implements a TVS and an MOV for different power consumption, however it seems that the MOV Spice model is unable to handle the speeds of the lightning simulation,

When i simulate i get the following: "Analysis: Time step too small; time =2.54083e-006, timestep = 1.25e-019: trouble with node u3:1:4:"

U3 is the MOV and i attempted to make i big time amount but was unable to go higher than what is listed above.



"Timestep too small" errors have nothing to do with inability to handle the speeds of the signals in the simulation.  It is all about difficulty with convergence, often caused by regions where the equations describing the element are poorly defined (discontinuous functions or derivatives).  When SPICE or LTspice encounters those problems, it backs up, makes the timestep smaller, and tries again.  When it hits a really bad spot, it repeatedly does that without success, until the timestep is unreasonably small, and it aborts.

As you noticed, LTspice aborted once the timestep reached 0.0000000001 nanoseconds.  Small enough?

The node or element that is called out in the error report usually has nothing to do with the problem.  It's just that it was peripherally related to the detection of the problem.

Did you try the many suggestions that are in the "FAQ" file?  Look for the section about "Timestep too small" errors.

Files > z_yahoo > FAQ > faq_17-2.txt
https://groups.io/g/LTspice/files/z_yahoo/FAQ/faq_17-2.txt

If following those instructions doesn't help, it may help to upload your simulation files (a .ZIP file containing the schematic and model files, and any symbol files that didn't come with LTspice; but NOT any of LTspice's output files) to the group's Temp folder.  Don't upload pictures of schematics.

Regards,
Andy



Andy,
I attempted the steps you suggested but had no luck. I uploaded a .zip file which has the schematic as well as the model files for the varistor previously talked about.

Files>Temp>lightning testing.zip

Any help you can provide would be greatly appreciated.

Best,
Jeff



Different methods from the "timestep two small" suggestions will probably work. In this case setting max timestep to 2ns helped. Simulation runs slow but finishes.

Frank

jacksonabournat.blogspot.com

Source: https://groups.io/g/LTspice/topic/importing_a_txt_library_into/69673479

0 Response to "How to Feed an Audiofile Into Ltspice"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel