18650 Button-Top Battery Cell

An 18650 lithium-ion cell with a button top, in cutaway: steel can with bead and crimp, jelly roll with its strips fanned out, tabs, insulators, gasket, vent disc, PTC ring, cap and wrap. The cell size, the can wall, the centre hole and the two electrode strips are published teardown figures. The kernel winds the 660 mm anode as a spiral and measures the roll diameter against the can bore. The fanned tail, the cap parts and the wrap are a display model.
Code
This is the full program. The playground runs it in your browser without a change.
ts
import { box, clone, compound, cut, cutAll, cylinder, extrude, face, getBounds, interpolateCurve, line, measureLength, polygon, revolve, rotate, unwrap, wire } from 'brepjs/quick';
import { color } from 'brepjs/playground';
// 18650 lithium-ion cell with a button top, in cutaway, with the end of the jelly roll fanned out. The axis is Z, units are mm.
// The cell size, the can wall, the centre hole and the two electrode strips are published teardown figures.
// The separator gap, the fanned tail, the cap parts, the tabs and the wrap are a display model.
interface CellParams {
cutaway?: number; // degrees of the can, the cap and the wrap to cut away (0 = closed cell)
unroll?: number; // mm of the strips that fan out of the roll (needs a cutaway of 60 degrees or more)
wrap?: boolean; // false leaves the bare can
}
type P2 = [number, number]; // [r, z]
type P3 = [number, number, number];
type Shape = ReturnType<typeof cylinder>;
// Kernel shapes live in WASM memory. Every temporary goes through own(). freeing() runs a build and then frees them all.
const owned: { delete(): void }[] = [];
const own = <T extends { delete(): void }>(s: T): T => {
owned.push(s);
return s;
};
const freeing = <T,>(build: () => T): T => { try { return build(); } finally { owned.splice(0).forEach((s) => s.delete()); } }; // also when the build throws
// ---- published figures (a 3.5 Ah 18650)
const CELL = { diameter: 18.4, height: 65 };
const CAN_WALL = 0.19;
const HOLE = 2; // diameter of the hole in the middle of the jelly roll
const ANODE = { length: 660, width: 60, thick: 0.17 };
const CATHODE = { length: 610, width: 59, thick: 0.16 };
// ---- display model
const SEPARATOR = 0.012; // gap between the two strips, on each side
const SLEEVE = 0.08; // wrap thickness
const ROLL_Z = 0.7; // bottom of the anode strip
const BEAD = 61; // where the can is necked in above the roll
const CAP_Z = 62; // underside of the cap stack
const BUTTON = 3.6; // radius of the button top
// A closed profile in the (r, z) half-plane, revolved about the axis.
const lathe = (pts: P2[], angle = 2 * Math.PI): Shape => {
const profile = own(unwrap(polygon(pts.map(([r, z]): P3 => [r, 0, z]))));
return unwrap(revolve(profile, { axis: [0, 0, 1], angle })) as Shape;
};
const block = (x0: number, x1: number, y0: number, y1: number, z0: number, z1: number): Shape =>
box(x1 - x0, y1 - y0, z1 - z0, { at: [(x0 + x1) / 2, (y0 + y1) / 2, (z0 + z1) / 2] });
// The anode as a curve: an Archimedean spiral of the published length that starts on the centre hole.
// pitch is the radial step for each turn. The kernel measures the curve and its bounds.
const wind = (pitch: number, length: number, thick: number) => {
const k = pitch / (2 * Math.PI);
const radius = (t: number): number => HOLE / 2 + k * t;
const dt = Math.PI / 8;
let end = 0;
for (let s = 0; s < length; ) {
const ds = Math.hypot(radius(end + dt / 2), k) * dt;
end += s + ds < length ? dt : (dt * (length - s)) / ds;
s += ds;
}
const steps = Math.ceil(end / dt);
const edge = (extra: number) =>
own(unwrap(interpolateCurve(Array.from({ length: steps + 1 }, (_, i): P3 => [(radius((end * i) / steps) + extra) * Math.cos((end * i) / steps), (radius((end * i) / steps) + extra) * Math.sin((end * i) / steps), 0]))));
const span = getBounds(edge(thick));
return { wound: unwrap(measureLength(edge(0))), turns: end / (2 * Math.PI), diameter: span.xMax - span.xMin };
};
// One ply of the fanned-out tail: a sheet that leaves the roll on a tangent and curls away from it.
// u runs along the tangent, v points away from the roll. The sheet lies between v = base and base + thick.
const ply = (radius: number, azimuth: number, base: number, thick: number, curl: number, length: number, z0: number, z1: number): Shape => {
const a = (azimuth * Math.PI) / 180;
const n = 8;
const side = (extra: number): P3[] =>
Array.from({ length: n + 1 }, (_, i) => {
const u = (length * i) / n;
const slope = 2 * curl * u;
const w = Math.hypot(1, slope);
const pu = u - (extra * slope) / w; // offset along the normal of the curled line
const pv = radius + base + curl * u * u + extra / w;
return [pv * Math.cos(a) - pu * Math.sin(a), pv * Math.sin(a) + pu * Math.cos(a), z0];
});
const inner = side(0);
const outer = side(thick).reverse();
const loop = own(unwrap(wire([own(unwrap(interpolateCurve(inner))), own(line(inner[n]!, outer[0]!)), own(unwrap(interpolateCurve(outer))), own(line(outer[n]!, inner[0]!))])));
return unwrap(extrude(own(unwrap(face(loop as never))), [0, 0, z1 - z0])) as Shape;
};
function cell({ cutaway = 140, unroll = 28, wrap = true }: CellParams = {}) {
const rc = CELL.diameter / 2 - SLEEVE; // outside of the can
const ri = rc - CAN_WALL;
const h = CELL.height;
const lip = h - 1; // top of the crimped can edge
// Can: a drawn steel cup with a bead above the roll and a crimped edge.
const can = lathe([
[0, SLEEVE], [rc, SLEEVE], [rc, BEAD + 0.05], [rc - 0.81, BEAD + 0.25], [rc - 0.81, BEAD + 0.55], [rc, BEAD + 0.75], [rc, lip - 0.3], [rc - 0.22, lip], [7.3, lip],
[7.3, lip - CAN_WALL], [ri - 0.13, lip - CAN_WALL], [ri, lip - 0.4], [ri, BEAD + 0.8], [ri - 0.81, BEAD + 0.6], [ri - 0.81, BEAD + 0.2], [ri, BEAD], [ri, SLEEVE + 0.3], [0, SLEEVE + 0.3],
]);
// Jelly roll: the kernel measures the wound anode. The roll body takes its diameter from that curve.
const pitch = ANODE.thick + CATHODE.thick + 2 * SEPARATOR;
const anode = wind(pitch, ANODE.length, ANODE.thick);
const rr = anode.diameter / 2;
const rollTop = ROLL_Z + ANODE.width;
const roll = lathe([[HOLE / 2, ROLL_Z], [rr, ROLL_Z], [rr, rollTop], [HOLE / 2, rollTop]]);
// Tail: separator, anode, separator and cathode leave the roll inside the cutaway and fan out. Each ply is shorter than the one below it.
const inset = (ANODE.width - CATHODE.width) / 2;
const fan = cutaway >= 60 && unroll > 0;
const leave = 8; // azimuth where the tail leaves the roll, near the middle of the cutaway
const sheet = (base: number, thick: number, curl: number, share: number, dz: number): Shape[] =>
fan ? [ply(rr, leave, base, thick, curl, unroll * share, ROLL_Z + dz, rollTop - dz)] : [];
const tail = {
separators: [...sheet(0, SEPARATOR, 0.003, 1, 0), ...sheet(SEPARATOR + ANODE.thick, SEPARATOR, 0.016, 0.62, 0)],
anode: sheet(SEPARATOR, ANODE.thick, 0.008, 0.81, 0),
cathode: sheet(2 * SEPARATOR + ANODE.thick, CATHODE.thick, 0.03, 0.43, inset),
};
// Insulators and tabs at the two ends of the roll.
const floor = SLEEVE + 0.3;
const insulators = [
lathe([[HOLE / 2, floor + 0.12], [8.6, floor + 0.12], [8.6, ROLL_Z], [HOLE / 2, ROLL_Z]]),
lathe([[4.6, rollTop], [8.1, rollTop], [8.1, rollTop + 0.2], [4.6, rollTop + 0.2]]),
];
const dimple = CAP_Z - 0.35; // the vent disc dips down to the positive tab
const tabs = [
block(-2, 8.6, -1.5, 1.5, floor, floor + 0.12),
block(4, 4.15, -1.5, 1.5, rollTop, dimple - 0.15),
block(-1.5, 4.15, -1.5, 1.5, dimple - 0.15, dimple),
];
// Cap stack: vent disc, PTC ring and button cap, held in a gasket under the crimp.
const gasket = lathe([
[ri, BEAD + 0.8], [ri, lip - 0.4], [ri - 0.13, lip - CAN_WALL], [7.3, lip - CAN_WALL], [7.3, CAP_Z + 1.2], [7.9, CAP_Z + 1.2], [7.9, CAP_Z], [6.6, CAP_Z], [6.6, BEAD + 0.6], [ri - 0.81, BEAD + 0.6],
]);
const vent = lathe([[0, dimple], [1.5, dimple], [2.3, CAP_Z], [7.9, CAP_Z], [7.9, CAP_Z + 0.3], [2.2, CAP_Z + 0.3], [1.4, dimple + 0.3], [0, dimple + 0.3]]);
const ptc = lathe([[4.4, CAP_Z + 0.3], [7.9, CAP_Z + 0.3], [7.9, CAP_Z + 0.8], [4.4, CAP_Z + 0.8]]);
const hat = own(lathe([[7.9, CAP_Z + 0.8], [7.9, CAP_Z + 1.2], [BUTTON + 1.1, CAP_Z + 1.2], [BUTTON, h], [0, h], [0, h - 0.4], [BUTTON - 0.25, h - 0.4], [BUTTON + 0.85, CAP_Z + 0.8]]));
const ports = [0, 120, 240].map((a) => own(rotate(own(cylinder(0.6, 3, { at: [BUTTON - 1, 0, CAP_Z + 2.1], axis: [1, 0, 0] })), a + 60) as Shape));
const cap = unwrap(cutAll(hat, ports)) as Shape;
// Wrap: a shrink sleeve that folds over both ends.
const sleeve = lathe([[7.5, 0], [rc + SLEEVE, 0], [rc + SLEEVE, lip + SLEEVE], [7, lip + SLEEVE], [7, lip], [rc, lip], [rc, SLEEVE], [7.5, SLEEVE]]);
// Cutaway: a wedge centred on +X.
const sweep = (Math.max(cutaway, 1) * Math.PI) / 180;
const wedge = own(rotate(own(lathe([[0, -5], [20, -5], [20, 80], [0, 80]], sweep)), -cutaway / 2) as Shape);
const open = (s: Shape): Shape => {
own(s);
return cutaway > 0 ? (unwrap(cut(s, wedge)) as Shape) : (unwrap(clone(s)) as Shape);
};
return {
can: open(can),
roll,
tail,
insulators: [...insulators.map((s) => open(s)), open(gasket)],
tabs: compound(tabs.map(own)) as Shape,
vent: open(vent),
ptc: open(ptc),
cap: open(cap),
wrap: wrap ? [open(sleeve)] : [],
wound: anode.wound,
turns: anode.turns,
rollDiameter: anode.diameter,
bore: 2 * ri,
};
}
const part = freeing(() => cell());
console.log('Anode: ' + part.wound.toFixed(0) + ' mm wound in ' + part.turns.toFixed(1) + ' turns. Roll diameter: ' + part.rollDiameter.toFixed(2) + ' mm from the kernel bounds.');
console.log('The bore of the can is ' + part.bore.toFixed(2) + ' mm.');
export default [
color(part.can, '#c3c9d1'),
color(part.roll, '#ece7da'),
...part.tail.separators.map((s) => color(s, '#ece7da')),
...part.tail.anode.map((s) => color(s, '#c9783c')),
...part.tail.cathode.map((s) => color(s, '#48515c')),
...part.insulators.map((s) => color(s, '#f5f2ea')),
color(part.tabs, '#e6e9ee'),
color(part.vent, '#e6e9ee'),
color(part.ptc, '#ff5a1f'),
color(part.cap, '#c3c9d1'),
...part.wrap.map((s) => color(s, '#12b5b0')),
];Functions used
box clone compound cut cutAll cylinder extrude face getBounds interpolateCurve line measureLength polygon revolve rotate unwrap wire color