"""SMD aluminium electrolytic capacitor (chip type, V-chip) by maker series and case size: the aluminium can standing on its plastic platform, with two flat terminals under the platform. Centred on the can's axis, seated on the XY plane, the terminals along X: the positive terminal at -X (a bi-polar series' terminal 1), the negative at +X. Dimensions from the maker's catalogue, listed in the README.""" import math from steve import Model series = "UWT" # Maker series size = "6.3x5.4" # Case size, diameter x height (mm) # Each entry, by series and case size: (can diameter D, overall height L, terminal length A, platform B (along the terminals), platform C # (across), gap between the terminals E, terminal width H), nominal, in mm. H is the middle of the catalogue's range ("0.5 to 0.8": 0.65). # Nichicon "Aluminum Electrolytic Capacitors, Chip Type" catalogue, CAT.8100M (2023; # www.nichicon.co.jp/english/_assets/images/products/catalog/corporate/digital/06_Chip_Type_Aluminum_Electrolytic_Capacitors_E.pdf), # "Chip Type" drawings and dimension tables: UZG page 1, UZT page 3, UWP page 5, UWT page 7, UUP page 15, UCD page 25. SERIES = { "UZG": {"4x3.9": (4.0, 3.9, 1.8, 4.3, 4.3, 1.0, 0.65), "5x3.9": (5.0, 3.9, 2.1, 5.3, 5.3, 1.3, 0.65), "6.3x3.9": (6.3, 3.9, 2.4, 6.6, 6.6, 2.2, 0.65)}, "UZT": {"4x4.5": (4.0, 4.5, 1.8, 4.3, 4.3, 1.0, 0.65), "5x4.5": (5.0, 4.5, 2.1, 5.3, 5.3, 1.3, 0.65), "6.3x4.5": (6.3, 4.5, 2.4, 6.6, 6.6, 2.2, 0.65)}, "UWT": {"4x5.4": (4.0, 5.4, 1.8, 4.3, 4.3, 1.0, 0.65), "5x5.4": (5.0, 5.4, 2.1, 5.3, 5.3, 1.3, 0.65), "6.3x5.4": (6.3, 5.4, 2.4, 6.6, 6.6, 2.2, 0.65), "8x5.4": (8.0, 5.4, 3.3, 8.3, 8.3, 2.3, 0.65)}, "UCD": {"4x5.8": (4.0, 5.8, 1.8, 4.3, 4.3, 1.0, 0.65), "5x5.8": (5.0, 5.8, 2.1, 5.3, 5.3, 1.3, 0.65), "6.3x5.8": (6.3, 5.8, 2.4, 6.6, 6.6, 2.2, 0.65), "6.3x7.7": (6.3, 7.7, 2.4, 6.6, 6.6, 2.2, 0.65), "8x6.2": (8.0, 6.2, 3.3, 8.3, 8.3, 2.3, 0.65), "8x10": (8.0, 10.0, 2.9, 8.3, 8.3, 3.1, 0.95), "10x7.7": (10.0, 7.7, 3.2, 10.3, 10.3, 4.5, 0.95), "10x10": (10.0, 10.0, 3.2, 10.3, 10.3, 4.5, 0.95)}, "UWP": {"4x5.4": (4.0, 5.4, 1.8, 4.3, 4.3, 1.0, 0.65), "5x5.4": (5.0, 5.4, 2.1, 5.3, 5.3, 1.3, 0.65), "6.3x5.4": (6.3, 5.4, 2.4, 6.6, 6.6, 2.2, 0.65), "8x5.4": (8.0, 5.4, 3.3, 8.3, 8.3, 2.3, 0.65)}, "UUP": {"4x5.8": (4.0, 5.8, 1.8, 4.3, 4.3, 1.0, 0.65), "5x5.8": (5.0, 5.8, 2.1, 5.3, 5.3, 1.3, 0.65), "6.3x5.8": (6.3, 5.8, 2.4, 6.6, 6.6, 2.2, 0.65)}, } # Bi-polar series (catalogue: "Bi-Polarized"): the platform's four corners are chamfered and the top has no polarity band. BIPOLAR = ("UWP", "UUP") # Proportions, for looks (the drawings show these but don't dimension them): the terminals are 0.2 thick under the platform (the drawings: # "0.3 max." below it); the platform is 0.1 x L thick, its chamfered corners cut 0.15 x B; the can's top edge is rounded off by a 45 degree # bevel of 0.03 x D, and a seal groove 0.04 x D deep and 0.06 x L high runs round it 0.1 x L above the platform; the printed polarity band # covers the top's circle segment on the negative side beyond 0.45 x the radius, 0.02 deep, flush with the top. TERM_T = 0.2 # The can's wall, for the mass (the catalogue doesn't give it): 0.2 thick, about the aluminium sheet such cans are drawn from. WALL = 0.2 if series not in SERIES: raise ValueError(f"no series {series!r}: {', '.join(SERIES)}") if size not in SERIES[series]: raise ValueError(f"no case size {size!r} in series {series}: {', '.join(SERIES[series])}") D, L, A, B, C, E, H = SERIES[series][size] bipolar = series in BIPOLAR R = D / 2 tp = 0.1 * L z_can = TERM_T + tp ch = 0.15 * B bevel = 0.03 * D g_depth, g_high, g_at = 0.04 * D, 0.06 * L, z_can + 0.1 * L model = Model() # Platform: B along X, C along Y, the positive (-X) corners chamfered, all four for a bi-polar series. xa, ya = B / 2, C / 2 outline = [(-xa + ch, -ya), (xa - (ch if bipolar else 0), -ya)] outline += [(xa, -ya + ch), (xa, ya - ch)] if bipolar else [(xa, ya)] outline += [(xa - ch, ya)] if bipolar else [] outline += [(-xa + ch, ya), (-xa, ya - ch), (-xa, -ya + ch)] model.plane("platform_plane", on="XY", offset=TERM_T, name="Platform") with model.sketch("platform_sketch", on="platform_plane", name="Platform") as sk: sk.polyline("platform_outline", outline, closed=True) model.extrude("platform", "platform_sketch", distance=tp, op="new", body="platform_body", name="Platform") # Can: revolved half section (radius, height), with the seal groove and the bevelled top edge. section = [(0, z_can), (R, z_can), (R, g_at), (R - g_depth, g_at + g_high / 2), (R, g_at + g_high), (R, L - bevel), (R - bevel, L), (0, L)] with model.sketch("can_sketch", on="XZ", name="Can") as sk: sk.polyline("can_section", section, closed=True) model.revolve("can", "can_sketch", axis="Z", op="new", body="can_body", name="Can") # The can is a shell WALL thick, open at the bottom over the platform; the wound element (foil, paper and electrolyte) and its seal fill # it as one solid, following the groove. w = WALL inner = [(0, z_can), (R - w, z_can), (R - w, g_at), (R - g_depth - w, g_at + g_high / 2), (R - w, g_at + g_high), (R - w, L - w - bevel), (R - w - bevel, L - w), (0, L - w)] with model.sketch("winding_sketch", on="XZ", name="Winding") as sk: sk.polyline("winding_section", inner, closed=True) model.revolve("hollow", "winding_sketch", axis="Z", op="cut", body="can_body", name="Can hollow") model.revolve("winding", "winding_sketch", axis="Z", op="new", body="winding_body", name="Winding") bodies = ["platform_body", "can_body", "winding_body"] if not bipolar: model.plane("top_plane", on="XY", offset=L, name="Top") with model.sketch("band_sketch", on="top_plane", name="Polarity band") as sk: # Circle segment beyond x = 0.45 R on the negative (+X) side, within the bevel's inner edge, as a 24-sided outline. r = R - bevel a = math.acos(0.45 * R / r) sk.polyline("band_outline", [(r * math.cos(-a + 2 * a * i / 24), r * math.sin(-a + 2 * a * i / 24)) for i in range(25)], closed=True) model.extrude("band_cut", "band_sketch", distance=-0.02, op="cut", body="can_body", name="Polarity band recess") model.extrude("band", "band_sketch", distance=-0.02, op="new", body="band_body", name="Polarity band") bodies.append("band_body") # Terminals: flat strips under the platform, from the gap E out to A beyond it. for name, sx in (("positive", -1), ("negative", 1)): with model.sketch(f"{name}_sketch", on="XY", name=f"Terminal {name}") as sk: sk.rect(f"{name}_rect", (sx * E / 2, -H / 2), (sx * (E / 2 + A), H / 2)) model.extrude(f"{name}_terminal", f"{name}_sketch", distance=TERM_T, op="new", body=f"{name}_body", name=f"Terminal {name}") # Materials, for looks and a rough mass (the catalogue gives no weight): the can is aluminium; the wound element inside (aluminium foil, # paper and electrolyte, roughly 1.2 to 1.5 g/cm3) is shown as pa6 (nylon, 1.14), the nearest in density in the material list; the # platform is a heat-resistant plastic (the catalogue: "Plastic platform"), pa6 too; the band is printed ink, shown with the platform's # material in black; the terminals are tin-plated, shown as tin. model.material("aluminum", bodies=["can_body"], color="#c8cbd0") model.material("pa6", bodies=["winding_body"], color="#8a8f96") model.material("pa6", bodies=["platform_body"] + (["band_body"] if not bipolar else []), color="#2b2b2b") model.material("tin", bodies=["positive_body", "negative_body"], color="#d9dadc") result = model.result()