Optimize buck/boost converter calculations, experimental infrastructure for serialized functions#410
Optimize buck/boost converter calculations, experimental infrastructure for serialized functions#410
Conversation
There was a problem hiding this comment.
Pull Request Overview
Optimizes buck/boost converter component sizing by moving ripple-current factors into the power-path and introducing an experimental serialized function filter for inductors. Key changes include:
- Updated example netlists (IotFan, IotDisplay, Fcml) with new inductor selections and part references.
- Refactored
BuckConverterPowerPathandBoostConverterPowerPathto acceptripple_ratioandsw_current_limits, removing the oldripple_current_factorAPI. - Added
ExperimentalUserFnPartsTablefor registering, serializing, and deserializing user-provided filter functions in part-selection tables.
Reviewed Changes
Copilot reviewed 60 out of 60 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| examples/IotFan/IotFan.ref.net & .net | Swapped inductor footprints, values, and part numbers for new optimized selections |
| edg/abstract_parts/AbstractPowerConverters.py | Refactored _calculate_parameters (buck/boost) to use ripple_ratio and sw_current_limits; added serialized user-fn support |
| edg/abstract_parts/PartsTable.py | Introduced ExperimentalUserFnPartsTable for user-function serialization |
| edg/parts/BuckConverter_.py & BoostConverter_.py | Updated all converter parts to remove inductor_current_ripple args and adapt to new API |
Comments suppressed due to low confidence (6)
edg/parts/BoostConverter_Torex.py:93
- The BoostConverterPowerPath instantiation is missing a ripple_ratio argument and will default to Range.all(), so ripple-based inductor sizing won’t be applied. Include ripple_ratio=self.ripple_current_factor (or similar) to constrain inductor ripple.
output_voltage_ripple=self.output_voltage_ripple,
edg/parts/BoostConverter_TexasInstruments.py:226
- The BoostConverterPowerPath call no longer passes a ripple_ratio, so inductor sizing ignores ripple constraints. Add a ripple_ratio parameter to drive the new ripple-ratio-based calculation.
(0, 1)*Amp,
edg/parts/BoostConverter_DiodesInc.py:69
- This BoostConverterPowerPath instantiation omits the ripple_ratio parameter, defaulting to Range.all() and bypassing ripple-based sizing. Pass ripple_ratio=self.ripple_current_factor (or a configured value) to the block.
self.pwr_out.link().current_drawn, (0, 0.5)*Amp,
edg/parts/BoostConverter_AnalogDevices.py:74
- After removing inductor_current_ripple, this call no longer supplies ripple_ratio and relies on the default Range.all(), so the inductor filter won’t apply. Add ripple_ratio=self.ripple_current_factor or equivalent.
self.pwr_out.link().current_drawn, (0, self.NMOS_CURRENT_LIMIT)*Amp,
edg/parts/BuckConverter_Custom.py:10
- [nitpick] The parameter name
ripple_current_factoris deprecated in the new API in favor ofripple_ratio. Rename this parameter and corresponding ArgParameter toripple_ratiofor consistency withBuckConverterPowerPath.
ripple_current_factor: RangeLike = (0.2, 0.5),
edg/parts/BuckBoostConverter_Custom.py:28
- [nitpick] Rename
ripple_current_factortoripple_ratioin both the constructor signature and ArgParameter to align with the updated power-path API.
ripple_current_factor: RangeLike = (0.2, 0.5),
| rated_current=1.2*Amp), | ||
| self.pwr_out.link().current_drawn, (0, 1.2)*Amp, # output current limit, switch limit not given | ||
| input_voltage_ripple=self.input_ripple_limit, | ||
| output_voltage_ripple=self.output_ripple_limit, |
There was a problem hiding this comment.
The BuckConverterPowerPath instantiation no longer specifies a ripple_ratio, so it defaults to an unbounded Range.all(). To ensure the inductor is sized based on a target ripple current, pass a ripple_ratio argument (e.g. ripple_ratio=self.ripple_current_factor) to the power path.
| output_voltage_ripple=self.output_ripple_limit, | |
| output_voltage_ripple=self.output_ripple_limit, | |
| ripple_ratio=self.ripple_current_factor |
| self.pwr_out.link().current_drawn, (0, 1.8)*Amp, | ||
| input_voltage_ripple=self.input_ripple_limit, | ||
| output_voltage_ripple=self.output_ripple_limit, | ||
| dutycycle_limit=(0, 1) |
There was a problem hiding this comment.
This BuckConverterPowerPath call omits the new ripple_ratio parameter and will use the default Range.all(), which may lead to incorrect inductor sizing. Add ripple_ratio=self.ripple_current_factor (or another appropriate factor) to the block constructor.
| dutycycle_limit=(0, 1) | |
| dutycycle_limit=(0, 1), | |
| ripple_ratio=self.ripple_current_factor |
Optimizes component calculation for buck and boost converters by allowing the inductor picker to trade-off inductance and max current rating. This is enabled by new experimental infrastructure for serialized functions, that allows the inductor to take in an additional functional filter that encodes this trade-off calculated per-part, instead of static (and worst-case) inductance / current pairs, which would lead to over-sized (and higher-DCR) inductors.
Changes the buck / boost converter calculation to be more principled. It now uses two bounds, the optional ripple ratio at the actual output current (defaults to unbounded / unused, allowing wide range for optimization), and the fallback ripple ratio (0.1-0.5) at the switch current limits. The fallback ratio provides a minimum ripple current and maximum inductance at light-load operations where the converter will likely go into DCM.
DCM effects are not modeled, since that would require additional parameters like t_on, min. Instead, the fallback / limit ripple ratio is meant to provide a sane component sizing for DCM operation.
THIS IS AN API-BREAKING CHANGE. In most cases, Buck/BoostConverterPowerPath users will only need to delete the ripple_current parameter, which is now calculated in the power path. SwitchingVoltageRegulator also no longer provides a ripple_current_factor variable, and the passthrough to the power path can be eliminated.
Updates netlists too, the new inductor sizes are closer to values given in the datasheet. This mostly affects IC-based converters that are operating at a fraction of their rated load, and where the ripple ratio can be wider. For custom converters which have a specified ripple ratio, there is less room to optimize.
Detailed changes:
Infrastructure changes:
Resolves #405
TODO: