@@ -394,7 +394,7 @@ def generate(self) -> None:
394394 self .assign (self .actual_inductor_current_ripple , values .ripple_scale / self .inductor .actual_inductance )
395395
396396 self .connect (self .switch , self .inductor .a .adapt_to (VoltageSink (
397- current_draw = self . pwr_out . link (). current_drawn * values .effective_dutycycle
397+ current_draw = values .inductor_avg_current
398398 )))
399399 self .connect (self .pwr_out , self .inductor .b .adapt_to (VoltageSource (
400400 voltage_out = self .output_voltage ,
@@ -586,13 +586,13 @@ def generate(self) -> None:
586586 self .assign (self .actual_inductor_current_ripple , values .ripple_scale / self .inductor .actual_inductance )
587587
588588 self .connect (self .pwr_in , self .inductor .a .adapt_to (VoltageSink (
589- current_draw = self . pwr_out . link (). current_drawn / ( 1 - values .dutycycle )
589+ current_draw = values .inductor_avg_current
590590 )))
591591 self .connect (self .switch , self .inductor .b .adapt_to (VoltageSource (
592592 voltage_out = self .output_voltage ,
593593 current_limits = BuckConverterPowerPath ._ilim_expr (self .inductor .actual_current_rating , self .sw_current_limits ,
594594 self .actual_inductor_current_ripple )
595- / (1 - values .effective_dutycycle )
595+ * (1 - values .effective_dutycycle . upper )
596596 )))
597597
598598 self .in_cap = self .Block (DecouplingCapacitor (
@@ -714,13 +714,18 @@ def generate(self) -> None:
714714 BuckConverterPowerPath ._buck_inductor_filter ,
715715 combined_inductor_avg_current .upper , combined_ripple_scale , combined_min_ripple )
716716 ))
717- self .connect (self .switch_in , self .inductor .a )
718- self .connect (self .switch_out , self .inductor .b )
717+ self .connect (self .switch_in , self .inductor .a .adapt_to (VoltageSink (
718+ current_draw = combined_inductor_avg_current
719+ )))
720+ self .connect (self .switch_out , self .inductor .b .adapt_to (VoltageSource (
721+ voltage_out = self .output_voltage ,
722+ current_limits = BuckConverterPowerPath ._ilim_expr (self .inductor .actual_current_rating , self .sw_current_limits ,
723+ self .actual_inductor_current_ripple )
724+ * (1 - boost_values .effective_dutycycle .upper )
725+ )))
719726 self .assign (self .actual_inductor_current_ripple , combined_ripple_scale / self .inductor .actual_inductance )
720- self .assign (self .actual_avg_current_rating ,
721- BuckConverterPowerPath ._ilim_expr (self .inductor .actual_current_rating , self .sw_current_limits ,
722- self .actual_inductor_current_ripple ))
723- self .assign (self .actual_inductor_current , combined_inductor_avg_current + self .actual_inductor_current_ripple / 2 )
727+ self .assign (self .actual_inductor_current_peak ,
728+ combined_inductor_avg_current + self .actual_inductor_current_ripple / 2 )
724729
725730 self .in_cap = self .Block (DecouplingCapacitor (
726731 capacitance = buck_values .input_capacitance .intersect (boost_values .input_capacitance ) * Farad ,
0 commit comments