kicad2ems.pcbqs.circuit.copper¶
A model's board: the copper between its parts' pads, as part of the circuit.
"board": {
# beside the model; a .kicad_pcb, or kicad2ems's board.json
"file": "06_boost.kicad_pcb",
# a model part's footprint, when its reference differs; a footprint a
# pin (["TP15", "TP14"]: a coil soldered to two test points); null: off
# the board (a pin's, or the part's)
"parts": {"V1": "J1", "R1": "J2"},
# a model node's net on the board, when its name differs
"nets": {"vbus": "+24V"},
# the part whose pad is a net's node itself (else its first)
"reference": {"in": "C1"},
"mesh": {"coarse_mm": 3, "fine_mm": 1.6, "fit_tolerance": 0.03}}
A part's pin is the pads of its footprint on its node's net ('0' is the board's
GND), so nothing is drawn or named twice: the model says which part is on which
node, the board which pad is on which net. Without copper every pin on a node is
one point. With it, each net's pads are joined by what the board has between
them: one pad of the net is the node itself (its reference), and every other pad
reaches it through a port of a passive R-L model of the copper (all the nets'
ports in one model, so their mutual inductance is in it too), extracted by the
quasi-static solver (pcbqs.mqs) and fitted over frequency.
cu = prepare(model, out, log) # extract, or read back
# <out>/copper-model.json
deck = build(resolved, state, cu) # circuit/deck.py
A part with no footprint on the board (a coil on a cable, a bench supply) is at
its net's node, and the results' notes say so.
- exception kicad2ems.pcbqs.circuit.copper.BoardError[source]¶
A model and a board that do not fit: says which part, pad or net.
- kicad2ems.pcbqs.circuit.copper.copper_mesh(model, board, log=<built-in function print>, **options)[source]¶
The solver (MQS, with `options` of its own) on the copper between the model's pads, meshed over them and a margin as board.mesh says: (MQS, pins' where, pins' terminals).
- kicad2ems.pcbqs.circuit.copper.footprint_of(model, ref, k)[source]¶
The footprint pin k of part `ref` is on: board.parts' (a name, a name a pin, or null: off the board), else the part's own reference.
- kicad2ems.pcbqs.circuit.copper.frequencies(model)[source]¶
The frequencies the copper model is fitted at: DC to 20 MHz, and every switching and source frequency of every sweep point with its tenth harmonic.
- kicad2ems.pcbqs.circuit.copper.geometry(model, board, log=<built-in function print>)[source]¶
The solver's model of the board's copper with a port at every pad but one of each net: (MQS, ports [{name, terminal, reference, net}], same {terminal: the terminal it is one mesh node with}).
- kicad2ems.pcbqs.circuit.copper.model_of(copper, model, board, log=<built-in function print>)[source]¶
The copper's (MQS, ports, same) for a prepared copper dict: the one prepare made in this process, else made.
- kicad2ems.pcbqs.circuit.copper.net_name(model, node, nets)[source]¶
The board's net of a model node: board.nets' when given, the board's ground for '0', else the same name.
- kicad2ems.pcbqs.circuit.copper.nodes(model, cu)[source]¶
The circuit node of every pin: {(ref, k): node}. A net's reference pad is the model's node; any other pad is a node of its own ('<footprint>.<net>'), joined to it by its port.
- kicad2ems.pcbqs.circuit.copper.pins(model, board)[source]¶
Where each pin of the model is on the board: ({(ref, 0 | 1): terminal}, {terminal: (footprint, net)}, [parts with no footprint]). A terminal is a footprint's pads on one net, named '<footprint>.<net>'.
- kicad2ems.pcbqs.circuit.copper.port_currents(model, cu, currents)[source]¶
The current each port carries when its part carries `currents` ({ref: A entering its first node}): what leaves a part's second pin into its pad's copper, and what its first pin draws out of it. [A], in the ports' order, as Circuit.copper's PCB<i>.I counts it (into the pad's end of the port).
- kicad2ems.pcbqs.circuit.copper.port_nodes(model, cu)[source]¶
{port name: (its pad's node, its net's node)} for Circuit.copper.
- kicad2ems.pcbqs.circuit.copper.prepare(model, out, log=<built-in function print>)[source]¶
The copper of the model's board, ready for the deck: {file, ports, model (R_ohm, L_H, foster: the passive fit), pins {(ref, k): terminal}, same, absent, fit_error, fingerprint}. Extracted once for a model and its board and kept in <out>/copper-model.json.