The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
May 19th, 2024, 11:51pm
Pages: 1
Send Topic Print
Verilog-A model of a voltage dependent series RC (Read 9175 times)
Leron
New Member
*
Offline



Posts: 5

Verilog-A model of a voltage dependent series RC
Feb 08th, 2007, 1:29am
 
Hi All!
nice forum..
I am trying to model a varactor as a series RC circuit. The values of R and C are provided as a function of the total applied voltage Vd=V(p,n) (see below)

           C     x        R
p o-----| |----o----/\/\/\-----o n

C=C0+C*tanh((Vd-vc0)/vc1)
R=R0+R1*tanh((1.01*Vd-vr0)/vr1)

The verilog code is implemented according to what suggested by Kundert in his document (i.e., using a charge based model).
The Verilog code is:

`include "constants.vams"
`include "disciplines.vams"
module varactor(p,n);
electrical p,n,x;
parameter real Nf=1;
real Vd;
real Qfit, Rfit;

real C0;
real C1;
real vc0;
real vc1;

real R0;
real R1;
real vr0;
real vr1;

analog begin
Vd=V(p,n);
C0=1.15e-15;
C1=8.1e-16;
vc0=-0.13;
vc1=0.29;

R0=81.5;
R1=-15;
vr0=0.05;
vr1=1;

Qfit=Nf*(C0*Vd+C1*vc1*ln(cosh((Vd-vc0)/vc1)));
Rfit=(R0+R1*tanh((1.01*Vd-vr0)/vr1))/Nf;
I(p,x) <+ ddt(Qfit);
V(x,n)<+I(x,n)*Rfit;

end
endmodule


The problem is that, after AC simulation in Spectre, while the capacitance is properly calculated, the resistance is different from what expected.
Do you have any suggestion about how to correctly model such a circuit? I think that there is some kind of misuse of the internal node in my model.
thank you a lot

Francesco
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2384
Silicon Valley
Re: Verilog-A model of a voltage dependent series
Reply #1 - Feb 8th, 2007, 10:23am
 
You need to apply the same approach to calculating resistor current as was applied to calculate capacitor charge. In other words, the resistance is defined to be di/dv (it is only I/V for linear resistors), and so the current is the integral of the resistance with respect to v.

-Ken
Back to top
 
 
View Profile WWW   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: Verilog-A model of a voltage dependent series
Reply #2 - Feb 8th, 2007, 11:03am
 
It looks like you did a fine job of integrating tanh to get ln(cosh) for the capacitor.  I think you should have done the same for the resistor.  Right now, you've got V = I * R(V) in your Verilog-A model, so V appears on both sides of the equation.

But I don't know from what you posted whether they actually measured the resistance or maybe the conductance G = 1/R = dI/dV and then inverted it.  Since they specified R(V), I'd try integrating 1/R(V) dV and writing I(x,p) <+ I(V); where I(V) is that integral.

Good luck!
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: Verilog-A model of a voltage dependent series
Reply #3 - Feb 8th, 2007, 11:06am
 
I was in the middle of typing my post when Ken posted ... but I think there's a small glitch:

Ken Kundert wrote on Feb 8th, 2007, 10:23am:
the resistance is defined to be di/dv (it is only I/V for linear resistors)


Conductance is di/dv, so you need to invert (1/R) the resistance before integrating.  (The other possibility is that you have to find the functional inverse, if we really have V = I * R(V), then you need to find a function of I that gives the voltage.)
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
Leron
New Member
*
Offline



Posts: 5

Re: Verilog-A model of a voltage dependent series
Reply #4 - Feb 19th, 2007, 3:41am
 
Hi All!
thanks for  the help. Actually I solved by using the following code:

`include "disciplines.vams"
`include "constants.vams"

module varactor_kundert(p,n);
inout p,n;
electrical p,n,x;
branch (p, x) cap;
branch (x, n) res;
parameter real Nf=1;
real Vc, Vr, Vd;
real Cfit,Qfit, Rfit;
real C0, C1;
real R0, R1;
real vc0, vc1, vr0, vr1;

analog begin

Vd= V(p,n);
Vc = V(cap);
Vr = V(res);
C0=1.16e-15;
C1=8.1e-16;
vc0=-0.13;
vc1=0.29;
R0=81.5;
R1=-15;
vr0=0.05;
vr1=1;

Qfit=Nf*(C0*Vc+C1*vc1*ln(cosh((Vc-vc0)/vc1)));
Rfit=(R0+R1*tanh((1.01*Vd-vr0)/vr1))/Nf;
           
   V(res) <+ Rfit*I(res);
   I(cap) <+ ddt(Qfit);
   
