Author Topic: Spice calibration  (Read 1472 times)

GK

  • Member
  • Posts: 456
Re: Spice calibration
« Reply #45 on: July 28, 2010, 07:36:40 PM »
Does anyone know if there are decent LT-spice compatible models for the IRFP9240/IRFP240 pair about?
Irrational trends do not end rationally.

andy_c

  • Member
  • Posts: 583
    • Andy's web page
Re: Spice calibration
« Reply #46 on: July 28, 2010, 08:07:16 PM »
You might try emailing Bob, I think he was working on those.

I've also attached my models for the IRFP244/FQA9P25, which are similar and might be useful in a pinch.  I put Bob's email address in the zip file too.

GK

  • Member
  • Posts: 456
Re: Spice calibration
« Reply #47 on: July 29, 2010, 03:43:29 AM »
Thanks Andy.
Irrational trends do not end rationally.

syn08

  • Member
  • Posts: 471
    • Advanced Audio Projects
Re: Spice calibration
« Reply #48 on: August 12, 2010, 07:15:24 AM »
You might try emailing Bob, I think he was working on those.

I've also attached my models for the IRFP244/FQA9P25, which are similar and might be useful in a pinch.  I put Bob's email address in the zip file too.

Hi Andy,

I'm trying to port these models to PSpice and I'm running in problems.

1. "pi" is not defined. Not a big deal, takes just another .PARAM line, but is "pi" defined by default in LTSpice?

2. "x" is not defined. I assume it's V(G, D), can you confirm?

3. This is a tough one. Are you sure about the Cgd expression? PSpice doesn't take Q (charge?) as a capacitor C parameter.  Are you sure that's not Ggd instead of Cgd?
Advanced Audio Projects
www.synaesthesia.ca

andy_c

  • Member
  • Posts: 583
    • Andy's web page
Re: Spice calibration
« Reply #49 on: August 12, 2010, 09:55:54 AM »
I'm trying to port these models to PSpice and I'm running in problems.

1. "pi" is not defined. Not a big deal, takes just another .PARAM line, but is "pi" defined by default in LTSpice?

Yes, it's a built-in constant in LTspice.

2. "x" is not defined. I assume it's V(G, D), can you confirm?

Yes, that's right.  Here's the LTspice docs that describe x.

Quote
There is also a general nonlinear capacitor available. Instead of specifying the capacitance, one writes an expression for the charge.
LTspice will compile this expression and symbolically differentiate it with respect to all the variables, finding the partial derivative's that correspond to capacitances.

Syntax: Cnnn n1 n2 Q=<expression> [ic=<value>] [m=<value>]

There is a special variable, x, that means the voltage across the device. Therefore, a 100pF constant capacitance can be written as

Cnnn n1 n2 Q=100p*x


3. This is a tough one. Are you sure about the Cgd expression? PSpice doesn't take Q (charge?) as a capacitor C parameter.  Are you sure that's not Ggd instead of Cgd?

LTspice is a PITA for nonlinear capacitances.  One cannot specify a nonlinear C-V characteristic directly.  Instead, one must specify a Q-V characteristic.  So if there's a formula for the C-V characteristic available, it's necessary with LTspice to compute its integral to get Q vs. V.  This post describes the LTspice VDMOS C-V model that I used for the nonlinear Cgd.  It's split into two expressions, one involving atan() and one involving tanh().  The functions for Q vs. V are the integrals of tanh() and atan() with a 1/a out front, which I had to look up in a CRC math table book.

I'm pretty sure this isn't necessary in PSPICE, and that one can specify C-V directly.  The post I linked above shows that A=C and B=D, so that can be used along with the equations in the first graph of that post to fill in Cgd vs. V directly.  I think the PSPICE implementation should be a lot cleaner and simpler, with the atan() expression for Cgd with reverse-biased Vgd and tanh expression for Cgd with forward-biased Vgd.
« Last Edit: August 12, 2010, 10:20:35 AM by andy_c »

syn08

  • Member
  • Posts: 471
    • Advanced Audio Projects
Re: Spice calibration
« Reply #50 on: August 12, 2010, 10:45:51 AM »
LTspice is a PITA for nonlinear capacitances.   

You would think so :angryfancy:. Here's the "regular" way to implement nonlinear caps in PSpice.

http://www.cadence.com/rl/Resources/application_notes/nonlinear_capacitor_model_appnote.pdf

I'll dig further in the Cadence docs for ways to do this through expressions.

EDIT: Yes, that was not to difficult. Instead of a cap I have to use a conductance G and specify the value as C(V)*DDT(V) Now the stupid thing is that PSPICE doesn't allow multiple line syntax for expressions, x doesn't exist and therefore the expression line is longer than 132 chars  :angryfancy:
« Last Edit: August 12, 2010, 10:59:09 AM by syn08 »
Advanced Audio Projects
www.synaesthesia.ca

syn08

  • Member
  • Posts: 471
    • Advanced Audio Projects
