Spice simulation - Page 22 - diyAudio
Go Back   Home > Forums > Design & Build > Software Tools

Software Tools SPICE, PCB CAD, speaker design and measurement software, calculators

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 31st August 2007, 07:02 PM   #211
andy_c is offline andy_c  United States
Banned
 
Join Date: Apr 2003
Quote:
Originally posted by ingrast
What about SpiceMod?

The free version may be useful as long as the models generated are accurate. Do you have an evaluation?
Yes, I got the evaluation, thanks. I'm sure I will use it often. Usually when I make models of various types, the time-consuming part comes from getting the data from the datasheet graphs. For example, in fitting the gate-drain capacitance to datasheet values for the LTSpice VDMOS models, I grab about 20 points of capacitance vs. voltage to fit the capacitance formula. I basically sit there in front of my computer with a ruler trying to get the data point values. Then there's the issue of interpolating on log scales. It's very tedious and time consuming. That's where I think this "Engauge Digitizer" can help. Hopefully it can deal with log scales.

Also, I'd like to eventually learn a systematic way to get BSIM3 parameters for MOSFETs. If I could grab a ton of points very fast with the digitizer and bring them into Excel, it would be a snap to determine how close the model fits the data once the formulas for the model have been entered into Excel.
  Reply With Quote
Old 31st August 2007, 07:20 PM   #212
andy_c is offline andy_c  United States
Banned
 
Join Date: Apr 2003
Quote:
Originally posted by bogdan_borko
Enyone here using Circuit Maker? I`d love to pass to LT spice but i never maneged to add mosfet models to library... Could someone help me?

Could I copy someone`s folder with models from LT spice program files? Could you send your folder here Andy_C?
I'm not using CircuitMaker but I can help with LTSpice.

I've found through experience that it is not a good idea to modify existing LTSpice libraries. Here's why. If you wish to share a simulation with someone else (such as posting it here), and you have added a certain model to your library and the other person has not, then any simulation using that model will not run for the other person because they don't have your model.

A better, but more tedious way, is to just take a copy of the model file, say, mymodel.mod, and put it in the same directory as your .asc simulation file. Then manually add a SPICE directive to your schematic to use this model file. This is done by pressing the "S" key, then entering the text ".include mymodel.mod" without quotes. Of course, just replace "mymodel.mod" with the actual name of the model file.

Let's say that mymodel.mod contains this text:

.MODEL mjl3281a npn(...model parameters here...)

To change the default "NPN" transistor type for example, do not right-click on the transistor and use the normal "Pick New Transistor" option. Instead, just right-click on the text of the device where it says "NPN" and paste in the model name (in this case "mjl3281a" without quotes) into the dialog box where it currently says "NPN". Then LTSpice will look for "mjl3281a" instead of "NPN" when it goes to run the simulation. Because you have added a ".include mymodel.mod" SPICE directive and mymodel.mod contains the definition of the mjl3281a model, it will find the model.
  Reply With Quote
Old 31st August 2007, 07:42 PM   #213
diyAudio Member
 
bogdan_borko's Avatar
 
