pcb_calc_trace_width_for_current
Calculate the minimum PCB trace width needed to carry a target current using IPC-2221, including recommended width, layer, copper weight, temperature rise, margin, and optional voltage drop.
Instructions
Minimum track WIDTH to carry a target current (inverse IPC-2221).
The design-time complement of pcb_calc_track_current_capacity:
instead of "what current does this width carry?", it answers "I need N
amps, how wide?". Pure math, no Altium hit.
Solves I = k * dT^0.44 * (h*w)^0.725 for w with the same
constants as the forward tool (so they round-trip), k = 0.048
external / 0.024 internal, h = copper_oz * 1.378 mils.
Args:
current_amps: Target current the track must carry. The
EasyEDA and KiCad builds spell this current_a;
either is accepted here, so one call works on any
backend.
current_a: Alias for current_amps.
copper_oz: Copper weight, oz/ft^2 (0.5 / 1.0 / 2.0 / 3.0).
delta_t_c: Allowed temperature rise above ambient (10 degC is a
common conservative budget; 20-30 degC for tight boards).
layer: "external" (top/bottom) or "internal" (inner; needs
~2.6x the width for the same rise).
margin: Fractional widening above the bare IPC minimum for the
recommendation (default 0.2 = 20 %).
length_mils: If > 0, also returns DC resistance and voltage drop at
the recommended width.
Returns:
{"ok": True, "min_width_mils", "recommended_width_mils", "copper_oz", "delta_t_c", "layer", ...optional resistance/drop}
or {"ok": False, "reason": ...}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| layer | No | external | |
| margin | No | ||
| copper_oz | No | ||
| current_a | No | ||
| delta_t_c | No | ||
| length_mils | No | ||
| current_amps | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||