end
endmodule


Thanks again

Francesco
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: Verilog-A model of a voltage dependent series
Reply #5 - Feb 19th, 2007, 4:19am
 
Leron wrote on Feb 19th, 2007, 3:41am:
Hi All!
thanks for  the help. Actually I solved by using the following code:


Francesco -
It looks to me like you didn't read (or didn't understand) Ken's and my replies.  Your resistor is wrong.  I think, perhaps, for a varactor, the series resistance is probably small (and the nonlinearity even smaller), so you haven't noticed the difference yet.  I hope it doesn't come back to bite you.

-Geoffrey
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
Leron
New Member
*
Offline



Posts: 5

Re: Verilog-A model of a voltage dependent series
Reply #6 - Feb 19th, 2007, 5:56am
 
Actually I got it working by trial and error before looking at your replies (I was out for work, sorry).
Anyway you are definitely right. I will try to implement your (and Kun's of course) suggestions.
Thank you

Francesco
Back to top
 
 
View Profile   IP Logged
Leron
New Member
*
Offline



Posts: 5

Re: Verilog-A model of a voltage dependent series
Reply #7 - Feb 19th, 2007, 7:31am
 
Hi Geoffrey,
just to let you understand my problem. The values of series resistance and capacitance as a function ov the overall V(p,n) have been extracted from small signal s-parameters simulations of an accumulation mode varactor for different biasing. Assuming that the resistance is well represented by the model Rfit=R0+R1*tanh((V-V0)/V1), I tried to extract the integral of Gfit=1/Rfit. The formula is as expected rather complicated. Then, keeping in mind the last code I posted, I wrote the current as

I(res)<+ddt(integral(Gfit));
I(cap)<+ddt(Qfit);

To check the code, I tried to extract the R and C from s-parameters and compare it with the expected values. Unfortunately they are different. Did I implement the currents wrongly?
Conversely, with the code reported in my previous post, the values are the ones expected. Could you please help me in understanding what's wrong in my code since I am not able to figure it out?
Thank you really for any help/suggestions

Francesco
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: Verilog-A model of a voltage dependent series
Reply #8 - Feb 19th, 2007, 11:57am
 
Francesco -
I wasn't intending for you to use ddt and integral; those two are with respect to time, but we're interested in the derivative and integral with respect to voltage.

I'm a little puzzled by two things in your model:
1) you have R(Vd) where Vd  is the voltage across the whole device, not just across the resistive part
2) you have 1.01 * Vd, rather than just re-scaling vr0 and vr1 (and R1) such that
 R =R0 + R1*tanh((Vd-vr0)/vr1))/Nf;

If Vd were the voltage across the resistor, then when you wrote:
 Rfit=(R0+R1*tanh((1.01*Vd-vr0)/vr1))/Nf;
 V(res) <+ Rfit*I(res);
you'd have the equation
 V = (R0 + R1*tanh((V-vr0)/vr1)) * I
(let's remove the 1.01 and Nf), or equivalently,
I = V/(R0 + R1*tanh((V-vr0)/vr1)))

Now, the small-signal conductance would be the partial derivative of I with respect to V,
 G = 1/(R0 + R1*tanh((V-vr0)/vr1))) + V/(R0 + R1*tanh((V-vr0)/vr1)))^2 * R1*sech^2((V-vr0)/vr1) / vr1
where the first term is what you wanted.

I suggested that, if the nonlinearity is small -- that is, R1/R0 is small -- then this second term might be small enough that you don't notice it.

I don't have time right now to think about it, but the fact that this is a varactor, and in fact, there is no large-signal current, might mean that your solution is not as bad an approximation as I thought.  The resistance/conductance you measure isn't the derivative of the large-signal current, since (except for leakage), there is no large-signal current.
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
Leron
New Member
*
Offline



Posts: 5

Re: Verilog-A model of a voltage dependent series
Reply #9 - Feb 20th, 2007, 1:27am
 
Hi Geoffrey,
you are right, the integral I used is wrong. About your concerns:
1) Vd is the voltage across the whole device. That's the main problem. I have a polinomial fit for the resistance and for the capacitance  as a function of Vd (if you want I can post the formulas) but it is not wise to use it in Verilog-A. That's why I am using tanh modeling.

2) You are again right. Indeed I rescaled and I get the same equation you mentioned without this odd 1.01.

Actually, since the behavior of the component modeled like in the last piece of code looks like the one expected from the poly fitting, I am using it also because I cannot find a better way to circunvent the problem. Of course, if you have any suggestion I will be happy to follow it.
Thank you again for the help

Francesco
Back to top
 
 
View Profile   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.