A converter found on a board, as a circuit model: what the near-field tool
selects (pcbqs.mqs: a regulator, its input net and capacitors, the inductor on
its switch net), with what the board has on the inductor's far side.
python -m kicad2ems.pcbqs.mqs board.kicad_pcb --converter U702 \
--vin-volts 5 --vout 3.3 --fsw 1e6 --current 2 --circuit > u702.json
python -m kicad2ems.pcbqs.circuit u702.json --copper \
--out out/u702
model = model_of(board, 'board.kicad_pcb', a)
# a: the near-field tool's settings (mqs_cli.parser)
The model is a buck as the board draws it:
V1 the supply, on the input net: on the board's one connector between
that net and ground, when it has just one (else not on the board: at
the net's node)
C... the input capacitors of the near-field selection, with its ESR and
ESL
QH, QL the regulator's two switches, input to switch node and switch node
to ground, both on the regulator's footprint (board.parts), the
lower the complement of the upper with a dead time; where the board
has a diode from ground to the switch node, that diode instead of
QL. A discrete cell: QH on its upper transistor, QL on its lower one
(or its diode)
L... the inductor, its value from the board
C... the capacitors on the inductor's far net within reach of the
regulator or the inductor; none there: COUT, all that net's
capacitance in one (not on the board)
RL the load, vout / iout: what the output net feeds is not the model's
to know (on the output net's one connector, when it has just one)
The duty is adjusted until the output is vout. The nodes are in, sw and out,
their nets in board.nets, so the board's copper between the pads can be put in
(--copper) and the fields over it (--fields). What a board cannot say is assumed
and listed in the model's description: the voltages when the near-field settings
give a duty alone, the switches' on resistance, the inductor's DCR.
A discrete cell whose part up from the switch node is a diode, or whose settings
say an output above its input, is a boost (boost_of): the capacitors the
near-field tool selected are its output's (its hot loop: those capacitors, the
upper part, the lower switch), and its input is the net on the inductor's far
side:
V1 the supply, on the inductor's far net (the board's one connector
there, when it has just one)
C... the capacitors on that net within reach of the inductor or the switch,
where there are any
L... the inductor, from the input to the switch node
Q... the lower switch, as the board names it; D... (or the upper switch,
the lower's complement) up to the output
C... the output capacitors: the near-field selection's
RL the load, vout / iout, iout what the hot loop's pulse leaves the
output: its amplitude x vin / vout