Skip to content

Standardize power path current draw conventions#411

Merged
ducky64 merged 7 commits intomasterfrom
converter-draw
Jun 17, 2025
Merged

Standardize power path current draw conventions#411
ducky64 merged 7 commits intomasterfrom
converter-draw

Conversation

@ducky64
Copy link
Copy Markdown
Collaborator

@ducky64 ducky64 commented Jun 16, 2025

Standardize conventions defined in the Buck/BoostConverterPowerPath: switch on buck is an VoltageSink that draws the average inductor current, and switch on the boost is a VoltageSource that provides the max average output current. Refactors the BuckBoostConverterPowerPath to use this convention. This isn't the cleanest, but this allows these parameters to propagate to the connected device (eg, buck converter controller IC's power-in pin) through the connection instead of needing to be plumbed explicitly. This makes the custom discrete converter a bit tougher, but probably a good trade-off.

Additional fixes:

  • current limit on the boost power path, accounts for the boost ratio properly.
  • account for efficiency factor on current draw for buck and boost converters
    • updates examples to tolerate this
  • plumb rds_on through the custom converters
  • model switch current limits in custom converters (generally not the limiting factor, but still good practice)
    • add ForcedVoltageCurrentLimit as a library block
  • unit tests that run the buck and boost converter power path and check generated parameters

Adds the actual inductor current peak for all converter power paths. Makes the discrete custom buck converter use this, instead of calculating it independently.

Resolves #406 and #307

TODO

  • account for switch limits in custom power converter output current limit
  • end to end block unit testing

@ducky64 ducky64 requested a review from Copilot June 16, 2025 08:10
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

Standardizes current draw conventions for buck/boost converter power paths, adds inductor current peak tracking, fixes boost current limits and efficiency factors, and ensures rds_on is passed to FET blocks.

  • Adopt buck switch as a VoltageSink drawing average inductor current and boost switch as a VoltageSource providing max average output current
  • Introduce actual_inductor_current_peak everywhere and refactor chains to use it for FET sizing
  • Correct boost limit calculation (ratio and efficiency) and propagate fet_rds through custom converters

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
edg/parts/FanConnector.py Updated comment to reflect correct startup duration and steady-state current draw
edg/parts/BuckConverter_Custom.py Plumbed rds_on into FetHalfBridge, renamed force ports, switched to peak current
edg/parts/BuckBoostConverter_Custom.py Added VoltageSourceConnector, removed voltage_drop, refactored chain logic
edg/abstract_parts/AbstractPowerConverters.py Updated port types/comments, added actual_inductor_current_peak, adjusted connects
Comments suppressed due to low confidence (3)

edg/parts/BuckConverter_Custom.py:41

  • [nitpick] The forced-chain variables mix pwr_in_force with sw_out_force. Consider using a consistent prefix/suffix (e.g., sw_in_force/sw_out_force or pwr_in_force/pwr_out_force) to improve clarity.
(self.pwr_in_force, ), _ = self.chain(  # use average current draw for boundary ports

edg/abstract_parts/AbstractPowerConverters.py:396

  • The new actual_inductor_current_peak parameter isn’t covered by existing tests. Add unit tests to verify it’s computed correctly and propagated to downstream blocks.
self.assign(self.actual_inductor_current_peak,

edg/parts/BuckBoostConverter_Custom.py:22

  • [nitpick] This docstring is ambiguous: the connector uses VoltageSink ports on both sides. Clarify that it links a source port to a sink port and update parameter descriptions accordingly.
"""Connects two voltage sources together (inductor output to FET center 'source')."""

self.Block(VoltageSinkConnector(self.output_voltage,
self.power_path.actual_inductor_current,
self.power_path.actual_avg_current_rating)),
Range.all(), # unused, port actually in reverse
Copy link

Copilot AI Jun 16, 2025

Choose a reason for hiding this comment

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

[nitpick] Passing Range.all() as a placeholder argument is confusing. Consider overloading VoltageSinkConnector/VoltageSourceConnector or providing a named constant to make intent explicit.

Suggested change
Range.all(), # unused, port actually in reverse
UNUSED_CURRENT_LIMIT, # explicit placeholder for unused current limit

Copilot uses AI. Check for mistakes.
@ducky64 ducky64 marked this pull request as draft June 17, 2025 08:23
@ducky64 ducky64 marked this pull request as ready for review June 17, 2025 08:30
@ducky64 ducky64 merged commit e895c5f into master Jun 17, 2025
12 checks passed
@ducky64 ducky64 deleted the converter-draw branch June 17, 2025 08:38
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.

Standardize conventions for current draws on Buck/BoostConverterPowerPath

2 participants