The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 18th, 2024, 8:32am
Pages: 1
Send Topic Print
Verilog-A model of cantilever beam (Read 7421 times)
shiv
New Member
*
Offline



Posts: 4

Verilog-A model of cantilever beam
Feb 14th, 2012, 10:02am
 
hello guys,
Is there anyone using Verilog-A for microsystems..I am facing problem in writing the netlist file(.sp file) for mechanical components,Using H-spice ...plz help
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: Verilog-A model of cantilever beam
Reply #1 - Feb 14th, 2012, 1:58pm
 
You need to provide more information for anyone to be able to help you!
Back to top
 
 

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



Posts: 4

Re: Verilog-A model of cantilever beam
Reply #2 - Feb 15th, 2012, 10:40am
 
‘include”constant.vams”
`include “disciplines.vams”

module cantilever(fa,fb,ra,rb,z);

Input fa, fb ;
electrical fa, fb;
Input B;
magnetic_2 B;
output ra, rb ;
electrical ra, rb;
output z;  
kinematic z;

parameter real K = 2.4;
parameter real  M = 7.5e-10;
parameter real  D = 7e-7;
parameter real  Lc= 500e-6;
parameter real  Wc = 100e-6;
parameter real Rf = 5;
parameter real  Rj= 1e3;
parameter real  Tgf = 32;

real DRj;
kinematic  FORCE_EXT;
kinematic BEND;
kinematic_v  VELOCITY;

analog
           begin

V(fa, fb)  <+ Rf * I(fa,fb);

F(FORCE_EXT) <+ I(fa,fb) * Wc * T(B);

F(FORCE_EXT) <+ white_noise (4 * 1.38e-23 * 300 * D, “Mech_Noise”);

Vel(VELOCITY) <+ ddt(Pos(BEND));
Pos(BEND) <+ (1/K) * F(FORCE_EXT);
Pos(BEND) <+  -(D/K) * Vel(VELOCITY);
Pos(BEND) <+  -(M/K) * ddt(Vel(VELOCITY));

DRj  = Rj * Tgf * (Lc/Wc) * K * Pos(BEND);

V(ra,rb) <+ white_noise (4 * 1.38e-23 * 300 * Rj, “Gauge_noise”);

Pos(z)  <+ Pos(BEND);

end
endmodule

......
this is the .va file ,but dont kow exactly how to write .sp file for it(specially kinematic,magnetic,etc)... want to do frequency response(ac) analysis..
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: Verilog-A model of cantilever beam
Reply #3 - Feb 16th, 2012, 6:46am
 
I don't see B in your module port list, and I don't see magnetic_2 in my disciplines.vams:

Input B;
magnetic_2 B;
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 cantilever beam
Reply #4 - Feb 16th, 2012, 6:55am
 
But, in response to your actual question, I would try writing a netlist where you just treat the magnetic and kinematic ports of the module as though they were electrical.

Code:
* example netlist
.hdl "cantilever.va"
x1 (fa 0 B ra 0 z) cantilever
vB B gnd 1.0 // set to an appropriate value
ia fa gnd 1m 



I once had a Verilog-A model of a transistor with self-heating modeled on a "thermal" port; the simulator refused to let me put that in a netlist until I convinced R&D that it was OK to have thermal ports in a spice netlist.  That was a while ago, so I expect they've all figured out what to do.

It might be that you want to create a VA model for a "magnetic source" -- just set the potential, I guess that's "T()" for your magnetic_2 discipline.

Code:
module magnetic_source(B);
  inout B;
  magnetic_2 B;
  parameter real field_strength = 0;

  analog T(B) <+ field_strength;
endmodule 



Then even a picky simulator should allow you to connect this B to the same "net" as the B input for the cantilever.
Back to top
 
 

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



Posts: 4

Re: Verilog-A model of cantilever beam
Reply #5 - Feb 21st, 2012, 8:10pm
 
thank you Geoffrey_Coram...
thank you very much sir...
im from mechanical background,dont know much about spice modeling,n thats why facing problem in simulating this code still know...
is there any literature for mechanical modeling in verilog-A available..
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: Verilog-A model of cantilever beam
Reply #6 - Feb 22nd, 2012, 6:17am
 
I'm not familiar with literature on mechanical modeling.  I did a search at IEEE Xplore on "verilog-a mems" and came up with a few hits:

Hardware description language modeling of an electrostatically actuated bi-axial micromirror
http://ieeexplore.ieee.org/search/srchabstract.jsp?tp=&arnumber=1304069

which might give you a starting point.
Back to top
 
 

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



Posts: 4

Re: Verilog-A model of cantilever beam
Reply #7 - May 19th, 2012, 7:06pm
 
hello sir, need help in simulating this code using hspice..

want to perform AC analysis for frequency response plot ..

please help in writing the sp file for it to simulate..

given : The beam - driver model is defined as a three port system. The port defined are two drivers (VD1 and VD2) and the beam (VC). ports are bi-directional, so the current can flow in any direction depending on the configuration used to excite the beam and to perform the electrical readout.

At Driver 1 (input side), an ac voltage is applied superimposed with dc volate. At driver 2 (output side ), a dc voltage is applied.



`include “constants.vams”
`include “disciplines.vams”
`define yes 1
`define no 0

module model_v1(D1 , D2 , C , Z , Vc);

// definition of input / output ports   ------------------

inout D1 , D2 , C ; // drivers and cantilever
electrical D1 , D2 , C ;

inout  Z ; // nominal displacement
kinematic  Z ;

inout Vc ;   // cantilever velocity
kinematic_v  Vc ;

// Cantilever design parameters     ------------------------------

parameter real Lc   = 830e-6; // Cantilever Length
parameter real Tc   = 10e-6; // cantilever thickness
parameter real Wc  = 100e-6; //cantilever width
parameter real gap =  2e-6; // cantilever – driver gap

parameter real xa  = 3e-6; // driver initial position
parameter real xb = 7e-6; // driver final position

parameter real  Qf  = 300; // mechanical Q-factor
parameter real  E    = 170e9; // young modulus
parameter real  Ro  = 2.233e3; // mass density

parameter real  k3  = 0; // cubic spring coefficient
   
// electrical design parameters

parameter real alpha = 0; // fringing field factor

// capacitance parassites
parameter integer N = 6 ; // cantilever sections
parameter integer clamped2 = `yes ;

