pcb_calc_trace_width_for_impedance
Calculate trace width needed to hit a target impedance (like 50 Ω single-ended or 100 Ω differential) for microstrip or stripline geometries, inverting IPC-2141 closed forms to find the width.
Instructions
Trace WIDTH to hit a target impedance (inverse of pcb_calc_impedance).
The design-time complement: instead of "what impedance does this width
give?", it answers "I need 90 ohm USB / 100 ohm HDMI differential, or
50 ohm single-ended; how wide?". Inverts the same IPC-2141 / Wadell
closed forms, so it round-trips with the forward calc. Pure math, no
Altium. Same +/-10 % caveat -- a fab field solver refines the stackup;
read the real dielectric heights / er with pcb_get_layer_stackup.
Args:
target_ohms: Single-ended Z0 for microstrip/stripline, or
the differential Zdiff for microstrip_diff/
stripline_diff.
geometry: One of microstrip, microstrip_diff, stripline,
stripline_diff.
dielectric_height_mils: Trace-to-plane height (microstrip) or full
between-plane thickness (stripline).
dielectric_constant: er (default 4.2 FR-4).
copper_oz: Copper weight for trace thickness (default 1.0).
spacing_mils: Edge-to-edge gap (required for *_diff).
Returns:
{"ok": True, "width_mils", "single_ended_z0_ohms", "feasible", ...} (feasible False when the target needs a width <= 0: raise the
dielectric height or lower the target), or {"ok": False, ...}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| geometry | Yes | ||
| copper_oz | No | ||
| target_ohms | Yes | ||
| spacing_mils | No | ||
| dielectric_constant | No | ||
| dielectric_height_mils | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||