Re: Spice calibration
« Reply #51 on: August 12, 2010, 11:21:36 AM »
Ggd G D VALUE=
+ {if(V(G,D)<0,{C*(V(G,D)*atan(a*V(G,D))-1/(2*a)*log(1+a*a*V(G,D)^2))+b*V(G,D)},{C/a*log(cosh(a*V(G,D)))+B*V(G,D)})*DDT(V(G,D))}

This is how it looks in PSpice. Works fine now...
Advanced Audio Projects
www.synaesthesia.ca

syn08

  • Member
  • Posts: 471
    • Advanced Audio Projects
Re: Spice calibration
« Reply #52 on: August 12, 2010, 11:38:06 AM »
Andy, there's something very wrong with the Fairchild model, the Id tempco (in red) is way to small. Here's the result, for 25-125 degrees (relative temperature, re: 27 degs). The IRFP244 (in green) seems to be about right. Could you check the same in LTSpice?
Advanced Audio Projects
www.synaesthesia.ca

andy_c

  • Member
  • Posts: 583
    • Andy's web page
Re: Spice calibration
« Reply #53 on: August 12, 2010, 11:38:56 AM »
Those look like the expressions for Q(V) rather than C(V) though.  From your post, it looks like you can use C(V) (=dQ/dV) directly.  The C(V) expressions are like this:

For Vd > Vg
C(V)=C*atan(a*Vgd)+B

For Vd < Vg
C(V)=C*tanh(a*Vgd)+B

These are just the expressions from the graph below:

[ Guests cannot view attachments ]

but using the additional information A=C and B=D (obtained by setting the function values and their first derivatives equal at Vgd=0).

andy_c

  • Member
  • Posts: 583
    • Andy's web page
Re: Spice calibration
« Reply #54 on: August 12, 2010, 11:40:40 AM »
Andy, there's something very wrong with the Fairchild model, the Id tempco (in red) is way to small. Here's the result, for 25-125 degrees (relative temperature, re: 27 degs). The IRFP244 (in green) seems to be about right. Could you check the same in LTSpice?

I never tried to get the tempco stuff right at all.  It should not be trusted.

I should have mentioned that these were for room temp only.  Sorry!
« Last Edit: August 12, 2010, 11:43:49 AM by andy_c »

syn08

  • Member
  • Posts: 471
    • Advanced Audio Projects
Re: Spice calibration
« Reply #55 on: August 12, 2010, 11:55:19 AM »
Those look like the expressions for Q(V) rather than C(V) though.

Don't think so, G is in fact a voltage controlled current source and the VALUE= is actually the output current as a function of voltage, e.g.

G1 1 2  VALUE = {5mA*SIN(6.28*1kHz*TIME+V(5))}

OTOH, I=C(V)*(dV/dt) so the G output current emulates the nonlinear cap.
Advanced Audio Projects
www.synaesthesia.ca

andy_c

  • Member
  • Posts: 583
    • Andy's web page
Re: Spice calibration
« Reply #56 on: August 12, 2010, 12:02:48 PM »
I'm not sure I follow.  You are saying your current source has the form:  i(t)=C(V)*DDT(V).  So Q(V) is not involved, only C(V).  But the expressions you have for C(V) look to be the same as the expressions I have for Q(V) in my model (which aren't necessary as you can apparently specify C(V) directly).  That is, your expressions have stuff like log(cosh(...)).
« Last Edit: August 12, 2010, 12:06:37 PM by andy_c »

syn08

  • Member
  • Posts: 471
    • Advanced Audio Projects
Re: Spice calibration
« Reply #57 on: August 12, 2010, 12:10:32 PM »
I'm not sure I follow.  You are saying your current source has the form:  i(t)=C(V)*DDT(V).  So Q(V) is not involved, only C(V).  But the expressions you have for C(V) look to be the same as the expressions I have for Q(V) in my model (which aren't necessary as you can apparently specify C(V) directly).  That is, your expressions have stuff like log(cosh(...)).

Ah, you are right, your expression is dimensionally already a charge, so DDT(V) is no longer required. So it's only about replacing C with a VCCS.
Advanced Audio Projects
www.synaesthesia.ca

andy_c

  • Member
  • Posts: 583
    • Andy's web page
Re: Spice calibration
« Reply #58 on: August 12, 2010, 12:20:46 PM »
I think it's probably simplest to retain the DDT(V), and use for C(V) the expressions in this post.  My expressions are the integrals of those, but that's because of the LTspice quirk.  I think the DDT(V) is mandatory, otherwise you'll get a nonlinear conductance.

syn08

  • Member
  • Posts: 471
    • Advanced Audio Projects
Re: Spice calibration
« Reply #59 on: August 12, 2010, 06:14:49 PM »
I think it's probably simplest to retain the DDT(V), and use for C(V) the expressions in this post.  My expressions are the integrals of those, but that's because of the LTspice quirk.  I think the DDT(V) is mandatory, otherwise you'll get a nonlinear conductance.

As expected, results are identical. I suppose using DDT instead of the complicated analytical derivatives would improve the speed and the convergence.
Advanced Audio Projects
www.synaesthesia.ca