Abstract parts cleanup#496
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Follow-on cleanup to the abstract parts split (#495), continuing the migration of “application circuit” style helpers out of abstract_parts and into circuits, while also reshaping a few abstract APIs (LED drivers, regulators, zeners) and updating example golden netlists accordingly.
Changes:
- Split out power converter abstractions (eg,
VoltageRegulator,LinearRegulator,SwitchingVoltageRegulator) and move switching “power-path” helper blocks (Buck*/Boost*) intoedg.circuits. - Deprecate/decouple the LED driver abstract API and update concrete LED driver parts (
Tps92200,Al8861) and example usage to use the concrete parts directly. - Move clamp/USB series resistor circuits into
edg.circuits, addVoltageClampinghelpers, and update many example.net.refgolden files to reflect the new module paths.
Reviewed changes
Copilot reviewed 51 out of 51 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| examples/UsbSourceMeasure/UsbSourceMeasure.net.ref | Updates sheetfile paths for moved buck/boost/buck-boost power-path circuits. |
| examples/TestBlinkyWithSchematicImport/TestBlinkyWithSchematicImport.net.ref | Updates sheetfile paths for moved buck power-path circuit. |
| examples/TestBlinkyWithModeledSchematicImport/TestBlinkyWithModeledSchematicImport.net.ref | Updates sheetfile paths for moved buck power-path circuit. |
| examples/TestBlinkyWithLibraryExport/TestBlinkyWithLibraryExport.net.ref | Updates sheetfile paths for moved buck power-path circuit. |
| examples/TestBlinkyWithLibrary/TestBlinkyWithLibrary.net.ref | Updates sheetfile paths for moved buck power-path circuit. |
| examples/TestBlinkyPacked/TestBlinkyPacked.net.ref | Updates sheetfile paths for moved buck power-path circuit. |
| examples/TestBlinkyMicro/TestBlinkyMicro.net.ref | Updates sheetfile paths for moved buck power-path circuit. |
| examples/TestBlinkyImplicit/TestBlinkyImplicit.net.ref | Updates sheetfile paths for moved buck power-path circuit. |
| examples/TestBlinkyExpanded/TestBlinkyExpanded.net.ref | Updates sheetfile paths for moved buck power-path circuit. |
| examples/TestBlinkyComplete/TestBlinkyComplete.net.ref | Updates sheetfile paths for moved buck power-path circuit. |
| examples/TestBlinkyChain/TestBlinkyChain.net.ref | Updates sheetfile paths for moved buck power-path circuit. |
| examples/TestBlinkyArray/TestBlinkyArray.net.ref | Updates sheetfile paths for moved buck power-path circuit. |
| examples/test_iot_led_driver.py | Switches from LedDriver abstraction/refinements to directly instantiating Tps92200. |
| examples/Simon/Simon.net.ref | Updates sheetfile paths for moved boost power-path circuit. |
| examples/RobotOwl/RobotOwl.net.ref | Updates sheetfile paths for moved boost power-path circuit. |
| examples/RobotDriver/RobotDriver.net.ref | Updates sheetfile paths for moved buck power-path circuit. |
| examples/PicoProbe/PicoProbe.net.ref | Updates sheetfile paths for moved USB series resistor circuit. |
| examples/Multimeter/Multimeter.net.ref | Updates sheetfile paths for moved boost power-path and USB series resistor circuits. |
| examples/IotThermalCamera/IotThermalCamera.net.ref | Updates sheetfile paths for moved buck power-path circuit. |
| examples/IotRollerBlinds/IotRollerBlinds.net.ref | Updates sheetfile paths for moved buck power-path circuit. |
| examples/IotLedDriver/IotLedDriver.svgpcb.js | Netlist ordering update (pwm nets appear earlier). |
| examples/IotLedDriver/IotLedDriver.net.ref | Updates sheetfile paths for moved buck power-path circuit and net ordering for pwm nets. |
| examples/IotIron/IotIron.net.ref | Updates sheetfile paths for moved buck power-path circuit. |
| examples/IotFan/IotFan.net.ref | Updates sheetfile paths for moved buck power-path circuit. |
| examples/IotDisplay/IotDisplay.net.ref | Updates sheetfile paths for moved buck power-path circuit. |
| examples/IotCurtainCrawler/IotCurtainCrawler.net.ref | Updates sheetfile paths for moved buck power-path circuit. |
| examples/HighSwitch/HighSwitch.net.ref | Updates sheetfile paths for moved buck power-path circuit. |
| examples/Fcml/Fcml.net.ref | Updates sheetfile paths for moved boost power-path and USB series resistor circuits. |
| examples/Datalogger/Datalogger.net.ref | Updates sheetfile paths for moved buck power-path circuit. |
| examples/CanAdapter/CanAdapter.net.ref | Updates sheetfile paths for moved buck power-path circuit. |
| examples/BleJoystick/BleJoystick.net.ref | Updates sheetfile paths for moved buck power-path circuit. |
| edg/parts/power/LedDriver_Tps92200.py | Refactors Tps92200 to no longer subclass the LedDriver abstraction; exports ports directly and builds supporting circuitry in contents(). |
| edg/parts/power/LedDriver_Al8861.py | Refactors Al8861 to no longer subclass the LedDriver abstraction; adds explicit LED ports and parameters. |
| edg/circuits/VoltageClamping.py | Adds AnalogClampResistor and DigitalClampResistor circuits under circuits. |
| edg/circuits/UsbSeriesResistor.py | Adds UsbSeriesResistor circuit under circuits. |
| edg/circuits/test_switching_converters.py | Updates tests to import buck/boost power-path blocks from their new modules. |
| edg/circuits/BuckConverterPowerPath.py | New buck converter power-path generator moved into circuits. |
| edg/circuits/BuckBoostConverterPowerPath.py | New buck-boost converter power-path generator moved into circuits. |
| edg/circuits/BootstrapCapacitor.py | New bootstrap capacitor wrapper moved into circuits. |
| edg/circuits/BoostConverterPowerPath.py | New boost converter power-path generator moved into circuits. |
| edg/circuits/init.py | Re-exports newly added circuits blocks. |
| edg/abstract_parts/ZenerDiode.py | Splits zener diode abstractions into their own module and deprecates analog clamp zener in favor of clamp resistor. |
| edg/abstract_parts/VoltageRegulator.py | Introduces VoltageRegulator abstract base and enable wrapper (split from the deleted PowerConverters.py). |
| edg/abstract_parts/test_ideal_circuit.py | Updates imports to new regulator module locations. |
| edg/abstract_parts/SwitchingVoltageRegulator.py | Introduces switching regulator abstractions (buck/boost/buck-boost) split from PowerConverters.py. |
| edg/abstract_parts/Resistor.py | Removes clamp resistor and USB series resistor circuits from abstract_parts (moved to circuits), plus small docstring grammar tweaks. |
| edg/abstract_parts/PowerConverters.py | Deletes monolithic power converter module (superseded by split modules). |
| edg/abstract_parts/LinearRegulator.py | Introduces linear regulator abstractions split from PowerConverters.py. |
| edg/abstract_parts/LedDriver.py | Deprecates LED driver abstraction API. |
| edg/abstract_parts/Diode.py | Removes zener diode definitions from Diode.py (now in ZenerDiode.py). |
| edg/abstract_parts/init.py | Updates public exports to point at new split modules and removes moved circuits. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| self.assign(self.actual_boost_dutycycle, boost_values.effective_dutycycle) | ||
|
|
||
| combined_ripple_scale = max(buck_values.ripple_scale, boost_values.ripple_scale) | ||
| combined_inductor_avg_current = boost_values.inductor_avg_current.hull(boost_values.inductor_avg_current) |
Comment on lines
+9
to
+19
| class BuckBoostConverterPowerPath(InternalSubcircuit, GeneratorBlock): | ||
| """A helper block to generate the power path (inductors, capacitors) for a 4-switch buck-boost converter. | ||
|
|
||
| Main assumptions in component sizing | ||
| - Operating only in continuous mode, TODO: also consider boundary and discontinuous mode | ||
| - TODO: account for capacitor ESR? | ||
|
|
||
| Useful resources: | ||
| https://www.ti.com/lit/an/slva535b/slva535b.pdf | ||
| Largely based on this document, the tl;dr of which is combine the buck and boost equations | ||
| """ |
| @@ -1,3 +1,4 @@ | |||
| from typing import Any | |||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-on to #495, cleans up some of the abstract_parts modules.