Skip to content

Commit 8d23b06

Browse files
committed
feat(pfc): implement totem-pole and interleaved-boost variant code branches
MAS::PowerFactorCorrection has long exposed topologyVariant / numberOfPhases / wideBandgapSwitch in the schema, but the MKF engineering layer only ever computed the boost variant. Add explicit code branches for the two next-most-common industrial variants: - TOTEM_POLE bridgeless, GaN/SiC. The boost inductor sees AC voltage and bipolar current (true sine envelope, not |sin|); duty-cycle calc uses Vd=0 since the boost diode is replaced by a synchronous switch. CCM totemPole REQUIRES wideBandgapSwitch=true (Si MOSFETs disallowed per Erickson §17 / ON Semi AND8016) — validated and throws. - INTERLEAVED_BOOST per-phase magnetics: one inductor at Pout/N, sized by the same boost formulas with per-phase power. numberOfPhases ∈ {2,3} validated. A single private helper validate_topology_variant() is invoked at every public engineering entry point (run_checks, calculate_inductance_*, process_design_requirements, process_operating_points, generate_ngspice_circuit, simulate_and_extract_topology_waveforms) so unsupported variants (bridgeless, semiBridgeless, buck, buckBoost, sepic, cuk, vienna) throw loudly with a clear 'not yet implemented' message — vienna in particular redirects to VIENNA_PLAN.md (it is a 3-phase 3-level topology with its own dedicated model, not a PFC variant code branch). Per the repository's no-fallbacks rule. Tests added in TestTopologyPowerFactorCorrection.cpp: - Totem-pole: validation throws if wideBandgap unset in CCM, and the synthesized inductor current swings symmetrically positive/negative. - Interleaved boost: per-phase L for N=2 is ~2× single-phase boost L, for N=3 is ~3×; numberOfPhases<2 or >3 throws. - Unsupported variants throw with the right messages. Verification: - 8 PFC tests pass (3 existing + 5 new), 70 assertions. - Full converter regression: 252 cases, 5509 assertions (was 247/5488). Plan: §3.D.1 of CONVERTER_MODELS_REVIEW_PLAN.md updated — schema-first note replaced with the MKF code-branch status; the variant table now shows boost / totem-pole / interleaved-boost as ✅.
1 parent 9bb30f9 commit 8d23b06

4 files changed

Lines changed: 351 additions & 43 deletions

File tree

src/converter_models/CONVERTER_MODELS_REVIEW_PLAN.md

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,31 +1226,38 @@ SLUA754; Infineon AN_201702_PL52_010; ON Semi AND8016 / AND8123).
12261226
| **Boost PFC (CCM/DCM/CrCM/TCM)** | 1 | full-bridge rectifier + boost | Universal-input PSUs ≤ ~1.5 kW ||
12271227
| **Bridgeless / Dual-Boost PFC** | 1 | no input bridge — two boost legs share inductor (one per half-cycle) | Mid-power, eliminates 2 conduction-loss diodes ||
12281228
| **Semi-bridgeless PFC** | 1 | bridgeless with EMI-bridge clamp | Cost-optimised bridgeless ||
1229-
| **Totem-Pole PFC (CCM, GaN/SiC)** | 1 | bridgeless, two switches in totem-pole config | State-of-the-art (~98 % η), 1 kW–10 kW server PSUs | |
1230-
| **Totem-Pole PFC (CrCM)** | 1 | as above, low-power critical-mode | ~300 W LED, telecom | |
1231-
| **Interleaved Boost PFC** | 2 or 3 | shared input bridge, N parallel boost cells phase-shifted | Ripple cancellation, 1–3 kW PSUs (e.g. server, EV) | |
1229+
| **Totem-Pole PFC (CCM, GaN/SiC)** | 1 | bridgeless, two switches in totem-pole config | State-of-the-art (~98 % η), 1 kW–10 kW server PSUs | |
1230+
| **Totem-Pole PFC (CrCM)** | 1 | as above, low-power critical-mode | ~300 W LED, telecom | |
1231+
| **Interleaved Boost PFC** | 2 or 3 | shared input bridge, N parallel boost cells phase-shifted | Ripple cancellation, 1–3 kW PSUs (e.g. server, EV) | |
12321232
| **Vienna Rectifier** | 3 | 3-phase, 3-level | Telecom rectifiers, EV chargers ≥ 5 kW ||
12331233
| **Buck PFC** | 1 | input bridge + buck cell | Low-power LED drivers (Vbus < Vin_pk) ||
12341234
| **Buck-Boost PFC / SEPIC PFC / Cuk PFC** | 1 | various | Very low-power universal-input LED, isolated step-down/up ||
12351235

