kicad2ems.pcbqs.pdn.cavity

PDN impedance from a plane pair: the power plane over its ground plane as a 2D
cavity (the voltage between the planes, V(x, y), on linear triangles over the
area where both are copper), with the decoupling capacitors, the regulator and
the load attached at their vias as ports. DC to the first cavity modes and
beyond, as long as the planes are close compared with the wavelength (d <<
lambda): the field between them is then uniform across d.

    pdn = PlanePair(board, power='+1V0', ground='GND', power_layer='In2.Cu',
                    ground_layer='In1.Cu',
                    ports=[dict(name='U1', x=40, y=-20, r=0.15),
                           dict(name='C1', x=36, y=-16, r=0.15, C=10e-6,
                                ESR=3e-3, ESL=0.4e-9),
                           dict(name='VRM', x=5, y=-20, r=0.15, R=1e-3,
                                L=20e-9)], dmax=1.0)
    f = np.logspace(3, 9, 241)
    # (nf, nports, nports): the port impedance matrix with every element
    # attached
    Z = pdn.z(f)
    Z0 = pdn.z(f, bare=True)          # the planes alone

The planes, per unit area and per square:
  shunt     Y = j w C' (1 - j tand),  C' = eps0 / sum(d_i / er_i)
            (the dielectric between them)
  series    Z = 2 Rs(f) + j w mu0 d
            (both planes' surface resistance, the inductance of the space
            between)
  -div(grad V / Z) + Y V = J (the current into the cavity at the ports); the
  edges are open (no current out).
Rs(f) = 1 / (sigma delta (1 - exp(-t / delta))): 1 / (sigma t) at DC, the skin
resistance once delta << t.

A port is the vertices of a disc of radius r around its point, held at one
voltage (a via through the cavity). Its element (a decap: C, ESR, ESL, mount; a
regulator: R, L; a load: none) is a series impedance between the planes there.
`mount` (H) is the inductance of the vias from the part's pads down to the
cavity, added to its ESL: mount_inductance(h, pitch, r) estimates it for a via
pair.
kicad2ems.pcbqs.pdn.cavity.capacitance(area_mm2, d_mm, er)[source]
A plane pair's static capacitance, F.
kicad2ems.pcbqs.pdn.cavity.dielectric(board, za, zb)[source]
(d mm, er, tand) of the stack's dielectric between heights za and zb
(mm): the series (effective) er.
kicad2ems.pcbqs.pdn.cavity.element_z(p, w, mount=0.0)[source]
The series impedance of a port's element at angular frequency w (np.inf:
none), plus `mount` H. An element with a table (Zf: (f Hz, Z), a vendor's
model or a regulator's file, models.py) takes it in place of C, R, L.
kicad2ems.pcbqs.pdn.cavity.fill_holes(geom, area, cover=None)[source]
geom with its holes smaller than `area` (mm2) filled, and those `cover`
(shapely: the antipads of the vias through it, a field of them merged into
one hole) covers but for 5% of their area.
kicad2ems.pcbqs.pdn.cavity.mount_inductance(h, pitch, r)[source]
The loop inductance (H) of a power-ground via pair of height h, centres
`pitch` apart, radius r (any one unit): mu0 h / pi * ln(pitch / r), two
parallel wires shorted at one end.
kicad2ems.pcbqs.pdn.cavity.plane_admittance(K, M, f, d, er, tand, t, sigma=58000000.0)[source]
The cavity's admittance matrix at f: K / Z + M Y (K: stiffness, M: mass
in m2; d, t in mm), Z the planes' series impedance per square, Y the
dielectric's shunt admittance per m2 (the module docstring).
kicad2ems.pcbqs.pdn.cavity.rect_cavity_z(a, b, d, er, tand, ports, f, modes=80, sigma=58000000.0, t=0.035)[source]
The analytic impedance matrix (nf, k, k) of a rectangular plane pair a x
b (mm, corner at the origin), spacing d (mm), between square ports (x, y, w)
(mm): the cavity's double sum over its modes (m, n),
    Z_ij = j w mu0 d / (a b) sum_mn chi_m^2 chi_n^2 / (k_mn^2 - k^2)
           f_mn(i) f_mn(j),
    f_mn(p) = cos(m pi x / a) cos(n pi y / b) sinc(m pi w / 2a)
              sinc(n pi w / 2b),
chi_0 = 1, chi_m = sqrt(2);
k^2 = w^2 mu eps (1 - j tand) (1 - j 2 Rs / (w mu0 d))
(the planes' loss).