Skip to content

Commit f599370

Browse files
committed
fix(llc): correct reflected output voltage for voltage-doubler rectifier
For VOLTAGE_DOUBLER, the cap stack delivers 2*Vsec_pk to the load and n_main is doubled at design time. The reflected output voltage seen at the magnetizing inductor is n_main*Vout/2, not n_main*Vout. Without this correction the steady-state TDA solver saw Vo = 2*Vi, drove ILs == IL everywhere, and the analytical secondary current Id = ILs - IL collapsed to zero. CoilAdviser then threw 'Current is not processed' on the zero-RMS secondary winding and end-to-end MagneticAdviser returned no results for HB+VD and FB+VD. Drop [!mayfail] from Test_MagneticAdviserFromConverter_LLC_VoltageDoubler (both variants now return >= 1 magnetic). A NOTE flags that peak Isec in the analytical fallback still looks 4-6x high vs FB/CT/CD and that SPICE codegen for the VD output stage still fails (silent analytical fallback) — both warrant follow-up but no longer block adviser coverage.
1 parent 033a5f8 commit f599370

2 files changed

Lines changed: 17 additions & 15 deletions

File tree

src/converter_models/Llc.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,15 @@ OperatingPoint Llc::process_operating_point_for_input_voltage(
797797
// output. Multi-output secondaries are scaled per-output below.
798798
double n_main = get_n_for_output(0);
799799
double Vo = n_main * llcOpPoint.get_output_voltages()[0];
800+
// For voltage-doubler, the cap stack provides 2·Vsec_pk to the load and
801+
// n_main was doubled at design time (see process_design_requirements). The
802+
// *reflected* output voltage seen at the magnetizing inductor is therefore
803+
// n_main · Vout / 2, not n_main · Vout. Without this correction, the
804+
// steady-state solver sees Vo = 2·Vi → no power transfer → ILs == IL and
805+
// the analytical secondary current collapses to zero.
806+
if (get_effective_rectifier_type() == LlcRectifierType::VOLTAGE_DOUBLER) {
807+
Vo *= 0.5;
808+
}
800809

801810
if (magnetizingInductance <= 0) magnetizingInductance = 200e-6;
802811

tests/TestMagneticAdviserConverterVariants.cpp

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -123,22 +123,15 @@ TEST_CASE("Test_MagneticAdviserFromConverter_LLC_VariantMatrix",
123123
}
124124

125125

126-
// FIXME(llc-voltage-doubler): two stacked bugs prevent VD from reaching the
127-
// adviser end-to-end. Tagged [!mayfail] so the contract is visible (we WILL
128-
// fix it) without blocking CI. Do not relax to size >= 0.
129-
// (1) Llc.cpp::simulate_and_extract_operating_points — SPICE netlist for
130-
// VOLTAGE_DOUBLER produces "No output file generated by ngspice"
131-
// (Llc.cpp:1738). Either the VD output-stage subcircuit fails to
132-
// converge or a node is unresolved. Inspect the generated netlist
133-
// (set config.keepTempFiles=true) before fixing.
134-
// (2) The analytical fallback path (process_operating_points) does not
135-
// populate current.processed() on every VD winding, so the wire-solver
136-
// throws "[INVALID_WIRE_DATA] Current is not processed" at the first
137-
// call from CoilAdviser. Mirror what the CT/FB/CD branches do at
138-
// Llc.cpp:1117–1226 and ensure processed-data is set for every emitted
139-
// SignalDescriptor.
126+
// NOTE(llc-voltage-doubler): SPICE codegen for VOLTAGE_DOUBLER still emits
127+
// "No output file generated by ngspice" (Llc.cpp::simulate_and_extract_operating_points)
128+
// and the path falls back to the analytical TDA model. The analytical path
129+
// produces non-trivial Isec waveforms but their peak amplitudes look ~4–6×
130+
// higher than the FB/CT/CD equivalents and warrant a SPICE cross-check before
131+
// the model is considered production-ready. End-to-end MagneticAdviser
132+
// coverage is asserted here (≥1 result) so the contract is enforced.
140133
TEST_CASE("Test_MagneticAdviserFromConverter_LLC_VoltageDoubler",
141-
"[adviser][from-converter][llc-topology][variant-matrix][!mayfail]") {
134+
"[adviser][from-converter][llc-topology][variant-matrix]") {
142135
struct Variant { std::string bridge; std::string rectifier; std::string label; };
143136
std::vector<Variant> variants = {
144137
{"halfBridge", "voltageDoubler", "HB+VD"},

0 commit comments

Comments
 (0)