kicad2ems.pcbqs.circuit.deck¶
The ngspice deck of a resolved model: every part and coupling it lists, and
nothing else.
deck = build(model, state=None) # model: model.resolve()'s; state:
# engine.end_state()'s, to continue a run
result = deck.run(folder, 1 / period, cycles=..., ...)
It is power_spice.Circuit (the passives with their parasitics, the switch
models, the run) with the parts that were missing: a diode, a source, a load, a
coupling between two inductors, and a switch driven by a drive of any duty,
phase and dead time. Every two-terminal part is sensed the same way: <ref>.V is
the voltage from its first node to its second, <ref>.I the current entering its
first node, so V x I is the power it absorbs.
- class kicad2ems.pcbqs.circuit.deck.Deck[source]¶
power_spice.Circuit and the general parts.
- diode(ref, anode, cathode, model, initial_V=None)[source]¶
Vf_V at If_A sets the saturation current for the emission coefficient n; R_ohm in series, Cj_F the junction capacitance at zero bias, TT_s the transit time (reverse recovery).
- kicad2ems.pcbqs.circuit.deck.build(model, state=None, copper=None)[source]¶
The deck of a resolved model. state: {ref: {initial_V, initial_A, initial_I}} from a previous run's end (engine.end_state): every capacitor, inductor and switch starts where that run stopped, and the run uses them (uic); None: ngspice works out the DC solution at time zero, where every gate is still low. copper (copper.prepare's): the board's copper between the parts' pads, each pad a node of its own.
- kicad2ems.pcbqs.circuit.deck.gate_timing(drive, invert, model, period)[source]¶
(delay, width, T) of a switch's gate pulse from its drive: on for duty x T from phase (its complement: the rest of the period), each edge held back by half the dead time, so a switch and its complement are never on together. T is the drive's own period.