# Automatic design from a specification

A specification goes in; a checked converter and a report come out. `design.auto` chains the design steps an engineer would take by hand and checks each one by simulation, so you start from a design that has already been run at every corner of your spec.

Automatic design is one step of the design flow. [Design tools](https://voltecx-web.nguyenvanqui291.workers.dev/features/design-tools) shows the steps before and after it: the requirements interview, the feasibility check, the topology and control comparison, the Test Bench and the EMI estimate.

## Write the spec

Three fields are required: the input voltage, the output voltage and the load current. `{"vin": 12, "vout": 3.3, "iout": 5}` is a complete spec. Add the limits you care about and Voltecx checks them; a limit you leave out is listed as not checked.

| You can ask for | Checked by |
|---|---|
| Output ripple, regulation over the input and load range | Simulation at every corner |
| Load step and line step (dip and recovery time) | Simulation |
| Start-up time and overshoot | Simulation |
| Efficiency at up to 16 load points | Loss model on the switching circuit |
| Junction temperature at the hottest ambient | Thermal model of each device |
| Phase and gain margin | Loop-gain measurement |
| Yield with part tolerances | Seeded Monte Carlo |

In the desktop app the spec is a form under **Design › Auto Design**. From a script it is JSON.

## Answer a few questions first

Not sure what to put in the spec? The requirements interview (`spec.questions`, or **Design › Automate › Requirements Interview** in the desktop app) asks for what is missing, in rounds: first the application (server PSU, charger, LED driver, solar and so on), input, output, load and isolation, then ripple, efficiency, load step, ambient and cooling, priority, protections and the magnetics you prefer, then the EMI class, standards, control implementation, auxiliary rails, service life and, for an isolated design, the transformer core and winding. The application sets the suggested efficiency, EMI class, standards and life. Each question comes with a suggested default and why it matters, and you can take a whole round of defaults at once. You see the spec as a summary table and confirm it before the design runs. The AI assistant asks the same questions the same way. Scripts with a full spec skip the interview.

## What the run does

0. **Checks the spec is within reach.** Before anything is sized, `spec.feasibility` bounds the efficiency (the semiconductors' losses alone), the output ripple (the best catalogue capacitor bank) and the junction temperature (the best catalogue heatsink). An efficiency or ripple no design can meet stops the run at once, with the reason and the smallest change that brings it within reach, such as a lower efficiency target or a lower switching frequency; a junction too hot is listed as an open item.
1. **Ranks topologies** for your spec and draws the best one it can design: buck, synchronous buck, boost, synchronous boost, buck-boost, SEPIC, flyback, four-switch buck-boost, multiphase buck, LLC or phase-shifted full bridge.
2. **Sizes the power stage** from textbook equations, then designs each inductor or transformer (core, material, gap, turns and wire) from the simulated current.
3. **Closes the voltage loop.** When the spec has a load step, or the converter has a right-half-plane zero, the loop is designed over every corner, including firmware delay and light-load discontinuous conduction. Instead of firmware the loop can be built from parts: an op-amp network, or a controller IC. On a boost or flyback the controller is the UCx843 in peak-current mode in the circuit, with its sense resistor, current limit and slope compensation for duties above 50 %, each value from TI's data sheet.
4. **Verifies every corner** of the spec and returns one row per requirement. Where a part value can fix a failing row (output capacitance for ripple, for example), it tunes and checks again.
5. **Chooses parts** from the vendor library (each device cites its data sheet), then computes efficiency, junction temperatures, part stress and the worst case over tolerances.
6. **Prepares the hand-off:** gate driver and bootstrap sizing, the sense network into the ADC, protection thresholds, fixed-point firmware, a conducted-EMI estimate with an input filter when one is needed, layout hints for the hot loops, a bill of materials and a KiCad schematic.
7. **Adds auxiliary rails** when the spec asks: 3.3 V for the MCU, a gate-drive bias or a post-regulator on the output. Each gets an LDO from a catalogue of TI and Microchip parts, every value cited to its data sheet, checked for dropout headroom over the input range, ripple through its PSRR at the switching frequency and junction temperature. The rails go into the schematic as one subsystem, then onto the bill of materials and into the report.

With `auto.blocks`, the circuit comes back as a block diagram you can read: one subsystem per design step (power stage, EMI filter, protection, sensing, controller, gate drive) in power-flow order, the control row joined by net labels and each block showing its key values. **Circuit › Layout › Group into Blocks** does the same for a circuit you drew yourself, and one undo takes it back.

The same spec and seed give the same circuit and the same report. Runs have hard caps on simulations and solver steps.

## Read the report

The report comes as JSON, Markdown, HTML and SVG, in English or Traditional Chinese. Every number comes from a simulation or from a textbook equation printed beside it. A failed design is still useful: the report names the stage that stopped it, the rows that failed and the next step for each. The **not checked** list says what the run did not test, such as radiated emission.

*In the next release.* The spec stays with the design: it is saved in the circuit's file, so the Test Bench, `spec.verify`, the EMI estimate (its limit, such as CISPR 25 class 3) and the thermal check use it after you reopen the file.

## Faster, and a report to hand over

Automatic design tries the converter on a circuit-averaged model first and confirms the result on the switching circuit. After a verification passes, the switching runs start from the averaged steady state, so they need about four loop time constants instead of the slowest corner's settling time. One command, `report.designSummary`, writes the report as a folder to hand over: a self-contained `index.html`, `report.md`, the schematic as PNG and SVG, and the Bode plot and key waveforms as SVG. Everything is in English or Traditional Chinese, as you choose.

*In the next release.* The report travels with the file: Auto Design keeps a record of its report with the circuit, so after you reopen the `.pcraft`, on any computer, `report.export` and `report.designSummary` write the same report without running the design again.

## Cost and lifetime as targets

Add `"cost": {"max": 12, "qty": 1000}` and `"life": {"years": 10, "ambient": 60}` to the spec. With a cost limit the bill of materials picks the cheapest of the parts that carry the stress, priced at the quantity breaks of the whole build, and the run stops with "not feasible at this cost" when one board costs more. With a life target each electrolytic, polymer or hybrid capacitor that would wear out sooner is swapped for an alternate that lasts, using its manufacturer's own life formula. The report's **Cost and life** chapter shows a trade-off table: efficiency, board area, cost per board and shortest capacitor life for each capacitor choice, with what each gain costs, such as "+12 % cost for +4.0 years of life". `design.tradeoff` gives the same table for any simulated circuit (**Design › Design Steps › Trade-offs**). Voltecx ships no price it has not read on a cited page, so give your prices or connect Nexar; a part without a price is listed, never guessed. Add `"missionProfile"` to `life` (load and ambient against time, with the power-cycling model) and the `life` gate also checks the power semiconductors' thermal-cycling life under that profile, from `design.lifetime`.

## Why this topology, and which control

`design.compare` puts the choice in a table: for each ranked topology, the efficiency with semiconductor and magnetics losses, the device stresses, the part count, the magnetics volume, the catalogue cost and how hard the loop is to close, with pros and cons and a sentence on why the chosen one won. On the chosen buck, boost or buck-boost it then designs voltage mode, peak current mode, average current mode and a digital PI for the same phase margin and simulates each through a load step: bandwidth, margins, dip and settling time, and what each takes to build. The design report has the same chapter, and the assistant answers "why this one?" from it.

## Use each tool alone

Every stage is a command you can run on your own circuit: `spec.feasibility` (also with size and cost targets and your prices), `topology.suggest`, `magnetics.design`, `design.robustLoop`, `analysis.pareto` (a seeded NSGA-II search of the design space), `spec.verify`, `design.digitalize`, `emi.conducted`, `layout.hints`, `bom.export` and `file.exportKicad`. The single-step design tools (`design.converter`, `design.voltageLoop` with automatic Type III, `design.currentLoop`, `design.llc`, `design.protection`, `design.gateDrive`) are in the Design panel.

## Know the limits

- A pass means the design meets the spec **in Voltecx's models and data**. It is not a safety or compliance result, and it has not been compared with hardware.
- PFC is not part of `design.auto` yet. The LLC and four-switch buck-boost keep an open loop, and the report says so.
- EMI, layout and price figures are estimates. The EMI stage is a pre-compliance estimate against CISPR 32, not a measurement.
- The vendor device library has 22 parts. The magnetics search uses the OpenMagnetics MAS starter set and 21 ferrite shapes of the ETD, PQ, RM, EFD and planar E and ER families read from the Ferroxcube and TDK data sheets, so a 200 W flyback gets candidates from several core families. Confirm the chosen core, gap and wire against the manufacturer's data sheet.
- The KiCad export writes a schematic, a project and design rules, not a board.

Automatic design is a Pro feature. See [pricing](https://voltecx-web.nguyenvanqui291.workers.dev/pricing).
