Skip to content

Commit efc8215

Browse files
committed
AdvancedFourSwitchBuckBoost: PDR override (Issue M1)
Builds DesignRequirements directly from desiredInductance, bypassing the parent's PDR which auto-sizes inductance from current ripple.
1 parent 9a23336 commit efc8215

2 files changed

Lines changed: 28 additions & 14 deletions

File tree

src/converter_models/FourSwitchBuckBoost.cpp

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -558,25 +558,12 @@ namespace OpenMagnetics {
558558
FourSwitchBuckBoost::run_checks(_assertErrors);
559559
Inputs inputs;
560560
const double L = get_desired_inductance();
561-
if (L <= 0.0) {
562-
throw std::invalid_argument(
563-
"AdvancedFourSwitchBuckBoost::process: desiredInductance must be > 0");
564-
}
565561

566562
std::vector<double> inputVoltages;
567563
std::vector<std::string> inputVoltagesNames;
568564
Topology::collect_input_voltages(get_input_voltage(), inputVoltages, inputVoltagesNames);
569565

570-
DesignRequirements dr;
571-
dr.get_mutable_turns_ratios().clear();
572-
DimensionWithTolerance Lwt;
573-
Lwt.set_nominal(roundFloat(L, 10));
574-
dr.set_magnetizing_inductance(Lwt);
575-
std::vector<IsolationSide> isolationSides;
576-
isolationSides.push_back(get_isolation_side_from_index(0));
577-
dr.set_isolation_sides(isolationSides);
578-
dr.set_topology(Topologies::FOUR_SWITCH_BUCK_BOOST_CONVERTER);
579-
inputs.set_design_requirements(dr);
566+
inputs.set_design_requirements(process_design_requirements());
580567

581568
for (size_t i = 0; i < inputVoltages.size(); ++i) {
582569
for (size_t opIdx = 0; opIdx < get_operating_points().size(); ++opIdx) {
@@ -593,6 +580,29 @@ namespace OpenMagnetics {
593580
return inputs;
594581
}
595582

583+
DesignRequirements AdvancedFourSwitchBuckBoost::process_design_requirements() {
584+
// Issue M1: build DR directly from desiredInductance. Do NOT chain
585+
// to FourSwitchBuckBoost::process_design_requirements() — the parent
586+
// sizes inductance from current ripple, defeating the "Advanced"
587+
// override semantics.
588+
const double L = get_desired_inductance();
589+
if (L <= 0.0) {
590+
throw std::invalid_argument(
591+
"AdvancedFourSwitchBuckBoost::process_design_requirements: desiredInductance must be > 0");
592+
}
593+
594+
DesignRequirements dr;
595+
dr.get_mutable_turns_ratios().clear();
596+
DimensionWithTolerance Lwt;
597+
Lwt.set_nominal(roundFloat(L, 10));
598+
dr.set_magnetizing_inductance(Lwt);
599+
std::vector<IsolationSide> isolationSides;
600+
isolationSides.push_back(get_isolation_side_from_index(0));
601+
dr.set_isolation_sides(isolationSides);
602+
dr.set_topology(Topologies::FOUR_SWITCH_BUCK_BOOST_CONVERTER);
603+
return dr;
604+
}
605+
596606
// ============================================================
597607
// get_extra_components_inputs — L (single inductor), Cin, Co
598608
// ============================================================

src/converter_models/FourSwitchBuckBoost.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,10 @@ class AdvancedFourSwitchBuckBoost : public FourSwitchBuckBoost {
299299

300300
Inputs process();
301301

302+
// Issue M1: build DesignRequirements directly from desired* fields,
303+
// bypassing the parent's PDR which auto-sizes inductance from ripple.
304+
DesignRequirements process_design_requirements() override;
305+
302306
const double& get_desired_inductance() const { return desiredInductance; }
303307
double& get_mutable_desired_inductance() { return desiredInductance; }
304308
void set_desired_inductance(const double& value) { desiredInductance = value; }

0 commit comments

Comments
 (0)