analyze_power_budget
Estimate current on every supply net from the KiCad schematic and recommend track widths and net classes from loads, connectors, and part data.
Instructions
Estimate how much current every supply net carries, from the schematic, and suggest track widths / net classes. Works for any kind of board.
Reads the saved schematic via kicad-cli (save it first). Parts are looked up in the current database; regulators, drivers, and series parts (fuse, diode, switch, inductor, 0-ohm) propagate current from loads back to the source.
Returns 'questions' when information is missing - answer them and run again:
unknown_parts: open the part's 'datasheet' link (taken from the KiCad symbol; about half of vendor sites allow automated download - if it fails, search the web for " datasheet"), read the supply/output current figures, then call set_part_current with the URL as source. 'rating_hint' is only a pointer from the symbol description.
unknown_connectors: ask the user what is plugged in (and its worst-case current, e.g. motor stall), then pass it in external_loads. Values from the built-in database are flagged in 'unverified_parts' until checked against a datasheet.
Args: schematic_path: .kicad_sch / .kicad_pro / project folder; default = project of the open board. external_loads: What hangs off connectors (or any part), by reference: {"J2": 2.5} or {"J2": {"typ_a": 0.4, "max_a": 2.5, "note": "motor stall"}}. Current is charged to every non-ground net the part touches; restrict with "pins": ["1"] (e.g. only the supply pin of a 3-pin servo header). sources: References of the supply inputs (battery/power connectors). Default: batteries, USB/barrel jacks, and connectors named like BAT/PWR/SUPPLY. net_voltages: Voltages for nets whose name doesn't say it, e.g. {"/VMOT": 7.4}; used for switching regulators and linear-regulator dissipation. temp_rise_c: Temperature rise for the width suggestions. copper_oz: Copper weight for the width suggestions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sources | No | ||
| copper_oz | No | ||
| temp_rise_c | No | ||
| net_voltages | No | ||
| external_loads | No | ||
| schematic_path | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||