Commit 8d23b06
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
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1226 | 1226 | | |
1227 | 1227 | | |
1228 | 1228 | | |
1229 | | - | |
1230 | | - | |
1231 | | - | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
1232 | 1232 | | |
1233 | 1233 | | |
1234 | 1234 | | |
1235 | 1235 | | |
1236 | | - | |
1237 | | - | |
1238 | | - | |
1239 | | - | |
1240 | | - | |
1241 | | - | |
1242 | | - | |
1243 | | - | |
1244 | | - | |
1245 | | - | |
1246 | | - | |
1247 | | - | |
1248 | | - | |
1249 | | - | |
1250 | | - | |
1251 | | - | |
1252 | | - | |
1253 | | - | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
1254 | 1261 | | |
1255 | 1262 | | |
1256 | 1263 | | |
| |||
0 commit comments