Appendix B.2: Testbed HSPICE File
G.K. Fedder,
Simulation of Microelectromechanical Systems,
Ph.D. Thesis , U.C.Berkeley, 1994.
Mechanical simulation of microactuator system with buffer 8/20/94
*******************************************************************
***************** PARAMETERS **************************************
*******************************************************************
* All entered parameters are in mks units.
* Scale factors are used to scale up units used in internal calculations.
* step-generator position-reference input value (target sensor vpp)
.param vref_z=56m
* initial conditions for displacement and rotation
.param z_ic=-2n
.param phi_ic=0.5u
.param theta_ic=-0.3u
.param z_scale=1e6
.param phi_scale=1e6
.param theta_scale=1e6
.param cap_scale=1e-12
.param cref=40.25f
********************** material parameters ***************************
* dimensions of plate: Lx, Ly, Lz
.param lx=380e-6
.param ly=360e-6
.param lz=1.6e-6
* distance from center of plate to springs: Lkx, Lky
.param lkx=113e-6
.param lky=180e-6
* distance from center of plate to center of sensors: s_xc, s_yc
* sensor electrode size: s_xw, s_yw
.param s1_xc=60e-6
.param s1_yc=60e-6
.param s1_xw=100e-6
.param s1_yw=100e-6
.param s2_xc=-60e-6
.param s2_yc=60e-6
.param s2_xw=100e-6
.param s2_yw=100e-6
.param s3_xc=-60e-6
.param s3_yc=-60e-6
.param s3_xw=100e-6
.param s3_yw=100e-6
.param s4_xc=60e-6
.param s4_yc=-60e-6
.param s4_xw=100e-6
.param s4_yw=100e-6
* distance from center of plate to center of lower actuators: ab_xc, ab_yc
* sensor electrode size: ab_xw, ab_yw
.param ab1_xc=150e-6
.param ab1_yc=150e-6
.param ab1_xw=52e-6
.param ab1_yw=52e-6
.param ab2_xc=-150e-6
.param ab2_yc=150e-6
.param ab2_xw=52e-6
.param ab2_yw=52e-6
.param ab3_xc=-150e-6
.param ab3_yc=-150e-6
.param ab3_xw=52e-6
.param ab3_yw=52e-6
.param ab4_xc=150e-6
.param ab4_yc=-150e-6
.param ab4_xw=52e-6
.param ab4_yw=52e-6
* distance from center of plate to center of upper actuators: at_xc, at_yc
* sensor electrode size: at_xw, at_yw
.param at1_xc=150e-6
.param at1_yc=150e-6
.param at1_xw=54e-6
.param at1_yw=54e-6
.param at2_xc=-150e-6
.param at2_yc=150e-6
.param at2_xw=54e-6
.param at2_yw=54e-6
.param at3_xc=-150e-6
.param at3_yc=-150e-6
.param at3_xw=54e-6
.param at3_yw=54e-6
.param at4_xc=150e-6
.param at4_yc=-150e-6
.param at4_xw=54e-6
.param at4_yw=54e-6
* distance from poly1 to poly2 = z0
.param z0=2.2e-6
* distance from poly2 to poly3 = z0t
* air gap of upper actuator is negative by convention.
* This is compensated by setting bot_or_top=-1 in the ppc subckt.
.param z0t=-2.7e-6
* spring constant = k = spring
.param kz=0.25
* viscosity of air = 1.83e-5 Pa-s
.param viscosity='1.83e-5'
* etch-hole form factor for damping (zeta_z=12 in air)
.param bf_z='0.02'
.param bf_theta='0.02'
.param bf_phi='0.02'
* etch-hole form factor for capacitance
.param alpha_s='1.0'
.param alpha_l='1.0'
.param alpha_u='0.964'
* dielectric constant of air
.param ep='1.'
* Flexure resistance (ohms)
* about 22kohms in testbed suspension
.param r_flexure='22e3'
* Feedback voltage levels (no compensation)
.param v_up0='5.0'
.param v_dn0='5.0'
* Logic high and low voltages
.param vdd='2.5'
.param vss='-2.5'
*******************************************************************
***************** CALCULATIONS ************************************
*******************************************************************
*********** IMPORTANT **********************************
* All parameters associated with moments are scaled by *
* 1/Ly^2 for x-axis (theta) and 1/Lx^2 for y-axis (phi)*
********************************************************
.param f_scale='cap_scale*z_scale*z_scale'
.param c_scale='z_scale/cap_scale'
.param x_scale='z_scale/phi_scale'
.param y_scale='z_scale/theta_scale'
.param mt_scale='theta_scale/z_scale/ly/ly'
.param mp_scale='phi_scale/z_scale/lx/lx'
* mass = m = bm
* density = 2330 kg/m^3
.param mass='2330*lx*ly*lz'
* squeeze film damping coefficient = c
* Ks = fitting factor for square plate = 0.425
* Use Lx as longer side of plate
* assume damping independent of position
.param damp='0.425*viscosity*lx*ly*ly*ly/z0/z0/z0'
* scaled moment about x-axis or y-axis = J
.param moment='mass/12'
* scaled damping coefficient for moment about x-axis or y-axis = B
.param z_damp='bf_z*damp'
.param theta_damp='bf_theta*damp'
.param phi_damp='bf_phi*damp'
* torsional spring constant about x-axis = ktheta
.param ktheta='kz*lky*lky/ly/ly'
* torsional spring constant about y-axis = kphi
.param kphi='kz*lkx*lkx/lx/lx'
* gravitational force
.param fg='-z_scale*9.8*mass'
* External forces for testing circuit
.param f_ext='0.0'
.param mphi_ext='0.0'
.param mtheta_ext='0.0'
*******************************************************************
***************** MAIN CIRCUIT ************************************
*******************************************************************
* Sum of forces and moments
v_z_ext fz fat4_z f_ext
v_theta_ext mtheta mat4_theta mtheta_ext
v_phi_ext mphi mat4_phi mphi_ext
********************** mechanical system *****************************
*
* Mechanical subcircuit models a second-order system (mass-spring damper)
* subckt nodes: x1 mech
* input parameters: pm=mass, pb=damping factor, pk=spring constant
* pscale=scale factor
*
xz fz dz mech pm=mass pb=z_damp pk=kz pscale=z_scale
xtheta mtheta theta mech
+ pm=moment pb=theta_damp pk=ktheta pscale=theta_scale
xphi mphi phi mech pm=moment pb=phi_damp pk=kphi pscale=phi_scale
***************** sensor positions z1, z2, z3, z4 ********************
* y ^
* |
* |
* |
* ----------------
* | |
* | z2 z1 |
* | |
* | | -------------> x
* | | theta rotation about x-axis
* | z3 z4 | phi rotation about y-axis
* | | Use right-hand rule for rotation direction
* ----------------
* in general: zi = z +/- Ly theta +/- Lx phi
***************** Parallel-Plate Sensors *****************************
* Cs1 - output v(31)
cs1_ref 29 31 cref
x_s1 31 30 fs1_z 0 ms1_theta 0 ms1_phi 0
+ dz theta phi ppc xc=s1_xc yc=s1_yc zco=z0 xw=s1_xw yw=s1_yw
* Cs2 - output v(32)
cs2_ref 29 32 cref
x_s2 32 30 fs2_z fs1_z ms2_theta ms1_theta ms2_phi ms1_phi
+ dz theta phi ppc xc=s2_xc yc=s2_yc zco=z0 xw=s2_xw yw=s2_yw
* Cs3 - output v(33)
cs3_ref 29 33 cref
x_s3 33 30 fs3_z fs2_z ms3_theta ms2_theta ms3_phi ms2_phi
+ dz theta phi ppc xc=s3_xc yc=s3_yc zco=z0 xw=s3_xw yw=s3_yw
* Cs4 - output v(34)
cs4_ref 29 34 cref
x_s4 34 30 fs4_z fs3_z ms4_theta ms3_theta ms4_phi ms3_phi
+ dz theta phi ppc xc=s4_xc yc=s4_yc zco=z0 xw=s4_xw yw=s4_yw
***************** Parallel-Plate Actuators ***************************
x_ab1 62 30 fab1_z fs4_z mab1_theta ms4_theta mab1_phi ms4_phi
+ dz theta phi ppc xc=ab1_xc yc=ab1_yc zco=z0 xw=ab1_xw yw=ab1_yw
x_ab2 64 30 fab2_z fab1_z mab2_theta mab1_theta mab2_phi mab1_phi
+ dz theta phi ppc xc=ab2_xc yc=ab2_yc zco=z0 xw=ab2_xw yw=ab2_yw
x_ab3 66 30 fab3_z fab2_z mab3_theta mab2_theta mab3_phi mab2_phi
+ dz theta phi ppc xc=ab3_xc yc=ab3_yc zco=z0 xw=ab3_xw yw=ab3_yw
x_ab4 68 30 fab4_z fab3_z mab4_theta mab3_theta mab4_phi mab3_phi
+ dz theta phi ppc xc=ab4_xc yc=ab4_yc zco=z0 xw=ab4_xw yw=ab4_yw
x_at1 61 30 fat1_z fab4_z mat1_theta mab4_theta mat1_phi mab4_phi
+ dz theta phi ppc xc=at1_xc yc=at1_yc zco=z0t xw=at1_xw yw=at1_yw
+ bot_or_top=-1
x_at2 63 30 fat2_z fat1_z mat2_theta mat1_theta mat2_phi mat1_phi
+ dz theta phi ppc xc=at2_xc yc=at2_yc zco=z0t xw=at2_xw yw=at2_yw
+ bot_or_top=-1
x_at3 65 30 fat3_z fat2_z mat3_theta mat2_theta mat3_phi mat2_phi
+ dz theta phi ppc xc=at3_xc yc=at3_yc zco=z0t xw=at3_xw yw=at3_yw
+ bot_or_top=-1
x_at4 67 30 fat4_z fat3_z mat4_theta mat3_theta mat4_phi mat3_phi
+ dz theta phi ppc xc=at4_xc yc=at4_yc zco=z0t xw=at4_xw yw=at4_yw
+ bot_or_top=-1
*********************** Timing Circuitry ****************************
* Modulation voltages, modulation duty cycle will be small.
* Vm+ = v(29), Vm- = v(28)
* modulation frequency = 50 kHz
vmod1a 71 0 dc 0 pulse(0 0.3 0 .1u .1u 10u 20u)
vmod1b 72 0 dc 0 pulse(0 -0.3 10u .1u .1u 10u 20u)
evmod1 29 0 vol='v(71)+v(72)'
evmod2 28 0 vol='-v(29)'
*
* testbed suspension resistance
r_series 28 30 r_flexure
*
* Sample/Hold clocks
* vpp = v_sense(t=clk1)-v_sense(t=clk2)
* actuator output clocked out on clk3
vclk1 clk1 0 dc 0 pulse(0 vdd 2.5u .1u .1u 5u 20u)
vclk2 clk2 0 dc 0 pulse(0 vdd 12.5u .1u .1u 5u 20u)
vclk3 clk3 0 dc 0 pulse(0 vdd 0 .1u .1u 5u 20u)
***************** Position-Reference Inputs **************************
* Reference position inputs v(39),v(40),v(41),v(42)
vref1 39 0 dc 0 pulse(0 vref_z 200u .1u .1u 5m 10m)
vref2 40 0 dc 0 pulse(0 vref_z 200u .1u .1u 5m 10m)
vref3 41 0 dc 0 pulse(0 vref_z 200u .1u .1u 5m 10m)
vref4 42 0 dc 0 pulse(0 vref_z 200u .1u .1u 5m 10m)
******************* Position-Sense Circuitry *************************
* Node 61 produces a voltage pulse when z1 is negative, C is large,
* so use top actuators
* Node 62 produces a voltage pulse when z1 is positive, C is small,
* so use bottom actuators
* similar logic holds for the other quadrants
xsense1 31 39 61 62 clk1 clk2 clk3 sensor v_up=v_up0 v_dn=v_dn0
xsense2 32 40 63 64 clk1 clk2 clk3 sensor v_up=v_up0 v_dn=v_dn0
xsense3 33 41 65 66 clk1 clk2 clk3 sensor v_up=v_up0 v_dn=v_dn0
xsense4 34 42 67 68 clk1 clk2 clk3 sensor v_up=v_up0 v_dn=v_dn0
**********************************************************************
**********************************************************************
* SUBCKT's
**********************************************************************
**********************************************************************
************************ Sense ckt ***********************************
.subckt sensor sense_in ref_in top bottom clk1 clk2 clk3
+ v_up=vdd v_dn=vdd
* Comparators (linear below 10^(-15) V)
* Position strobed when Vm+ = -0.3 V, Vm- = 0.3 V
* so if v(1)>v(2), then the plate is below the reference
* and the top actuator is activated
* Unity-gain buffer
* nodes are: sense_in=buffer input, z_buf=buffer output
xbuffer z_buf sense_in buffer vos=6m
ez_in z_buffer 0 z_buf 0 1
*
* Sample signal
xsamp1 zsamp1 z_buffer clk1 sample
xsamp2 zsamp2 z_buffer clk2 sample
*
* Instrumentation amplifier
* Vpp = v(zsamp1) - v(samp2)
e_ampl v_pp 0 zsamp1 zsamp2 1
*
* position comparator
* positive z_hi means plate is above reference
xcomp_pos v_pp ref_in z_hi compare
xcomp_neg ref_in v_pp z_low compare
*
* latch signal on next sample cycle
xlatch top2 bot2 z_low z_hi clk3 latch
*
* activate either the top or bottom actuator
* output through second-order smoothing filter to help
* with convergence
ea_top top3 0 vol='v_up*v(top2)/vdd'
ea_bot bot3 0 vol='v_dn*v(bot2)/vdd'
xtop top3 top smooth
xbot bot3 bottom smooth
.ends sensor
************************ S/H ***************************************
.subckt sample out in phi_in
gs1 in out vcr pwl(1) phi_in 0 0.5v,100x 2.0v,1.0
csamp out 0 0.01u
.ic v(out) 0
.ends sample
************************ latch ***************************************
.subckt latch out_p out_m in_p in_m stb
xnand1 in_p stb 6 nand
xnand2 in_m stb 7 nand
xnand3 6 out_m1 out_p1 nand
xnand4 7 out_p1 out_m1 nand
*
* clean up digital output signals by sending through a comparator
vmids vmid 0 'vdd/2'
xdig_p out_p1 vmid out_p compare cmp_pl=0.025m cmp_pc=0.1n cmp_low=0
xdig_m vmid out_p1 out_m compare cmp_pl=0.025m cmp_pc=0.1n cmp_low=0
.ends latch
************************ comparator **********************************
*
.subckt compare in_p in_m out_p cmp_pl=0.25m cmp_pc=1n
+ cmp_hi=vdd cmp_low=vss
ez_less 1 0 pwl(1) in_p in_m -1u,cmp_low 1u,cmp_hi
rb in_p 0 10
rf in_p 1 1x
cb in_p 0 1f
xsmooth 1 out_p smooth pl=cmp_pl pc=cmp_pc
.ends compare
************************ nand gate ***********************************
.subckt nand 1 2 n_out
e_nand n_out1 0 nand(2) 1 0 2 0
+ -2.5 2.5v
+ 0.0 2.5v
+ 0.25 2.4
+ 0.5 2.25
+ 2.0 0.25v
+ 2.25 0.1v
+ 2.5 0.0v
xnout n_out1 n_out smooth
.ends nand
************************ ppc *****************************************
.subckt ppc 1 2 fz2 fz1 mt2 mt1 mp2 mp1 z_in theta phi
+ xc=0 yc=0 zco=2 xw=1 yw=1 bot_or_top=1
******** fixed scale factors ****************
* x_scale = z_scale/phi_scale
* y_scale = z_scale/theta_scale
* f_scale = z_scale*zscale*cap_scale
* c_scale = z_scale/cap_scale
* mt_scale = theta_scale/z_scale/lx/lx
* mp_scale = phi_scale/z_scale/ly/ly
* z_in, zc, and z force (fz) scaled by z_scale
* theta and theta moment (mt) scaled by theta_scale
* phi and phi moment (mp) scaled by phi_scale
* capacitance scaled by cap_scale
* x,y in mks units
* positive force pulls up, negative force pulls down
xcap 1 2 cap 0 tvc
* zc = z +/- Lx theta +/- Ly phi
* "Top" z position will actually be negative. This is compensated by
* setting bot_or_top=-1 in ppc subckt.
ez zc 0 vol=
+ 'bot_or_top*(v(z_in)+zco*z_scale+yc*y_scale*v(theta)-xc*x_scale*v(phi))'
v_dz zc dzc 'bot_or_top*zco*z_scale'
r_dz dzc 0 1x
ec cap 0 vol='8.854e-12*c_scale*ep*xw*yw/v(zc)'
efz fz2 fz1
+ vol='-bot_or_top*v(cap)*f_scale*(v(1)-v(2))*(v(1)-v(2))/2./v(zc)'
emt mt2 mt1 fz2 fz1 'yc*mt_scale'
emp mp2 mp1 fz1 fz2 'xc*mp_scale'
.ends
************************ tvc *****************************************
* Time varying capacitor (tvc) subcircuit
* C is connected to nodes 1 and 2.
* C(t) = v(3,4)
.subckt tvc 1 2 3 4
* e1: generate non-linear voltage so, I = d/dt [C(v3-v4) * V]
e1 5 0 vol='v(3,4)*v(1,2)'
* c1: linear capacitance
c1 6 0 cap_scale
* v1: Ammeter to measure current into capacitor
v1 5 6 dc 0
* Drive the current through c1 back into the circuit
f1 1 2 v1 1
.ends tvc
************************ smooth **************************************
.subckt smooth in out pl=0.1m pc=0.4n pr=1k
* second-order smoothing filter
* H(s) = 1/(LC s^2 + RC s + 1)
* damping factor = 0.5 R / sqrt(L/C) = 1
* wn = 1/sqrt(LC) => 318 kHz (L=.25m, C=1n)
ef_in n1 0 in 0 1
r_in n1 n2 pr
l_in n2 n3 pl
c_in n3 0 pc
e1 out 0 n3 0 1
.ends
************************ mech ****************************************
.subckt mech f_in x_out pm=1 pb=1 pk=1 pscale=1
* f=v(f_in), z=v(x_out)
* f comes in scaled up by pscale (in micro Newtons)
* z comes out scaled up by pscale (in microns)
xin f_in force smooth
L1 force xr 'pscale*pm'
r1 xr xinit 'pscale*pb'
c1 xinit 0 '1./pk/pscale'
ez x_out1 0 vol='v(xinit)/pk'
rout x_out1 0 1x
ez_clip x_out 0 pwl(1) x_out1 0 -2,-2 2,2
.ends mech
**********************************************************************
* include CMOS unity-gain buffer subcircuit
.include 'buffer.subckt'
**********************************************************************
***************************** MODELS *********************************
**********************************************************************
*
*.model diode d level=3 l=9e-6 w=15e-6 cj=5.3e-3 is=1 xw=1e-6
.model diode d
.model mn_4um nmos level=2 capop=0 acm=0
+ vto=0.56 kp=33u gamma=0.55 phi=0.6
+ lambda=0.043 rdc=10.0 rsc=10.0
+ ld=0.22u xj=0.25u tox=500.0e-10 nsub=2.3e+16
+ uo=619.0 ucrit=2.6e+04 uexp=0.106
+ neff=1.000 delta=1.4 nfs=1.38e+12
+ rsh=4.0 pb=0.8
+ cj=4.06e-04 mj=0.443 cjsw=4.44e-10 mjsw=0.291
+ cgdo=2.5e-10 cgso=2.5e-10 cgbo=2.5e-10
+ vmax=6.84e+4
+ nss=1.0e+12 tpg=1.0
*
.model mp_4um pmos level=2
+ vto=-0.56 kp=17u gamma=0.55 phi=0.6
+ lambda=0.046 rdc=100.0 rsc=100.0
+ ld=0.16u xj=0.25u tox=500.0e-10 nsub=0.79e+16
+ uo=257.0 ucrit=2.4e+04 uexp=0.270
+ neff=1.001 delta=0.0 nfs=1.1e+12
+ rsh=4.0 pb=0.71
+ cj=2.30e-04 mj=0.410 cjsw=2.20e-10 mjsw=0.1
+ cgdo=2.5e-10 cgso=2.5e-10 cgbo=2.5e-10
+ vmax=4.50e+4
+ nss=1.0e+12 tpg=-1.0
*
.model mp_8um pmos level=2
+ vto=-0.56 kp=17u gamma=0.55 phi=0.6
+ lambda=0.023 rdc=100.0 rsc=100.0
+ ld=0.16u xj=0.25u tox=500.0e-10 nsub=0.79e+16
+ uo=257.0 ucrit=2.4e+04 uexp=0.270
+ neff=1.001 delta=0.0 nfs=1.1e+12
+ rsh=4.0 pb=0.71
+ cj=2.30e-04 mj=0.410 cjsw=2.20e-10 mjsw=0.1
+ cgdo=2.5e-10 cgso=2.5e-10 cgbo=2.5e-10
+ vmax=4.50e+4
+ nss=1.0e+12 tpg=-1.0
*
**********************************************************************
***************************** CONTROL CARDS **************************
**********************************************************************
*
.ic
+ v(dz)='z_ic*z_scale' v(xz.xinit)='z_ic*kz*z_scale'
+ v(phi)='phi_ic*phi_scale' v(xphi.xinit)='phi_ic*kphi*phi_scale'
+ v(theta)='theta_ic*theta_scale'
+ v(xtheta.xinit)='theta_ic*ktheta*theta_scale'
+ v(xz.xr)='z_ic*kz*z_scale'
+ v(xphi.xr)='phi_ic*kphi*phi_scale'
+ v(xtheta.xr)='theta_ic*ktheta*theta_scale'
+ v(xsense1.6)=vdd v(xsense1.7)=vdd
+ v(xsense2.6)=vdd v(xsense2.7)=vdd
+ v(xsense3.6)=vdd v(xsense3.7)=vdd
+ v(xsense4.6)=vdd v(xsense4.7)=vdd
+ v(61)=vdd v(62)=0 v(63)=vdd v(64)=0 v(65)=vdd v(66)=0 v(67)=vdd v(68)=0
+ v(70)=0
.options acct
+ chgtol=1e-16 absi=1e-15 absv=1e-9
+ dvdt=0 imax=20 rmin=1e-12
+ lvltim=3 post
+ probe ingold=1 co=132
.tran 1u 1m uic
.print v(fz) v(mphi) v(mtheta) v(dz) v(phi) v(theta) v(30)
.print v(fab1_z) v(fab2_z) v(fab3_z) v(fab4_z)
+ v(fat1_z) v(fat2_z) v(fat3_z) v(fat4_z)
.print v(31) v(32) v(33) v(34) v(fs1_z) v(fs2_z) v(fs3_z) v(fs4_z)
.print v(x_s1.dzc) v(x_s2.dzc) v(x_s3.dzc) v(x_s4.dzc)
+ v(xsense1.v_pp) v(xsense2.v_pp) v(xsense3.v_pp) v(xsense4.v_pp)
.probe v(fz) v(mphi) v(mtheta)
.probe v(dz) v(phi) v(theta)
.probe v(fs1_z) v(fs2_z) v(fs3_z) v(fs4_z)
.probe v(fab1_z) v(fab2_z) v(fab3_z) v(fab4_z)
.probe v(fat1_z) v(fat2_z) v(fat3_z) v(fat4_z)
.probe v(x_s1.dzc) v(x_s2.dzc) v(x_s3.dzc) v(x_s4.dzc)
*.probe v(x_at1.dzc) v(x_at2.dzc) v(x_at3.dzc) v(x_at4.dzc)
*.probe v(x_ab1.dzc) v(x_ab2.dzc) v(x_ab3.dzc) v(x_ab4.dzc)
.probe v(30) v(31) v(32) v(33) v(34)
.probe v(61) v(63) v(65) v(67)
.probe v(xsense1.v_pp) v(xsense2.v_pp) v(xsense3.v_pp) v(xsense4.v_pp)
.end