1236-
Currently `MAS::PowerFactorCorrection` exposes only the boost topology
1237-
(no `topologyVariant` enum field, no `numberOfPhases` field, no
1238-
`bridgeType` field). To add the variants above, the schema needs:
1239-
1240-
- `topologyVariant` (enum: `boost`, `bridgeless`, `semiBridgeless`,
1241-
`totemPole`, `interleavedBoost`, `vienna`, `buck`, `buckBoost`,
1242-
`sepic`, `cuk`).
1243-
- `numberOfPhases` (integer, default 1) for `interleavedBoost` (2–3) /
1244-
`vienna` (3).
1245-
- Optionally a `wideBandgapSwitch` boolean for totem-pole CCM
1246-
(only feasible with GaN/SiC due to MOSFET body-diode reverse-recovery).
1247-
1248-
This is a substantial extension. Until done, the existing
1249-
`MAS::PowerFactorCorrection` schema implicitly means "boost PFC" and the
1250-
MKF model only generates the boost variant. Per
1251-
`CONVERTER_MODELS_GOLDEN_GUIDE.md` §16.2 ("schema first, regen
1252-
MAS.hpp, then use the inherited accessor") this should be a separate
1253-
schema-change PR before any code branches are added.
1236+
Currently `MAS::PowerFactorCorrection` exposes `topologyVariant`,
1237+
`numberOfPhases`, and `wideBandgapSwitch` (schema migration completed
1238+
2026-05). Engineering-layer code branches in MKF (2026-05):
1239+
1240+
- **Boost** (default if `topologyVariant` unset) — fully implemented.
1241+
- **Totem-Pole** — fully implemented. Inductor sees AC bipolar voltage
1242+
(true sine envelope, not |sin|); duty-cycle calc uses `Vd=0` since
1243+
the boost diode is replaced by a synchronous switch. CCM
1244+
`totemPole` requires `wideBandgapSwitch=true` (validated; throws on
1245+
Si MOSFET CCM per Erickson §17 / ON Semi AND8016).
1246+
- **Interleaved Boost** — fully implemented. Per-phase magnetics:
1247+
one inductor at `Pout/N`, sized by the same boost formulas with
1248+
per-phase power. `numberOfPhases ∈ {2, 3}` validated; the user
1249+
replicates the resulting magnetic across `N` phases.
1250+
- All other variants (`bridgeless`, `semiBridgeless`, `buck`,
1251+
`buckBoost`, `sepic`, `cuk`, `vienna`) throw at every engineering
1252+
entry point with a "not yet implemented" message. `vienna` in
1253+
particular redirects to `VIENNA_PLAN.md` (it is a 3-phase 3-level
1254+
topology with its own dedicated model, not a PFC variant code
1255+
branch).
1256+
1257+
Tests covering the variant branches live in
1258+
`tests/TestTopologyPowerFactorCorrection.cpp` under tags
1259+
`[pfc-topology][totem-pole]`, `[pfc-topology][interleaved-boost]`,
1260+
and `[pfc-topology][variants]`.
12541261

12551262
#### 3.D.2 §5.1 converter-port stream — DONE (2026-05)
12561263

0 commit comments

Comments
 (0)