Keyboard Shortcuts
Likes
- LTspice
- Messages
Search
Re: mosfet parameter setting of imported spice model
john23,
?
In other words, your PMOS or PMOS4 schematic symbol is telling LTspice to do this:
?
It does not connect L and W to the imported SPICE model.? It is the other way around.? It "connects" the imported SPICE model to that MOSFET instance (M1 or M2) which also has the size values from L and W.
?
Of course you would not use W=100n and L=1u.? Those were just my examples to illustrate it.
?
Andy
? |
Re: mosfet parameter setting of imported spice model
On Sat, Apr 12, 2025 at 05:06 AM, john23 wrote:
That is how SPICE works.
?
The .MODEL does not (or might not) have values for W and L.? But the instance of each transistor does have W and L values, which are applied to that instance of each MOSFET.
?
The imported SPICE model is identified by a name, which I illustrated in message 159780.? The MOSFET instance must be given the same name, as I explained in message 159780, and that is how that instance logically connects to the imported SPICE model with the same name.
?
Andy
? |
Re: mosfet parameter setting of imported spice model
Hello Andy, I notices that the spice model I imported doesnt have ant W,L parameters in it. So when we define ?l=1u w=100n? ?parameters in the PMOS4 model,how does it know to connect the inported spice model to the W, L? how does it know the names of L and W and to logiccaly connect the, to the imported spice model? Thanks. |
Re: Overriding a library diode's internal parameter(s)
Probably the easiest way is to use AKO.
?
Use a unique name for your experimental diode model so it does not conflict with existing models names in the LTspice native diode library or your own user library (if you have one).
?
Place this on the schematic:
?
.Model MUR460X AKO:MUR460 D (Rs=Rser)
?
where MUR460X is the unique model name.
?
Then use MUR460X as your diode symbol "Value" attribute.
Use N=Nx as the diode symbol "Spice line" attribute value.
?
Then use params on the schematic to define Nx and Rser and step them if you wish. |
Re: Overriding a library diode's internal parameter(s)
I'd love to get back to this when I am not visiting Mom.
toggle quoted message
Show quoted text
|
Re: Overriding a library diode's internal parameter(s)
¿ªÔÆÌåÓýThis surprised me when I unintentionally did it: ¡°N" when used in the diode element line sets the number of effective diodes connected in series.? N=5 means this one diode in your schematic represents 5 diodes in series.? It can have fractional values too, such as 5.31.¡° ? Dave ? From: [email protected] <[email protected]>
On Behalf Of Andy I via groups.io
Sent: Friday, April 11, 2025 3:09 PM To: [email protected] Subject: EXTERNAL: Re: [LTspice] Overriding a library diode's internal parameter(s) ? On Fri, Apr 11, 2025 at 05:15 PM, Richard Andrews wrote:
Your schematic has two things wrong.? This is not how it should be done.
? As I discussed already (perhaps you missed it), the "N" that is inside a diode's .MODEL definition is not the same as the "N" that goes on the diode's element line. ? "N" inside a diode's .MODEL definition is the diode's "Emission Coefficient".? It is the same "n" that is in the Shockley Ideal Diode Law, multiplied by (kT/q) and in the denominator of the exponent of "e".? Its normal value is 1.0, and can be set a little larger, usually between 1 and 2, to indicate a "less perfect" diode.? That is its intended purpose.? Some SPICE models set N unusually low, apparently to construct a theoretical diode with much less than the normal forward voltage. ? "N" when used in the diode element line sets the number of effective diodes connected in series.? N=5 means this one diode in your schematic represents 5 diodes in series.? It can have fractional values too, such as 5.31. ? The two N's must never be confused!? They are two completely different things. ? In this example, Dave wanted to use the "N" diode multiplier, which must be part of the diode element line and must not be inside the diode's .MODEL statement.? But "Rs" is a .MODEL parameter so it must be inside the diode's .MODEL statement. ? Andy ? |
Re: mosfet parameter setting of imported spice model
On Fri, Apr 11, 2025 at 04:57 PM, john23 wrote:
Wow.? I watched a few minutes of that video.? A few minutes was all I could tolerate.? Incredibly bad. ?
I often say that you should not rely on watching videos to learn anything about electronics or LTspice.? Here is proof.? An hour and a half of it.
?
Andy
? |
Re: Overriding a library diode's internal parameter(s)
On Fri, Apr 11, 2025 at 05:15 PM, Richard Andrews wrote:
Your schematic has two things wrong.? This is not how it should be done.
?
As I discussed already (perhaps you missed it), the "N" that is inside a diode's .MODEL definition is not the same as the "N" that goes on the diode's element line.
?
"N" inside a diode's .MODEL definition is the diode's "Emission Coefficient".? It is the same "n" that is in the Shockley Ideal Diode Law, multiplied by (kT/q) and in the denominator of the exponent of "e".? Its normal value is 1.0, and can be set a little larger, usually between 1 and 2, to indicate a "less perfect" diode.? That is its intended purpose.? Some SPICE models set N unusually low, apparently to construct a theoretical diode with much less than the normal forward voltage.
?
"N" when used in the diode element line sets the number of effective diodes connected in series.? N=5 means this one diode in your schematic represents 5 diodes in series.? It can have fractional values too, such as 5.31.
?
The two N's must never be confused!? They are two completely different things.
?
In this example, Dave wanted to use the "N" diode multiplier, which must be part of the diode element line and must not be inside the diode's .MODEL statement.? But "Rs" is a .MODEL parameter so it must be inside the diode's .MODEL statement.
?
Andy
?
|
Re: mosfet parameter setting of imported spice model
Also, don't forget to name the MOSFET with the right model name.? On your schematic, you have defined a P-channel MOSFET model with the name "CMOSP":
Therefore, the name next to the PMOS symbol (M2) must be changed from "PMOS" to "CMOSP".? This is true for either the PMOS symbol or the PMOS4 symbol.
?
If you don't do that, you would end up simulating with the default SPICE MOSFET which is 50-year-old CMOS technology.
?
Andy
? |
Re: mosfet parameter setting of imported spice model
On Fri, Apr 11, 2025 at 04:57 PM, john23 wrote:
I did not yet look at the video.? So my answer does not directly refer to your question about the video. ?
But there are two ways to set the Width (and Length) of a MOSFET:
After doing either of these, it is a good idea to then use Ctrl-Right-Click on the symbol and get an "X" into the "Vis." column for those attributes, so that they are visible and easier to edit on your schematic.
?
When using the PMOS4 and NMOS4 symbols, note this caution:? The 4th pin on those symbols, for the "Bulk" pin, needs to be attached to a wire to somewhere, typically to your VDD or VSS supply net.? That wire must NOT go straight up or down from the Bulk to the Source pin!? You must draw that wire sideways away from the Bulk pin, and then up or down to reach the wire where you want it to connect.? If instead you try to draw a wire from Bulk straight to the Source pin, it does not reach the Source pin, and the Bulk node floats!??This happens because LTspice tries to prevent you from making "direct component pin shorts".? (It's complicated.)
?
Andy
? |
mosfet parameter setting of imported spice model
Hello,I have imported the tsmc Pdk 180nm shown bellow in the ltspice model.
however in the 1:01:06 moment of the video they somehow managed in the menu to get the channel width of the mosfet.
Where I import the spice model as is and I cant change the W of the mosfet .
How did they do it in Ltspice ?? /g/LTspice/files/Temp/pmos_vds.asc
?
?
1:01:06
https://sanjayvidhyadharan.in/Downloads/tsmc_180_nm/tsmc018.lib
|
Re: NCS2001
On Thu, Apr 10, 2025 at 10:57 PM, Andy I wrote:
In case I did not state this adequately, the concern is that you would literally fry U3.? Its input pin is being pulled well beyond U3's VEE supply voltage. ?
It does not appear to affect the simulation's convergence problem that I see.? It might be only a hardware problem.? And that op-amp would distort pretty badly, so maybe it would also affect how well it simulated - if only it simulated at all.
?
Andy
? |
Re: NCS2001
¿ªÔÆÌåÓýNow the OP tells us that the.ASC is just a
fragment of something bigger, so loose ends are to be expected. On 2025-04-11 09:56, John Woodgate
wrote:
--
Best wishes John Woodgate RAYLEIGH Essex OOO-Own Opinions Only If something is true: * as far as we know - it's science *for certain - it's mathematics *unquestionably - it's religion |
Re: NCS2001
¿ªÔÆÌåÓýIt's not that they look funny, it's that the
output of U2 (marked 'fb' for 'feedback?), goes nowhere, and the
supply rail from C3 looks as if it should power something,
perhaps a missing U1? I also note that U3 doesn't do anything
useful; it and R7 could be eliminated and V2 connected to R6. On 2025-04-11 00:18, Andy I via
groups.io wrote:
I think the things John mentioned are non-issues.? Wires to nowhere do not matter even if they look funny.? --
Best wishes John Woodgate RAYLEIGH Essex OOO-Own Opinions Only If something is true: * as far as we know - it's science *for certain - it's mathematics *unquestionably - it's religion |
Re: NCS2001
Hi,
?
The line
?
GD16 16 1 TABLE {V(16,1)} ((-100,-100E-15)(0,0)(1m,1u)(2m,1m))?
?
is pspice syntax and accepted by LTspice. You need not change it. The only downside of the pspice syntax is that it is not documented, for obvious reasons.
?
I reiterate: We don't change LTspice just for the fun of changing things. We have very good reasons. Above all, we strive to let the program be backward compatible. That's much harder than it might appear, though. We want everything that worked in prior versions to keep working, unless there is a good reason not to.
?
Best Regards,
Mathias ?
On Fri, Apr 11, 2025 at 01:41 AM, Andy I wrote:
|
Re: NCS2001
Derek,
?
I have (maybe) good news and mostly not so good news.
?
I think my obsessing over the syntax was somewhat misplaced.? In my opinion this form of the TABLE function is rare, and it's not documented in LTspice's help, but it does exist in at least two other SPICE programs - even with those darned curly braces!.? The problem is that LTspice is not obligated to support it, even though it does now it previously did and it would be best if it continues to do so.
?
From what I can tell, older versions of LTspice did correctly handle that TABLE() syntax.? It silently converted the G-sources to B-sources, with the B-source's TABLE() function which is better suited for that TABLE() syntax.
?
From your experience with this model file, it is possible that LTspice version 24.1 broke that, and it no longer works.? If so, you should report it to Analog Devices.
?
Separately, I modified onsemi's NCS2001 model file by converting the TABLEs to the other form as documented in LTspice's Help.? Today I can't use the computer that has the latest LTspice, at least for a few more hours.? But with an older version, my modified model file runs without syntax errors.? (The unmodified model did too, so that is not really an improvement for those using pre-24.1 LTspice.)
?
Interestingly, after changing the TABLE() syntax, LTspice does not convert the G-sources to B-sources.? So the old code knew what to do in either case and did it correctly.? Let's hope that v24.1.6 can handle the alternate TABLE() syntax.
?
However, I still can not run your simulation.? It always aborts while trying to find the initial operating point, always with a "timestep too small" error.? That is not a real timestep because it is still in the DC phase, but that's a detail left for another time.
?
So the bottom line is I still can't get it to work.? Syntax-wise, it seems to be OK.? But for me, both original and modified models quit in the same way.? Maybe you will have better luck, as the latest LTspice might converge better.? I did not try modifying your circuit to see if the misconvergence? problem could be avoided another way.
?
I uploaded my modified model file in: NCS2001_test_AI.zip in the Temp folder.
?
Andy
? |
Re: NCS2001
Derek,
?
I think your voltage source V1 is wrong.? Its sine wave amplitude is 1.2 V with a DC offset of 0.6 V, so it swings between -0.6 V and 1.8 V.? That goes low enough to violate the Absolute Maximum Input Common Mode Voltage Range, and Note 1 below the table.? You would be damaging the part.
?
Andy
? |