// nodes declaration ---------------------------------

real  W, Ra, Ma, k, k1, Meff, Zmax, Zx, D, W0, Cx;
integer ii, j;
real dx, xn;
real Ci[0:10]; // array of Ci coefficients
real Ai[0:10]; // array of the Ai coefficients
electrical Cd1, Cd2, DCd1, DCd2 ;
electrical dVd1 , dVd2 ;
real FF; // Finging field component
kinematic Zk3; // cubic nonlinearity component
kinematic FG1, FG2;  //Electrical forces

// parameters calculation -------------------------

Analog begin
@(initial_step) begin
if (clamped2 == `yes) begin

// clamped-clamped cantilever

k = 16*E*Tc*pow(Wc,3) /pow(Lc, 3);  // stiffness constant
k1 = 2.365 ; // 1st mode constant
Meff = 12*R0*Lc*Wc*Tc/pow(k1,4); //  effective mass
W0 = pow(k/Meff,0.5);  // Natural resonance frequency
D = W0*Meff/Qf ; // Damping factor

W  = 1; // reference force density
Ra = (W/(2*pow(Lc,3)))*((Lc + xb)*pow(xa,3) – (Lc + xa)*pow(xb,3));  \\ force reaction
Ma = (W/(12*pow(Lc,2)))*(pow(xa,4))-pow(xb,4)) – Lc*Ra/3 ; // moment reaction
FF = 1 + alpha*(gap/Tc)*pow(Wc/Tc),0.222);     //  fringing field contribution

// calculation of the Ci and Ai coefficients

for(ii=0;  ii < N+1; ii=ii +1)begin
dx = (xb - xa)/N ; // section length
Xn = ii*dx + xa; // section position

A[ii] = 1;

// deflection profile
Zx = ((xa - xb)*W/(2*k))*((pow(Xn,3)/3) – (xa + xb)*pow(Xn,2)/2) + pow(Xn – xa, 4)*W/(24*k)

// maximum deflection Z(Lc)

Zmax = ((xa - xb)*W/(2*k))*((pow(Lc,3)/3) – (xa + xb)*pow(Lc,2)/2) + (pow(Lc-xa,4) – pow(Lc – xb, 4))*W/(24*k);

Cx = Zx/Zmax; // normalized deflection profile

Ci[ii] = Cx;

   end
end

//----------------------------------------------------
Ai[0] = 0.5;
Ai[N] = 0.5;

end

// cantilever velocity

Vel(Vc) <+ ddt(Pos(Z));

// cubic nonlinearity

Pos(Zk3) <+ k3*pow(Pos(Pos(Z),3));

// electrical force calculation : Fel (x,t)

for( j=0; j<N+1; j=j+1) begin

F(FG1)  <+  - ((`P_EPS0*dx*Tc/2)*(pow(V(D1,C),2))*Ai[j]/(pow(gap + Ci[j]*Pos(Z),2))*FF;
F(FG2)  <+  ((`P_EPS0*dx*Tc/2)*(pow(V(D2,C),2)*Ai[j]/(pow(gap – Ci[j]*Pow(Z),2)))*FF;
end

// movement equation

Pos(Z)  <+  ((F(FG1) + F(FG2)) – D*Vel(Vc) – Meff*ddt(Vel(Vc)) – Pos(Zk3)) / k;

// Capacity calculation

for(j=0;  j<N+1; j=j+1) begin

V(Cd1)  <+ ((`P_EPS0*dx*Tc)*Ai[j]/(gap +Ci[j]*Pos(Z)))*FF;
V(Cd2) <+ ((`P_EPS0*dx*Tc)*Ai[j]/(gap – Ci[j]8Pos(Z)))*FF;


// current calculation

V(dCd1)  <+ ddt(V(Cd1));
V(dCd2)  <+ ddt(V(Cd2));

V(dVd1)  <+ ddt(V(D1,C));
V(dVd2)  <+ ddt(V(D2,C));

I(D1,C) <+  V(Cd1)*V(dVd1) + V(D1,C)*V(dCd1);
I(D2,C) <+  V(Cd2)*V(dVd2) + V(D2,C)*V(dCd2);

    end
endmodule
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.