Skip to content

Abstract parts cleanup#496

Merged
ducky64 merged 8 commits into
masterfrom
reorg-follower
May 24, 2026
Merged

Abstract parts cleanup#496
ducky64 merged 8 commits into
masterfrom
reorg-follower

Conversation

@ducky64
Copy link
Copy Markdown
Collaborator

@ducky64 ducky64 commented May 24, 2026

Follow-on to #495, cleans up some of the abstract_parts modules.

  • Breaks ZenerDiode out of Diode
  • Deprecates LedDriver abstract class, removes subclasses dependence on this base class by inlining code. Non-backwards compatible (though trivially fixable), refinements will break.
  • Breaks up PowerConverters into LinearRegulator, SwitchingVoltageRegulator
    • Moves the BuckConverterPowerPath, BoostConverterPowerPath, BuckBoostConverterPowerPath into circuits
  • Moves some of the resistor application circuits into the circuits package, especially the functional protection circuits as opposed to type-wrappers

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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*) into edg.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, add VoltageClamping helpers, and update many example .net.ref golden 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
"""
Comment thread edg/parts/power/LedDriver_Tps92200.py Outdated
@@ -1,3 +1,4 @@
from typing import Any
@ducky64 ducky64 merged commit c8fd285 into master May 24, 2026
12 checks passed
@ducky64 ducky64 deleted the reorg-follower branch May 24, 2026 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants