// gullwing-4.fe // Surface Evolver datafile for the fourth example in the Gull Wing series. // This file prevents anomalous undercutting at the toe and heel by // putting certain edges on constraints. //Geometric parameters (all lengths in mils) // Paramters whose values should not be changed at runtime. parameter padtoe = -36 // x coordinate of pad toe end. parameter padheel = 15 // x coordinate of pad heel end. parameter padwidth = 14 // full y width of pad. parameter thick = 6 //Thickness of lead in the z direction. parameter width = 10 // Width of lead in y direction parameter leadtoe = -30 // Toe of lead, relative to heel (mils) parameter bend = 90*pi/180 // bending angle of a curved section, radians parameter rad = 10 // inside radius of bends parameter orad = rad+thick // outside radius of bends // Geometry parameters to change in moving lead around. parameter gap = 5 // Height of the bottom of the gull foot above the pad parameter leadheel = 0 // y coord of flat-curve junction of lead parameter leadshift = 0 // x offset of centerline of lead //Materials Parameters parameter gamlv = 0.45 // Liquid-vapor surface energy of solder (Kg/s^2) parameter den= 1.3e-10 // Density of solder (Kg/mil^3) parameter mr_grav= 385000 // Acceleration of gravity (mil/s^2) //Contact angles on sides, foot, and bottom surfaces of lead, and pad parameter theta_side = 20 // Contact angle on sides of the gull wing (degrees) parameter theta_lower = 20 // Contact angle on the bottom surface of the gull wing (degrees) parameter theta_toe = 20 // Contact angle on the toe of the gull wing (degrees) parameter thetap = 20 // Wetting angle on the pad (degrees) gravity_constant mr_grav scale_limit 2 // should vary inversely as tension // Constraints for display of lead curved sections #define ZLOWER1 gap #define ZLOWER2 (orad + gap - sqrt(orad^2-(y-leadheel)^2)) #define ZLOWER3 (gap+(rad+orad)*(1-cos(bend))-rad + \ sqrt(rad^2 - (y-leadheel-(rad+orad)*sin(bend))^2) ) #define ZLOWER ( (y < leadheel) ? ZLOWER1 : \ (y < leadheel+orad*sin(bend) ? ZLOWER2 : ZLOWER3)) constraint 1 // lower side of lower curve formula: (z-(gap+orad))^2 + (y-leadheel)^2 = orad^2 constraint 2 // upper side of lower curve formula: (z-(gap+orad))^2 + (y-leadheel)^2 = rad^2 constraint 3 // lower side of upper curve formula: (z-(gap+(rad+orad)*(1-cos(bend))-rad))^2 + (y-leadheel-(rad+orad)*sin(bend))^2 = rad^2 constraint 4 // upper side of upper curve formula: (z-(gap+(rad+orad)*(1-cos(bend))-rad))^2 + (y-leadheel-(rad+orad)*sin(bend))^2 = orad^2 // Constraints for solder contact on the pad constraint 5 // pad surface formula: z = 0 energy: e1: 0 e2: -gamlv*cos(thetap*pi/180)*x e3: 0 constraint 6 nonnegative // Keep inside pad edges in x direction formula: (padwidth^2/4 - x^2) constraint 7 nonnegative // Keep inside y direction formula: (y-padtoe)*(padheel-y) // Constraints to keep solder on the lead, with integrals to replace // omitted facets. constraint 10 // toe surface of lead, i.e. -y side formula: y = leadtoe+leadheel energy: e1: -gamlv*cos(theta_toe*pi/180)*(z-gap) e2: 0 e3: 0 constraint 11 // +x side of lead formula: x = leadshift + width/2 energy: e1: 0 e2: -gamlv*cos(theta_side*pi/180)*(z-ZLOWER) + G*den*ZLOWER^2/2*x e3: 0 content: c1: 0 c2: -ZLOWER*x c3: 0 constraint 12 // -x side of lead formula: x = leadshift - width/2 energy: e1: 0 e2: gamlv*cos(theta_side*pi/180)*(z-ZLOWER) + G*den*ZLOWER^2/2*x e3: 0 content: c1: 0 c2: -ZLOWER*x c3: 0 constraint 13 // bottom surface of lead, formulas like constraints 1 and 3 formula: (y < leadheel) ? (z - gap) : // flat part ( ((y-leadheel)*cos(bend) < (gap+orad-z)*sin(bend)) ? orad^2 - ((z-(gap+orad))^2 + (y-leadheel)^2) : // first curve ((z-(gap+(rad+orad)*(1-cos(bend))-rad))^2 + // second curve (y-leadheel-(rad+orad)*sin(bend))^2 - rad^2) ) energy: e1: gamlv*cos(theta_lower*pi/180)*( y < leadheel ? y-(leadtoe+leadheel) : ( y < leadheel+(orad+rad)*sin(bend) ? -leadtoe + orad*asin((y-leadheel)/orad) : -leadtoe + orad*bend + rad*(bend-asin((leadheel+(orad+rad)*sin(bend)-y)/rad)) )) e2: G*den*ZLOWER^2/2*x e3: 0 content: c1: 0 c2: -z*x // z same as ZLOWER here. c3: 0 // One-sided constraints to keep solder contact within bounds on lead constraint 20 nonnegative // -y bound; keep from running off toe formula: y = leadtoe+leadheel constraint 21 nonpositive // within x bounds; formula combo of constraints 11 and 12 formula: (x - leadshift + width/2)*(x - leadshift - width/2) constraint 22 nonnegative // above the bottom, formula combo of constraints 1 and 3 formula: (y < leadheel) ? (z - gap) : // flat part ( ((y-leadheel)*cos(bend) < (gap+orad-z)*sin(bend)) ? orad^2 - ((z-(gap+orad))^2 + (y-leadheel)^2) : // first curve ((z-(gap+(rad+orad)*(1-cos(bend))-rad))^2 + // second curve (y-leadheel-(rad+orad)*sin(bend))^2 - rad^2) ) constraint 23 nonpositive // below the top, formula combo of constraints 2 and 4 formula: (y < leadheel) ? (z - gap - thick) : // flat part ( (y-leadheel)*cos(bend) < (gap+orad-z)*sin(bend) ? rad^2 - ((z-(gap+orad))^2 + (y-leadheel)^2) : // first curve ((z-(gap+(rad+orad)*(1-cos(bend))-rad))^2 + // second curve (y-leadheel-(rad+orad)*sin(bend))^2 - orad^2) ) //******************************************************************* // Constraints for preventing undercutting at toe and heel. // The gap-margin prevents some possible legitimate undercutting under // the toe. parameter margin = 1; constraint 31 // +x side of lead formula: z >= gap-margin ? x = leadshift + width/2 : 0 constraint 32 // -x side of lead formula: z >= gap-margin ? x = leadshift - width/2 : 0 constraint 33 nonpositive // keep in front of toe above gap formula: z >= gap-margin ? y - (leadtoe+leadheel) : -1 constraint 34 nonpositive // keep under heel formula: z - ZLOWER vertices 1 -padwidth/2 padtoe 0 fixed // For display of pad on substrate. 2 padwidth/2 padtoe 0 fixed 3 padwidth/2 padheel 0 fixed 4 -padwidth/2 padheel 0 fixed 5 -width/2 leadtoe gap fixed // For display of the lead. 6 width/2 leadtoe gap fixed 7 width/2 leadheel gap fixed 8 -width/2 leadheel gap fixed 9 -width/2 leadtoe gap+thick fixed 10 width/2 leadtoe gap+thick fixed 11 width/2 leadheel gap+thick fixed 12 -width/2 leadheel gap+thick fixed 13 width/2 orad*sin(bend) gap+orad*(1-cos(bend)) fixed 14 width/2 (rad+orad)*sin(bend) gap+(rad+orad)*(1-cos(bend)) fixed 15 -width/2 (rad+orad)*sin(bend) gap+(rad+orad)*(1-cos(bend)) fixed 16 -width/2 orad*sin(bend) gap+orad*(1-cos(bend)) fixed 17 width/2 rad*sin(bend) gap+thick+rad*(1-cos(bend)) fixed 18 width/2 (rad+orad)*sin(bend) gap+thick+(rad+orad)*(1-cos(bend)) fixed 19 -width/2 (rad+orad)*sin(bend) gap+thick+(rad+orad)*(1-cos(bend)) fixed 20 -width/2 rad*sin(bend) gap+thick+rad*(1-cos(bend)) fixed // Vertices for solder surface 21 -padwidth/2 padtoe 0 constraints 5,6,7 // On pad 22 padwidth/2 padtoe 0 constraints 5,6,7 23 padwidth/2 padheel 0 constraints 5,6,7 24 -padwidth/2 padheel 0 constraints 5,6,7 25 -width/2 leadtoe gap+thick/3 constraints 10,12,22,23 26 width/2 leadtoe gap+thick/3 constraints 10,11,22,23 27 width/2 orad*sin(bend/2) gap+orad*(1-cos(bend/2)) constraints 11,13 28 -width/2 orad*sin(bend/2) gap+orad*(1-cos(bend/2)) constraints 12,13 edges 1 1 2 fixed no_refine // For display of pad on substrate. 2 2 3 fixed no_refine 3 3 4 fixed no_refine 4 4 1 fixed no_refine 5 5 6 fixed // For display of lead. 6 6 7 fixed 7 7 8 fixed 8 8 5 fixed 9 9 10 fixed 10 10 11 fixed 11 11 12 fixed 12 12 9 fixed 13 5 9 fixed 14 6 10 fixed 15 7 11 fixed 16 8 12 fixed 17 7 13 fixed constraint 1 18 13 14 fixed constraint 3 19 15 16 fixed constraint 3 20 16 8 fixed constraint 1 21 13 16 fixed 22 14 15 fixed 23 11 17 fixed constraint 2 24 17 18 fixed constraint 4 25 19 20 fixed constraint 4 26 20 12 fixed constraint 2 27 17 20 fixed 28 18 19 fixed 29 13 17 fixed 30 14 18 fixed 31 15 19 fixed 32 16 20 fixed // Edges for solder 33 21 22 constraints 5,6,7 34 22 23 constraints 5,6,7 35 23 24 constraints 5,6,7 36 24 21 constraints 5,6,7 37 25 26 constraints 10,21,22,23 38 26 27 constraints 11,20,22,23 39 27 28 constraints 13,21 40 28 25 constraints 12,20,22,23 47 21 25 constraints 32,33 // with anti-undercutting constraints. 48 22 26 constraints 31,33 49 23 27 constraints 31,34 50 24 28 constraints 32,34 Faces 1 1 2 3 4 fixed color green no_refine // For display of pad. 2 -8 -7 -6 -5 fixed color yellow // For display of lead. 3 6 15 -10 -14 fixed color yellow 4 8 13 -12 -16 fixed color yellow 5 5 14 -9 -13 fixed color yellow 6 9 10 11 12 fixed color yellow 7 17 29 -23 -15 color yellow // not fixed yet so can massage below. 8 18 30 -24 -29 color yellow 9 7 -20 -21 -17 fixed color yellow constraint 1 10 21 -19 -22 -18 fixed color yellow constraint 3 11 23 27 26 -11 fixed color yellow constraint 2 12 24 28 25 -27 fixed color yellow constraint 4 13 16 -26 -32 20 color yellow 14 32 -25 -31 19 color yellow 15 31 -28 -30 22 fixed color yellow // Solder faces 16 33 48 -37 -47 tension gamlv // solder-air faces 17 34 49 -38 -48 tension gamlv 18 35 50 -39 -49 tension gamlv 19 36 47 -40 -50 tension gamlv body 1 16 17 18 19 volume 3780 density den read hessian_normal // default in version 2.14 and later. linear_metric // for proper scaling of eigenvalues //************************************************************************* // Some initial massage. // Subdivide some curve edges for better display refine edge where (id >= 17 and id <= 20) or (id >= 23 and id <= 26) // Get rid of pesky vertices in middle of curved sides. delete edge ee where sum(ee.facet,color==yellow)==2 and ee.length < thick/3 foreach facet ff where color==yellow do { fix ff.edge; fix ff.vertex; fix ff} // Get rid of energy on display surfaces set facet tension 0 where color==yellow or color==green read "gullforces.cmd" //**************************************************************************** // For fixing vertices that hit one-sided constraints, so hessian works // better. nail := { constraint_tolerance := 1e-2; recalc; // to get hit_constraint to use new constraint_tolerance fix vertex where hit_constraint 6 or hit_constraint 7 or hit_constraint 20 or hit_constraint 21 or hit_constraint 22 or hit_constraint 23 or hit_constraint 33; fix vertex where id>=25 and id<=28; constraint_tolerance := 1e-12; } unnail := { unfix vertex where on_constraint 6 or on_constraint 7 or on_constraint 20 or on_constraint 21 or on_constraint 22 or on_constraint 23 or on_constraint 33 or on_constraint 13; } //**************************************************************************** // Typical evolution. These have been developed for the gap=5, vol=3780 // version: Sequence to run: gogo; gomore; gogo2; gogo3 gogo := { l 40; r; g 10; U; g 20; u; V;u;V; refine edge where valence==1 and not fixed; u; V; g 20; u; V; g 20; r; V; u; V; u; g 20; V; u; V; u; g 40; } // Converge using hessian (after gogo) gomore := { nail; g; nail; g; nail; hessian; hessian; hessian; hessian; } // For when heel undercutting prevention becomes unnecessary unheel := { foreach vertex vv where on_constraint 34 do { unset vv constraint 31; unset vv constraint 32; unset vv constraint 34; }; foreach edge ee where on_constraint 34 do { unset ee constraint 31; unset ee constraint 32; unset ee constraint 34; } } // Next refinement gogo2 := { unheel; unnail; margin := 1; r; u; V; u; V; g 20; nail; g; nail; g; nail; hessian; hessian; hessian; } // And the next refinement gogo3 := { unnail; r; u; V; u; V; g 20; g 20; t .2; // taking care of a bit of trouble at the heel g 10; nail; g; nail; hessian; nail; hessian; hessian; } read "outline.cmd" read "slats.cmd"