kicad2ems.pcbqs.pdn.dc

DC voltage drop (IR drop) of a power rail and its return: the steady conduction
in the copper, each layer's copper a resistive sheet (sigma x thickness, linear
triangles on pcbqs's mesh), the vias plated barrels between the layers they
join, the pads equipotential terminals: the source's held at its voltage, each
load's drawing its current.

    rail = Rail(board, '+3V3', loads={'U21': 2.0, 'U14': 1.0})
        # rail.py: the tree, the source, the parts
    res = solve_rail(rail, volts=3.3, dmax=1.0)
    res['loads']['U21']  # dict(V: what it sees, its supply pads' minus its
                         # ground pads', drop, power_drop, ground_rise)
    res['power'].sheets  # {layer: Sheet with V (node volts), J (A per mm of
                         # width per triangle)}
    res['power'].vias  # [dict(x, y, r, I, segments)]; res['series']: each
                       # series part's current and drop

The network (Network) is the copper of a set of nets (a rail tree, or the
ground); a terminal is a set of pads ([(layer, polygon)]: a through-hole pad on
every layer it is plated through), meshed with its outline as mesh edges and
held to one voltage (its vertices tied to one junction); a series part (a sense
resistor, a bead, a jumper) is a resistance between its two pads' terminals. A
via joins the copper of the nets on every layer between its ends that it lies
on, through a barrel of plating thickness `plating` (mm): rho dz / area.

solve(board, net, source, loads) is the one-net form: source dict(x, y, r,
layer, V), loads [dict(name, x, y, r, layer, I)], each a disc pad; ground=True
solves a return (the source at 0 V, the loads' currents put back).
class kicad2ems.pcbqs.pdn.dc.DCResult(net: object, sheets: dict, vias: list, loads: dict, loss: float, nodes: int, notes: list = <factory>, source: dict = None, terminals: dict = None, series: dict = None)[source]
class kicad2ems.pcbqs.pdn.dc.Network(board, nets, terminals, dmax=1.0, sigma=58000000.0, plating=0.025, fine=(), fine_r=2.0, dmax_fine=None, log=<built-in function print>, quality=25)[source]
The conduction network of the copper of `nets` with its terminals {name:
[(layer, polygon)]}. fine: the names of terminals meshed finer around
(within `fine_r` mm, at dmax_fine), the current crowding into them.
conductivity(sheets=None, vias=None)[source]
The copper's conductivity scaled from sigma (the copper at another
temperature: electrothermal.py): sheets {layer: (M,) factor per
triangle}, vias [a factor per via, one for all its barrels]; a layer or
a via not given goes back to sigma. The next solve() takes it.
series(name, a, b, R)[source]
A series part (resistance R, ohms) between terminals a and b.
solve(fixed, inject)[source]
Terminal voltages fixed {name: V} and currents injected {name: A, +
into the copper}: the voltages, currents and loss. Copper not connected
to a fixed terminal is left out (NaN) and said.
kicad2ems.pcbqs.pdn.dc.rail_networks(rail, dmax=1.0, sigma=58000000.0, plating=0.025, log=<built-in function print>, fine=True)[source]
A rail's two networks (rail.Rail): (power, ground, no_return) — the
tree's copper with its source, series parts and loads as terminals, the
ground's with the ground source and the loads' ground pads, and the loads
with no ground pad. solve_networks solves them; solve_rail is both.
kicad2ems.pcbqs.pdn.dc.solve(board, net, source, loads, dmax=1.0, sigma=58000000.0, plating=0.025, ground=False, log=<built-in function print>, fine=True)[source]
The one-net form (see the module docstring); pads are discs (x, y, r) on
a layer.
kicad2ems.pcbqs.pdn.dc.solve_networks(rail, volts, pw, gn, no_gnd, log=<built-in function print>)[source]
solve_rail's answer from rail_networks' networks (as they are: at
another conductivity, Network.conductivity).
kicad2ems.pcbqs.pdn.dc.solve_rail(rail, volts, dmax=1.0, sigma=58000000.0, plating=0.025, log=<built-in function print>, fine=True)[source]
A rail (rail.Rail) and its return at DC: the source's pads held at
`volts`, each load drawing rail.loads[ref] amps over its pads on the tree
and returning it over its ground pads. {'loads': {ref: dict(V, drop,
power_drop, ground_rise, I)}, 'series': {ref: dict(I, drop, loss_W)}, 'power':
DCResult, 'ground': DCResult, 'notes'}.