Join Date: Nov 2005
Location: serbia, zajecar
thanks a lot, I`ll try it...
  Reply With Quote
Old 31st August 2007, 10:12 PM   #214
Tim__x is offline Tim__x  Canada
diyAudio Member
 
Join Date: Jun 2004
Location: Edmonton area, Alberta
The LTSpice updater has a nasty habit of "updating" (read: obliterating) your library files anyway. It's much better to .include a .mod file, or put the model directly in the schematic as a spice directive.
  Reply With Quote
Old 31st August 2007, 10:21 PM   #215
andy_c is offline andy_c  United States
Banned
 
Join Date: Apr 2003
Quote:
Originally posted by Tim__x
The LTSpice updater has a nasty habit of "updating" (read: obliterating) your library files anyway. It's much better to .include a .mod file, or put the model directly in the schematic as a spice directive.
I've never had this happen, but I haven't run with modified libraries in a year or so. I did notice that it took my handwritten models in standard.bjt, which were split across multiple lines using the "+" line continuation character, and made them into a single line.
  Reply With Quote
Old 1st September 2007, 01:32 PM   #216
PB2 is offline PB2  United States
diyAudio Member
 
PB2's Avatar
 
Join Date: Sep 2004
Location: North East
Blog Entries: 1
Default AnaSoft SPICE Models

I go searching for spice models every so often when I'm working on a project and I came across AnaSoft here many years ago. I don't recall which models I used so I cannot comment on them. Anyone else have comments concerning these models:
http://www.anasoft.co.uk/links.html

Pete B.
  Reply With Quote
Old 1st September 2007, 01:42 PM   #217
PB2 is offline PB2  United States
diyAudio Member
 
PB2's Avatar
 
Join Date: Sep 2004
Location: North East
Blog Entries: 1
Default Intusoft SPICE models

I have been impressed with Intusoft's products over the years and purchased IS-Spice back in the early 80s, running it on an XT, yep it was SLOW. I did not use it much, but it did seem to be a quality product.

I seem to have (some?) of Intusoft's libraries from much later - 2002 but I'm not sure if they are free or not:
http://www.intusoft.com/products/ica...Libraries.html

Has anyone else used them?

Intusoft had an excellent news letter and I also have several of their books.

Pete B.
  Reply With Quote
Old 4th September 2007, 09:46 PM   #218
andy_c is offline andy_c  United States
Banned
 
Join Date: Apr 2003
I've been playing around with the freeware Engauge Digitizer a bit. In doing SPICE model parameter extraction in the past, I've been painstakingly reading values from graphs manually. This is very time consuming, boring, and not very accurate. I record these values into Excel and use some least-squares techniques with the Excel solver to find a set of model parameters to get a best fit to the data. After seeing a reference to the Engauge Digitizer in a thread in the Tubes forum I decided to check it out.

Wow! I'm embarrassed to think how much time I wasted manually reading data from graphs. This tool is great! The documentation is very well written. Without having to study anything, you can get up to speed immediately and start grabbing data just by reading the step-by-step instructions in the help files.

Here's how it works. You get a graphics file containing the plot whose data you'd like to fit. I just use the freeware IrfanView to get a screen capture from the PDF file of the datasheet in PNG format. Then you use File, Import to bring the file in. Then, using the mouse, you mark three axis points (left x-axis, right x-axis and top y-axis) and their x and y values. You can specify whether each axis is linear or log. Then you just click on the curve and it automatically grabs a whole bunch of x,y pairs from the curve. You can specify as many curves as you want. Then you just do a File, Export and it will save a comma-separated file (.csv file) that can be brought directly into Excel. Way cool!

I wish I'd known about this tool when I first started doing model parameter extraction. I could have saved myself many hours and gotten better data in the bargain.

I'd encourage anybody doing model parameter extraction to try this tool out.
  Reply With Quote
Old 5th September 2007, 12:56 AM   #219
KSTR is offline KSTR  Germany
diyAudio Member
 
KSTR's Avatar
 
Join Date: Jul 2007
Location: Central Berlin, Germany
Default processing .WAV files, "initializing circuit matrix" message

Finally I found what's behind the enormous delay that LTSpice uses to exhibit when processing .WAV files, showing the message "initializing circuit matrix..."

I switched off virtual memory, just having my 160MByte of real RAM on this PC (PII, 500MHz), and fiddled a little with different .WAV file sizes. Eventually LTSpice complained "Could not allocate 90,316,800 more bytes in one contiguous block" when I tried to link a 128 seconds long mono .WAV file (16bit/44.1kHz) to a voltage source. The .WAV's filesize was 11,296,768 bytes

Dividing the numbers gives us a factor of 8, this means it allocates (and fills) a huge memory array with 16 bytes per sample. This might come from one long double (8 byte) for the sample value and one long double for its time stamp value being memorized. Rather inefficient, I'd say. Once you don't have enough real RAM, windoze starts to use the swap file and that is what slows the process down, way more the CPU power. The latter I could prove with swap enabled again and using a 64 sec file (5.5MByte) which was processed almost in half the time once the data came from windows HD cache memory rather than directly from the HD when processed again.

Looks like a good aproach is to
i) really strip one's system down to the minimum memory waste (don't load the typical resident "little helper" stuff,
ii) use an OS with benign memory reqs, like WIN98SE),
iii) have only LTSpice openend,
iv) have lots of real RAM
v) and have the swap(s) on a different harddisk than your working files and system, preferably the fastest you can get or even a RAID-striped setup.

Regards, Klaus
  Reply With Quote
Old 6th September 2007, 09:55 PM   #220
andy_c is offline andy_c  United States
Banned
 
Join Date: Apr 2003
Default EKV modeling of power MOSFETs

Over in the "BJT vs. MOSFET" thread, there's been some discussion of the effects of taking into account the MOSFET weak inversion (sub-threshold conduction) in SPICE simulations of the crossover region behavior of a power MOSFET output stage.

There are plots in Doug Self's book of a simulated MOSFET output stage in which the input of a complementary source follower is swept with DC, and the derivative of the output voltage with respect to the input is plotted. These plots show some really nasty nonlinear behavior in the crossover region, with two sharp dips in the curve and a hump in between. It appears that Self's SPICE analysis was done using one of the traditional MOSFET SPICE model types (level 1, 2 or 3). These models don't take into account sub-threshold conduction.

But Edmond Stuart (estuart) has created some BSIM3 models for the 2SJ201 and 2SK1530 power MOSFET devices, based on actual measurements of them in the weak inversion region. BSIM3 takes into account weak inversion in its V-I characteristic. It was shown over in the other thread that when you do plots like what Self did, comparing the simulated behavior in the crossover region of a source follower using level 1 models and Edmond's BSIM3 models, that the level 1 model gives a terrible-looking result that looks like Self's, while the BSIM3 model gives a very benign, smooth behavior in the crossover region. Those plots are shown here. Some people, including myself and Edmond, have reached the conclusion that Self's "gloom and doom" about MOSFET output stages is based on a faulty SPICE analysis and is, as such, incorrect.

Because of these results, I've been interested in replacing the LTSpice VDMOS models in my power amp simulation with models that take into account weak inversion. I've described a little bit about some preliminary investigations in this post in the BJT/MOSFET thread. The result is that I decided to use the EKV model, because it's the simplest one that supports weak inversion. Also, it's well documented.

This brings me to a question that Edmond asked me in the other thread, which I'm answering here because it relates strictly to SPICE.

Quote:
Originally posted by estuart
(...) Probably I'll also switch to EKV. Far less parameters that make you mad.
Are you extracting the parameters for the 2SJ201/2SK1530 pair as well?
Anyhow, keep us informed about your progress, please.
Hi Edmond,

I'm not using these devices, but after I'm finished extracting model parameters for the devices I do use, I could try extracting data for these if you're interested in trying them.

Here's the status so far. You probably remember that for the LTSpice VDMOS parameter extraction I did before, I was using the Excel solver to adjust the model parameters to minimize the sum of the squares of the errors between model prediction and datasheet values of drain current. This was pretty easy because the formula for the drain current for level 1 is a simple thing that fits into a single spreadsheet cell. But for EKV, the computation of drain current is somewhat complex. So I'm writing a function in Visual Basic for Applications (VBA, which is part of Excel) that computes the drain current given Vgs and Vds. This works just like a built-in spreadsheet function. Each time it's called, it fetches the values of the model parameters from the spreadsheet, and together with Vgs and Vds passed as arguments, computes the drain current using the equations from the EKV model manual. There are 17 DC parameters, so in theory at least, I could use the solver to adjust all 17. It's basically an implementation of the EKV DC model in VBA, used in conjunction with a primitive optimizer (the Excel solver) to adjust the parameters. So far, I"ve implemented about half the required equations in the EKV model manual in my VBA function. I'd like to be able to generate some test plots tomorrow.

The other thing I want to incorporate into this is using the Engauge Digitizer as described in an earlier post. This should make getting data from the graphs as painless and accurate as possible. I'll use data from two graphs to do the fitting - the output curves, and the Id vs. Vgs at a fixed Vds.
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with Spice simulation overmind Everything Else 4 23rd December 2002 04:58 PM


New To Site? Need Help?

All times are GMT. The time now is 11:02 AM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright 1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2