@@ -300,15 +300,15 @@ def _d_inverse_d(d_range: Range) -> Range:
300300 return raw_range
301301
302302 @staticmethod
303- @ExperimentalUserFnPartsTable .user_fn ([float , float ])
304- def _buck_inductor_filter (max_avg_current : float , ripple_scale : float ):
303+ @ExperimentalUserFnPartsTable .user_fn ([float , float , float ])
304+ def _buck_inductor_filter (max_avg_current : float , ripple_scale : float , min_ripple : float ):
305305 """Applies further filtering to inductors using the trade-off between inductance and peak-peak current.
306306 max_avg_current is the maximum average current (not accounting for ripple) seem by the inductor
307307 ripple_scale is the scaling factor from 1/L to ripple, Vo/(Vi-Vo)/fs/Vi"""
308308 def filter_fn (row : PartsTableRow ) -> bool :
309- ripple = ripple_scale / row [TableInductor .INDUCTANCE ]
310- max_current_pp = Range . exact ( max_avg_current ) + ripple / 2
311- return max_current_pp . fuzzy_in ( row [TableInductor .CURRENT_RATING ])
309+ ripple_current = max ( ripple_scale / row [TableInductor .INDUCTANCE ]. lower , min_ripple )
310+ max_current_pp = max_avg_current + ripple_current / 2
311+ return max_current_pp in row [TableInductor .CURRENT_RATING ]
312312 return filter_fn
313313
314314 @staticmethod
@@ -380,7 +380,7 @@ def generate(self) -> None:
380380 current = self .output_current , # min-bound only, the real filter happens in the filter_fn
381381 frequency = self .frequency ,
382382 experimental_filter_fn = ExperimentalUserFnPartsTable .serialize_fn (
383- self ._buck_inductor_filter , values .inductor_avg_current .upper , values .ripple_scale )
383+ self ._buck_inductor_filter , values .inductor_avg_current .upper , values .ripple_scale , values . min_ripple )
384384 ))
385385 self .assign (self .actual_inductor_current_ripple , values .ripple_scale / self .inductor .actual_inductance )
386386
@@ -399,7 +399,7 @@ def generate(self) -> None:
399399 )).connected (self .gnd , self .pwr_in )
400400 self .out_cap = self .Block (DecouplingCapacitor (
401401 capacitance = (Range .exact (float ('inf' )) * Farad ).hull (
402- (values .output_capacitance_scale * self .actual_inductor_current_ripple .upper ())),
402+ (values .output_capacitance_scale * self .actual_inductor_current_ripple .upper (). max ( values . min_ripple ) )),
403403 exact_capacitance = True
404404 )).connected (self .gnd , self .pwr_out )
405405
@@ -573,7 +573,8 @@ def generate(self) -> None:
573573 current = values .inductor_peak_currents , # min-bound only, the real filter happens in the filter_fn
574574 frequency = self .frequency ,
575575 experimental_filter_fn = ExperimentalUserFnPartsTable .serialize_fn (
576- BuckConverterPowerPath ._buck_inductor_filter , values .inductor_avg_current .upper , values .ripple_scale )
576+ BuckConverterPowerPath ._buck_inductor_filter ,
577+ values .inductor_avg_current .upper , values .ripple_scale , values .min_ripple )
577578 ))
578579 self .assign (self .actual_inductor_current_ripple , values .ripple_scale / self .inductor .actual_inductance )
579580
@@ -700,13 +701,15 @@ def generate(self) -> None:
700701
701702 combined_ripple_scale = max (buck_values .ripple_scale , boost_values .ripple_scale )
702703 combined_inductor_avg_current = boost_values .inductor_avg_current .hull (boost_values .inductor_avg_current )
704+ combined_min_ripple = max (buck_values .min_ripple , boost_values .min_ripple )
703705
704706 self .inductor = self .Block (Inductor (
705707 inductance = buck_values .inductance .intersect (boost_values .inductance ) * Henry ,
706708 current = buck_values .inductor_peak_currents .hull (boost_values .inductor_peak_currents ),
707709 frequency = self .frequency ,
708710 experimental_filter_fn = ExperimentalUserFnPartsTable .serialize_fn (
709- BuckConverterPowerPath ._buck_inductor_filter , combined_inductor_avg_current .upper , combined_ripple_scale )
711+ BuckConverterPowerPath ._buck_inductor_filter ,
712+ combined_inductor_avg_current .upper , combined_ripple_scale , combined_min_ripple )
710713 ))
711714 self .connect (self .switch_in , self .inductor .a )
712715 self .connect (self .switch_out , self .inductor .b )
0 commit comments