# Parts and the bill of materials, from simulated stress

A simulation tells you what each part has to carry. Voltecx turns that into the parts you buy: it rates every part on the voltage, current, power and temperature it saw in the run, proposes devices and passives that carry it with margin, tells you what to check on each data sheet, and writes a bill of materials and a KiCad project with the part numbers filled in. Every catalogue part it picks names the manufacturer data sheet it was read from. A line that no catalogue part fits, and none of your own parts either, gets no part and says why: Voltecx never makes one up.

## Rate every part on its stress

`analysis.stress` reads the last run and gives one row per part: the measured peak and RMS voltage and current, the power and the junction temperature, the ratings the part needs after derating, and the margin of the assigned device over them. A part the device cannot carry is named. The default derating is 0.8 of the voltage rating, 0.7 of the RMS current, 0.8 of the peak current, 0.5 of the power and a junction at most 125 °C. These are common engineering practice, not a standard, and the reply says so. Pass `derating` to use your own factors, and `t0` and `t1` to rate the steady state rather than the whole run, start-up included. The same derating feeds `design.parts`, `device.recommend` and `bom.export`. To rate the parts against NASA EEE-INST-002 instead, use `design.reliability`. [Derating: how much margin do power components need?](https://voltecx-web.nguyenvanqui291.workers.dev/blog/derating-rules-power-components) works through both rule sets on a 48 V flyback.

## The Parts table

`design.parts` (**Design › Design Steps › Parts**, **Design › Design Steps › Parts** in 0.9.0) picks the semiconductor for every switch and diode. It simulates if the result is missing or stale, rates each part with `analysis.stress`, ranks the library devices that carry it by estimated loss with `device.recommend`, and proposes the best one. It skips a device rated more than 2.5 times the part's worst-case voltage, or one whose gate plateau the switch's drive voltage does not clear, unless nothing else qualifies. With `corners` it also simulates the circuit at each input and load you list and keeps only devices that carry every corner. `buyable` proposes a vendor part over an illustrative one.

*In the next release.* In the Design panel, the Parts table shows one row per switch and diode: the chosen device, the voltage the part saw (**Stress**), the device's rating (**Rated**), the **Margin** of that rating over the derated need (red when it falls short) and the estimated **Loss**. Hover the **?** at the end of a row to see what to check on the data sheet before you buy: for a MOSFET, Rds(on) at the hot junction, Qg and Qgd, Coss, body-diode recovery and the Vds overshoot at turn-off; for an IGBT, Vce(sat) hot, Eoff and the tail current, short-circuit withstand time and the diode's recovery; for a diode, reverse recovery, forward voltage hot, leakage and surge rating. Click a part's name to select it on the schematic. The Auto Design result window lists the same parts. From a script, `apply: true` assigns every proposal in one undo step.

## Capacitors and inductors with their margins

*In the next release.* Under the semiconductors, **Capacitors and inductors** lists the catalogue part that `bom.export` picks for each one, how many, and the margin of the rating that limits it: voltage or ripple current for a capacitor, saturation or RMS current for an inductor (hover the margin to see which). A ceramic capacitor's count already allows for the capacitance it loses at its DC voltage. The **?** lists what to read on that part's data sheet, such as the ripple rating at your frequency and temperature, the DC-bias curve of a ceramic, the lifetime of an electrolytic or the saturation current when hot. From a script, this is `design.parts` with `passives: true`.

## Find a part

- `library.search` filters the device library and the devices in the open circuit by type and ratings (`vdsMin`, `idMin`, `rdsonMax`, `vfMax`, `rthJcMax` and more), and sorts them. *In the next release:* `module` lists only power modules or only discrete parts.
- `device.recommend` ranks the devices that carry one part's stress by estimated loss, says whether your gate drive clears each device's plateau, and with `apply` assigns the best one, or the one you `choose`.
- `device.fromPartNumber` looks up a part number, part of one, or key specs such as `650 V < 20 mΩ TO-247` or `10u 50V 1206`. Type it in the **Part number** field in **Properties** and press Enter: a semiconductor gets its loss and thermal tables, a capacitor its capacitance and data-sheet ESR, an inductor its inductance, DCR and saturation current, and the log names the data sheet.
- *In the next release:* **Library › Search Parts** (`parts.search`) searches every part source at once by part number, category and specs, one line per part with its key specs, package, price, stock and where the data came from. **Place** (`parts.place`) puts it on the schematic with its values filled, in one undo step. It works offline on the shipped catalogue.

## The vendor device library

The built-in library holds 92 vendor semiconductors from 9 manufacturers: 74 MOSFETs (silicon, SiC and GaN), 3 IGBTs and 15 diodes. *In the next release:* 24 more Infineon IGBTs, 16 of them power modules, bring it to 116. 34 more MOSFETs follow them: 600–650 V silicon superjunction parts for power factor correction, 650 V GaN, 40–150 V silicon for 48 V stages and LLC rectifiers, and parts from Taiwanese makers. That makes 150 vendor devices from 20 manufacturers, 108 of them MOSFETs. Each cites its data sheet: the document, its revision and the figures and tables its values were read from. Next to it, `bom.export` picks passives from a catalogue of 577 capacitors, 96 inductors and 10 resistor families, each with its source. Six generic devices are marked illustrative: they are for exploring, and `buyable: true` keeps them out of the proposals whenever a vendor part qualifies. [Models and parts](https://voltecx-web.nguyenvanqui291.workers.dev/features/models-and-parts) covers the GaN devices, the IGBT modules and how to bring your own vendor SPICE model.

## Your own parts

When no catalogue part fits a line, add your own. **Library › Your Parts** (`parts.check`) takes a part read off a data sheet: its kind, part number, manufacturer, source and ratings. It flags missing fields, values that are not numbers and values outside the range real parts have, which is usually a unit slip. It also shows which result each field changes. Paste the data sheet's text and it suggests the values it finds, quoting the line each came from. **Fill in from BOM line** starts from the empty template of an unmatched line. `parts.list` lists your library. It stays on your computer: the desktop app keeps it in a local file, and nothing is uploaded. `bom.export` then uses your part for a line no catalogue part fits, marked `user` with the source you gave. *In the next release:* the library is a small manager. Search it and group parts by category, edit a part in place (`parts.update`), and move a team's approved-parts list between machines as CSV or JSON (`parts.export`, `parts.import`); an import names every row it leaves out and keeps the good ones. *Also in the next release:* add a part from its data sheet with a review. Each value is read with its page and table, a field the sheet does not give stays empty, and nothing is saved until you check the values and press Save (`parts.fromDatasheet`).

## The bill of materials

`bom.export` (**File › Export › Bill of materials**, also in Design › Manufacturing) picks a part for every component from the stress of the last run, with the same derating: capacitors, resistors and inductors from the passive catalogue, switches and diodes from the device library or the device already assigned, and a transformer or inductor designed by `magnetics.design` as a custom wound line. Each line says how it was filled (`matched`, `assigned`, `custom`, `user`, `illustrative` or `unmatched`) and lists alternates. A line without a part carries the template to fill in. The CSV has the KiCad BOM columns first, then the purchasing columns, each part's source, its lifecycle status, qualification and second sources.

Prices come only from what you give (`prices`), from Nexar when `NEXAR_TOKEN` is set, or from the offline price list, which ships empty. A part without a price stays unpriced, and the totals say whether the list is complete. `prefer: "cost"` compares the price of the best candidates. *In the next release:* `boards` reads each price at the quantity break of a production run. `grade: "automotive"` and `lifecycle: "avoid"` or `"active"` filter on the supply records, and each line names the candidates they left out. [How to cut the cost of a power supply](https://voltecx-web.nguyenvanqui291.workers.dev/blog/power-supply-cost-optimisation) shows where those choices move the cost.

*In the next release:* **View › Bill of Materials** shows the same list in the app as a table of designators, value, rating, part number, manufacturer, pieces and DNP. Click a line to select its parts on the schematic, or a header to sort by designator, value or quantity. Scripts read the rows with `bom.list`.

## Compare two BOMs

`bom.diff` takes two `bom.export` replies, one per version of the circuit, and lists the lines added and removed and, per reference designator, a changed status, part number, manufacturer, value, quantity, footprint or unit price, with the change in total cost, pieces and board area. It runs nothing and changes nothing.

## Fitted or not: DNP

A DNP (do not populate) part keeps its footprint on the board but is not fitted. `circuit.setDnp`, or the **DNP** box in **Properties**, marks it in one undo step. It is drawn dashed with a DNP mark, left out of the simulation, listed in the BOM's DNP section with the value it would have, and exported to KiCad with `dnp yes`. The debug aids of **Design › Automate › Debug Aids** use it for the snubber, gate-resistor and bulk-capacitor footprints you may fit at bring-up.

## On to KiCad and the assembly house

`file.exportKicad` (**File › Export › KiCad project**) writes a KiCad 8 schematic with the Reference, Value, Footprint, Datasheet, MPN, Manufacturer and Source of every part taken from `bom.export`. It also writes a project with net classes sized for the voltage and current of each net, a design-rules file with clearances from IPC-2221B, and a pcbnew script that places the hot loop and the gate parts. Voltecx writes no board file: the layout is yours. Once you have routed the board, `file.manufacturingOutputs` (**Design › Manufacturing › Manufacturing Outputs**) runs kicad-cli (KiCad 10) for the design rules check with schematic parity, Gerbers, drill files, the position file, the BOM in a generic or JLCPCB format and an assembly drawing. It lists whatever still stands between the board and an order, such as unrouted nets, DRC errors or a part without an MPN. It needs KiCad installed on the desktop.

`bom.export`, `bom.diff`, `design.parts` and `device.recommend` are in the Parts & ICs licence module; `file.exportKicad` and `file.manufacturingOutputs` are in EMI & Layout. See [licences](https://voltecx-web.nguyenvanqui291.workers.dev/features/licences-and-protection).

## From a script

```sh
powercraft-cli run --root work --cmd file.openExample --param name=buck \
  --cmd simulation.run \
  --cmd design.parts --params '{"passives": true}' \
  --cmd bom.export --params '{"priceSource": "offline", "csvPath": "buck-bom.csv"}' \
  --cmd file.exportKicad --params '{"path": "buck.kicad_sch"}'
```

Each command prints one JSON line: the rated parts with their margins and watch lists, the bill of materials, and the KiCad files written under `work`. `passives` is in the next release; in 0.9.0 leave it out.

More in the manual: [the Design panel](https://voltecx-web.nguyenvanqui291.workers.dev/docs/manual/07-design-panel/), [`bom.export`, `file.exportKicad` and `file.manufacturingOutputs`](https://voltecx-web.nguyenvanqui291.workers.dev/docs/manual/16-automatic-design/) and [comparing two versions](https://voltecx-web.nguyenvanqui291.workers.dev/docs/manual/09-import-export/). The whole flow from spec to hand-off is on [Design tools](https://voltecx-web.nguyenvanqui291.workers.dev/features/design-tools).
