"""Land grid array (LGA, HLGA, VLGA) sensor and oscillator packages, each from its maker's data sheet outline. Centred on the origin with the seating plane on the XY plane, the body's length along X and its width along Y; the lands are on the underside, each its own copper solid. Dimensions from the outline named by `package`; see the README.""" from steve import Model package = "BMI088" # maker's package outline, named by the device whose data sheet prints it detail = "full" # full: body, pin-1 mark and lands; simple: the body only # outline: (kind, pins, body length along X, body width along Y, height, standoff, land rows), mm, nominal values as printed. # A land row is (lands, pitch, direction, offset, land size along X, land size along Y): "x" rows run along X at Y = offset, "y" rows run along Y at # X = offset; the lands of a row are centred on the body's centre line. # BMI088: Bosch Sensortec BMI088 data sheet, BST-BMI088-DS000-19, revision 1.9 (01/2024), p. 54, Figure 10: 4.50 x 3.00, 0.95 +/-0.05 high; 7 + 7 lands # 0.250 x 0.475 at 0.50 pitch (3.00 span), rows 2.33 apart; two end lands 0.475 x 0.250, 3.83 apart, on the centre line. # BMI160: Bosch Sensortec BMI160 data sheet, BST-BMI160-DS000-09, revision 1.0 (November 2020), p. 106, Figure 41: 3.00 x 2.50 x 0.83 +/-0.05; 14 lands # 0.475 x 0.25; 3 + 3 along the long sides at 0.50 pitch (1.00 span), 4 + 4 along the short sides at 0.50 pitch (1.50 span); each land's outer end # (0.1) in from the body's edge (a reference dimension), which puts the land centres 0.9125 and 1.1625 from the centre lines. # L3GD20: ST L3GD20 data sheet, DocID022116 Rev 2 (February 2013), p. 42, Figure 21 (drawing 8125097_A): D1 = E1 = 4.000; A2 0.785 + A3 0.200 # (A1 1.000 maximum); 4 lands a side, T1 0.400 (across the edge) x T2 0.300, pitch N1 0.650 (N2 0.975, L2 1.950), M 0.100 in from the edge, which # puts the land centres 1.7 from the centre lines. # LPS22HH: ST LPS22HH data sheet, DocID030890 Rev 2 (February 2019), p. 55, Figure 26 (DM00386636_1): HLGA-10L 2.0 x 2.0 x 0.73 typical (0.8 maximum); 10 lands # 0.25 x 0.275 +/-0.05, the 0.275 across the edge; 3 + 3 at 0.5 pitch (1 span) along two sides, 2 + 2 at 0.5 along the others; lands (0.1) in from # the edges (reference), which puts their centres 0.7625 from the centre lines. # LPS25HB: ST LPS25HB data sheet, DocID027112 Rev 4 (August 2016), p. 46, Figure 22 and Table 24 (8398191_3): HLGA-10L 2.5 x 2.5 x 0.76 typical # (0.8 maximum); pad size 0.3 x 0.45 +/-0.05 (10x), the 0.45 across the edge; 3 + 3 at 0.6 pitch along two sides and 2 + 2 at 0.6 along the # others, row centres 0.92 from the centre lines. # AUA: Microchip DSC60XX data sheet, DS20005625C, pp. 15-16, drawing C04-1202A (4-lead VLGA 2.5 x 2.0 mm, package code AUA): D 2.50, E 2.00 BSC, # A 0.84 (0.79 to 0.89), standoff A1 0.02 (0.00 to 0.05); lands b1 x L 0.65 x 0.65, pitch e 1.65 BSC along D and e1 1.25 BSC along E. OUTLINES = { "BMI088": ("LGA", 16, 4.5, 3.0, 0.95, 0.0, ((7, 0.5, "x", 1.165, 0.25, 0.475), (7, 0.5, "x", -1.165, 0.25, 0.475), (1, 0.0, "y", 1.915, 0.475, 0.25), (1, 0.0, "y", -1.915, 0.475, 0.25))), "BMI160": ("LGA", 14, 3.0, 2.5, 0.83, 0.0, ((3, 0.5, "x", 0.9125, 0.25, 0.475), (3, 0.5, "x", -0.9125, 0.25, 0.475), (4, 0.5, "y", 1.1625, 0.475, 0.25), (4, 0.5, "y", -1.1625, 0.475, 0.25))), "L3GD20": ("LGA", 16, 4.0, 4.0, 0.985, 0.0, ((4, 0.65, "x", 1.7, 0.3, 0.4), (4, 0.65, "x", -1.7, 0.3, 0.4), (4, 0.65, "y", 1.7, 0.4, 0.3), (4, 0.65, "y", -1.7, 0.4, 0.3))), "LPS22HH": ("HLGA", 10, 2.0, 2.0, 0.73, 0.0, ((3, 0.5, "x", 0.7625, 0.25, 0.275), (3, 0.5, "x", -0.7625, 0.25, 0.275), (2, 0.5, "y", 0.7625, 0.275, 0.25), (2, 0.5, "y", -0.7625, 0.275, 0.25))), "LPS25HB": ("HLGA", 10, 2.5, 2.5, 0.76, 0.0, ((3, 0.6, "x", 0.92, 0.3, 0.45), (3, 0.6, "x", -0.92, 0.3, 0.45), (2, 0.6, "y", 0.92, 0.45, 0.3), (2, 0.6, "y", -0.92, 0.45, 0.3))), "AUA": ("VLGA", 4, 2.5, 2.0, 0.84, 0.02, ((2, 1.65, "x", 0.625, 0.65, 0.65), (2, 1.65, "x", -0.625, 0.65, 0.65))), } # Proportions, for looks only: the pin-1 mark on top, and how deep each land sits in its pocket of the body (LAND_DEPTH; the outlines give no land # thickness). The lands' underside is the seating plane, so neither affects fit. LAND_DEPTH = 0.03 kind, pins, length, width, top, standoff, rows = OUTLINES[package] model = Model() model.plane("body_plane", on="XY", offset=standoff, name="Body") with model.sketch("body_sketch", on="body_plane", name="Body") as sk: sk.rect("body_rect", (-length / 2, -width / 2), (length / 2, width / 2)) model.extrude("body", "body_sketch", distance=top - standoff, op="new", body="body_body", name="Body") if detail == "full": model.plane("top_plane", on="XY", offset=top, name="Top") with model.sketch("mark_sketch", on="top_plane", name="Pin-1 mark") as sk: sk.circle("mark_circle", (-length / 2 + 0.15 * width, width / 2 - 0.15 * width), 0.05 * width) model.extrude("mark", "mark_sketch", distance=-0.03, op="cut", body="body_body", name="Pin-1 mark") # Each land is its own copper solid in a pocket of the body, from the seating plane up. lands = [] for r, (count, pitch, direction, offset, size_x, size_y) in enumerate(rows): for i in range(count): along = (i - (count - 1) / 2) * pitch x, y = (along, offset) if direction == "x" else (offset, along) tag = f"land_{r}_{i}" with model.sketch(f"{tag}_sketch", on="XY", name="Land") as sk: sk.rect(f"{tag}_rect", (x - size_x / 2, y - size_y / 2), (x + size_x / 2, y + size_y / 2)) model.extrude(tag, f"{tag}_sketch", distance=standoff + LAND_DEPTH, op="new", body=f"{tag}_body", name="Land") model.extrude(f"{tag}_pocket", f"{tag}_sketch", distance=standoff + LAND_DEPTH, op="cut", body="body_body", name="Land pocket") lands.append(f"{tag}_body") # Body: moulding on a laminate substrate (ptfe, the nearest plastic in the material list); lands: copper. model.material("ptfe", bodies=["body_body"], color="#26282b") if detail == "full": model.material("copper", bodies=lands, color="#c9ccd1") result = model.result()