Spaces:
Running
Running
Integrate and qualify the 2:1 switched inductor converter
Browse files- Dockerfile +1 -0
- README.md +7 -0
- docs/topology/2to1_resonant/verify_browser.mjs +2 -2
- docs/topology/2to1_switched_inductor/README.md +141 -0
- docs/topology/2to1_switched_inductor/build_starter.mjs +58 -0
- docs/topology/2to1_switched_inductor/parity.md +101 -0
- docs/topology/2to1_switched_inductor/update_source.py +91 -0
- docs/topology/2to1_switched_inductor/verify_browser.mjs +250 -0
- docs/topology/2to1_switched_inductor/verify_cache.mjs +81 -0
- docs/topology/2to1_switched_inductor/verify_model.py +80 -0
- docs/topology/2to1_switched_inductor/verify_ngspice.py +61 -0
- docs/topology/2to1_switched_inductor/verify_sweeps.mjs +66 -0
- docs/topology/2to1_switching_capacitors/integration/verify_live.mjs +2 -2
- docs/topology/analysis_feature_parity_matrix.md +4 -0
- docs/topology/feature_parity_checklist.md +4 -0
- docs/topology/minjie_confirmation_list.md +12 -0
- docs/topology/simulator_feature_parity_matrix.md +4 -0
- docs/topology/topology_inventory.md +5 -4
- rsc2/preset.py +2 -2
- rsc2/preset_contract.json +2 -1
- si2/__init__.py +0 -0
- si2/preset.py +275 -0
- si2/preset_contract.json +163 -0
- si2/switched-inductor.cir +52 -0
- simulator_bridge.js +45 -20
- simulator_frame.py +8 -1
- simulator_service.py +2 -1
- static/compare/app.js +71 -38
- static/compare/assets/si2-candidate.svg +1 -0
- static/compare/assets/si2.svg +1 -0
- static/compare/engine.js +43 -8
- static/compare/index.html +4 -4
- static/compare/models-data.json +24 -0
- static/compare/recommend.js +62 -3
- static/compare/scoreboard.js +4 -4
- static/compare/style.css +4 -1
- static/compare/switched-inductor.js +51 -0
- static/compare/technology.js +4 -1
- static/gallery.js +12 -2
- static/index.html +2 -2
- static/openpels-source.zip +2 -2
- static/pe.js +12 -11
- static/simulator.js +4 -2
- static/starters/index.json +15 -1
- static/starters/si2.icproj.json +0 -0
- static/starters/si2.sp +14 -0
- static/testbenches/rsc2-preset.json +2 -1
- static/testbenches/si2-preset.json +163 -0
Dockerfile
CHANGED
|
@@ -13,6 +13,7 @@ COPY --chown=appuser static ./static
|
|
| 13 |
COPY --chown=appuser simulator ./simulator
|
| 14 |
COPY --chown=appuser sp2 ./sp2
|
| 15 |
COPY --chown=appuser rsc2 ./rsc2
|
|
|
|
| 16 |
COPY --chown=appuser server.py simulator_service.py simulator_frame.py simulator_bridge.js simulator-source.json ./
|
| 17 |
USER appuser
|
| 18 |
EXPOSE 7860
|
|
|
|
| 13 |
COPY --chown=appuser simulator ./simulator
|
| 14 |
COPY --chown=appuser sp2 ./sp2
|
| 15 |
COPY --chown=appuser rsc2 ./rsc2
|
| 16 |
+
COPY --chown=appuser si2 ./si2
|
| 17 |
COPY --chown=appuser server.py simulator_service.py simulator_frame.py simulator_bridge.js simulator-source.json ./
|
| 18 |
USER appuser
|
| 19 |
EXPOSE 7860
|
README.md
CHANGED
|
@@ -80,6 +80,13 @@ opens the local circuit and its two state views. **Simulate** opens the generic
|
|
| 80 |
NGSpice preset with editable tank settings and custom sweeps.
|
| 81 |
[Derivation and local validation](docs/topology/2to1_resonant/README.md)
|
| 82 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
## Rebuild the frontend
|
| 84 |
|
| 85 |
The release contains the built UI in `static/`. The source archive includes the
|
|
|
|
| 80 |
NGSpice preset with editable tank settings and custom sweeps.
|
| 81 |
[Derivation and local validation](docs/topology/2to1_resonant/README.md)
|
| 82 |
|
| 83 |
+
For the **2:1 switched inductor** converter, select **2:1** in Gallery. Analysis
|
| 84 |
+
uses independently entered input voltage and duty, sizes the four MOSFETs, and
|
| 85 |
+
reports both power-loss resistance and voltage droop. The editable starter
|
| 86 |
+
includes eight switching drawings. The NGSpice preset exposes continuous
|
| 87 |
+
duty, inverse coupling, parasitics, waveforms and custom sweeps.
|
| 88 |
+
[Derivation and local validation](docs/topology/2to1_switched_inductor/README.md)
|
| 89 |
+
|
| 90 |
## Rebuild the frontend
|
| 91 |
|
| 92 |
The release contains the built UI in `static/`. The source archive includes the
|
docs/topology/2to1_resonant/verify_browser.mjs
CHANGED
|
@@ -19,7 +19,7 @@ page.on("pageerror", e => errors.push(e.message));
|
|
| 19 |
|
| 20 |
async function selectRsc() {
|
| 21 |
await page.locator('[data-family="2"]').click();
|
| 22 |
-
await expect(page.locator(".topology-tile")).toHaveCount(
|
| 23 |
await page.locator('[data-topology-id="rsc2"]').click();
|
| 24 |
await expect(analysis.locator('#circuits [data-topology="rsc2"]')).toBeVisible();
|
| 25 |
}
|
|
@@ -52,7 +52,7 @@ const artifact = name => download(sim.locator(`[download="${name}"]`));
|
|
| 52 |
const near = (a,b,tolerance=1e-10) => assert(Math.abs(a-b)<tolerance,`${a} vs ${b}`);
|
| 53 |
try {
|
| 54 |
await page.goto(base);
|
| 55 |
-
await expect(page.locator(".topology-tile")).toHaveCount(
|
| 56 |
await page.locator('[data-family="4"]').click();
|
| 57 |
await expect(page.locator('[data-topology-id="rsc2"]')).toHaveCount(0);
|
| 58 |
await selectRsc();
|
|
|
|
| 19 |
|
| 20 |
async function selectRsc() {
|
| 21 |
await page.locator('[data-family="2"]').click();
|
| 22 |
+
await expect(page.locator(".topology-tile")).toHaveCount(6);
|
| 23 |
await page.locator('[data-topology-id="rsc2"]').click();
|
| 24 |
await expect(analysis.locator('#circuits [data-topology="rsc2"]')).toBeVisible();
|
| 25 |
}
|
|
|
|
| 52 |
const near = (a,b,tolerance=1e-10) => assert(Math.abs(a-b)<tolerance,`${a} vs ${b}`);
|
| 53 |
try {
|
| 54 |
await page.goto(base);
|
| 55 |
+
await expect(page.locator(".topology-tile")).toHaveCount(9,{timeout:20000});
|
| 56 |
await page.locator('[data-family="4"]').click();
|
| 57 |
await expect(page.locator('[data-topology-id="rsc2"]')).toHaveCount(0);
|
| 58 |
await selectRsc();
|
docs/topology/2to1_switched_inductor/README.md
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 2:1 switched inductor development report
|
| 2 |
+
|
| 3 |
+
Open **Gallery → 2:1 → 2:1 switched inductor** at [local OpenPELS](http://127.0.0.1:8765). Analysis offers continuous duty, a positive-current CCM screen, transistor sizing, a loss breakdown, and design, technology, per-unit and equivalent-circuit exports. The schematic opens the local editable project and its eight switching-state drawings. The Simulator runs NGSpice with continuous inputs, waveforms, measurements, custom sweeps and artifact downloads. Analysis and Simulator exchange Vin, Iout and duty. Numerical run controls and the generic switch parameters are set in Simulator. The original flat-current two-phase coupled buck remains available for comparison. It represents the same power-stage graph with a simpler loss model and a different starter.
|
| 4 |
+
|
| 5 |
+
## Circuit provenance and verification
|
| 6 |
+
|
| 7 |
+
The existing MCP session supplied the Analog Canvas project **2:1 Buck Converter**, `dut` revision 138 and structure revision 11. The exported project SHA-256 was `f1842161e1ce94b6f93f2a2d20fe7ef0a379d46febdfb45fe2186b9ec91ba73e`. The exported gallery SVG SHA-256 was `d7f5d535ed8b0108e2a222c289301cb9746520e076b541617a2a0a73d33ca997`. The project was read and exported through MCP. The Canvas project received no edits.
|
| 8 |
+
|
| 9 |
+
- Q1/M1 and Q2/M2 are the upper and lower devices of the A leg. Q3/M5 and Q4/M6 are the upper and lower devices of the B leg. Upper drains share VIN. Lower sources and COUT/IOUT returns share ground.
|
| 10 |
+
- The A switch node connects to L1 pin 1, then from pin 2 through RL1 to VOUT. The B switch node connects to L2 pin 2, then from pin 1 through RL2 to VOUT. Both currents are referenced from the switch nodes toward VOUT. The dots face the switch on L1 and VOUT on L2, giving inverse mutual inductance with these current references. The Canvas core lines and dots were drafting objects. The local starter uses one electrical coupling object with positive SPICE K and the same opposed dotted terminal order.
|
| 11 |
+
- The live gates carry graphical annotations A, A̅, B, B̅. The graph has no gate sources or wired gate pins. The state captions and active-device shading specify the complementary pairs and B's half-period offset. The local starter adds four independent gate ports and an explicit VOUT port. The NGSpice deck supplies the commands. The raw Canvas device dimensions and component values do not calibrate either local model.
|
| 12 |
+
- The canonical project export includes the state descriptions and shading, including both high-side devices in AB=11. State document revisions are `4, 43, 0, 0, 1, 1, 1, 1` in the order of the two 50% drawings, three >50% drawings and three <50% drawings. The local project includes those power-stage cells. The two illustrative DC-model cells remain in the original project. Analysis generates its own equivalent circuit from the qualified equations.
|
| 13 |
+
- The native SPICE export preserves the Canvas external Sky130 device interface and physical connectivity. The exported subcircuit includes the load and requires its external model. The separately executable NGSpice preset uses linear switch models. [Native schematic](../../../static/starters/si2.icproj.json) · [Structural SPICE](../../../static/starters/si2.sp) · [Executable deck](../../../si2/switched-inductor.cir)
|
| 14 |
+
|
| 15 |
+
| AB | Conducting | A winding path | B winding path |
|
| 16 |
+
| --- | --- | --- | --- |
|
| 17 |
+
| 10 | Q1, Q4 | VIN → Q1 → L1/DCR → OUT | Ground → Q4 → L2/DCR → OUT |
|
| 18 |
+
| 01 | Q2, Q3 | Ground → Q2 → L1/DCR → OUT | VIN → Q3 → L2/DCR → OUT |
|
| 19 |
+
| 00 | Q2, Q4 | Ground → Q2 → L1/DCR → OUT | Ground → Q4 → L2/DCR → OUT |
|
| 20 |
+
| 11 | Q1, Q3 | VIN → Q1 → L1/DCR → OUT | VIN → Q3 → L2/DCR → OUT |
|
| 21 |
+
|
| 22 |
+
For normalized time `x = t/T`, A is high in `[0,D)` and B is high when `(x+1/2) mod 1 < D`. Below 50%, the sequence is 10, 00, 01, 00 with durations `D, 1/2−D, D, 1/2−D` in units of T. At 50% the sequence is 10, 01. Above 50% it is 11, 10, 11, 01 with durations `D−1/2, 1−D, D−1/2, 1−D`. No commanded state shorts VIN to ground. A high-side current is positive drain to source in positive-current CCM. Low-side channel current then flows source to drain during freewheel. The loss model uses magnitude squared for either direction.
|
| 23 |
+
|
| 24 |
+
## Analytical model
|
| 25 |
+
|
| 26 |
+
Let `L` be the matched self-inductance per winding, `−kL` the signed mutual inductance, `T = 1/fs`, `uA,uB ∈ {0,1}`, `I = Iout`. The modal inductances are `Lc = L(1−k)` and `Ld = L(1+k)` for summed and differential current. Positive magnetic energy requires `0 ≤ k < 1`. The numerical workbench screens `k ≤ 0.85`.
|
| 27 |
+
|
| 28 |
+
For an ideal stiff output, in each state:
|
| 29 |
+
|
| 30 |
+
```text
|
| 31 |
+
vLA = uA Vin − Vout; vLB = uB Vin − Vout
|
| 32 |
+
[vLA, vLB]ᵀ = L [[1, −k], [−k, 1]] d[iA, iB]ᵀ/dt
|
| 33 |
+
d(iA+iB)/dt = [(uA+uB) Vin − 2 Vout]/Lc
|
| 34 |
+
d(iA−iB)/dt = (uA−uB) Vin/Ld
|
| 35 |
+
```
|
| 36 |
+
|
| 37 |
+
Winding currents and capacitor voltage remain continuous. Each winding has zero average voltage at periodic steady state. Since each switch node is at VIN for fraction D, the ideal conversion is **Vout/Vin = D**. The 2:1 name refers to D=0.5. The shared capacitor carries `iC=iA+iB−I`, and charge balance imposes `⟨iA+iB⟩=I`. Symmetry gives `⟨iA⟩=⟨iB⟩=I/2`. Ideal input current is `uA iA+uB iB`, with average `D I`. The leading resistive correction to this average matters when assessing stage power from port measurements.
|
| 38 |
+
|
| 39 |
+
### Ripple, currents and stress
|
| 40 |
+
|
| 41 |
+
For phase A, sort the switch edges `0, 1/2, D, (D+1/2) mod 1, 1`. In each segment j of duration fraction `hⱼ`, the normalized current increment is
|
| 42 |
+
|
| 43 |
+
```text
|
| 44 |
+
Δ(iA/I)ⱼ = hⱼ Vin/(2 L fs I) × [(uA+uB−2D)/(1−k) + (uA−uB)/(1+k)].
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
Integration gives the affine endpoints. Offset them so that the area-weighted phase average equals 1/2. Use the maximum and minimum across all segment boundaries to determine the ripple and valley, including cases where signs change inside a winding's gate interval. Phase B is phase A delayed by T/2. At D=0.5 the formula reduces to `Δi_phase=Vin/(4 fs Ld)`. At k=0 it reduces to `Vin D(1−D)/(fs L)`.
|
| 48 |
+
|
| 49 |
+
Each interval of a single phase's on and off command is time-symmetric about its midpoint in voltage, so its signed current deviation from its phase mean is antisymmetric. The conditional current averages are therefore I/2 in both on and off intervals in the lossless waveform. The full-cycle upper current average is `D I/2`, and the low-side drain-to-source average is `−(1−D) I/2`. For normalized endpoints aⱼ and bⱼ, the squared current contributes `hⱼ(aⱼ²+aⱼbⱼ+bⱼ²)/3`. The sum over on states gives `wH`, the sum over off states gives `wL`. Thus `IQH,rms=I√wH`, `IQL,rms=I√wL`, and `IL,rms=I√(wH+wL)` per leg. These segment integrals are exact for stiff, lossless switching levels.
|
| 50 |
+
|
| 51 |
+
The summed current ramps at 2fs with ideal `ΔiΣ = Vin min(D,1−D)|1−2D|/(fs Lc)`. At 50%, summed ripple cancels while each winding still ripples. Charge balance gives `IC,rms = ΔiΣ/√12`. The capacitor's ideal voltage ripple before ESR is `ΔiΣ/(16 fs Co)`. The finite-Co Simulator solves the coupled output dynamics and measures output ripple including ESR. Small winding/clock mismatch can reintroduce common-mode ripple near D=0.5.
|
| 52 |
+
|
| 53 |
+
Each off switch blocks approximately VIN in the ideal circuit. The ideal inductor voltages are `+(1−D)Vin` and `−D Vin`. Finite resistance creates modest offsets and the commutation bench may show model-dependent terminal excursions. The model does not supply hardware safe operating margins. High and low switches must exchange current without same-leg overlap or interrupting the inductive path. The generic bench uses ideal simultaneous commutation. Real positive-current CCM can freewheel through a low-side diode during dead time. This requires a device model including diode drop, reverse recovery and gate dynamics.
|
| 54 |
+
|
| 55 |
+
Positive-current CCM requires both current valleys to exceed zero. At zero valley the converter reaches the boundary. If a real controller turns off the synchronous lower switch at zero, a third interval with zero phase current produces DCM and a load-dependent conversion law. Forced synchronous operation can instead permit reverse current and remains continuous through zero. The delivered model bounds exclude both diode-emulated DCM and reverse-current operation.
|
| 56 |
+
|
| 57 |
+
### Loss, sizing and efficiency
|
| 58 |
+
|
| 59 |
+
```text
|
| 60 |
+
PFET = 2 I² (RH wH + RLswitch wL)
|
| 61 |
+
PDCR = 2 I² Rw (wH+wL)
|
| 62 |
+
PESR = ESRout ΔiΣ²/12
|
| 63 |
+
Req,power = (PFET+PDCR+PESR)/I²
|
| 64 |
+
Rd,voltage ≈ [Rw + D RH + (1−D) RLswitch]/2
|
| 65 |
+
Vdelivered ≈ D Vin − I Rd,voltage
|
| 66 |
+
```
|
| 67 |
+
|
| 68 |
+
The distinct voltage resistance comes from average inductor voltage and the conditional mean on/off currents. Equal upper and lower Ron gives exact mean drop `I(Rw+Ron)/2` in the symmetric linear model with negligible off-state and switch-transition currents. Unequal Ron perturbs the current waveform and the conditional means. Using ideal currents for the losses and first-order voltage drop avoids requiring a nonlinear iterative solve. The power resistance still includes all calculated RMS conduction and ESR. A separate switched-capacitor charge-sharing loss is inapplicable.
|
| 69 |
+
|
| 70 |
+
With equal technology and total width W, each `Ronᵢ = r₀/Wᵢ`, where the illustrative `r₀=0.602 Ω·mm`. Minimizing `Σ wᵢ/Wᵢ` at fixed W gives `Wᵢ = W√wᵢ/Σ√wᵢ`. In the existing per-unit convention `Rs=12 r₀/W` and `RFET/Rs=(Σ√wᵢ)²/12`. Four equal widths result at 50% with matched phases. At fixed W, the existing linear-width gate and effective Coss terms are independent of that distribution. The shared width search then minimizes total modeled power under the entered silicon and voltage-droop limits. Fixed component counts tie under the resource priorities. The normalized gain sweep holds `k` and `Vin/(L fs I)` constant, recalculates width proportions at each duty and omits points outside the CCM domain.
|
| 71 |
+
|
| 72 |
+
Gate power follows the illustrative width data `Pg = W qg VGS fs × events`, where `qg=2.51 pC/mm`. The simulator's automatic capacitance proxy matches one gate-charge event per switch per period at the entered Ron and voltage. With an explicit per-device capacitance, `Pg = 4 Cg VGS² fs`. Effective hard-switch Coss energy per unit width can be supplied to Analysis. For four identical linear capacitances with full rail swing and dissipative charge and discharge, each contributes `Coss Vin² fs`, giving `4 Coss Vin² fs` total. This is a limiting model for zero energy recovery. NGSpice integrates the optional four linear capacitances in the circuit and includes their effect in switch terminal power. For real devices, nonlinear energy and commutation timing need separate measurements.
|
| 73 |
+
|
| 74 |
+
```text
|
| 75 |
+
Pout = I Vdelivered
|
| 76 |
+
η = Pout/(Pout + I² Req,power + Pg + known Poss)
|
| 77 |
+
```
|
| 78 |
+
|
| 79 |
+
The model excludes core loss, saturation, AC winding resistance, switching overlap, gate-driver idle demand, input-capacitor losses, nonlinear Coss, and layout parasitics. Efficiency refers to the modeled load and gate supply. It does not establish hardware efficiency.
|
| 80 |
+
|
| 81 |
+
## Simulator domain and numerical method
|
| 82 |
+
|
| 83 |
+
| Controls | Default | Individual acceptance bounds |
|
| 84 |
+
| --- | --- | --- |
|
| 85 |
+
| Rail, current | 3 V, 1 A | 1.8–4 V, 0.25–4 A |
|
| 86 |
+
| Switching frequency, duty | 2 MHz, 0.5 | 0.8–4 MHz, 0.25–0.75 |
|
| 87 |
+
| Per-winding self-inductance, inverse coupling, DCR | 1000 nH, 0.6, 4 mΩ | 300–2500 nH, 0–0.85, 1–40 mΩ |
|
| 88 |
+
| Upper and lower switch Ron | 12 mΩ, lower follows upper | 4–60 mΩ, each set independently |
|
| 89 |
+
| Cout, ESR | 47 µF, 5 mΩ | 10–100 µF, 0.5–40 mΩ |
|
| 90 |
+
| Gate level, effective gate capacitance | 3.3 V, automatic | 2.5–4.5 V, 0–100 pF |
|
| 91 |
+
| Linear Coss per device | 0 pF | 0–30 pF |
|
| 92 |
+
| Run duration and refined max-step ceiling | Automatic | 20–1000 µs and 100–3000 ps when set |
|
| 93 |
+
| Single parameter sweep | Off | 2–15 evenly spaced points |
|
| 94 |
+
|
| 95 |
+
Each submitted combination must pass the ideal valley screen, have positive output headroom, cover at least 24 periods, and fit the shared per-case/job interval budgets. The default integrates for six estimated common-mode time constants, with a 48-period minimum. The coarse maximum step is T/240 or twice the entered refined-step ceiling, whichever is smaller. The entered values jointly affect the model. Each trace is screened for positive measured valleys, periodic voltage and energy balance, gate duty and overlap, and convergence at half the maximum step. The bench uses a constant-current sink. Configuration ranges are admissibility bounds, with qualified witnesses in the comparison and sweep tables. Cases that fail a measured check surface diagnostics.
|
| 96 |
+
|
| 97 |
+
The deck initializes both winding currents at the calculated lossless cycle phase and Cout near the DC equilibrium to reduce settling time. These values define the initial condition of a steady-state validation, with no claim about startup. Zero-volt sensors measure channel current without inserting a branch impedance. Off resistance is 1 GΩ. Ideal complementary commands have a finite control edge of T/10,000 for transient event handling; this sets the command edge, while the channel law still switches at the midpoint. Gear integration suppresses trapezoidal ringing at the ideal switch events. Coss=0 removes the corresponding capacitors. No added switching bias, snubber, freewheel diode or other circuit stabilization is used. Waveforms give all four VGS commands, all switch currents, switch-node and winding voltages, individual winding currents and their sum and difference, output capacitor current, both port voltages and the power boundary quantities.
|
| 98 |
+
|
| 99 |
+
## Verification and implementation
|
| 100 |
+
|
| 101 |
+
The [independent numerical script](verify_model.py) integrates sampled winding flux via the 2×2 inductance matrix and compares against the production state-segment formulas. It verifies eight points for KVL, phase-current KCL, capacitor balance, ideal conversion, RMS weights, loss contributions and optimal device area. It includes k=0, an ideal k=0.95 sensitivity point, a CCM-boundary witness and cases on both sides of 50%.
|
| 102 |
+
|
| 103 |
+
The [NGSpice comparison](verify_ngspice.py) measures the physical bench at eight points against the independent flux solution, including measured current sharing, cap RMS, DCR, individual channel losses where Coss is zero and the optional linear Coss case. The [feature-parity record](parity.md) links the Chrome workflows, tagged regressions, frontend cache check and downloaded evidence.
|
| 104 |
+
|
| 105 |
+
| Case | Modeled / measured conduction Req (mΩ) | Measured output (V) | Measured efficiency incl. gate |
|
| 106 |
+
| --- | ---: | ---: | ---: |
|
| 107 |
+
| Nominal 3 V, 1 A, duty 0.50 | 8.1465 / 8.1465 | 1.492000 | 99.237% |
|
| 108 |
+
| Duty 0.30 | 8.3143 / 8.3146 | 0.891999 | 98.711% |
|
| 109 |
+
| Duty 0.70 | 8.3143 / 8.3146 | 2.091999 | 99.446% |
|
| 110 |
+
| Uncoupled limit | 8.3750 / 8.3750 | 1.492000 | 99.222% |
|
| 111 |
+
| k=0.85, duty 0.52 | 8.1490 / 8.1490 | 1.551999 | 99.267% |
|
| 112 |
+
| 1.8 V, 0.8 A, duty 0.36 | 8.0286 / 8.0287 | 0.641600 | 98.000% |
|
| 113 |
+
| 4 V, 3 A, duty 0.69 | 16.0263 / 16.0259 | 2.712000 | 98.227% |
|
| 114 |
+
| 3.18 V, 1.42 A, duty 0.61 with Coss | 8.5430 / 8.5426 | 1.927773 | 99.296% |
|
| 115 |
+
|
| 116 |
+
The final row subtracts the modeled hard-switch Coss energy from measured terminal dissipation to compare conduction. Across these eight matched-model cases the largest differences were 2.53 µV in delivered voltage, 0.44 µΩ in conduction-equivalent resistance and 0.00375 percentage points in efficiency. Calculated nominal winding ripple was 0.234375 A peak-to-peak and NGSpice measured 0.234372 A. Nominal voltage droop used 8.0000 mΩ and the measured stage-energy residual was about 1.9 µW. Reproducing the edited width and effective gate/Coss inputs across both tools is required for a like-for-like efficiency comparison. The benchmark numbers use measured stage input and separate gate energy.
|
| 117 |
+
|
| 118 |
+
The implementation changes the browser catalog, recommendation, analysis, rendering and handoff code, preserves the existing 4:1 engine and adds a preset module, a documented deck, contracts and generated starter/art. The distributable source archive includes the matching bundle inputs and updated build checks. [Minjie review items](../minjie_confirmation_list.md#switched-inductor-review)
|
| 119 |
+
|
| 120 |
+
## Change inventory
|
| 121 |
+
|
| 122 |
+
| Area | Added or updated files |
|
| 123 |
+
| --- | --- |
|
| 124 |
+
| Analytical model and UI | Added `static/compare/switched-inductor.js`. Updated `static/compare/{app.js,engine.js,index.html,models-data.json,recommend.js,scoreboard.js,style.css,technology.js}`. |
|
| 125 |
+
| Gallery and workbench | Updated `static/{gallery.js,index.html,pe.js,simulator.js}` for registration, cache and nominal-family handoff. |
|
| 126 |
+
| Circuit and package assets | Added `static/compare/assets/{si2.svg,si2-candidate.svg}`, `static/starters/{si2.icproj.json,si2.sp}` and `static/testbenches/si2-preset.json`. Updated `static/starters/index.json` and `static/openpels-source.zip`. |
|
| 127 |
+
| Simulator | Added `si2/{__init__.py,preset.py,preset_contract.json,switched-inductor.cir}`. Updated `simulator_service.py`, `simulator_frame.py`, `simulator_bridge.js` and `Dockerfile`. Reused the tested trace reader via a column-count argument in `rsc2/preset.py`. The resonant model note moved into `rsc2/preset_contract.json` and its distributed JSON. |
|
| 128 |
+
| Generation and testing | Added `build_starter.mjs`, `update_source.py`, `verify_model.py`, `verify_ngspice.py`, `verify_browser.mjs`, `verify_sweeps.mjs` and `verify_cache.mjs` under this report directory. Updated the prior SP-SC and resonant browser suites for the Gallery count. |
|
| 129 |
+
| Documentation | Added this report and `parity.md`. Updated the root README, topology inventory, Analysis and Simulator matrices, feature checklist and Minjie review log. |
|
| 130 |
+
|
| 131 |
+
## Reproduction
|
| 132 |
+
|
| 133 |
+
```sh
|
| 134 |
+
./run-local.sh
|
| 135 |
+
.venv/bin/python docs/topology/2to1_switched_inductor/verify_model.py
|
| 136 |
+
.venv/bin/python docs/topology/2to1_switched_inductor/verify_ngspice.py
|
| 137 |
+
node docs/topology/2to1_switched_inductor/verify_browser.mjs
|
| 138 |
+
node docs/topology/2to1_switched_inductor/verify_sweeps.mjs
|
| 139 |
+
```
|
| 140 |
+
|
| 141 |
+
Run the development build and test commands from the repository root. The shell launcher serves at port 8765. The feature-parity record documents remaining qualifications and the repository milestone.
|
docs/topology/2to1_switched_inductor/build_starter.mjs
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import assert from 'node:assert/strict';
|
| 2 |
+
import {readFileSync, writeFileSync} from 'node:fs';
|
| 3 |
+
import {resolve} from 'node:path';
|
| 4 |
+
import {pathToFileURL} from 'node:url';
|
| 5 |
+
|
| 6 |
+
const packageFile = name => pathToFileURL(resolve('local-source/openpels/packages',name,'dist/index.js')).href;
|
| 7 |
+
const {parseProject,serializeCompactProject} = await import(packageFile('project-protocol'));
|
| 8 |
+
const {createDesignNetlistExport} = await import(packageFile('netlist'));
|
| 9 |
+
const raw = JSON.parse(readFileSync(process.argv[2],'utf8'));
|
| 10 |
+
assert.equal(raw.schemaVersion,87);
|
| 11 |
+
raw.schemaVersion=86;
|
| 12 |
+
const project=parseProject(JSON.stringify(raw));
|
| 13 |
+
project.documents=project.documents.filter(d=>!d.name.startsWith('DC Averaged'));
|
| 14 |
+
const top=project.documents.find(d=>d.id===project.topDocumentId);
|
| 15 |
+
const device=(d,ref)=>d.instances.find(i=>i.reference===ref);
|
| 16 |
+
const netAt=(d,instance,pinName)=>d.nets.find(n=>n.terminals.some(t=>t.instanceId===instance.id&&t.pinName===pinName));
|
| 17 |
+
const connect=(name,destination,position,rotation,net,direction)=>{
|
| 18 |
+
const id='si2-port-'+name, pin={instanceId:id,pinName:'P'};
|
| 19 |
+
top.instances.push({id,symbolId:'port',placement:{position,rotation,mirror:'none'}});
|
| 20 |
+
top.netlist.terminals.push({id:'si2-terminal-'+name,netId:net.id,name,direction,interfaceInstanceIds:[id]});
|
| 21 |
+
net.terminals.push(pin);
|
| 22 |
+
top.routes.push({id:'si2-port-route-'+name,netId:net.id,start:{kind:'terminal',...pin},
|
| 23 |
+
legs:[{id:'si2-port-end-'+name,mode:'manual',to:{kind:'endpoint',endpoint:destination}}]});
|
| 24 |
+
};
|
| 25 |
+
for(const [reference,name,x,y] of [['M1','A',350,140],['M2','ABAR',350,280],
|
| 26 |
+
['M5','B',460,140],['M6','BBAR',460,280]]) {
|
| 27 |
+
const mos=device(top,reference);
|
| 28 |
+
const gate={kind:'terminal',instanceId:mos.id,pinName:'G'};
|
| 29 |
+
const net={id:'si2-gate-'+name,terminals:[{instanceId:mos.id,pinName:'G'}]};
|
| 30 |
+
top.nets.push(net);
|
| 31 |
+
connect(name,gate,{x,y},0,net,'input');
|
| 32 |
+
}
|
| 33 |
+
const output=netAt(top,device(top,'COUT'),'1');
|
| 34 |
+
const junction=top.junctions.find(j=>j.id==='junction-ui-28');
|
| 35 |
+
assert.ok(junction);
|
| 36 |
+
connect('VOUT',{kind:'junction',junctionId:junction.id},{x:800,y:junction.position.y},180,output,'output');
|
| 37 |
+
const defaults={L1:'1u',L2:'1u',RL1:'4m',RL2:'4m',COUT:'47u'};
|
| 38 |
+
for(const d of project.documents) {
|
| 39 |
+
d.inductorCouplings=[{id:'si2-coupling', name:'K1', k:'.6',
|
| 40 |
+
members:['L1','L2'].map(ref=>({instanceId:device(d,ref).id,dotPin:'1'}))}];
|
| 41 |
+
// The physical coupling object now supplies the dots and core lines.
|
| 42 |
+
d.drafting.objects=d.drafting.objects.filter(o=>!/^(circle-[78]|construction-9)/.test(o.id));
|
| 43 |
+
for(const [ref,value] of Object.entries(defaults)) device(d,ref).netlist.parameters.value=value;
|
| 44 |
+
device(d,'IOUT').netlist.parameters.dc='1';
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
const saved=serializeCompactProject(project);
|
| 48 |
+
const reloaded=parseProject(saved);
|
| 49 |
+
assert.equal(reloaded.documents.length,9);
|
| 50 |
+
assert.equal(reloaded.documents[0].inductorCouplings[0].k,'.6');
|
| 51 |
+
const result=createDesignNetlistExport(reloaded);
|
| 52 |
+
assert.equal(result.status,'ready',JSON.stringify(result.diagnostics.filter(x=>x.severity==='error')));
|
| 53 |
+
assert.match(result.file.text,/K1 L1 L2 \.6/i);
|
| 54 |
+
assert.match(result.file.text,/L1 \S+ \S+ 1u/i);
|
| 55 |
+
assert.deepEqual(result,createDesignNetlistExport(parseProject(serializeCompactProject(reloaded))));
|
| 56 |
+
writeFileSync('static/starters/si2.icproj.json',saved);
|
| 57 |
+
writeFileSync('static/starters/si2.sp',result.file.text);
|
| 58 |
+
console.log('SI starter verified: top cell, eight switching drawings, four gate ports, winding dots and SPICE roundtrip.');
|
docs/topology/2to1_switched_inductor/parity.md
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Switched inductor feature parity
|
| 2 |
+
|
| 3 |
+
XFLY6S at `local-baseline-v1.0` is the functional reference. SP-SC and resonant SC are the implementation references for a 2:1 Gallery selection, focused sizing, editable Canvas starter, and generic NGSpice jobs. The applicable domain is the symmetric inverse-coupled synchronous buck described in the [development report](README.md). Evidence uses Chrome at port 8765. The shared baseline scripts check the original Analysis exports and run the original NGSpice presets.
|
| 4 |
+
|
| 5 |
+
## Entry point and schematic checklist
|
| 6 |
+
|
| 7 |
+
- [x] Gallery exposes SI in the six-card 2:1 family and excludes it from the 4:1 filter. Nine cards appear across families. Analysis opens with 3 V, 1 A and 50% duty.
|
| 8 |
+
- [x] **Edit schematic** opens the local four-device, two-winding power stage. The native project includes eight state drawings. Chrome adds and undoes a local part, reloads saved state, and exports SVG and structural SPICE. The source checker verifies the port and coupling instance and the native project's netlist round trip.
|
| 9 |
+
- [x] The source archive builds the matching front end and starter. Cache-enabled Chrome proves normal refresh of an existing tab from the previous frontend and a fresh tab agrees.
|
| 10 |
+
- [x] Derivation, parameter bounds, measured results, nonidealities and Minjie review items are published. [Development report](README.md) · [Minjie review](../minjie_confirmation_list.md#switched-inductor-review)
|
| 11 |
+
|
| 12 |
+
## Analysis matrix
|
| 13 |
+
|
| 14 |
+
The [Chrome workflow](verify_browser.mjs) exercises the design form, workbench, images and exports. The [numerical model check](verify_model.py) uses independent sampled flux integration. The [baseline Analysis script](../2to1_switching_capacitors/integration/verify_analysis_parity.mjs) verifies XFLY6S controls and exports against the tag, the SP-SC path, and original 4:1 design exports.
|
| 15 |
+
|
| 16 |
+
| Feature or control | Disposition and evidence |
|
| 17 |
+
| --- | --- |
|
| 18 |
+
| Gallery handoff | Pass. The SI card opens the focused 2:1 model with 3 V, 1 A, 0.5 duty and hidden standalone ratio controls. |
|
| 19 |
+
| Family intro and scope | Pass. The design identifies duty-regulated positive-current CCM and the nominal 2:1 point. |
|
| 20 |
+
| Output voltage and current | Pass. Direct Vin and duty determine ideal Vout. Chrome edits Vin, Iout and duty together, then checks the requested and delivered voltage in the design JSON and the Simulator handoff. |
|
| 21 |
+
| Derived input voltage | N/A for direct entry from fixed Vout × ratio. SI regulates duty at an independent Vin. Pass for ideal target Vout = D × Vin. |
|
| 22 |
+
| Load resistance and requested power | Pass. The summary and export derive both from D × Vin and entered load. Delivered power uses the lossy output. |
|
| 23 |
+
| Switching frequency | Pass. 2 MHz default and 2.3 MHz edited, with checked ripple and gate-power calculations. |
|
| 24 |
+
| Silicon budget selector | Pass. Default 200 mm maximum width and alternate die-area sizing. |
|
| 25 |
+
| Die area | Pass. Edited to 1.1 mm² in area mode and exported. |
|
| 26 |
+
| Usable transistor fraction | Pass. 1.1 disables the design export, 0.46 restores it. |
|
| 27 |
+
| Ron × area | Pass. 0.93 mΩ·mm² edited and processed in budget sizing. |
|
| 28 |
+
| Flying or clamp capacitance | N/A to this graph. Pass for the applicable output capacitor, edited to 52 µF and checked in the device report. |
|
| 29 |
+
| Main capacitor ESR | Pass. Edited 6.2 mΩ and included in outgoing-ripple RMS loss. |
|
| 30 |
+
| Maximum capacitor count | Pass for one output capacitor. Limit 0 excludes the design. |
|
| 31 |
+
| Maximum estimated droop | Pass. Zero droop limit excludes the design. Mean-current winding balance supplies the loss-dependent constraint. |
|
| 32 |
+
| Priority and objective | Pass. Loss, capacitor-count and winding-count priorities verified. Physical counts tie for this single circuit. |
|
| 33 |
+
| Winding count and DCR | Pass. Count 1 excludes the pair. Per-winding DCR contributes through winding RMS in the edited design. |
|
| 34 |
+
| Leakage Lk, magnetizing Lm | N/A as independently entered coordinates alongside equivalent self-L and k. Both modes are determined by L(1−k) and L(1+k). Pass for self-L and inverse coupling. |
|
| 35 |
+
| Phase ripple and cancellation | Pass. Maximum ripple 5% excludes the nominal winding design. A low-current case fails the valley screen. At 50% the ideal output ripple cancels while winding ripple stays finite. |
|
| 36 |
+
| Update, validation and exclusions | Pass. Live and explicit recalculation, feasible/infeasible cases, disabled invalid export, and corrected inputs verified. |
|
| 37 |
+
| Loss Lineup / Circuit cards | Pass. Both views render the same physical design and use the source schematic. |
|
| 38 |
+
| Candidate design and preview | Pass. Qualified/excluded panels, rank, circuit, power and resistance figures, and inspect interaction. |
|
| 39 |
+
| Width sizing | Pass. Same total-width optimizer and alternate budgets. The advanced map and JSON expose four RMS-optimal widths, unequal at 0.61 duty. |
|
| 40 |
+
| Equivalent resistance and droop | Pass. Browser validates separate power and voltage resistances and their roles in Vout and loss. Independent NGSpice tests check both. |
|
| 41 |
+
| Switch conduction and capacitor ESR | Pass. Separate Loss Lineup terms. The independent script and bench agree on channel loss and capacitor current RMS. |
|
| 42 |
+
| Winding DCR | Pass. Separate winding term and independent DCR verification. |
|
| 43 |
+
| Charging increment | N/A. There is no flying charge-transfer capacitor. Output-cap ESR is an RMS loss. No increment is added to the total. |
|
| 44 |
+
| Gate-driving loss | Pass. Edited swing and events affect modeled loss. The gate energy calculation is verified in the export. |
|
| 45 |
+
| Coss, core, ripple correction | Pass for blank and entered effective Coss and finite winding-ripple loss. Core and dead-time effects need data outside this circuit model. |
|
| 46 |
+
| Total, mix, score and pros/tradeoffs | Pass. Serialized displayed powers sum to total. The focused singleton has no relative score. |
|
| 47 |
+
| Efficiency | Pass. Design export reconciles delivered and total modeled power. Independent NGSpice cases use measured input, output and the gate estimate. |
|
| 48 |
+
| Inspect action | Pass. Opens the workbench and restores the linked loss weights. |
|
| 49 |
+
| Workbench disclosure, status and schematic | Pass. Source image, positive-current domain, model and RMS derivation are available. |
|
| 50 |
+
| Comparison toggles | Pass. Add and remove the legacy two-phase coupled buck card while retaining the SI physical design. |
|
| 51 |
+
| Equivalent circuit, coefficients and formulas | Pass. Duty-dependent gain, normalized RMS and gated shunt terms. Legacy RC charging terms have no application to SI. |
|
| 52 |
+
| Die allocation map | Pass. Four labeled blocks and exact normalized width fractions in physical export. |
|
| 53 |
+
| Normalized weights, Apply and Reset | Pass. Manual ESR/DCR, L-current scale and coupling, active weights in CSV, Reset and return to linked sizing. Legacy ρQ affects flying-cap comparison curves only. |
|
| 54 |
+
| Effective-resistance plot, legend and cursor | Pass. Gain sweep, cursor and tooltip on the duty-dependent SI curve. Positive-current domain truncates invalid branches. |
|
| 55 |
+
| Model conditions and finite-RC demonstration | Pass for the SI scope and the existing independent generic demonstration. The finite-RC event model is inapplicable to the buck RMS derivation. |
|
| 56 |
+
| 180 nm frequency, width, capacitance and ESR | Pass. Design inputs and sized width populate the technology report. Duplicate inputs are hidden in focused sizing so the two ledgers stay synchronized. |
|
| 57 |
+
| 180 nm winding resistance | Pass. The physical result reads DCR from Design Constraints. |
|
| 58 |
+
| VGS and charge events | Pass. 3.55 V and 1.1 weighted events per period exercised and reconciled. |
|
| 59 |
+
| Effective Coss energy | Pass. 1.3 pJ/mm/cycle included once in exported power and efficiency. Blank displays unknown. |
|
| 60 |
+
| Technology constants and table | Pass. Preserves the illustrative device FOM, component/shunt columns and provenance. |
|
| 61 |
+
| Design JSON | Pass. Inputs, eligibility, optimized widths, absolute and normalized losses, voltage droop, efficiency and physical current and stress estimates. |
|
| 62 |
+
| Technology JSON | Pass. Four devices, resistance components, gate and Coss loss terms match the physical design. |
|
| 63 |
+
| Per-unit CSV | Pass. Duty, coupling and current scale accompany existing weights and coefficients. Original exports are unchanged. |
|
| 64 |
+
| Equivalent circuit SVG | Pass. Browser downloads the SI loss schematic with the RMS-ledger interpretation. |
|
| 65 |
+
| Upload, local review, operating notes and connection | Pass for the preserved local workflow from the tagged Analysis regression. Third-party inference is outside this task. A flat-current state table alone cannot recover the coupled, piecewise-affine winding ripple. |
|
| 66 |
+
|
| 67 |
+
## Simulator matrix
|
| 68 |
+
|
| 69 |
+
The [Chrome workflow](verify_browser.mjs) verifies the nominal path, simultaneous edits, four duty sweep points, downloads and recovery. The [sweep suite](verify_sweeps.mjs) exercised all 16 axes against the actual service. All 32 sweep points passed. The test checked the 16 rendered charts and CSV files, deck hashes and parameter bindings. The [tagged comparison](../2to1_switching_capacitors/integration/verify_simulator_parity.mjs) checks the original XFLY6S, XFLY8S and C3L measurements and timing controls.
|
| 70 |
+
|
| 71 |
+
| Feature or control | Disposition and evidence |
|
| 72 |
+
| --- | --- |
|
| 73 |
+
| Page layout and sections | Pass. Parameters, schematic, summary, plot, table and sweep retain the existing form and render with SI data. |
|
| 74 |
+
| Topology selector and schematic | Pass. Gallery enters the SI Simulator with its SVG and allows a preset selection. |
|
| 75 |
+
| Input voltage | Pass. 3 V default, 3.18 V simultaneous edit and continuous rail sweep. |
|
| 76 |
+
| Output voltage target | Pass. Duty is a direct converter command and the ideal output follows D × Vin. Loaded output is measured separately. Reverse-solved fixed-ratio target and legacy calibrated 4:1 duty are inapplicable. |
|
| 77 |
+
| Load current and model | Pass. Constant-current load, continuous edits and sweep. A target-derived resistor would change the steady-state definition of this validated bench. |
|
| 78 |
+
| Frequency | Pass. Frequency drives both commands and period bounds, verified in downloaded decks and sweep. |
|
| 79 |
+
| Flying capacitance and ESR | N/A to the graph. Pass for output capacitance and ESR, each swept and bound to the executed deck. |
|
| 80 |
+
| Switch Ron and device area | Pass. Upper and lower linear switch Ron verified independently. Physical device area optimization stays in Analysis. |
|
| 81 |
+
| Gate voltage and gate capacitance | Pass. Direct ideal VGS waveform, automatic gate FOM or explicit capacitance, sweeps and exported settings. |
|
| 82 |
+
| Coss and Cout | Pass. Linear Coss contributes to terminal dissipation and energy storage; Cout changes ripple. Separate browser sweep axes. |
|
| 83 |
+
| Coupling, self-inductance and DCR | Pass. Both independent winding coordinates, DCR and actual dot orientation checked. Sweeps bind values into the coupled deck. |
|
| 84 |
+
| Stop time and max step | Pass. Automatic or entered values. Both sweep axes verify measured duration and refined maximum-step ceiling. |
|
| 85 |
+
| Gallery, Analysis and Simulator handoff | Pass. SI keeps nominal family, independent Vin, load and duty in both directions. |
|
| 86 |
+
| Action, status and busy handling | Pass. Asynchronous job ticket, disabled Run during work, progress/status and success plot. |
|
| 87 |
+
| Sweep interaction and progress | Pass. Opt-in single-axis sweeps, editable start/stop/count, clear payload errors. Fixed legacy percentage sweeps have no physical requirement for this reference. |
|
| 88 |
+
| Efficiency curves | Pass. Stage-only and gate-inclusive plot, measured results table and CSV agree. |
|
| 89 |
+
| Waveforms | Pass. Shifted VGS, switch nodes, winding current and voltage, four channel currents, port voltages, input current and output-cap current. PNG decode and waveform download exercised. Downloaded commands verify AB=10/01 at 50%, AB=00/10/01 at 37% and AB=11/10/01 at 61%, with complementary commands in each leg. |
|
| 90 |
+
| Winding current sum and difference | Pass. Plot and exported traces include both channels and derived sum/difference. Ideal cancellation and finite winding ripple observed at 50%. |
|
| 91 |
+
| Summary cards and measurement table | Pass. Ideal and measured output, model efficiency, duty, gate power, winding RMS and ripple, capacitor RMS, stress and energy balance. |
|
| 92 |
+
| Power boundaries | Pass. Stage input minus load, measured terminal/DCR/ESR dissipation, stored-energy change and separate gate energy. |
|
| 93 |
+
| Artifacts | Pass. Browser downloads executed decks, waveform CSV, job JSON, log, measurements, plot and sweep CSV. Deck hashes are recomputed against result records. |
|
| 94 |
+
| Validation, queue, errors | Pass. A nonpositive ideal current valley is rejected before execution. Corrected joint settings run successfully. Steady state and convergence screens are covered by the independent comparison. |
|
| 95 |
+
| Asset reload | Pass. Cache-enabled prior build to live same-tab reload, asset bodies and no-store headers verified, plus a fresh-tab check and Simulator selection. |
|
| 96 |
+
|
| 97 |
+
## Reproduction
|
| 98 |
+
|
| 99 |
+
With the application serving on port 8765, run the two browser scripts and the baseline scripts linked above. The additional [cache script](verify_cache.mjs) expects the port free and an extracted previous build in `SI_CACHE_DIR/previous/static`. It launches both builds successively and uses one Chrome page and a fresh check. The previous static files for the cached visit came from commit `8382c2b`.
|
| 100 |
+
|
| 101 |
+
The qualification applies to matched windings, positive-current CCM and the generic switch model documented in the development report. Hardware startup, diode-emulated DCM, forced reverse-current operation, nonlinear device behavior and closed-loop regulation remain outside this model.
|
docs/topology/2to1_switched_inductor/update_source.py
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Update the corresponding-source archive from the verified runtime files."""
|
| 2 |
+
from pathlib import Path
|
| 3 |
+
import json
|
| 4 |
+
from zipfile import ZIP_DEFLATED, ZipFile
|
| 5 |
+
|
| 6 |
+
ROOT = Path(__file__).resolve().parents[3]
|
| 7 |
+
STATIC = ROOT/'static'
|
| 8 |
+
SCRIPTS = 'openpels/scripts/openpels/'
|
| 9 |
+
ANALYSIS = 'openpels-analysis/static/'
|
| 10 |
+
ARCHIVE = STATIC/'openpels-source.zip'
|
| 11 |
+
WORK = ROOT/'.openpels-runtime'
|
| 12 |
+
WORK.mkdir(exist_ok=True)
|
| 13 |
+
NEXT = WORK/'si2-source.zip'
|
| 14 |
+
|
| 15 |
+
updates = {}
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
def copy(target, source):
|
| 19 |
+
updates[target] = source.read_bytes()
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
def write(target, text):
|
| 23 |
+
updates[target] = text.encode()
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
with ZipFile(ARCHIVE) as source:
|
| 27 |
+
# The packager adds the embed bridge, embedded CSS and local header links.
|
| 28 |
+
app, bridge = (STATIC/'compare/app.js').read_text().split(
|
| 29 |
+
"// Appended inside the preserved analytical UI's scope.", 1)
|
| 30 |
+
write(ANALYSIS+'app.js', app.replace('picker();await update();announceAnalysisReady()}catch',
|
| 31 |
+
'picker();await update()}catch').rstrip()+'\n')
|
| 32 |
+
write(SCRIPTS+'analysis_bridge.js', "// Appended inside the preserved analytical UI's scope."+bridge)
|
| 33 |
+
for name in ('engine.js','models-data.json','recommend.js','scoreboard.js','technology.js',
|
| 34 |
+
'switched-inductor.js','assets/si2.svg','assets/si2-candidate.svg'):
|
| 35 |
+
copy(ANALYSIS+name, STATIC/'compare'/name)
|
| 36 |
+
index = (STATIC/'compare/index.html').read_text()
|
| 37 |
+
header = source.read(ANALYSIS+'index.html').decode().split('<header>',1)[1].split('</header>',1)[0]
|
| 38 |
+
write(ANALYSIS+'index.html',index.split('<header>',1)[0]+'<header>'+header+'</header>'+index.split('</header>',1)[1])
|
| 39 |
+
css = (STATIC/'compare/style.css').read_text().split('\n/* Embedded OpenPELS comparison workspace. */',1)
|
| 40 |
+
write(ANALYSIS+'style.css',css[0]+'\n' if not css[0].endswith('\n') else css[0])
|
| 41 |
+
for name in ('index.html','pe.js','gallery.js','simulator.js'):
|
| 42 |
+
copy(SCRIPTS+name, STATIC/name)
|
| 43 |
+
for name in ('Dockerfile','simulator_frame.py','simulator_bridge.js','simulator_service.py',
|
| 44 |
+
'rsc2/preset.py','rsc2/preset_contract.json','si2/__init__.py','si2/preset.py',
|
| 45 |
+
'si2/preset_contract.json','si2/switched-inductor.cir'):
|
| 46 |
+
copy(SCRIPTS+name,ROOT/name)
|
| 47 |
+
for name in ('si2.icproj.json','si2.sp'):
|
| 48 |
+
copy(SCRIPTS+'si2/'+name,STATIC/'starters'/name)
|
| 49 |
+
package = source.read(SCRIPTS+'package-site.py').decode().replace("('sp2','rsc2')","('sp2','rsc2','si2')")
|
| 50 |
+
write(SCRIPTS+'package-site.py',package)
|
| 51 |
+
generator = source.read(SCRIPTS+'generate-starters.mjs').decode()
|
| 52 |
+
marker = 'await writeFile(new URL("index.json", out), JSON.stringify(manifest, null, 2));'
|
| 53 |
+
if 'const si2 = ' not in generator:
|
| 54 |
+
starter = json.loads((STATIC/'starters/index.json').read_text())[-1]
|
| 55 |
+
generator = generator.replace(marker,'''
|
| 56 |
+
const si2 = new URL("./si2/", import.meta.url);
|
| 57 |
+
for (const file of ["si2.icproj.json","si2.sp"])
|
| 58 |
+
await copyFile(new URL(file,si2),new URL(file,out));
|
| 59 |
+
manifest.push('''+json.dumps(starter,indent=2,ensure_ascii=False)+''');
|
| 60 |
+
'''+marker)
|
| 61 |
+
write(SCRIPTS+'generate-starters.mjs',generator)
|
| 62 |
+
checker = source.read(SCRIPTS+'check-starters.mjs').decode()
|
| 63 |
+
if 'const switchedInductor = ' not in checker:
|
| 64 |
+
checker += '''
|
| 65 |
+
const switchedInductor = parseProject(await readFile(
|
| 66 |
+
new URL("../../apps/editor/dist-pe/starters/si2.icproj.json",import.meta.url),"utf8",
|
| 67 |
+
));
|
| 68 |
+
assert.equal(switchedInductor.documents.length,9);
|
| 69 |
+
assert.equal(switchedInductor.documents[0].inductorCouplings[0].k,".6");
|
| 70 |
+
const switchedInductorNetlist = createDesignNetlistExport(switchedInductor);
|
| 71 |
+
assert.equal(switchedInductorNetlist.status,"ready");
|
| 72 |
+
assert.equal(switchedInductorNetlist.file.text,await readFile(
|
| 73 |
+
new URL("../../apps/editor/dist-pe/starters/si2.sp",import.meta.url),"utf8"));
|
| 74 |
+
assert.deepEqual(switchedInductorNetlist,createDesignNetlistExport(
|
| 75 |
+
parseProject(serializeCompactProject(switchedInductor))));
|
| 76 |
+
console.log("si2: full CCM state drawings and structural SPICE roundtrip verified");
|
| 77 |
+
'''
|
| 78 |
+
write(SCRIPTS+'check-starters.mjs',checker)
|
| 79 |
+
gallery = source.read(SCRIPTS+'gallery.browser.mjs').decode()
|
| 80 |
+
if '[2, 5]' in gallery:
|
| 81 |
+
gallery = gallery.replace('.count(), 8)', '.count(), 9)').replace('[2, 5]', '[2, 6]')
|
| 82 |
+
gallery = gallery.replace('locator(".topology-tile").count(), 5)', 'locator(".topology-tile").count(), 6)')
|
| 83 |
+
write(SCRIPTS+'gallery.browser.mjs',gallery)
|
| 84 |
+
tests = source.read(SCRIPTS+'test_simulator.py').decode().replace("('sp2','rsc2')","('sp2','rsc2','si2')")
|
| 85 |
+
write(SCRIPTS+'test_simulator.py',tests)
|
| 86 |
+
with ZipFile(NEXT,'w',ZIP_DEFLATED) as target:
|
| 87 |
+
for entry in source.infolist():
|
| 88 |
+
target.writestr(entry,updates.pop(entry.filename,source.read(entry)))
|
| 89 |
+
for name,value in updates.items():
|
| 90 |
+
target.writestr(name,value)
|
| 91 |
+
NEXT.replace(ARCHIVE)
|
docs/topology/2to1_switched_inductor/verify_browser.mjs
ADDED
|
@@ -0,0 +1,250 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import assert from 'node:assert/strict';
|
| 2 |
+
import {createHash} from 'node:crypto';
|
| 3 |
+
import {readFile} from 'node:fs/promises';
|
| 4 |
+
import {createRequire} from 'node:module';
|
| 5 |
+
import {resolve} from 'node:path';
|
| 6 |
+
|
| 7 |
+
const require=createRequire(resolve(process.env.OPENPELS_SOURCE??'local-source/openpels','package.json'));
|
| 8 |
+
const {chromium,expect:baseExpect}=require('@playwright/test');
|
| 9 |
+
const expect=baseExpect.configure({timeout:15000});
|
| 10 |
+
const base=process.env.OPENPELS_URL??'http://127.0.0.1:8765';
|
| 11 |
+
const browser=await chromium.launch({channel:'chrome',headless:true,args:[
|
| 12 |
+
'--host-resolver-rules=MAP fonts.googleapis.com ~NOTFOUND, MAP fonts.gstatic.com ~NOTFOUND']});
|
| 13 |
+
const page=await browser.newPage({viewport:{width:1600,height:1200}});
|
| 14 |
+
const analysis=page.frameLocator('#comparison');
|
| 15 |
+
const sim=page.frameLocator('#simulator');
|
| 16 |
+
const editor=page.frameLocator('#editor');
|
| 17 |
+
const design=id=>analysis.locator('#design-'+id);
|
| 18 |
+
const setting=id=>sim.locator('#sp2-'+id);
|
| 19 |
+
const errors=[];
|
| 20 |
+
page.on('pageerror', e=>errors.push(e.message));
|
| 21 |
+
const near=(a,b,tolerance=1e-9)=>assert(Math.abs(a-b)<tolerance,`${a} vs ${b}`);
|
| 22 |
+
async function open(frame,id) {
|
| 23 |
+
const node=frame.locator(id);
|
| 24 |
+
if (!(await node.evaluate(el=>el.open))) await node.locator('summary').first().click();
|
| 25 |
+
}
|
| 26 |
+
async function download(locator) {
|
| 27 |
+
const [file]=await Promise.all([page.waitForEvent('download'),locator.click()]);
|
| 28 |
+
return readFile(await file.path());
|
| 29 |
+
}
|
| 30 |
+
const json=async locator=>JSON.parse(await download(locator));
|
| 31 |
+
const artifact=name=>download(sim.locator(`[download="${name}"]`));
|
| 32 |
+
function switchingStates(csv, gateVoltage) {
|
| 33 |
+
const [header,...rows]=csv.toString().trim().split('\n');
|
| 34 |
+
const columns=header.split(',');
|
| 35 |
+
const indices=['vgs_q1_v','vgs_q2_v','vgs_q3_v','vgs_q4_v'].map(name=>columns.indexOf(name));
|
| 36 |
+
for (const name of ['winding_sum_a','winding_delta_a','vl_a_v','vl_b_v','icap_a'])
|
| 37 |
+
assert(columns.includes(name));
|
| 38 |
+
const states=new Set();
|
| 39 |
+
for (const line of rows) {
|
| 40 |
+
const fields=line.split(',');
|
| 41 |
+
const commands=indices.map(i=>Number(fields[i])/gateVoltage);
|
| 42 |
+
if (commands.some(v=>v>.01&&v<.99)) continue;
|
| 43 |
+
const [a,aBar,b,bBar]=commands.map(v=>Number(v>.5));
|
| 44 |
+
assert.equal(a+aBar,1);
|
| 45 |
+
assert.equal(b+bBar,1);
|
| 46 |
+
states.add(`${a}${b}`);
|
| 47 |
+
}
|
| 48 |
+
return [...states].sort();
|
| 49 |
+
}
|
| 50 |
+
async function run(expected=202) {
|
| 51 |
+
const pending=page.waitForResponse(r=>r.request().method()==='POST'&&r.url().endsWith('/api/simulation/jobs'));
|
| 52 |
+
await sim.locator('#runButton').click();
|
| 53 |
+
const response=await pending;
|
| 54 |
+
assert.equal(response.status(),expected,await response.text());
|
| 55 |
+
if (expected!==202) return response.json();
|
| 56 |
+
const {id}=await response.json();
|
| 57 |
+
await expect(sim.locator('#status')).toHaveText(/^Run /,{timeout:120000});
|
| 58 |
+
await sim.locator('#plotWrap img').evaluate(img=>img.decode());
|
| 59 |
+
const result=JSON.parse(await artifact('result.json'));
|
| 60 |
+
assert.equal(result.run_id,id);
|
| 61 |
+
return result;
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
try {
|
| 65 |
+
await page.goto(base);
|
| 66 |
+
await expect(page.locator('.topology-tile')).toHaveCount(9);
|
| 67 |
+
await page.locator('[data-family="4"]').click();
|
| 68 |
+
await expect(page.locator('[data-topology-id="si2"]')).toHaveCount(0);
|
| 69 |
+
await page.locator('[data-family="2"]').click();
|
| 70 |
+
await expect(page.locator('.topology-tile')).toHaveCount(6);
|
| 71 |
+
const tile=page.locator('[data-topology-id="si2"]');
|
| 72 |
+
await expect(tile).toContainText('Analysis + simulation');
|
| 73 |
+
await tile.locator('img').evaluate(img=>img.decode());
|
| 74 |
+
await tile.click();
|
| 75 |
+
|
| 76 |
+
const card=analysis.locator('#circuits [data-topology="si2"]');
|
| 77 |
+
await expect(card).toBeVisible();
|
| 78 |
+
await expect(card.locator('.die-allocation [data-device]')).toHaveCount(4);
|
| 79 |
+
await expect(analysis.getByText('THE LOSS LINEUP',{exact:true})).toBeVisible();
|
| 80 |
+
await expect(analysis.locator('[data-loss-mechanism="charging"]')).toHaveCount(0);
|
| 81 |
+
await expect(analysis.locator('[data-loss-mechanism="coss"] strong')).toHaveText('Unknown');
|
| 82 |
+
for (const k of ['lk_nh','lm_uh','tank_nh']) await expect(design(k)).toBeHidden();
|
| 83 |
+
for (const [id,value,reason] of [['max_caps','0','Requires one output capacitor'],
|
| 84 |
+
['max_windings','1','Requires two inverse-coupled windings'],['max_drop_percent','0','droop exceeds'],
|
| 85 |
+
['max_phase_ripple_percent','5','phase ripple exceeds'],['io','.1','crosses zero']]) {
|
| 86 |
+
const old=await design(id).inputValue();
|
| 87 |
+
await design(id).fill(value);
|
| 88 |
+
await open(analysis,'.excluded-list');
|
| 89 |
+
await expect(analysis.locator('[data-candidate="si2"]')).toContainText(reason);
|
| 90 |
+
await design(id).fill(old);
|
| 91 |
+
await expect(analysis.locator('[data-candidate-status="eligible"]')).toBeAttached();
|
| 92 |
+
}
|
| 93 |
+
await design('budget_mode').selectOption('area');
|
| 94 |
+
await design('utilization').fill('1.1');
|
| 95 |
+
await expect(analysis.locator('#export-recommendation')).toBeDisabled();
|
| 96 |
+
for (const [id,value] of Object.entries({utilization:'.46',die_mm2:'1.1',ron_area_mohm_mm2:'.93',
|
| 97 |
+
vout:'3.18',io:'1.42',fs_mhz:'2.3',cap_uf:'52',si_l_nh:'1160',si_coupling:'.58',
|
| 98 |
+
si_duty:'.61',rc_mohm:'6.2',rl_mohm:'4.8'})) await design(id).fill(value);
|
| 99 |
+
for (const objective of ['capacitors','magnetics','loss']) {
|
| 100 |
+
await design('objective').selectOption(objective);
|
| 101 |
+
await expect(analysis.locator('[data-candidate-status="eligible"]')).toBeAttached();
|
| 102 |
+
}
|
| 103 |
+
await analysis.locator('[data-comparison-view="circuits"]').click();
|
| 104 |
+
await expect(analysis.locator('[data-candidate="si2"] img')).toBeVisible();
|
| 105 |
+
await analysis.locator('[data-candidate="si2"] [data-inspect-design]').click();
|
| 106 |
+
await open(analysis,'#sweep-section');
|
| 107 |
+
await analysis.locator('#rout-chart rect.hit').hover();
|
| 108 |
+
await expect(analysis.locator('#rout-chart .chart-tooltip')).toContainText('SI');
|
| 109 |
+
await analysis.locator('[data-topology-choice="buck2"]').click();
|
| 110 |
+
await expect(analysis.locator('#circuits [data-topology="buck2"]')).toBeVisible();
|
| 111 |
+
await analysis.locator('[data-topology-choice="buck2"]').click();
|
| 112 |
+
await expect(analysis.locator('#circuits [data-topology="buck2"]')).toHaveCount(0);
|
| 113 |
+
await open(analysis,'#model-details');
|
| 114 |
+
await open(analysis,'#si-model');
|
| 115 |
+
await expect(analysis.locator('#si-model')).toContainText('winding ripple remains');
|
| 116 |
+
|
| 117 |
+
await open(analysis,'#technology-panel');
|
| 118 |
+
for (const [id,value] of Object.entries({vgs:'3.55',events:'1.1',eoss_pj:'1.3'}))
|
| 119 |
+
await analysis.locator('#tech-'+id).fill(value);
|
| 120 |
+
await analysis.locator('#apply-technology').click();
|
| 121 |
+
await analysis.locator('#recommend-design').click();
|
| 122 |
+
const model=await json(analysis.locator('#export-recommendation'));
|
| 123 |
+
const technology=await json(analysis.locator('#export-technology'));
|
| 124 |
+
const row=model.winner;
|
| 125 |
+
assert.equal(row.id,'si2');
|
| 126 |
+
near(model.input_voltage,3.18);
|
| 127 |
+
near(model.requested_vout,3.18*.61);
|
| 128 |
+
near(model.load_resistance,3.18*.61/1.42);
|
| 129 |
+
near(row.req,row.parts.fet+row.parts.cap+row.parts.ind);
|
| 130 |
+
near(row.req,technology.rows[0].req);
|
| 131 |
+
near(row.cf,52e-6);
|
| 132 |
+
near(row.coss_power,1.3e-12*2.3e6*row.width_mm);
|
| 133 |
+
near(row.gate_power,3.55*1.1*2.3e6*2.51e-12*row.width_mm);
|
| 134 |
+
near(row.efficiency,row.delivered_w/(row.delivered_w+row.loss));
|
| 135 |
+
near(row.delivered_w,1.42*(3.18*.61-1.42*row.droop_resistance));
|
| 136 |
+
near(row.device.reduce((sum,d)=>sum+d.width_mm,0),row.width_mm);
|
| 137 |
+
assert(row.device[0].width_mm>row.device[1].width_mm);
|
| 138 |
+
near(Object.values(model.loss_scoreboard.rows[0].powers).reduce((a,b)=>a+b),row.loss);
|
| 139 |
+
await analysis.getByText('Per-unit loss weights',{exact:true}).click();
|
| 140 |
+
for (const [id,value] of Object.entries({rho_c:'.41',rho_l:'.31',rho_q:'26.2',si_coupling:'.51',si_ripple:'.8'}))
|
| 141 |
+
await analysis.locator('#'+id).fill(value);
|
| 142 |
+
await analysis.locator('#apply-weights').click();
|
| 143 |
+
await expect(analysis.locator('#inspection-context')).toContainText('Manual comparison weights');
|
| 144 |
+
const csv=(await download(analysis.locator('#export-csv'))).toString();
|
| 145 |
+
for (const value of ['Duty','Coupling','Vin_over_L_fs_Iout','0.61','0.51','0.8','0.41','0.31','26.2'])
|
| 146 |
+
assert(csv.includes('"'+value+'"'));
|
| 147 |
+
assert.match((await download(analysis.locator('[data-svg="si2"]'))).toString(),/No separate charging term/);
|
| 148 |
+
await analysis.locator('#reset').click();
|
| 149 |
+
await expect(analysis.locator('#si_coupling')).toHaveValue('0.6');
|
| 150 |
+
await analysis.locator('#recommend-design').click();
|
| 151 |
+
await expect(analysis.locator('#inspection-context')).toContainText('Switched inductor design weights');
|
| 152 |
+
|
| 153 |
+
await page.locator('#selected-edit').click();
|
| 154 |
+
await expect(page.locator('#context-name')).toContainText('2:1 switched inductor');
|
| 155 |
+
await expect(page.locator('#device-count')).toHaveText('4');
|
| 156 |
+
await expect(page.locator('#winding-count')).toHaveText('2');
|
| 157 |
+
await expect(editor.locator('.schematic-canvas')).toBeVisible();
|
| 158 |
+
const saved=await json(page.locator('#save-project'));
|
| 159 |
+
assert.equal(saved.documents.length,9);
|
| 160 |
+
assert.equal(saved.documents[0].instances.length,18);
|
| 161 |
+
await editor.getByRole('button',{name:'Place Resistor',exact:true}).click();
|
| 162 |
+
await editor.locator('.schematic-canvas').click({position:{x:605,y:95}});
|
| 163 |
+
await page.keyboard.press('Escape');
|
| 164 |
+
assert.equal((await json(page.locator('#save-project'))).documents[0].instances.length,19);
|
| 165 |
+
await editor.locator('.schematic-canvas').focus();
|
| 166 |
+
await page.keyboard.press(process.platform==='darwin'?'Meta+z':'Control+z');
|
| 167 |
+
assert.equal((await json(page.locator('#save-project'))).documents[0].instances.length,18);
|
| 168 |
+
await page.reload();
|
| 169 |
+
await page.getByRole('button',{name:'Schematic',exact:true}).click();
|
| 170 |
+
await expect(page.locator('#context-name')).toContainText('2:1 switched inductor');
|
| 171 |
+
const projectMenu=editor.getByTestId('project-menu-toggle');
|
| 172 |
+
for (const [name,pattern] of [['Export SVG',/<svg/],['Export Netlist',/K1 L1 L2 \.6/i]]) {
|
| 173 |
+
const command=editor.getByRole('button',{name,exact:true});
|
| 174 |
+
const submenu=editor.locator('[aria-controls="file-export-options"]');
|
| 175 |
+
if (!(await submenu.isVisible())) await projectMenu.click();
|
| 176 |
+
if (!(await command.isVisible())) await submenu.click();
|
| 177 |
+
assert.match((await download(command)).toString(),pattern);
|
| 178 |
+
}
|
| 179 |
+
|
| 180 |
+
await page.locator('#compare-reference').click();
|
| 181 |
+
await expect(card).toBeVisible();
|
| 182 |
+
await expect(design('vout')).toHaveValue('3');
|
| 183 |
+
await design('vout').fill('3.18');
|
| 184 |
+
await design('io').fill('1.42');
|
| 185 |
+
await design('si_duty').fill('.61');
|
| 186 |
+
await expect(page.locator('#selected-ratio')).toContainText('Vin 3.18 V · duty 0.61 · Iout 1.42 A');
|
| 187 |
+
await expect(page.locator('#selected-simulate')).toBeEnabled();
|
| 188 |
+
await page.locator('#selected-simulate').click();
|
| 189 |
+
await expect(sim.locator('#topologySelect')).toHaveValue('si2');
|
| 190 |
+
await expect(setting('vin')).toHaveValue('3.18');
|
| 191 |
+
await expect(setting('load')).toHaveValue('1.42');
|
| 192 |
+
await expect(setting('duty')).toHaveValue('0.61');
|
| 193 |
+
await expect(sim.locator('#sp2-nominal-output')).toContainText('1.9398 V');
|
| 194 |
+
await expect(sim.locator('[data-topology="si2"] img')).toBeVisible();
|
| 195 |
+
for (const id of ['vin','load','fs','duty','lt','coupling','dcr','rs','rslow','gate','gatecap','coss','cout','esr','stop','step'])
|
| 196 |
+
await expect(setting(id)).toBeVisible();
|
| 197 |
+
await setting('vin').fill('3');
|
| 198 |
+
await setting('load').fill('1');
|
| 199 |
+
await setting('duty').fill('.5');
|
| 200 |
+
const nominal=(await run()).metrics[0];
|
| 201 |
+
near(nominal.vout_v,1.492,1e-5);
|
| 202 |
+
near(nominal.efficiency_with_gate,.99237,.0002);
|
| 203 |
+
await expect(sim.locator('#sp2-result')).toContainText('Peak switch VDS');
|
| 204 |
+
assert.equal(createHash('sha256').update(await artifact(nominal.deck)).digest('hex'),nominal.deck_sha256);
|
| 205 |
+
const nominalWave=await artifact(nominal.waveform);
|
| 206 |
+
assert.match(nominalWave.toString(),/^time_s,vin_v,vout_v,input_current_a,sw_a_v,sw_b_v,/);
|
| 207 |
+
assert.deepEqual(switchingStates(nominalWave,3.3),['01','10']);
|
| 208 |
+
assert.match((await artifact('physical_design.log')).toString(),/No\. of Data Rows/);
|
| 209 |
+
assert.equal(JSON.parse(await artifact('physical_design-measurements.json')).refined.deck_sha256,nominal.deck_sha256);
|
| 210 |
+
await expect(sim.locator('#sp2-sweep-results')).toBeHidden();
|
| 211 |
+
await setting('load').fill('.25');
|
| 212 |
+
await setting('lt').fill('300');
|
| 213 |
+
assert.match((await run(400)).error,/winding-current valley/);
|
| 214 |
+
for (const [id,value] of Object.entries({vin:'3.18',load:'1.42',fs:'2.3',duty:'.61',lt:'1160',
|
| 215 |
+
coupling:'.58',dcr:'4.85',rs:'14.25',rslow:'8.7',gate:'3.55',gatecap:'8.2',
|
| 216 |
+
coss:'12',cout:'53',esr:'6.35',stop:'84.3',step:'557'})) await setting(id).fill(value);
|
| 217 |
+
await setting('include-sweep').check();
|
| 218 |
+
await setting('parameter').selectOption('duty');
|
| 219 |
+
for (const [id,value] of Object.entries({start:'.37',stop:'.67',count:'4'})) await setting('sweep-'+id).fill(value);
|
| 220 |
+
const tuned=await run();
|
| 221 |
+
assert.equal(tuned.sweep.length,4);
|
| 222 |
+
await sim.locator('#sp2-sweep-results img').evaluate(img=>img.decode());
|
| 223 |
+
await expect(sim.locator('#sp2-sweep-results tbody tr')).toHaveCount(4);
|
| 224 |
+
for (const result of [tuned.metrics[0],...tuned.sweep]) {
|
| 225 |
+
assert.equal(result.status,'passed',result.message);
|
| 226 |
+
const deck=await artifact(result.deck);
|
| 227 |
+
assert.equal(createHash('sha256').update(deck).digest('hex'),result.deck_sha256);
|
| 228 |
+
near(Number(deck.toString().match(/DUTY=(\S+)/)[1]),result.value??.61,1e-12);
|
| 229 |
+
assert.match(deck.toString(),/VIN=3\.18 ILOAD=1\.42 FS=2300000/);
|
| 230 |
+
assert.match(deck.toString(),/KCOUP=0\.58 RDCR=0\.00485 RH=0\.01425 RL=0\.0087 CESR=0\.00635 CO=5\.3e-05 COFF=1\.2e-11 VG=3\.55/);
|
| 231 |
+
assert(result.max_step_ps<=557);
|
| 232 |
+
}
|
| 233 |
+
assert.deepEqual(switchingStates(await artifact(tuned.metrics[0].waveform),3.55),['01','10','11']);
|
| 234 |
+
assert.deepEqual(switchingStates(await artifact(tuned.sweep[0].waveform),3.55),['00','01','10']);
|
| 235 |
+
assert.equal((await artifact('si2-sweep.csv')).toString().trim().split('\n').length,5);
|
| 236 |
+
await setting('duty').fill('.57');
|
| 237 |
+
await page.locator('#selected-analysis').click();
|
| 238 |
+
await expect(design('vout')).toHaveValue('3.18');
|
| 239 |
+
await expect(design('io')).toHaveValue('1.42');
|
| 240 |
+
await expect(design('si_duty')).toHaveValue('0.57');
|
| 241 |
+
assert.deepEqual(errors,[]);
|
| 242 |
+
console.log('Chrome SI: gallery, design controls and exports, editable starter and exports, nominal and swept jobs, recovery, and handoff passed.');
|
| 243 |
+
console.log(JSON.stringify({nominal,edited:tuned.metrics[0],sweep:tuned.sweep.map(r=>[r.value,r.status,r.vout_v,r.efficiency_with_gate])}));
|
| 244 |
+
} catch (error) {
|
| 245 |
+
console.error('Page errors',errors,'Workbench message',await page.locator('#message').textContent(),
|
| 246 |
+
'Selection',await page.locator('#selected-ratio').textContent());
|
| 247 |
+
throw error;
|
| 248 |
+
} finally {
|
| 249 |
+
await browser.close();
|
| 250 |
+
}
|
docs/topology/2to1_switched_inductor/verify_cache.mjs
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Both launchers must use port 8765. Leave it free before running this test.
|
| 2 |
+
import assert from "node:assert/strict";
|
| 3 |
+
import { spawn } from "node:child_process";
|
| 4 |
+
import { once } from "node:events";
|
| 5 |
+
import { readFile } from "node:fs/promises";
|
| 6 |
+
import { createRequire } from "node:module";
|
| 7 |
+
import { resolve } from "node:path";
|
| 8 |
+
|
| 9 |
+
const root=resolve(process.env.SI_CACHE_DIR);
|
| 10 |
+
const {chromium,expect:baseExpect}=createRequire(resolve(process.env.OPENPELS_SOURCE??"local-source/openpels","package.json"))("@playwright/test");
|
| 11 |
+
const expect=baseExpect.configure({timeout:20000});
|
| 12 |
+
const base="http://127.0.0.1:8765";
|
| 13 |
+
const browser=await chromium.launch({headless:true,channel:"chrome",
|
| 14 |
+
args:["--host-resolver-rules=MAP fonts.googleapis.com ~NOTFOUND, MAP fonts.gstatic.com ~NOTFOUND"]});
|
| 15 |
+
async function healthy(server) {
|
| 16 |
+
for(let attempt=0; attempt<50 && server.exitCode===null; attempt++) {
|
| 17 |
+
if(await fetch(base+"/").then(r=>r.ok,()=>false)) return;
|
| 18 |
+
await new Promise(done=>setTimeout(done,100));
|
| 19 |
+
}
|
| 20 |
+
throw Error("Local cache test server did not start.");
|
| 21 |
+
}
|
| 22 |
+
async function stop(server) {
|
| 23 |
+
if(server?.exitCode===null) {
|
| 24 |
+
const done=once(server,"exit");
|
| 25 |
+
server.kill();
|
| 26 |
+
await done;
|
| 27 |
+
}
|
| 28 |
+
}
|
| 29 |
+
let server;
|
| 30 |
+
try {
|
| 31 |
+
const previousServer = `from functools import partial
|
| 32 |
+
from http.server import SimpleHTTPRequestHandler, ThreadingHTTPServer
|
| 33 |
+
from sys import argv
|
| 34 |
+
class PreviousServer(ThreadingHTTPServer):
|
| 35 |
+
request_queue_size = 128
|
| 36 |
+
PreviousServer(('127.0.0.1',8765),
|
| 37 |
+
partial(SimpleHTTPRequestHandler,directory=argv[1])).serve_forever()`;
|
| 38 |
+
server=spawn(".venv/bin/python",["-c",previousServer,resolve(root,"previous/static")],{stdio:"inherit"});
|
| 39 |
+
await healthy(server);
|
| 40 |
+
const page=await browser.newPage();
|
| 41 |
+
page.on("requestfailed",request=>{
|
| 42 |
+
if(request.url().startsWith(base))
|
| 43 |
+
console.error("Local request failed",request.url(),request.failure()?.errorText);
|
| 44 |
+
});
|
| 45 |
+
page.on("pageerror",error=>console.error(error.message));
|
| 46 |
+
await page.goto(base);
|
| 47 |
+
await expect(page.locator(".topology-tile")).toHaveCount(8);
|
| 48 |
+
await page.locator('[data-family="2"]').click();
|
| 49 |
+
await page.locator('[data-topology-id="sp2"]').click();
|
| 50 |
+
await expect(page.frameLocator("#comparison").locator('#circuits [data-topology="sp2"]')).toBeVisible();
|
| 51 |
+
await stop(server);
|
| 52 |
+
server=spawn("./run-local.sh",[],{stdio:"inherit"});
|
| 53 |
+
await healthy(server);
|
| 54 |
+
const cacheAssets=["/pe.js","/gallery.js","/compare/app.js","/compare/style.css",
|
| 55 |
+
"/compare/models-data.json","/compare/switched-inductor.js"];
|
| 56 |
+
const responses=new Map();
|
| 57 |
+
page.on("response",r=>{
|
| 58 |
+
const path=new URL(r.url()).pathname;
|
| 59 |
+
if(cacheAssets.includes(path)) responses.set(path,r);
|
| 60 |
+
});
|
| 61 |
+
await page.reload();
|
| 62 |
+
await expect(page.locator(".topology-tile")).toHaveCount(9);
|
| 63 |
+
await page.locator('[data-family="2"]').click();
|
| 64 |
+
await page.locator('[data-topology-id="si2"]').click();
|
| 65 |
+
await expect(page.frameLocator("#comparison").locator('#circuits [data-topology="si2"]')).toBeVisible();
|
| 66 |
+
await expect.poll(()=>responses.size).toBe(cacheAssets.length);
|
| 67 |
+
for(const path of cacheAssets) {
|
| 68 |
+
const response=responses.get(path);
|
| 69 |
+
assert.equal(response.headers()["cache-control"],"no-store");
|
| 70 |
+
assert.deepEqual(await response.body(),await readFile(resolve("static","."+path)));
|
| 71 |
+
}
|
| 72 |
+
await page.locator("#selected-simulate").click();
|
| 73 |
+
await expect(page.frameLocator("#simulator").locator("#topologySelect")).toHaveValue("si2");
|
| 74 |
+
const cold=await browser.newPage();
|
| 75 |
+
await cold.goto(base);
|
| 76 |
+
await expect(cold.locator('[data-topology-id="si2"]')).toBeVisible();
|
| 77 |
+
console.log("Chrome cache enabled: prior frontend with ordinary static caching (8 cards) → same-tab normal reload (9 cards); six served asset bodies match release, and fresh context shows SI");
|
| 78 |
+
} finally {
|
| 79 |
+
await browser.close();
|
| 80 |
+
await stop(server);
|
| 81 |
+
}
|
docs/topology/2to1_switched_inductor/verify_model.py
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Independent time-domain validation of the inverse-coupled buck derivation."""
|
| 2 |
+
import math
|
| 3 |
+
import numpy as np
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
def integrate(duty, coupling, feed=3, fs=2e6, winding=1e-6, load=1, steps=40000):
|
| 7 |
+
# Solve flux linkage directly from midpoint-sampled gate commands and KVL.
|
| 8 |
+
period = 1/fs
|
| 9 |
+
time = (np.arange(steps)+.5)/steps
|
| 10 |
+
gates = np.column_stack((time < duty, (time-.5) % 1 < duty))
|
| 11 |
+
applied = feed*gates
|
| 12 |
+
output = applied.mean(axis=0)
|
| 13 |
+
np.testing.assert_allclose(output, duty*feed, atol=1e-12)
|
| 14 |
+
voltages = applied-output
|
| 15 |
+
flux = np.vstack((np.zeros(2), np.cumsum(voltages, axis=0)*period/steps))
|
| 16 |
+
matrix = winding*np.array([[1,-coupling],[-coupling,1]])
|
| 17 |
+
edges = np.linalg.solve(matrix, flux.T).T
|
| 18 |
+
i = (edges[:-1]+edges[1:])/2
|
| 19 |
+
i += load/2-i.mean(axis=0)
|
| 20 |
+
capacitor = i.sum(axis=1)-load
|
| 21 |
+
np.testing.assert_allclose(capacitor.mean(), 0, atol=1e-12)
|
| 22 |
+
np.testing.assert_allclose(np.diff(edges,axis=0)@matrix*steps/period,voltages,atol=1e-10)
|
| 23 |
+
np.testing.assert_allclose(edges[0],edges[-1],atol=1e-10)
|
| 24 |
+
currents = np.column_stack((i*gates, i*(1-gates)))
|
| 25 |
+
weights = np.mean(currents**2,axis=0)/load**2
|
| 26 |
+
widths = np.sqrt(weights)/sum(np.sqrt(weights))
|
| 27 |
+
minimum = sum(weights/widths)
|
| 28 |
+
for alternative in np.random.default_rng(4).dirichlet([3]*4, 500):
|
| 29 |
+
assert sum(weights/alternative) >= minimum
|
| 30 |
+
old = np.ptp(i.sum(axis=1))
|
| 31 |
+
expected = feed*min(duty,1-duty)*abs(1-2*duty)/(fs*winding*(1-coupling))
|
| 32 |
+
np.testing.assert_allclose(old, expected, rtol=5e-4, atol=1e-11)
|
| 33 |
+
np.testing.assert_allclose(np.mean(capacitor**2), expected**2/12, rtol=2e-7, atol=1e-15)
|
| 34 |
+
np.testing.assert_allclose(np.mean(currents,axis=0), load/2*np.array([duty,duty,1-duty,1-duty]), atol=1e-10)
|
| 35 |
+
np.testing.assert_allclose(feed*np.mean((gates*i).sum(axis=1)), duty*feed*load, atol=1e-10)
|
| 36 |
+
fet = 0.602/200*minimum*load**2
|
| 37 |
+
dcr = .004*np.mean((i*i).sum(axis=1))
|
| 38 |
+
esr = .005*np.mean(capacitor**2)
|
| 39 |
+
gate = 200*2.51e-12*3.3*fs
|
| 40 |
+
coss = 4*10e-12*feed**2*fs
|
| 41 |
+
req = (fet+dcr+esr)/load**2
|
| 42 |
+
delivered = (feed*duty-load*req)*load
|
| 43 |
+
efficiency = delivered/(delivered+fet+dcr+esr+gate+coss)
|
| 44 |
+
return dict(duty=duty, coupling=coupling, weights=weights.tolist(), widths=widths.tolist(),
|
| 45 |
+
output_ripple_a=expected, min_winding_a=float(i.min()), req_mohm=1000*req,
|
| 46 |
+
fet_w=fet,dcr_w=dcr,esr_w=esr,efficiency=efficiency)
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
def compare_engine():
|
| 50 |
+
import json
|
| 51 |
+
import subprocess
|
| 52 |
+
from pathlib import Path
|
| 53 |
+
|
| 54 |
+
root=Path(__file__).resolve().parents[3]
|
| 55 |
+
cases=[(.30,0,3,2e6,1e-6,1),(.40,.55,3,2e6,1e-6,1),(.50,.60,3,2e6,1e-6,1),
|
| 56 |
+
(.60,.55,3,2e6,1e-6,1),(.70,.80,3,2e6,1e-6,1),(.50,.95,3,2e6,1e-6,1),
|
| 57 |
+
(.61,.58,3.18,2.3e6,1.16e-6,1.42),(.49,.65,2.1,3.1e6,1.8e-6,.76)]
|
| 58 |
+
engine="""
|
| 59 |
+
const {evaluate} = require('./static/compare/switched-inductor.js');
|
| 60 |
+
const cases = JSON.parse(process.argv[1]);
|
| 61 |
+
console.log(JSON.stringify(cases.map(([duty,k,vin,fs,L,load]) =>
|
| 62 |
+
evaluate(duty,{rs:.602*12/200,rc:.005,rl:.004,coupling:k,rippleScale:vin/(fs*L*load)}))));
|
| 63 |
+
"""
|
| 64 |
+
rows=json.loads(subprocess.check_output(['node','-e',engine,json.dumps(cases)],cwd=root))
|
| 65 |
+
for case, row in zip(cases,rows):
|
| 66 |
+
expected=integrate(*case)
|
| 67 |
+
# Numerical midpoint integration leaves half a sample of peak ripple unresolved.
|
| 68 |
+
np.testing.assert_allclose(row['min_phase_per_amp']*case[-1],expected['min_winding_a'],atol=4e-5)
|
| 69 |
+
np.testing.assert_allclose([row[k] for k in ('high_weight','low_weight')],expected['weights'][::2],atol=2e-9)
|
| 70 |
+
np.testing.assert_allclose(row['fractions'],np.array(expected['widths'])[[0,2,1,3]],atol=2e-9)
|
| 71 |
+
np.testing.assert_allclose(row['total']*1000,expected['req_mohm'],atol=2e-7)
|
| 72 |
+
np.testing.assert_allclose([row[k]*case[-1]**2 for k in ('fet','ind','cap')],
|
| 73 |
+
[expected[k] for k in ('fet_w','dcr_w','esr_w')],atol=2e-10)
|
| 74 |
+
print(json.dumps(expected))
|
| 75 |
+
assert integrate(.5,.6,load=.1)['min_winding_a'] < 0
|
| 76 |
+
print('Independent KVL, charge, RMS and silicon sizing comparison passed for eight points.')
|
| 77 |
+
|
| 78 |
+
|
| 79 |
+
if __name__ == '__main__':
|
| 80 |
+
compare_engine()
|
docs/topology/2to1_switched_inductor/verify_ngspice.py
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Compare executed NGSpice traces with independent winding flux integration."""
|
| 2 |
+
import json
|
| 3 |
+
from pathlib import Path
|
| 4 |
+
import sys
|
| 5 |
+
import tempfile
|
| 6 |
+
|
| 7 |
+
import numpy as np
|
| 8 |
+
|
| 9 |
+
sys.path.insert(0,str(Path(__file__).resolve().parents[3]))
|
| 10 |
+
from si2.preset import run_case, validate
|
| 11 |
+
from verify_model import integrate
|
| 12 |
+
|
| 13 |
+
CASES = {
|
| 14 |
+
'nominal': {},
|
| 15 |
+
'lower duty': {'duty':.30},
|
| 16 |
+
'upper duty': {'duty':.70},
|
| 17 |
+
'zero coupling': {'coupling':0},
|
| 18 |
+
'high coupling': {'coupling':.85,'duty':.52},
|
| 19 |
+
'low rail, high clock': {'input_voltage_v':1.8,'switching_frequency_mhz':3.2,
|
| 20 |
+
'output_current_a':.8,'duty':.36,'inductance_nh':1450},
|
| 21 |
+
'high rail, high load': {'input_voltage_v':4,'switching_frequency_mhz':2.7,
|
| 22 |
+
'output_current_a':3,'duty':.69,'inductance_nh':1600,
|
| 23 |
+
'dcr_mohm':12,'output_esr_mohm':10,'switch_ron_mohm':20},
|
| 24 |
+
'simultaneous edit with capacitance': {'input_voltage_v':3.18,'switching_frequency_mhz':2.3,
|
| 25 |
+
'output_current_a':1.42,'duty':.61,'inductance_nh':1160,'coupling':.58,
|
| 26 |
+
'dcr_mohm':4.85,'output_esr_mohm':6.35,'switch_ron_mohm':14.25,
|
| 27 |
+
'low_ron_mohm':8.7,'switch_coff_pf':12,'gate_drive_v':3.55,
|
| 28 |
+
'gate_cap_pf':8.2,'output_cap_uf':53,'stop_us':84.3,'max_step_ps':557},
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
for name, settings in CASES.items():
|
| 32 |
+
_, case, _, _ = validate(dict(topologies=['si2'], **settings))
|
| 33 |
+
model = integrate(case.duty,case.coupling,case.vin,case.fs,case.winding,case.load)
|
| 34 |
+
with tempfile.TemporaryDirectory() as directory:
|
| 35 |
+
result = run_case(case,Path(directory))
|
| 36 |
+
w = np.array(model['weights'])*case.load**2
|
| 37 |
+
channel = w*np.array([case.high,case.high,case.low,case.low])
|
| 38 |
+
winding = case.dcr*w.sum()
|
| 39 |
+
cap = case.esr*model['output_ripple_a']**2/12
|
| 40 |
+
coss = 4*case.coss*case.vin**2*case.fs
|
| 41 |
+
conduction = channel.sum()+winding+cap
|
| 42 |
+
loss = conduction+coss+result['supplemental_gate_w']
|
| 43 |
+
dc_resistance = (case.dcr+case.duty*case.high+(1-case.duty)*case.low)/2
|
| 44 |
+
predicted_vout = case.ideal-case.load*dc_resistance
|
| 45 |
+
predicted_eta = case.load*predicted_vout/(case.load*predicted_vout+loss)
|
| 46 |
+
np.testing.assert_allclose(result['winding_average_a'],case.load/2,rtol=.01)
|
| 47 |
+
np.testing.assert_allclose(result['output_cap_rms_a'],model['output_ripple_a']/np.sqrt(12),rtol=.01,atol=.0001)
|
| 48 |
+
np.testing.assert_allclose(sum(result['dcr_w']),winding,rtol=.015)
|
| 49 |
+
if case.coss==0:
|
| 50 |
+
np.testing.assert_allclose(np.array(result['switch_w'])[[0,2,1,3]],channel,rtol=.02)
|
| 51 |
+
measured_loss = sum(result['switch_w'])+sum(result['dcr_w'])+sum(result['esr_w'])
|
| 52 |
+
np.testing.assert_allclose(measured_loss,conduction+coss,rtol=.035,atol=.00005)
|
| 53 |
+
np.testing.assert_allclose(result['vout_v'],predicted_vout,atol=.002)
|
| 54 |
+
np.testing.assert_allclose(result['efficiency_with_gate'],predicted_eta,atol=.001)
|
| 55 |
+
print(json.dumps(dict(name=name, predicted_vout=predicted_vout, vout=result['vout_v'],
|
| 56 |
+
predicted_r_mohm=1000*conduction/case.load**2, predicted_droop_mohm=1000*dc_resistance,
|
| 57 |
+
measured_conduction_r_mohm=1000*(measured_loss-coss)/case.load**2,
|
| 58 |
+
droop_r_mohm=1000*result['resistance_droop_ohm'],predicted_eta=predicted_eta,
|
| 59 |
+
eta=result['efficiency_with_gate'],balance_uw=1e6*result['balance_w'],
|
| 60 |
+
storage_uw=1e6*result['storage_w'])))
|
| 61 |
+
print('Eight independent NGSpice comparisons passed.')
|
docs/topology/2to1_switched_inductor/verify_sweeps.mjs
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import assert from 'node:assert/strict';
|
| 2 |
+
import {createHash} from 'node:crypto';
|
| 3 |
+
import {createRequire} from 'node:module';
|
| 4 |
+
import {resolve} from 'node:path';
|
| 5 |
+
const require=createRequire(resolve(process.env.OPENPELS_SOURCE??'local-source/openpels','package.json'));
|
| 6 |
+
const {chromium,expect}=require('@playwright/test');
|
| 7 |
+
const base=process.env.OPENPELS_URL??'http://127.0.0.1:8765';
|
| 8 |
+
const browser=await chromium.launch({channel:'chrome',headless:true,args:[
|
| 9 |
+
'--host-resolver-rules=MAP fonts.googleapis.com ~NOTFOUND, MAP fonts.gstatic.com ~NOTFOUND']});
|
| 10 |
+
const axes={
|
| 11 |
+
vin:[2.8,3.3,'VIN',1],load:[.8,1.25,'ILOAD',1],fs:[1.8,2.4,'FS',1e6],
|
| 12 |
+
duty:[.30,.70,'DUTY',1],lt:[800,1450,'LW',1e-9],coupling:[0,.82,'KCOUP',1],
|
| 13 |
+
dcr:[3,9,'RDCR',.001],rs:[9,18,'RH',.001],rslow:[10,18,'RL',.001],
|
| 14 |
+
gate:[2.8,3.8,'VG',1],gatecap:[4,22,null,1],coss:[5,22,'COFF',1e-12],
|
| 15 |
+
cout:[38,60,'CO',1e-6],esr:[2.5,11,'CESR',.001],
|
| 16 |
+
stop:[155,195,null,1],step:[750,1000,null,1],
|
| 17 |
+
};
|
| 18 |
+
try {
|
| 19 |
+
const page=await browser.newPage();
|
| 20 |
+
await page.goto(base);
|
| 21 |
+
await page.locator('[data-topology-id="si2"]').click();
|
| 22 |
+
await page.locator('#selected-simulate').click();
|
| 23 |
+
const sim=page.frameLocator('#simulator'), field=id=>sim.locator('#sp2-'+id);
|
| 24 |
+
await expect(sim.locator('#topologySelect')).toHaveValue('si2');
|
| 25 |
+
await field('duty').fill('.44');
|
| 26 |
+
await field('include-sweep').check();
|
| 27 |
+
await expect(field('parameter').locator('option')).toHaveCount(Object.keys(axes).length);
|
| 28 |
+
for (const [id,[start,stop,param,scale]] of Object.entries(axes)) {
|
| 29 |
+
await field('parameter').selectOption(id);
|
| 30 |
+
for(const [key,value] of Object.entries({start,stop,count:2}))
|
| 31 |
+
await field('sweep-'+key).fill(String(value));
|
| 32 |
+
const pending=page.waitForResponse(r=>r.request().method()==='POST'&&r.url().endsWith('/api/simulation/jobs'));
|
| 33 |
+
await sim.locator('#runButton').click();
|
| 34 |
+
const response=await pending;
|
| 35 |
+
assert.equal(response.status(),202,await response.text());
|
| 36 |
+
const {id:jobId}=await response.json();
|
| 37 |
+
await expect(sim.locator('#runButton')).toBeDisabled();
|
| 38 |
+
await expect(sim.locator('#status')).toHaveText(/^Run /,{timeout:120000});
|
| 39 |
+
const job=await (await page.request.get(base+'/api/simulation/jobs/'+jobId)).json();
|
| 40 |
+
assert.equal(job.state,'succeeded');
|
| 41 |
+
assert.equal(job.result.validation,'passed',job.result.validation_message);
|
| 42 |
+
await expect(sim.locator('#sp2-sweep-results tbody tr')).toHaveCount(2);
|
| 43 |
+
await sim.locator('#sp2-sweep-results img').evaluate(img=>img.decode());
|
| 44 |
+
const {sweep,artifacts}=job.result;
|
| 45 |
+
assert.deepEqual(sweep.map(row=>row.value),[start,stop]);
|
| 46 |
+
for (const row of sweep) {
|
| 47 |
+
assert.equal(row.status,'passed',id+': '+row.message);
|
| 48 |
+
const artifact=artifacts.find(file=>file.name===row.deck);
|
| 49 |
+
const deck=await (await page.request.get(base+artifact.url)).text();
|
| 50 |
+
assert.equal(createHash('sha256').update(deck).digest('hex'),row.deck_sha256);
|
| 51 |
+
if (param) {
|
| 52 |
+
const observed=Number(deck.match(new RegExp('(?: |^)'+param+'=(\\S+)'))[1]);
|
| 53 |
+
assert(Math.abs(observed-row.value*scale)<Math.max(1e-20,Math.abs(observed)*1e-12));
|
| 54 |
+
}
|
| 55 |
+
if (id==='gatecap') assert(deck.includes(row.value+' pF/device'));
|
| 56 |
+
if (id==='stop') assert(row.stop_us<=row.value && row.value-row.stop_us<.501);
|
| 57 |
+
if (id==='step') assert(row.max_step_ps<=row.value*(1+1e-12));
|
| 58 |
+
}
|
| 59 |
+
const csv=artifacts.find(file=>file.name==='si2-sweep.csv');
|
| 60 |
+
assert.equal((await (await page.request.get(base+csv.url)).text()).trim().split('\n').length,3);
|
| 61 |
+
console.log(id,JSON.stringify(sweep.map(({value,vout_v,efficiency_with_gate})=>[value,vout_v,efficiency_with_gate])));
|
| 62 |
+
}
|
| 63 |
+
console.log('All 16 SI input axes exercised in Chrome, with 32 sweep results, deck hashes and CSVs verified.');
|
| 64 |
+
} finally {
|
| 65 |
+
await browser.close();
|
| 66 |
+
}
|
docs/topology/2to1_switching_capacitors/integration/verify_live.mjs
CHANGED
|
@@ -28,9 +28,9 @@ try {
|
|
| 28 |
const sim = page.frameLocator("#simulator");
|
| 29 |
await page.goto(base.href);
|
| 30 |
await gallery.locator(".topology-tile").first().waitFor();
|
| 31 |
-
assert.equal(await gallery.locator(".topology-tile").count(),
|
| 32 |
await page.locator('[data-family="2"]').click();
|
| 33 |
-
assert.equal(await gallery.locator(".topology-tile").count(),
|
| 34 |
await gallery.locator('[data-topology-id="sp2"]').click();
|
| 35 |
await analysis.locator('#circuits article[data-topology="sp2"]').waitFor();
|
| 36 |
const efficiency = analysis.locator("#sp2-efficiency");
|
|
|
|
| 28 |
const sim = page.frameLocator("#simulator");
|
| 29 |
await page.goto(base.href);
|
| 30 |
await gallery.locator(".topology-tile").first().waitFor();
|
| 31 |
+
assert.equal(await gallery.locator(".topology-tile").count(), 9);
|
| 32 |
await page.locator('[data-family="2"]').click();
|
| 33 |
+
assert.equal(await gallery.locator(".topology-tile").count(), 6);
|
| 34 |
await gallery.locator('[data-topology-id="sp2"]').click();
|
| 35 |
await analysis.locator('#circuits article[data-topology="sp2"]').waitFor();
|
| 36 |
const efficiency = analysis.locator("#sp2-efficiency");
|
docs/topology/analysis_feature_parity_matrix.md
CHANGED
|
@@ -94,3 +94,7 @@ The Chrome parity and constraints runs passed at port 8765. XFLY6S design contro
|
|
| 94 |
## 2:1 resonant SC acceptance evidence
|
| 95 |
|
| 96 |
See the [resonant SC analysis matrix](2to1_resonant/parity.md#analysis-matrix) and its [development and validation report](2to1_resonant/README.md).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
## 2:1 resonant SC acceptance evidence
|
| 95 |
|
| 96 |
See the [resonant SC analysis matrix](2to1_resonant/parity.md#analysis-matrix) and its [development and validation report](2to1_resonant/README.md).
|
| 97 |
+
|
| 98 |
+
## 2:1 switched inductor
|
| 99 |
+
|
| 100 |
+
The [Switched Inductor Analysis matrix](2to1_switched_inductor/parity.md#analysis-matrix) records the XFLY6S comparison, finite-ripple analysis, duty and coupling controls, sizing, Loss Lineup, advanced workbench and exports.
|
docs/topology/feature_parity_checklist.md
CHANGED
|
@@ -49,3 +49,7 @@ Feature Parity Validation is mandatory for **every newly integrated Batch 3 topo
|
|
| 49 |
## 2:1 resonant SC acceptance evidence
|
| 50 |
|
| 51 |
See the [resonant SC entry point and schematic checklist](2to1_resonant/parity.md#entry-point-and-schematic-checklist) and its [development and validation report](2to1_resonant/README.md).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
## 2:1 resonant SC acceptance evidence
|
| 50 |
|
| 51 |
See the [resonant SC entry point and schematic checklist](2to1_resonant/parity.md#entry-point-and-schematic-checklist) and its [development and validation report](2to1_resonant/README.md).
|
| 52 |
+
|
| 53 |
+
## 2:1 switched inductor acceptance evidence
|
| 54 |
+
|
| 55 |
+
See the [SI entry point and schematic checklist](2to1_switched_inductor/parity.md#entry-point-and-schematic-checklist), the Analysis and Simulator matrices, and the [development report](2to1_switched_inductor/README.md).
|
docs/topology/minjie_confirmation_list.md
CHANGED
|
@@ -57,3 +57,15 @@ The [independent comparison](2to1_switching_capacitors/sp2_comparison.md) establ
|
|
| 57 |
| Simulator model and measurements | The existing asynchronous host dispatches the bounded resonant deck alongside SP-SC and the pinned 4:1 models. Review the synchronized generic switch, independent gate estimate, constant-current load, and the commutation-current warning threshold before introducing a MOSFET dead-time bench. |
|
| 58 |
|
| 59 |
[Derivation, scope, and validation](2to1_resonant/README.md)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
| Simulator model and measurements | The existing asynchronous host dispatches the bounded resonant deck alongside SP-SC and the pinned 4:1 models. Review the synchronized generic switch, independent gate estimate, constant-current load, and the commutation-current warning threshold before introducing a MOSFET dead-time bench. |
|
| 58 |
|
| 59 |
[Derivation, scope, and validation](2to1_resonant/README.md)
|
| 60 |
+
|
| 61 |
+
## Switched inductor review
|
| 62 |
+
|
| 63 |
+
| Item | Local decision for review |
|
| 64 |
+
| --- | --- |
|
| 65 |
+
| Catalog and legacy scope | Register the full finite-ripple workflow as `si2` under nominal 2:1. The existing `buck2` catalog represents the same electrical graph at flat-current fidelity. Review whether a future release should unify their Gallery presentations while retaining the flat-current comparison. |
|
| 66 |
+
| Circuit and coupling | Canvas shows opposed dots and 180° interleaving. The local schema-86 starter adds explicit gate/output ports and an electrical coupling object. It retains the switching cells and the external MOS model definition. |
|
| 67 |
+
| Analysis | Use inverse-coupled modal inductances and exact segment-square integration within the lossless waveform approximation. Track output-referred power resistance separately from mean-current voltage droop. Add per-unit coupling and current scale. Preserve the original 4:1 formulations. |
|
| 68 |
+
| Optimization | Allocate four widths by RMS current, share the existing width search, and screen winding valleys, phase ripple, component counts, area and voltage droop. Use the existing illustrative gate technology and effective Coss entry. |
|
| 69 |
+
| Simulator and handoff | The new modular job adds direct duty and independent Vin, lower-switch Ron, output capacitor ESR, and measured current/voltage probes. Only the SI handoff carries the additional rail and duty fields. The NGSpice model uses matched positive-current CCM, linear switch resistance, zero dead time, and explicitly initialized windings. Review device characterization and commutation fidelity before hardware predictions. |
|
| 70 |
+
|
| 71 |
+
[Derivation and validation](2to1_switched_inductor/README.md)
|
docs/topology/simulator_feature_parity_matrix.md
CHANGED
|
@@ -88,3 +88,7 @@ The 22 historical endpoint runs passed again. All 12 previously recorded extensi
|
|
| 88 |
## 2:1 resonant SC acceptance evidence
|
| 89 |
|
| 90 |
See the [resonant SC simulator matrix](2to1_resonant/parity.md#simulator-matrix) and its [development and validation report](2to1_resonant/README.md).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
## 2:1 resonant SC acceptance evidence
|
| 89 |
|
| 90 |
See the [resonant SC simulator matrix](2to1_resonant/parity.md#simulator-matrix) and its [development and validation report](2to1_resonant/README.md).
|
| 91 |
+
|
| 92 |
+
## 2:1 switched inductor
|
| 93 |
+
|
| 94 |
+
The [Switched Inductor Simulator matrix](2to1_switched_inductor/parity.md#simulator-matrix) records the tagged comparison, direct duty control, admissible CCM bounds, sixteen sweep axes, waveforms, measurements, downloads, and recovery.
|
docs/topology/topology_inventory.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
# OpenPELS topology inventory
|
| 2 |
|
| 3 |
-
The current release contains **
|
| 4 |
|
| 5 |
## Existing converters
|
| 6 |
|
| 7 |
-
Reference and Gallery SVG names are relative to [`static/compare/assets/`](../../static/compare/assets/). A starter ID names a portable `.icproj.json` and its companion structural `.sp` file in [`static/starters/`](../../static/starters/). The original 4:1 presets have groups in the [testbench manifest](../../static/testbenches/index.json#L1). The
|
| 8 |
|
| 9 |
| Converter and catalog ID | Qualified Gallery ratios | Reference SVG / Gallery SVG | Editable starter | Analytical model | NGSpice preset |
|
| 10 |
| --- | --- | --- | --- | --- | --- |
|
|
@@ -16,6 +16,7 @@ Reference and Gallery SVG names are relative to [`static/compare/assets/`](../..
|
|
| 16 |
| Two-phase synchronous buck (`buck2`), shown as **Two-phase coupled buck** | 2:1 | `buck2.svg` / `buck2-candidate.svg` | `buck2` | Yes. Derived flat-current loss model with 2:1 device sizing. | None |
|
| 17 |
| Two-phase 2:1 series-parallel switched capacitor (`sp2`) | 2:1 | `sp2.svg` / `sp2-candidate.svg` | `sp2` | Yes. Fixed 2:1 periodic RC losses, delivered efficiency estimate and equal sizing. | [`sp2`, at 2:1](2to1_switching_capacitors/local_integration.md), with configurable single-axis sweeps |
|
| 18 |
| Two-phase 2:1 resonant switched capacitor (`rsc2`) | 2:1 | `rsc2.svg` / `rsc2-candidate.svg` | `rsc2` | Matched periodic RLC, delivered efficiency and equal-device width sizing. | [`rsc2`, at 2:1](2to1_resonant/README.md), including tank and device sweeps |
|
|
|
|
| 19 |
| XFLY-Boost (`boost`) | Outside Gallery | `boost.svg` / — | None | Topology and a conditional step-up gain relation only. No numerical loss model. | None |
|
| 20 |
| XFLY-NS (`ns`) | Outside Gallery | `ns.svg` / — | None | Topology only. Requires a specified switching sequence and state derivation. | None |
|
| 21 |
|
|
@@ -27,11 +28,11 @@ XFLY8S is a related match by design. The analytical drawing includes `Cc1` and `
|
|
| 27 |
|
| 28 |
| Ratio | Live Gallery coverage | Native starter shelf | Integrated simulation |
|
| 29 |
| --- | --- | --- | --- |
|
| 30 |
-
| 2:1 |
|
| 31 |
| 3:1 | No filter or registered family | No shelf tab or starter | None |
|
| 32 |
| 4:1 | Four cards: `xfly2p`, `xfly4p`, `3lbuck`, `2sbuck` | `xfly6s`, `xfly8s` | `xfly6s`, `xfly8s`, `c3l` |
|
| 33 |
| 6:1, 8:1, 16:1 | Filters exist and show the unvalidated empty state | Tabs exist, no matching starters | None |
|
| 34 |
|
| 35 |
-
Three-level buck appears in two filters and counts once under **All topologies**. `FAMILY_RATIOS` defines the available Gallery filters. `familyIds()` screens the winding-based shortlist against `excitation`. The Gallery uses `referenceFamilyIds()`, which additionally admits the fixed-ratio `sp2` and `rsc2` references at 2:1. Numerical-domain checks in `engine.valid(id, M)` describe the range of the reference equations. An equation returning a value at `M = 1/3` or `1/6` does not qualify a 3:1 or 6:1 Gallery family. The catalog's `ratio` array encodes relative transistor allocation, while `recommend.specs` owns nominal family ratios. [Gallery ratio setup](../../static/gallery.js#L94), [Gallery loader](../../static/gallery.js#L107), [qualification](../../static/compare/recommend.js#L3), [numeric domain and allocation](../../static/compare/engine.js#L8), [starter tabs](../../static/index.html#L104)
|
| 36 |
|
| 37 |
Each of the three original 4:1 NGSpice groups contains startup, long-settling, and scaled winding-DCR-mismatch cases. The main Simulator uses the group's startup `.cir` file as a parameterized template. All nine originals also have manifest case IDs and checksums. The runtime has an original-case job path and a standalone validation runner, while the browser Simulator has a preset selector only. [XFLY6S cases](../../static/testbenches/index.json#L8), [XFLY8S cases](../../static/testbenches/index.json#L129), [C3L cases](../../static/testbenches/index.json#L259), [template selection](../../simulator_service.py#L105), [source-case runner](../../simulator_service.py#L123)
|
|
|
|
| 1 |
# OpenPELS topology inventory
|
| 2 |
|
| 3 |
+
The current release contains **eleven analytical catalog records, nine visible Gallery cards, six editable starters, and six NGSpice preset families**. The Gallery includes coupled-inductor references at 2:1 and 4:1 and the fixed-ratio series-parallel and resonant switched-capacitor references at 2:1, plus the finite-ripple switched inductor workflow at its nominal 2:1 point. This inventory also includes catalog records outside the Gallery. It does not count different drawings of one topology, individual testbench variants, or unrelated editor examples as additional converters. See [topology requirements](topology_requirements.md) and [addition workflow](topology_addition_workflow.md).
|
| 4 |
|
| 5 |
## Existing converters
|
| 6 |
|
| 7 |
+
Reference and Gallery SVG names are relative to [`static/compare/assets/`](../../static/compare/assets/). A starter ID names a portable `.icproj.json` and its companion structural `.sp` file in [`static/starters/`](../../static/starters/). The original 4:1 presets have groups in the [testbench manifest](../../static/testbenches/index.json#L1). The 2:1-family presets have individual contracts in the same directory.
|
| 8 |
|
| 9 |
| Converter and catalog ID | Qualified Gallery ratios | Reference SVG / Gallery SVG | Editable starter | Analytical model | NGSpice preset |
|
| 10 |
| --- | --- | --- | --- | --- | --- |
|
|
|
|
| 16 |
| Two-phase synchronous buck (`buck2`), shown as **Two-phase coupled buck** | 2:1 | `buck2.svg` / `buck2-candidate.svg` | `buck2` | Yes. Derived flat-current loss model with 2:1 device sizing. | None |
|
| 17 |
| Two-phase 2:1 series-parallel switched capacitor (`sp2`) | 2:1 | `sp2.svg` / `sp2-candidate.svg` | `sp2` | Yes. Fixed 2:1 periodic RC losses, delivered efficiency estimate and equal sizing. | [`sp2`, at 2:1](2to1_switching_capacitors/local_integration.md), with configurable single-axis sweeps |
|
| 18 |
| Two-phase 2:1 resonant switched capacitor (`rsc2`) | 2:1 | `rsc2.svg` / `rsc2-candidate.svg` | `rsc2` | Matched periodic RLC, delivered efficiency and equal-device width sizing. | [`rsc2`, at 2:1](2to1_resonant/README.md), including tank and device sweeps |
|
| 19 |
+
| 2:1 switched inductor (`si2`) | 2:1 nominal | `si2.svg` / `si2-candidate.svg` | `si2` | Duty-regulated inverse-coupled CCM, finite-ripple losses and RMS-optimal width allocation. | [`si2`](2to1_switched_inductor/README.md), including duty and component sweeps |
|
| 20 |
| XFLY-Boost (`boost`) | Outside Gallery | `boost.svg` / — | None | Topology and a conditional step-up gain relation only. No numerical loss model. | None |
|
| 21 |
| XFLY-NS (`ns`) | Outside Gallery | `ns.svg` / — | None | Topology only. Requires a specified switching sequence and state derivation. | None |
|
| 22 |
|
|
|
|
| 28 |
|
| 29 |
| Ratio | Live Gallery coverage | Native starter shelf | Integrated simulation |
|
| 30 |
| --- | --- | --- | --- |
|
| 31 |
+
| 2:1 | Six cards: `3lbuck`, `buck`, `buck2`, `sp2`, `rsc2`, `si2` | `buck2`, `sp2`, `rsc2`, `si2` | `sp2`, `rsc2`, `si2` |
|
| 32 |
| 3:1 | No filter or registered family | No shelf tab or starter | None |
|
| 33 |
| 4:1 | Four cards: `xfly2p`, `xfly4p`, `3lbuck`, `2sbuck` | `xfly6s`, `xfly8s` | `xfly6s`, `xfly8s`, `c3l` |
|
| 34 |
| 6:1, 8:1, 16:1 | Filters exist and show the unvalidated empty state | Tabs exist, no matching starters | None |
|
| 35 |
|
| 36 |
+
Three-level buck appears in two filters and counts once under **All topologies**. `FAMILY_RATIOS` defines the available Gallery filters. `familyIds()` screens the winding-based shortlist against `excitation`. The Gallery uses `referenceFamilyIds()`, which additionally admits the fixed-ratio `sp2` and `rsc2` references and the nominal `si2` reference at 2:1. Numerical-domain checks in `engine.valid(id, M)` describe the range of the reference equations. An equation returning a value at `M = 1/3` or `1/6` does not qualify a 3:1 or 6:1 Gallery family. The catalog's `ratio` array encodes relative transistor allocation, while `recommend.specs` owns nominal family ratios. [Gallery ratio setup](../../static/gallery.js#L94), [Gallery loader](../../static/gallery.js#L107), [qualification](../../static/compare/recommend.js#L3), [numeric domain and allocation](../../static/compare/engine.js#L8), [starter tabs](../../static/index.html#L104)
|
| 37 |
|
| 38 |
Each of the three original 4:1 NGSpice groups contains startup, long-settling, and scaled winding-DCR-mismatch cases. The main Simulator uses the group's startup `.cir` file as a parameterized template. All nine originals also have manifest case IDs and checksums. The runtime has an original-case job path and a standalone validation runner, while the browser Simulator has a preset selector only. [XFLY6S cases](../../static/testbenches/index.json#L8), [XFLY8S cases](../../static/testbenches/index.json#L129), [C3L cases](../../static/testbenches/index.json#L259), [template selection](../../simulator_service.py#L105), [source-case runner](../../simulator_service.py#L123)
|
rsc2/preset.py
CHANGED
|
@@ -143,7 +143,7 @@ def measure(trace, case):
|
|
| 143 |
tank_sum_ripple_a=float(np.ptp(tank_sum)), tank_delta_ripple_a=float(np.ptp(tank_delta)))
|
| 144 |
|
| 145 |
|
| 146 |
-
def execute_deck(directory, source, name):
|
| 147 |
deck = directory / f'{name}.cir'
|
| 148 |
deck.write_text(source)
|
| 149 |
log = directory / f'{name}.log'
|
|
@@ -158,7 +158,7 @@ def execute_deck(directory, source, name):
|
|
| 158 |
trace = np.loadtxt(trace_path, skiprows=1, ndmin=2)
|
| 159 |
finally:
|
| 160 |
trace_path.unlink()
|
| 161 |
-
if trace.shape[0] < 100 or trace.shape[1] !=
|
| 162 |
raise ValueError('NGSpice transient trace is incomplete.')
|
| 163 |
# Reaction to adjacent switch events can produce repeated timestamps in wrdata.
|
| 164 |
_, indices = np.unique(trace[:,0], return_index=True)
|
|
|
|
| 143 |
tank_sum_ripple_a=float(np.ptp(tank_sum)), tank_delta_ripple_a=float(np.ptp(tank_delta)))
|
| 144 |
|
| 145 |
|
| 146 |
+
def execute_deck(directory, source, name, columns=11):
|
| 147 |
deck = directory / f'{name}.cir'
|
| 148 |
deck.write_text(source)
|
| 149 |
log = directory / f'{name}.log'
|
|
|
|
| 158 |
trace = np.loadtxt(trace_path, skiprows=1, ndmin=2)
|
| 159 |
finally:
|
| 160 |
trace_path.unlink()
|
| 161 |
+
if trace.shape[0] < 100 or trace.shape[1] != columns or not np.isfinite(trace).all():
|
| 162 |
raise ValueError('NGSpice transient trace is incomplete.')
|
| 163 |
# Reaction to adjacent switch events can produce repeated timestamps in wrdata.
|
| 164 |
_, indices = np.unique(trace[:,0], return_index=True)
|
rsc2/preset_contract.json
CHANGED
|
@@ -140,5 +140,6 @@
|
|
| 140 |
"short": "RSC",
|
| 141 |
"model_note": "Matched series-RLC legs with synchronized 50% commands, bidirectional resistive switches and optional linear Coss. Gate demand is an external estimate. Nonlinear capacitance, dead time, body diodes and core loss are outside this switch model.",
|
| 142 |
"gate_note": "Optional per-switch gate capacitance. Blank derives capacitance from the illustrative Ron × Qg, entered Ron, and drive voltage (38.2 pF per switch at default). Gate voltage changes the gate-energy estimate; it does not set channel resistance.",
|
| 143 |
-
"switch_note": "The stage includes dissipation caused by entered Coss. Modeled commutation current is reported directly. Use a hardware-specific model to evaluate dead-time behavior and voltage stress."
|
|
|
|
| 144 |
}
|
|
|
|
| 140 |
"short": "RSC",
|
| 141 |
"model_note": "Matched series-RLC legs with synchronized 50% commands, bidirectional resistive switches and optional linear Coss. Gate demand is an external estimate. Nonlinear capacitance, dead time, body diodes and core loss are outside this switch model.",
|
| 142 |
"gate_note": "Optional per-switch gate capacitance. Blank derives capacitance from the illustrative Ron × Qg, entered Ron, and drive voltage (38.2 pF per switch at default). Gate voltage changes the gate-energy estimate; it does not set channel resistance.",
|
| 143 |
+
"switch_note": "The stage includes dissipation caused by entered Coss. Modeled commutation current is reported directly. Use a hardware-specific model to evaluate dead-time behavior and voltage stress.",
|
| 144 |
+
"domain_note": "Use a clock between 0.65 and 1.35 times LC natural frequency and damping below 0.8."
|
| 145 |
}
|
si2/__init__.py
ADDED
|
File without changes
|
si2/preset.py
ADDED
|
@@ -0,0 +1,275 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Measured NGSpice preset for the inverse-coupled two-phase CCM buck."""
|
| 2 |
+
from dataclasses import asdict, dataclass
|
| 3 |
+
from pathlib import Path
|
| 4 |
+
import json
|
| 5 |
+
import math
|
| 6 |
+
import subprocess
|
| 7 |
+
import time
|
| 8 |
+
|
| 9 |
+
import numpy as np
|
| 10 |
+
|
| 11 |
+
from rsc2.preset import execute_deck, interval
|
| 12 |
+
from sp2.sp2_preset import validate_preset, write_sweep
|
| 13 |
+
|
| 14 |
+
HERE = Path(__file__).resolve().parent
|
| 15 |
+
TRACE = ('time_s,vin_v,vout_v,input_current_a,sw_a_v,sw_b_v,vgs_q1_v,vgs_q2_v,vgs_q3_v,'
|
| 16 |
+
'vgs_q4_v,il_a_a,il_b_a,vl_a_v,vl_b_v,iq1_a,iq2_a,iq3_a,iq4_a,vcap_v')
|
| 17 |
+
EXTRA = 'icap_a,output_current_a,input_power_w,delivered_power_w,winding_sum_a,winding_delta_a'
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
def contract():
|
| 21 |
+
return json.loads((HERE/'preset_contract.json').read_text())
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
@dataclass(frozen=True)
|
| 25 |
+
class Case:
|
| 26 |
+
name: str
|
| 27 |
+
vin: float
|
| 28 |
+
load: float
|
| 29 |
+
fs: float
|
| 30 |
+
duty: float
|
| 31 |
+
winding: float
|
| 32 |
+
coupling: float
|
| 33 |
+
dcr: float
|
| 34 |
+
high: float
|
| 35 |
+
low: float
|
| 36 |
+
esr: float
|
| 37 |
+
cout: float
|
| 38 |
+
coss: float
|
| 39 |
+
gate: float
|
| 40 |
+
gate_cap: float | None
|
| 41 |
+
stop: float | None
|
| 42 |
+
step: float | None
|
| 43 |
+
|
| 44 |
+
@property
|
| 45 |
+
def period(self):
|
| 46 |
+
return 1/self.fs
|
| 47 |
+
|
| 48 |
+
@property
|
| 49 |
+
def ideal(self):
|
| 50 |
+
return self.vin*self.duty
|
| 51 |
+
|
| 52 |
+
|
| 53 |
+
def build_case(name, s):
|
| 54 |
+
high = s['switch_ron_mohm']*1e-3
|
| 55 |
+
return Case(name, s['input_voltage_v'], s['output_current_a'], s['switching_frequency_mhz']*1e6,
|
| 56 |
+
s['duty'], s['inductance_nh']*1e-9, s['coupling'], s['dcr_mohm']*1e-3,
|
| 57 |
+
high, high if s['low_ron_mohm'] is None else s['low_ron_mohm']*1e-3,
|
| 58 |
+
s['output_esr_mohm']*1e-3, s['output_cap_uf']*1e-6, s['switch_coff_pf']*1e-12,
|
| 59 |
+
s['gate_drive_v'], s['gate_cap_pf'], s['stop_us'], s['max_step_ps'])
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
def initial_currents(c):
|
| 63 |
+
# Calculate the extrema by integrating the flux over each gate state.
|
| 64 |
+
edges = sorted({0,.5,c.duty,(c.duty+.5)%1,1})
|
| 65 |
+
current = mean = 0
|
| 66 |
+
half = 0
|
| 67 |
+
extrema = [0]
|
| 68 |
+
for start, stop in zip(edges, edges[1:]):
|
| 69 |
+
mid = (start+stop)/2
|
| 70 |
+
a, b = int(mid<c.duty), int((mid+.5)%1<c.duty)
|
| 71 |
+
delta = (stop-start)*c.period*c.vin*((a-c.duty)+c.coupling*(b-c.duty))/(c.winding*(1-c.coupling**2))
|
| 72 |
+
mean += (stop-start)*(current+delta/2)
|
| 73 |
+
current += delta
|
| 74 |
+
extrema.append(current)
|
| 75 |
+
if stop == .5:
|
| 76 |
+
half = current
|
| 77 |
+
if c.load/2 + min(extrema)-mean <= 0:
|
| 78 |
+
raise ValueError('The ideal winding-current valley is nonpositive. Increase load, inductance or frequency for CCM.')
|
| 79 |
+
return c.load/2-mean, c.load/2+half-mean
|
| 80 |
+
|
| 81 |
+
|
| 82 |
+
def timing(c):
|
| 83 |
+
initial_currents(c)
|
| 84 |
+
resistance = c.dcr+c.duty*c.high+(1-c.duty)*c.low
|
| 85 |
+
if c.load*resistance/2 >= c.ideal:
|
| 86 |
+
raise ValueError('The DC winding drop exceeds the ideal output.')
|
| 87 |
+
# The common-mode output LC settles at approximately exp(-t/τ).
|
| 88 |
+
# Starting near the DC equilibrium avoids an artificial startup test.
|
| 89 |
+
tau = max(2*c.winding*(1-c.coupling)/(resistance+2*c.esr),
|
| 90 |
+
2*c.cout*resistance)
|
| 91 |
+
cycles = math.floor(c.stop*1e-6/c.period+1e-9) if c.stop is not None else math.ceil(max(48,6*tau/c.period))
|
| 92 |
+
if cycles < 24:
|
| 93 |
+
raise ValueError('Use a duration of at least 24 switching periods.')
|
| 94 |
+
step = min(c.period/240, 2*c.step*1e-12 if c.step else math.inf)
|
| 95 |
+
return cycles, step
|
| 96 |
+
|
| 97 |
+
|
| 98 |
+
def estimate(c):
|
| 99 |
+
cycles, step = timing(c)
|
| 100 |
+
return math.ceil(3*cycles*c.period/step)
|
| 101 |
+
|
| 102 |
+
|
| 103 |
+
def validate(payload):
|
| 104 |
+
return validate_preset(payload,contract(),build_case,estimate,'switched inductor')
|
| 105 |
+
|
| 106 |
+
|
| 107 |
+
def deck_source(c, cycles, step):
|
| 108 |
+
ia0, ib0 = initial_currents(c)
|
| 109 |
+
values = dict(VIN=c.vin, ILOAD=c.load, FS=c.fs, DUTY=c.duty, LW=c.winding,
|
| 110 |
+
IA0=ia0, IB0=ib0,
|
| 111 |
+
KCOUP=c.coupling, RDCR=c.dcr, RH=c.high, RL=c.low,
|
| 112 |
+
CESR=c.esr, CO=c.cout, COFF=c.coss, VG=c.gate)
|
| 113 |
+
lines = (HERE/'switched-inductor.cir').read_text().splitlines()
|
| 114 |
+
lines[1] = '.param '+' '.join(f'{key}={value:.15g}' for key,value in values.items())
|
| 115 |
+
gate_cap = 'Ron × Qg' if c.gate_cap is None else f'{c.gate_cap:g} pF/device'
|
| 116 |
+
lines.insert(2, f'* External gate-power calculation: {c.gate:g} V, {gate_cap}, one event per switch per period.')
|
| 117 |
+
tran = next(i for i,line in enumerate(lines) if line.startswith('.tran'))
|
| 118 |
+
lines[tran] = f'.tran {step:.15g} {cycles*c.period:.15g} 0 {step:.15g} uic'
|
| 119 |
+
# Avoid simulator-dependent handling of nominally zero-valued capacitors.
|
| 120 |
+
return '\n'.join(line for line in lines if c.coss or not line.startswith('Coss'))+'\n'
|
| 121 |
+
|
| 122 |
+
|
| 123 |
+
def measure(data, c):
|
| 124 |
+
t, vin, out, iin, swa, swb, ga, ga_bar, gb, gb_bar, ia, ib, va, vb, q1, q2, q3, q4, vc = data.T
|
| 125 |
+
duration = t[-1]-t[0]
|
| 126 |
+
|
| 127 |
+
def average(x):
|
| 128 |
+
return float(np.trapezoid(x,t)/duration)
|
| 129 |
+
|
| 130 |
+
def rms(x):
|
| 131 |
+
return math.sqrt(average(x*x))
|
| 132 |
+
|
| 133 |
+
ic = (out-vc)/c.esr
|
| 134 |
+
input_w, delivered = average(vin*iin), c.load*average(out)
|
| 135 |
+
stage = input_w-delivered
|
| 136 |
+
gates = (ga,ga_bar,gb,gb_bar)
|
| 137 |
+
switches = (q1,q2,q3,q4)
|
| 138 |
+
stresses = (vin-swa,swa,vin-swb,swb)
|
| 139 |
+
switch_w = [average(i*v) for i,v in zip(switches,stresses)]
|
| 140 |
+
dcr_w = [c.dcr*rms(i)**2 for i in (ia,ib)]
|
| 141 |
+
esr_w = c.esr*rms(ic)**2
|
| 142 |
+
stored = (c.winding*(ia**2+ib**2-2*c.coupling*ia*ib)+c.cout*vc**2+
|
| 143 |
+
c.coss*sum(v*v for v in stresses))/2
|
| 144 |
+
stored_w = float((stored[-1]-stored[0])/duration)
|
| 145 |
+
gate_w = (2*(1/c.high+1/c.low)*.602*2.51e-12*c.gate*c.fs if c.gate_cap is None
|
| 146 |
+
else 4*c.gate_cap*1e-12*c.gate**2*c.fs)
|
| 147 |
+
return dict(vout_v=average(out), iout_a=c.load, iin_a=average(iin), input_w=input_w,
|
| 148 |
+
delivered_w=delivered, stage_w=stage, supplemental_gate_w=gate_w,
|
| 149 |
+
stage_efficiency=delivered/input_w, efficiency_with_gate=delivered/(input_w+gate_w),
|
| 150 |
+
switch_w=switch_w, esr_w=[esr_w], dcr_w=dcr_w, storage_w=stored_w,
|
| 151 |
+
balance_w=stage-sum(switch_w)-sum(dcr_w)-esr_w-stored_w,
|
| 152 |
+
resistance_power_ohm=stage/c.load**2, resistance_droop_ohm=(c.ideal-average(out))/c.load,
|
| 153 |
+
ripple_vpp=float(np.ptp(out)), duty=c.duty,
|
| 154 |
+
measured_duty=[average(g)/c.gate for g in (ga,gb)],
|
| 155 |
+
winding_average_a=[average(ia),average(ib)], winding_rms_a=[rms(ia),rms(ib)],
|
| 156 |
+
winding_min_a=[float(np.min(ia)),float(np.min(ib))],
|
| 157 |
+
winding_ripple_a=[float(np.ptp(ia)),float(np.ptp(ib))],
|
| 158 |
+
winding_sum_ripple_a=float(np.ptp(ia+ib)), winding_delta_ripple_a=float(np.ptp(ia-ib)),
|
| 159 |
+
winding_voltage_mean_v=[average(va),average(vb)],
|
| 160 |
+
winding_voltage_peak_v=[float(np.max(abs(v))) for v in (va,vb)],
|
| 161 |
+
switch_rms_a=[rms(i) for i in switches],
|
| 162 |
+
switch_peak_v=[float(np.max(abs(v))) for v in stresses],
|
| 163 |
+
output_cap_rms_a=rms(ic), output_cap_average_a=average(ic),
|
| 164 |
+
gate_overlap_fraction=[average((g>c.gate/2)&(other>c.gate/2))
|
| 165 |
+
for g,other in ((ga,ga_bar),(gb,gb_bar))])
|
| 166 |
+
|
| 167 |
+
|
| 168 |
+
def run_case(case, directory):
|
| 169 |
+
cycles, step = timing(case)
|
| 170 |
+
samples = []
|
| 171 |
+
for name, resolution in ((case.name+'-coarse',step),(case.name,step/2)):
|
| 172 |
+
trace, checksum = execute_deck(directory,deck_source(case,cycles,resolution),name,columns=19)
|
| 173 |
+
if trace[-1,0] < cycles*case.period*(1-1e-7):
|
| 174 |
+
raise ValueError('NGSpice stopped before the measurement window.')
|
| 175 |
+
# Offset the whole-period window from nominal switch edges.
|
| 176 |
+
stop = (cycles-1.173205)*case.period
|
| 177 |
+
data = interval(trace,stop-4*case.period,stop)
|
| 178 |
+
current = measure(data,case)
|
| 179 |
+
previous = measure(interval(trace,stop-8*case.period,stop-4*case.period),case)
|
| 180 |
+
current['window_drift_v'] = abs(current['vout_v']-previous['vout_v'])
|
| 181 |
+
current['window_drift_w'] = abs(current['stage_w']-previous['stage_w'])
|
| 182 |
+
samples.append(current)
|
| 183 |
+
coarse, fine = samples
|
| 184 |
+
if not 0 < fine['vout_v'] < case.ideal or fine['stage_w'] <= 0:
|
| 185 |
+
raise ValueError('The stage has no positive below-ideal output or positive loss.')
|
| 186 |
+
if min(fine['winding_min_a']) <= 0:
|
| 187 |
+
raise ValueError('A measured winding current crossed zero. This preset qualifies positive-current CCM only.')
|
| 188 |
+
if (fine['window_drift_v'] > .0003 or fine['window_drift_w'] > max(.0001,.02*fine['stage_w'])
|
| 189 |
+
or abs(fine['output_cap_average_a']) > max(.0003,.002*case.load)
|
| 190 |
+
or max(map(abs,fine['winding_voltage_mean_v'])) > .001):
|
| 191 |
+
raise ValueError('The electrical stage did not reach periodic steady state. Increase duration.')
|
| 192 |
+
if abs(fine['balance_w']) > max(.00012,.02*fine['stage_w']):
|
| 193 |
+
raise ValueError('Measured dissipation failed the energy-balance check.')
|
| 194 |
+
if abs(fine['vout_v']-coarse['vout_v']) > .0004 or abs(fine['stage_w']-coarse['stage_w']) > max(.00015,.025*fine['stage_w']):
|
| 195 |
+
raise ValueError('Time-step refinement did not converge. Use a smaller maximum step.')
|
| 196 |
+
if max(abs(d-case.duty) for d in fine['measured_duty']) > .0002 or max(fine['gate_overlap_fraction']) > 1e-8:
|
| 197 |
+
raise ValueError('The complementary commands failed duty or overlap checks.')
|
| 198 |
+
t, vin, out, iin = data[:,:4].T
|
| 199 |
+
ia, ib = data[:,10:12].T
|
| 200 |
+
signals = np.column_stack((data,(out-data[:,-1])/case.esr,np.full(len(t),case.load),
|
| 201 |
+
vin*iin,case.load*out,ia+ib,ia-ib))
|
| 202 |
+
wave = directory/f'{case.name}_waveform.csv'
|
| 203 |
+
np.savetxt(wave,signals,delimiter=',',comments='',header=TRACE+','+EXTRA)
|
| 204 |
+
row = dict(status='passed',message='',deck=f'{case.name}.cir',waveform=wave.name,deck_sha256=checksum,
|
| 205 |
+
nominal_vout_v=case.ideal,vin_v=case.vin,stop_us=cycles*case.period*1e6,
|
| 206 |
+
max_step_ps=step/2*1e12,window_start_cycles=stop/case.period-4,window_stop_cycles=stop/case.period,**fine)
|
| 207 |
+
(directory/f'{case.name}-measurements.json').write_text(
|
| 208 |
+
json.dumps(dict(settings=asdict(case),refined=row,coarse=coarse),allow_nan=False,indent=2)+'\n')
|
| 209 |
+
return row
|
| 210 |
+
|
| 211 |
+
|
| 212 |
+
def plot_waveform(directory, wave):
|
| 213 |
+
import matplotlib
|
| 214 |
+
matplotlib.use('Agg')
|
| 215 |
+
import matplotlib.pyplot as plt
|
| 216 |
+
|
| 217 |
+
values = np.genfromtxt(directory/wave,delimiter=',',names=True)
|
| 218 |
+
t = (values['time_s']-values['time_s'][0])*1e6
|
| 219 |
+
figure, axes = plt.subplots(8,1,sharex=True,figsize=(9,11),layout='constrained')
|
| 220 |
+
signals = (
|
| 221 |
+
('Commands (V)', ('vgs_q1_v','vgs_q2_v','vgs_q3_v','vgs_q4_v'), ('Q1','Q2','Q3','Q4')),
|
| 222 |
+
('Switch nodes (V)', ('sw_a_v','sw_b_v'), ('A','B')),
|
| 223 |
+
('Winding voltage (V)', ('vl_a_v','vl_b_v'), ('A','B')),
|
| 224 |
+
('Winding current (A)', ('il_a_a','il_b_a'), ('A','B')),
|
| 225 |
+
('Winding sum / Δ (A)', ('winding_sum_a','winding_delta_a'), ('Sum','Difference')),
|
| 226 |
+
('Channel current (A)', ('iq1_a','iq2_a','iq3_a','iq4_a'), ('Q1','Q2','Q3','Q4')),
|
| 227 |
+
('Port / cap current (A)', ('input_current_a','output_current_a','icap_a'), ('Input','Load','COUT')),
|
| 228 |
+
('Port voltage (V)', ('vin_v','vout_v'), ('Input','Output')),
|
| 229 |
+
)
|
| 230 |
+
for ax,(label,keys,names) in zip(axes,signals):
|
| 231 |
+
for key,name,style in zip(keys,names,('-','--',':','-.')):
|
| 232 |
+
ax.plot(t,values[key],style,label=name)
|
| 233 |
+
ax.legend(loc='upper right',ncol=len(names))
|
| 234 |
+
ax.set_ylabel(label)
|
| 235 |
+
# Keep the output ripple visible alongside the higher and constant input.
|
| 236 |
+
axes[-1].lines[0].remove()
|
| 237 |
+
supply = axes[-1].twinx()
|
| 238 |
+
supply.plot(t,values['vin_v'],color='0.45',linestyle=':',label='Input')
|
| 239 |
+
supply.set_ylabel('Input (V)')
|
| 240 |
+
axes[-1].legend(loc='lower right')
|
| 241 |
+
axes[-1].set_ylabel('Output (V)')
|
| 242 |
+
axes[-1].set_xlabel('Time within measurement window (µs)')
|
| 243 |
+
figure.savefig(directory/'si2-waveforms.png',dpi=150)
|
| 244 |
+
plt.close(figure)
|
| 245 |
+
|
| 246 |
+
|
| 247 |
+
def run(payload, directory, progress=lambda complete,total: None):
|
| 248 |
+
settings, main, axis, entries = validate(payload)
|
| 249 |
+
started = time.perf_counter()
|
| 250 |
+
rows = []
|
| 251 |
+
total = 1+len(entries)
|
| 252 |
+
progress(0,total)
|
| 253 |
+
for index,(value,case) in enumerate([(None,main),*entries],1):
|
| 254 |
+
try:
|
| 255 |
+
row = run_case(case,directory)
|
| 256 |
+
except (ValueError, subprocess.TimeoutExpired) as error:
|
| 257 |
+
row = dict(status='failed',message=str(error))
|
| 258 |
+
rows.append(dict(value=value,**row))
|
| 259 |
+
progress(index,total)
|
| 260 |
+
operating,*sweep = rows
|
| 261 |
+
success = operating['status'] != 'failed'
|
| 262 |
+
if not success and not sweep:
|
| 263 |
+
raise ValueError(operating['message'])
|
| 264 |
+
if success:
|
| 265 |
+
plot_waveform(directory,operating['waveform'])
|
| 266 |
+
if axis:
|
| 267 |
+
write_sweep(directory,axis,sweep,topology='si2')
|
| 268 |
+
return dict(run_id=directory.name,settings={**settings,'topologies':['si2'],'sweep':payload.get('sweep')},
|
| 269 |
+
elapsed_s=time.perf_counter()-started,metrics=[operating] if success else [],
|
| 270 |
+
validation=operating['status'],validation_message=operating['message'],
|
| 271 |
+
model_provenance=dict(id='si2',model='inverse-coupled synchronous buck',
|
| 272 |
+
deck_sha256=operating.get('deck_sha256')),
|
| 273 |
+
sweep=sweep,parameter={k:axis[k] for k in ('label','unit')} if axis else None,
|
| 274 |
+
sweep_plot_url=f'/simulator/runs/{directory.name}/si2-sweep.png' if axis else None,
|
| 275 |
+
**({'plot_url':f'/runs/{directory.name}/si2-waveforms.png'} if success else {}))
|
si2/preset_contract.json
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"id": "si2",
|
| 3 |
+
"ratio": 2,
|
| 4 |
+
"status": "local-generic-model",
|
| 5 |
+
"run_kind": "run",
|
| 6 |
+
"parameters": {
|
| 7 |
+
"vin": {
|
| 8 |
+
"field": "input_voltage_v",
|
| 9 |
+
"label": "Input voltage",
|
| 10 |
+
"unit": "V",
|
| 11 |
+
"minimum": 1.8,
|
| 12 |
+
"maximum": 4,
|
| 13 |
+
"default": 3,
|
| 14 |
+
"optional": false
|
| 15 |
+
},
|
| 16 |
+
"load": {
|
| 17 |
+
"field": "output_current_a",
|
| 18 |
+
"label": "Output current",
|
| 19 |
+
"unit": "A",
|
| 20 |
+
"minimum": 0.25,
|
| 21 |
+
"maximum": 4,
|
| 22 |
+
"default": 1,
|
| 23 |
+
"optional": false
|
| 24 |
+
},
|
| 25 |
+
"fs": {
|
| 26 |
+
"field": "switching_frequency_mhz",
|
| 27 |
+
"label": "Switching frequency",
|
| 28 |
+
"unit": "MHz",
|
| 29 |
+
"minimum": 0.8,
|
| 30 |
+
"maximum": 4,
|
| 31 |
+
"default": 2,
|
| 32 |
+
"optional": false
|
| 33 |
+
},
|
| 34 |
+
"duty": {
|
| 35 |
+
"field": "duty",
|
| 36 |
+
"label": "High-side duty",
|
| 37 |
+
"unit": "fraction",
|
| 38 |
+
"minimum": 0.25,
|
| 39 |
+
"maximum": 0.75,
|
| 40 |
+
"default": 0.5,
|
| 41 |
+
"optional": false
|
| 42 |
+
},
|
| 43 |
+
"lt": {
|
| 44 |
+
"field": "inductance_nh",
|
| 45 |
+
"label": "Self-inductance per winding",
|
| 46 |
+
"unit": "nH",
|
| 47 |
+
"minimum": 300,
|
| 48 |
+
"maximum": 2500,
|
| 49 |
+
"default": 1000,
|
| 50 |
+
"optional": false
|
| 51 |
+
},
|
| 52 |
+
"coupling": {
|
| 53 |
+
"field": "coupling",
|
| 54 |
+
"label": "Inverse coupling magnitude",
|
| 55 |
+
"unit": "",
|
| 56 |
+
"minimum": 0,
|
| 57 |
+
"maximum": 0.85,
|
| 58 |
+
"default": 0.6,
|
| 59 |
+
"optional": false
|
| 60 |
+
},
|
| 61 |
+
"dcr": {
|
| 62 |
+
"field": "dcr_mohm",
|
| 63 |
+
"label": "DCR per winding",
|
| 64 |
+
"unit": "mΩ",
|
| 65 |
+
"minimum": 1,
|
| 66 |
+
"maximum": 40,
|
| 67 |
+
"default": 4,
|
| 68 |
+
"optional": false
|
| 69 |
+
},
|
| 70 |
+
"rs": {
|
| 71 |
+
"field": "switch_ron_mohm",
|
| 72 |
+
"label": "High-side switch Ron",
|
| 73 |
+
"unit": "mΩ",
|
| 74 |
+
"minimum": 4,
|
| 75 |
+
"maximum": 60,
|
| 76 |
+
"default": 12,
|
| 77 |
+
"optional": false
|
| 78 |
+
},
|
| 79 |
+
"rslow": {
|
| 80 |
+
"field": "low_ron_mohm",
|
| 81 |
+
"label": "Low-side switch Ron (blank uses high-side Ron)",
|
| 82 |
+
"unit": "mΩ",
|
| 83 |
+
"minimum": 4,
|
| 84 |
+
"maximum": 60,
|
| 85 |
+
"default": null,
|
| 86 |
+
"optional": true
|
| 87 |
+
},
|
| 88 |
+
"gate": {
|
| 89 |
+
"field": "gate_drive_v",
|
| 90 |
+
"label": "Gate-drive high level",
|
| 91 |
+
"unit": "V",
|
| 92 |
+
"minimum": 2.5,
|
| 93 |
+
"maximum": 4.5,
|
| 94 |
+
"default": 3.3,
|
| 95 |
+
"optional": false
|
| 96 |
+
},
|
| 97 |
+
"gatecap": {
|
| 98 |
+
"field": "gate_cap_pf",
|
| 99 |
+
"label": "Effective gate capacitance",
|
| 100 |
+
"unit": "pF",
|
| 101 |
+
"minimum": 0,
|
| 102 |
+
"maximum": 100,
|
| 103 |
+
"default": null,
|
| 104 |
+
"optional": true
|
| 105 |
+
},
|
| 106 |
+
"coss": {
|
| 107 |
+
"field": "switch_coff_pf",
|
| 108 |
+
"label": "Linear switch Coss",
|
| 109 |
+
"unit": "pF",
|
| 110 |
+
"minimum": 0,
|
| 111 |
+
"maximum": 30,
|
| 112 |
+
"default": 0,
|
| 113 |
+
"optional": false
|
| 114 |
+
},
|
| 115 |
+
"cout": {
|
| 116 |
+
"field": "output_cap_uf",
|
| 117 |
+
"label": "Output capacitance",
|
| 118 |
+
"unit": "µF",
|
| 119 |
+
"minimum": 10,
|
| 120 |
+
"maximum": 100,
|
| 121 |
+
"default": 47,
|
| 122 |
+
"optional": false
|
| 123 |
+
},
|
| 124 |
+
"esr": {
|
| 125 |
+
"field": "output_esr_mohm",
|
| 126 |
+
"label": "Output capacitor ESR",
|
| 127 |
+
"unit": "mΩ",
|
| 128 |
+
"minimum": 0.5,
|
| 129 |
+
"maximum": 40,
|
| 130 |
+
"default": 5,
|
| 131 |
+
"optional": false
|
| 132 |
+
},
|
| 133 |
+
"stop": {
|
| 134 |
+
"field": "stop_us",
|
| 135 |
+
"label": "Simulation duration",
|
| 136 |
+
"unit": "µs",
|
| 137 |
+
"minimum": 20,
|
| 138 |
+
"maximum": 1000,
|
| 139 |
+
"default": null,
|
| 140 |
+
"optional": true
|
| 141 |
+
},
|
| 142 |
+
"step": {
|
| 143 |
+
"field": "max_step_ps",
|
| 144 |
+
"label": "Refined maximum step ceiling",
|
| 145 |
+
"unit": "ps",
|
| 146 |
+
"minimum": 100,
|
| 147 |
+
"maximum": 3000,
|
| 148 |
+
"default": null,
|
| 149 |
+
"optional": true
|
| 150 |
+
}
|
| 151 |
+
},
|
| 152 |
+
"sweep_points": {
|
| 153 |
+
"minimum": 2,
|
| 154 |
+
"maximum": 15,
|
| 155 |
+
"default": 5
|
| 156 |
+
},
|
| 157 |
+
"name": "2:1 switched inductor",
|
| 158 |
+
"short": "SI",
|
| 159 |
+
"model_note": "Synchronous two-phase buck with inverse-coupled windings, complementary switching, and a half-period phase shift. Positive winding-current CCM is required.",
|
| 160 |
+
"gate_note": "Gate voltage sets the displayed ideal VGS command and gate-energy estimate. Blank effective gate capacitance uses the illustrative Ron × Qg technology data.",
|
| 161 |
+
"switch_note": "The stage includes optional linear Coss. Complementary switch transitions have zero dead time. Body diodes, overlap, core loss and saturation require a device-specific model.",
|
| 162 |
+
"nominal_gain_axis": "duty"
|
| 163 |
+
}
|
si2/switched-inductor.cir
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
OpenPELS inverse-coupled interleaved synchronous buck
|
| 2 |
+
.param VIN=3 ILOAD=1 FS=2Meg DUTY=0.5 LW=1u KCOUP=0.6 RDCR=4m RH=12m RL=12m CESR=5m CO=47u COFF=0 VG=3.3 IA0=0.3828125 IB0=0.6171875
|
| 3 |
+
.param PERIOD={1/FS} EDGE={PERIOD/10000} PW={DUTY*PERIOD-EDGE}
|
| 4 |
+
* Gear suppresses trapezoidal ringing during ideal-switch commutation.
|
| 5 |
+
.options method=gear reltol=1e-5 abstol=1e-10 vntol=1e-8
|
| 6 |
+
Vinput vin 0 {VIN}
|
| 7 |
+
* Start with A high. Both threshold crossings remain exactly half a period apart.
|
| 8 |
+
Vga ga 0 PULSE({VG} 0 {DUTY*PERIOD-EDGE/2} {EDGE} {EDGE} {(1-DUTY)*PERIOD-EDGE} {PERIOD})
|
| 9 |
+
Vgb gb 0 PULSE(0 {VG} {PERIOD/2-EDGE/2} {EDGE} {EDGE} {PW} {PERIOD})
|
| 10 |
+
* For D>0.5, B is initially high from the preceding period.
|
| 11 |
+
Bphaseb b 0 V=v(gb)+(time<{(DUTY-0.5)*PERIOD+EDGE/2} ? {VG}*min(1,max(0,({(DUTY-0.5)*PERIOD+EDGE/2}-time)/{EDGE})) : 0)
|
| 12 |
+
Bphasea_bar ga_bar 0 V={VG}-v(ga)
|
| 13 |
+
Bphaseb_bar gb_bar 0 V={VG}-v(b)
|
| 14 |
+
.model high SW(Ron={RH} Roff=1G Vt={VG/2} Vh=0)
|
| 15 |
+
.model low SW(Ron={RL} Roff=1G Vt={VG/2} Vh=0)
|
| 16 |
+
* Zero-volt branch sensors measure channel current independently of Coss.
|
| 17 |
+
Vq1 vin h1 0
|
| 18 |
+
S1 h1 swa ga 0 high
|
| 19 |
+
Vq2 swa l1 0
|
| 20 |
+
S2 l1 0 ga_bar 0 low
|
| 21 |
+
Vq3 vin h2 0
|
| 22 |
+
S3 h2 swb b 0 high
|
| 23 |
+
Vq4 swb l2 0
|
| 24 |
+
S4 l2 0 gb_bar 0 low
|
| 25 |
+
Coss1 vin swa {COFF}
|
| 26 |
+
Coss2 swa 0 {COFF}
|
| 27 |
+
Coss3 vin swb {COFF}
|
| 28 |
+
Coss4 swb 0 {COFF}
|
| 29 |
+
* First terminal is dotted. Canvas L1 pin 1 faces the switch;
|
| 30 |
+
* Canvas L2 pin 1 faces its DCR. Its port-directed current is -i(LB).
|
| 31 |
+
LA swa ra {LW} ic={IA0}
|
| 32 |
+
LB rb swb {LW} ic={-IB0}
|
| 33 |
+
K1 LA LB {KCOUP}
|
| 34 |
+
RA ra out {RDCR}
|
| 35 |
+
RB rb out {RDCR}
|
| 36 |
+
RCO out co {CESR}
|
| 37 |
+
CO co 0 {CO} ic={VIN*DUTY-ILOAD*(RDCR+DUTY*RH+(1-DUTY)*RL)/2}
|
| 38 |
+
Iload out 0 {ILOAD}
|
| 39 |
+
.tran 1n 100u 0 1n uic
|
| 40 |
+
.control
|
| 41 |
+
set wr_singlescale
|
| 42 |
+
set wr_vecnames
|
| 43 |
+
set numdgt=15
|
| 44 |
+
run
|
| 45 |
+
let input_a=-i(Vinput)
|
| 46 |
+
let ib=-i(LB)
|
| 47 |
+
let va=v(swa)-v(ra)
|
| 48 |
+
let vb=v(swb)-v(rb)
|
| 49 |
+
wrdata trace.dat v(vin) v(out) input_a v(swa) v(swb) v(ga) v(ga_bar) v(b) v(gb_bar) i(LA) ib va vb i(Vq1) i(Vq2) i(Vq3) i(Vq4) v(co)
|
| 50 |
+
quit
|
| 51 |
+
.endc
|
| 52 |
+
.end
|
simulator_bridge.js
CHANGED
|
@@ -58,9 +58,10 @@ function openpelsRenderArtifacts(result) {
|
|
| 58 |
window.addEventListener("DOMContentLoaded", () => {
|
| 59 |
const select = document.getElementById("topologySelect");
|
| 60 |
const frequency = document.getElementById("frequency");
|
| 61 |
-
const frequencies = { xfly6s: 100, xfly8s: 50, c3l: 50, sp2: 2, rsc2: 2 };
|
| 62 |
topologyLabels.sp2 = "2:1 series-parallel SC";
|
| 63 |
topologyLabels.rsc2 = "2:1 resonant SC";
|
|
|
|
| 64 |
const metricsTable = document.getElementById("metricsTable");
|
| 65 |
const originalHeader = metricsTable.tHead.rows[0].cloneNode(true);
|
| 66 |
const summary = document.getElementById("summaryMetrics");
|
|
@@ -113,7 +114,7 @@ window.addEventListener("DOMContentLoaded", () => {
|
|
| 113 |
field.className = "control";
|
| 114 |
const label = document.createElement("label");
|
| 115 |
label.htmlFor = "sp2-" + id;
|
| 116 |
-
label.textContent = entry.label + " (" + entry.unit + ")";
|
| 117 |
const input = document.createElement("input");
|
| 118 |
Object.assign(input, {id: label.htmlFor, type: "number", step: "any",
|
| 119 |
min: entry.minimum, max: entry.maximum, required: !entry.optional,
|
|
@@ -126,12 +127,11 @@ window.addEventListener("DOMContentLoaded", () => {
|
|
| 126 |
input.addEventListener("input", () => {
|
| 127 |
refreshPoint();
|
| 128 |
settingsChanged();
|
| 129 |
-
if (id === "vin" || id === "load") reportPoint();
|
| 130 |
});
|
| 131 |
}
|
| 132 |
note.textContent = spec.model_note
|
| 133 |
-
? [spec.model_note,spec.gate_note,spec.switch_note,
|
| 134 |
-
'Use a clock between 0.65 and 1.35 times LC natural frequency and damping below 0.8.'].join(' ')
|
| 135 |
: originalNote;
|
| 136 |
Object.assign(sweepCount, {min:spec.sweep_points.minimum,max:spec.sweep_points.maximum,
|
| 137 |
value:prior?.count ?? spec.sweep_points.default,required:true});
|
|
@@ -145,12 +145,18 @@ window.addEventListener("DOMContentLoaded", () => {
|
|
| 145 |
sweepBox.hidden = !sweepControl.checked;
|
| 146 |
}
|
| 147 |
function operation() {
|
| 148 |
-
|
|
|
|
|
|
|
|
|
|
| 149 |
}
|
| 150 |
function refreshPoint() {
|
| 151 |
-
const {vout} = operation();
|
|
|
|
| 152 |
document.getElementById("sp2-nominal-output").textContent =
|
| 153 |
-
within("vin",
|
|
|
|
|
|
|
| 154 |
sp2Settings.textContent = "The delivered output voltage is measured with the entered load.";
|
| 155 |
}
|
| 156 |
function settingsChanged() {
|
|
@@ -215,16 +221,22 @@ window.addEventListener("DOMContentLoaded", () => {
|
|
| 215 |
header.replaceChildren();
|
| 216 |
for (const [label,value] of [
|
| 217 |
["Topology", spec.short ?? "SP-SC"],
|
| 218 |
-
["Command duty", "0.5 nominal"],
|
| 219 |
["Stage efficiency", pct(m.stage_efficiency)],
|
| 220 |
["Efficiency incl. gate", pct(m.efficiency_with_gate)],
|
| 221 |
["Gate loss (mW)", (1000*m.supplemental_gate_w).toFixed(3)],
|
| 222 |
["Vout avg (V)", m.vout_v.toFixed(5)],
|
| 223 |
["Iout avg (A)", m.iout_a.toFixed(4)],
|
| 224 |
["Iin avg (A)", m.iin_a.toFixed(4)],
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 228 |
]) {
|
| 229 |
const th = document.createElement("th");
|
| 230 |
th.scope = "col";
|
|
@@ -239,15 +251,22 @@ window.addEventListener("DOMContentLoaded", () => {
|
|
| 239 |
["Output ripple", `${(1000*m.ripple_vpp).toFixed(3)} mV peak-to-peak`],
|
| 240 |
["Input / delivered power", `${m.input_w.toFixed(5)} / ${m.delivered_w.toFixed(5)} W`],
|
| 241 |
["Stage loss", `${(1000*m.stage_w).toFixed(3)} mW`],
|
| 242 |
-
["MOS terminal / flying ESR loss", `${(1000*m.switch_w.reduce((a,b) => a+b,0)).toFixed(3)} / ${(1000*m.esr_w.reduce((a,b) => a+b,0)).toFixed(3)} mW`],
|
| 243 |
...(m.dcr_w ? [
|
| 244 |
["Inductor DCR loss", `${(1000*m.dcr_w.reduce((a,b) => a+b,0)).toFixed(3)} mW`],
|
| 245 |
-
|
| 246 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 247 |
] : []),
|
| 248 |
["Energy balance residual", `${(1e6*m.balance_w).toFixed(2)} µW`],
|
| 249 |
["Executed duration / maximum step", `${m.stop_us.toFixed(3)} µs / ${m.max_step_ps.toFixed(3)} ps`],
|
| 250 |
-
["Measurement window", `${m.window_start_cycles}–${m.window_stop_cycles} cycles`],
|
| 251 |
["Supplemental gate estimate", `${(1000*m.supplemental_gate_w).toFixed(3)} mW`],
|
| 252 |
["Efficiency with gate estimate", `${(100*m.efficiency_with_gate).toFixed(3)} %`],
|
| 253 |
["R from stage loss / voltage droop",
|
|
@@ -388,14 +407,16 @@ window.addEventListener("DOMContentLoaded", () => {
|
|
| 388 |
}
|
| 389 |
function reportPoint() {
|
| 390 |
if (pendingReference || select.disabled) return;
|
| 391 |
-
if (presets[select.value] && (!within("vin", operation().
|
| 392 |
-
!within("load", operation().load)
|
|
|
|
| 393 |
parent.postMessage(
|
| 394 |
{
|
| 395 |
type: "pe:simulation-point",
|
| 396 |
topology: select.value,
|
| 397 |
vout: presets[select.value] ? operation().vout : Number(document.getElementById("targetVout").value),
|
| 398 |
iout: presets[select.value] ? operation().load : Number(document.getElementById("iout").value),
|
|
|
|
| 399 |
},
|
| 400 |
location.origin,
|
| 401 |
);
|
|
@@ -414,8 +435,9 @@ window.addEventListener("DOMContentLoaded", () => {
|
|
| 414 |
select.value = next.topology;
|
| 415 |
updateTopology();
|
| 416 |
if (presets[next.topology]) {
|
| 417 |
-
inputs.get("vin").value = Number((next.vout*2).toPrecision(15));
|
| 418 |
inputs.get("load").value = next.iout;
|
|
|
|
| 419 |
refreshPoint();
|
| 420 |
} else {
|
| 421 |
document.getElementById("targetVout").value = next.vout;
|
|
@@ -430,6 +452,8 @@ window.addEventListener("DOMContentLoaded", () => {
|
|
| 430 |
ratio: next.ratio,
|
| 431 |
vout: next.vout,
|
| 432 |
iout: next.iout,
|
|
|
|
|
|
|
| 433 |
},
|
| 434 |
location.origin,
|
| 435 |
);
|
|
@@ -446,7 +470,8 @@ window.addEventListener("DOMContentLoaded", () => {
|
|
| 446 |
!Object.hasOwn(frequencies, next.topology) ||
|
| 447 |
(presets[next.topology]
|
| 448 |
? next.ratio !== 2 || !Number.isFinite(next.vout) || !Number.isFinite(next.iout) ||
|
| 449 |
-
!within("vin", next.vout*2, next.topology) || !within("load", next.iout, next.topology)
|
|
|
|
| 450 |
: next.ratio !== 4 || !Number.isFinite(next.vout) ||
|
| 451 |
next.vout < 0.3 || next.vout > 1.1 || !Number.isFinite(next.iout) ||
|
| 452 |
next.iout < 0.1 || next.iout > 40)
|
|
|
|
| 58 |
window.addEventListener("DOMContentLoaded", () => {
|
| 59 |
const select = document.getElementById("topologySelect");
|
| 60 |
const frequency = document.getElementById("frequency");
|
| 61 |
+
const frequencies = { xfly6s: 100, xfly8s: 50, c3l: 50, sp2: 2, rsc2: 2, si2: 2 };
|
| 62 |
topologyLabels.sp2 = "2:1 series-parallel SC";
|
| 63 |
topologyLabels.rsc2 = "2:1 resonant SC";
|
| 64 |
+
topologyLabels.si2 = "2:1 switched inductor";
|
| 65 |
const metricsTable = document.getElementById("metricsTable");
|
| 66 |
const originalHeader = metricsTable.tHead.rows[0].cloneNode(true);
|
| 67 |
const summary = document.getElementById("summaryMetrics");
|
|
|
|
| 114 |
field.className = "control";
|
| 115 |
const label = document.createElement("label");
|
| 116 |
label.htmlFor = "sp2-" + id;
|
| 117 |
+
label.textContent = entry.unit ? entry.label + " (" + entry.unit + ")" : entry.label;
|
| 118 |
const input = document.createElement("input");
|
| 119 |
Object.assign(input, {id: label.htmlFor, type: "number", step: "any",
|
| 120 |
min: entry.minimum, max: entry.maximum, required: !entry.optional,
|
|
|
|
| 127 |
input.addEventListener("input", () => {
|
| 128 |
refreshPoint();
|
| 129 |
settingsChanged();
|
| 130 |
+
if (id === "vin" || id === "load" || id === spec.nominal_gain_axis) reportPoint();
|
| 131 |
});
|
| 132 |
}
|
| 133 |
note.textContent = spec.model_note
|
| 134 |
+
? [spec.model_note,spec.gate_note,spec.switch_note,spec.domain_note].filter(Boolean).join(' ')
|
|
|
|
| 135 |
: originalNote;
|
| 136 |
Object.assign(sweepCount, {min:spec.sweep_points.minimum,max:spec.sweep_points.maximum,
|
| 137 |
value:prior?.count ?? spec.sweep_points.default,required:true});
|
|
|
|
| 145 |
sweepBox.hidden = !sweepControl.checked;
|
| 146 |
}
|
| 147 |
function operation() {
|
| 148 |
+
const axis = spec.nominal_gain_axis;
|
| 149 |
+
const vin = inputs.get("vin").valueAsNumber;
|
| 150 |
+
const gain = axis ? inputs.get(axis).valueAsNumber : .5;
|
| 151 |
+
return {vin,gain,vout:vin*gain,load:inputs.get("load").valueAsNumber};
|
| 152 |
}
|
| 153 |
function refreshPoint() {
|
| 154 |
+
const {vin,gain,vout} = operation();
|
| 155 |
+
const gainAxis = spec.nominal_gain_axis;
|
| 156 |
document.getElementById("sp2-nominal-output").textContent =
|
| 157 |
+
within("vin", vin) && (!gainAxis || within(gainAxis,gain))
|
| 158 |
+
? Number(vout.toPrecision(10)) + (gainAxis ? " V ideal · Vout = duty × Vin" : " V at no load · Vout = Vin/2")
|
| 159 |
+
: "—";
|
| 160 |
sp2Settings.textContent = "The delivered output voltage is measured with the entered load.";
|
| 161 |
}
|
| 162 |
function settingsChanged() {
|
|
|
|
| 221 |
header.replaceChildren();
|
| 222 |
for (const [label,value] of [
|
| 223 |
["Topology", spec.short ?? "SP-SC"],
|
| 224 |
+
["Command duty", m.duty?.toFixed(3) ?? "0.5 nominal"],
|
| 225 |
["Stage efficiency", pct(m.stage_efficiency)],
|
| 226 |
["Efficiency incl. gate", pct(m.efficiency_with_gate)],
|
| 227 |
["Gate loss (mW)", (1000*m.supplemental_gate_w).toFixed(3)],
|
| 228 |
["Vout avg (V)", m.vout_v.toFixed(5)],
|
| 229 |
["Iout avg (A)", m.iout_a.toFixed(4)],
|
| 230 |
["Iin avg (A)", m.iin_a.toFixed(4)],
|
| 231 |
+
...(spec.id === "si2" ? [
|
| 232 |
+
["Winding RMS (A)", m.winding_rms_a.map(v => v.toFixed(3)).join(" / ")],
|
| 233 |
+
["Winding ripple (A pp)", m.winding_ripple_a.map(v => v.toFixed(3)).join(" / ")],
|
| 234 |
+
["Output capacitor RMS (A)", m.output_cap_rms_a.toFixed(3)],
|
| 235 |
+
] : [
|
| 236 |
+
["Flying RMS (A)", m.flying_rms_a.map(v => v.toFixed(3)).join(" / ")],
|
| 237 |
+
["Flying avg (V)", m.mean_flying_voltage_v.map(v => v.toFixed(4)).join(" / ")],
|
| 238 |
+
["Flying ripple (mV)", m.flying_ripple_vpp.map(v => (1000*v).toFixed(3)).join(" / ")],
|
| 239 |
+
]),
|
| 240 |
]) {
|
| 241 |
const th = document.createElement("th");
|
| 242 |
th.scope = "col";
|
|
|
|
| 251 |
["Output ripple", `${(1000*m.ripple_vpp).toFixed(3)} mV peak-to-peak`],
|
| 252 |
["Input / delivered power", `${m.input_w.toFixed(5)} / ${m.delivered_w.toFixed(5)} W`],
|
| 253 |
["Stage loss", `${(1000*m.stage_w).toFixed(3)} mW`],
|
| 254 |
+
[spec.id === "si2" ? "MOS terminal / output ESR loss" : "MOS terminal / flying ESR loss", `${(1000*m.switch_w.reduce((a,b) => a+b,0)).toFixed(3)} / ${(1000*m.esr_w.reduce((a,b) => a+b,0)).toFixed(3)} mW`],
|
| 255 |
...(m.dcr_w ? [
|
| 256 |
["Inductor DCR loss", `${(1000*m.dcr_w.reduce((a,b) => a+b,0)).toFixed(3)} mW`],
|
| 257 |
+
...(spec.id === "si2" ? [
|
| 258 |
+
["Winding sum / difference ripple", `${m.winding_sum_ripple_a.toFixed(4)} / ${m.winding_delta_ripple_a.toFixed(4)} A peak-to-peak`],
|
| 259 |
+
["Winding current valleys", m.winding_min_a.map(v=>v.toFixed(3)).join(" / ")+" A"],
|
| 260 |
+
["Peak winding voltage", m.winding_voltage_peak_v.map(v=>v.toFixed(3)).join(" / ")+" V"],
|
| 261 |
+
["Peak switch VDS", m.switch_peak_v.map(v=>v.toFixed(3)).join(" / ")+" V"],
|
| 262 |
+
] : [
|
| 263 |
+
["Commutation current magnitude", `${m.commutation_current_a.toFixed(4)} A`],
|
| 264 |
+
["Tank output sum / difference ripple", `${m.tank_sum_ripple_a.toFixed(4)} / ${m.tank_delta_ripple_a.toFixed(4)} A peak-to-peak`],
|
| 265 |
+
]),
|
| 266 |
] : []),
|
| 267 |
["Energy balance residual", `${(1e6*m.balance_w).toFixed(2)} µW`],
|
| 268 |
["Executed duration / maximum step", `${m.stop_us.toFixed(3)} µs / ${m.max_step_ps.toFixed(3)} ps`],
|
| 269 |
+
["Measurement window", `${Number(m.window_start_cycles.toFixed(3))}–${Number(m.window_stop_cycles.toFixed(3))} cycles`],
|
| 270 |
["Supplemental gate estimate", `${(1000*m.supplemental_gate_w).toFixed(3)} mW`],
|
| 271 |
["Efficiency with gate estimate", `${(100*m.efficiency_with_gate).toFixed(3)} %`],
|
| 272 |
["R from stage loss / voltage droop",
|
|
|
|
| 407 |
}
|
| 408 |
function reportPoint() {
|
| 409 |
if (pendingReference || select.disabled) return;
|
| 410 |
+
if (presets[select.value] && (!within("vin", operation().vin) ||
|
| 411 |
+
!within("load", operation().load) ||
|
| 412 |
+
(spec.nominal_gain_axis && !within(spec.nominal_gain_axis,inputs.get(spec.nominal_gain_axis).valueAsNumber)))) return;
|
| 413 |
parent.postMessage(
|
| 414 |
{
|
| 415 |
type: "pe:simulation-point",
|
| 416 |
topology: select.value,
|
| 417 |
vout: presets[select.value] ? operation().vout : Number(document.getElementById("targetVout").value),
|
| 418 |
iout: presets[select.value] ? operation().load : Number(document.getElementById("iout").value),
|
| 419 |
+
...(presets[select.value]?.nominal_gain_axis ? {vin:operation().vin,duty:operation().gain} : {}),
|
| 420 |
},
|
| 421 |
location.origin,
|
| 422 |
);
|
|
|
|
| 435 |
select.value = next.topology;
|
| 436 |
updateTopology();
|
| 437 |
if (presets[next.topology]) {
|
| 438 |
+
inputs.get("vin").value = next.vin ?? Number((next.vout*2).toPrecision(15));
|
| 439 |
inputs.get("load").value = next.iout;
|
| 440 |
+
if (spec.nominal_gain_axis && Number.isFinite(next.duty)) inputs.get(spec.nominal_gain_axis).value = next.duty;
|
| 441 |
refreshPoint();
|
| 442 |
} else {
|
| 443 |
document.getElementById("targetVout").value = next.vout;
|
|
|
|
| 452 |
ratio: next.ratio,
|
| 453 |
vout: next.vout,
|
| 454 |
iout: next.iout,
|
| 455 |
+
vin: next.vin,
|
| 456 |
+
duty: next.duty,
|
| 457 |
},
|
| 458 |
location.origin,
|
| 459 |
);
|
|
|
|
| 470 |
!Object.hasOwn(frequencies, next.topology) ||
|
| 471 |
(presets[next.topology]
|
| 472 |
? next.ratio !== 2 || !Number.isFinite(next.vout) || !Number.isFinite(next.iout) ||
|
| 473 |
+
!within("vin", next.vin ?? next.vout*2, next.topology) || !within("load", next.iout, next.topology) ||
|
| 474 |
+
(next.duty != null && !within("duty", next.duty, next.topology))
|
| 475 |
: next.ratio !== 4 || !Number.isFinite(next.vout) ||
|
| 476 |
next.vout < 0.3 || next.vout > 1.1 || !Number.isFinite(next.iout) ||
|
| 477 |
next.iout < 0.1 || next.iout > 40)
|
simulator_frame.py
CHANGED
|
@@ -18,9 +18,10 @@ def simulator_html(original):
|
|
| 18 |
<option value="c3l">C3L</option>
|
| 19 |
<option value="sp2">2:1 series-parallel SC</option>
|
| 20 |
<option value="rsc2">2:1 resonant SC</option>
|
|
|
|
| 21 |
</select>
|
| 22 |
</div>
|
| 23 |
-
<section id="sp2-fixture-info" hidden aria-label="
|
| 24 |
<div class="metric"><b>Nominal output voltage</b><span id="sp2-nominal-output"></span></div>
|
| 25 |
<div id="sp2-controls"></div>
|
| 26 |
<p id="sp2-settings"></p>
|
|
@@ -73,6 +74,12 @@ def simulator_html(original):
|
|
| 73 |
<img src="/compare/assets/sp2-candidate.svg" alt="Eight-switch 2:1 series-parallel SC">
|
| 74 |
</div>
|
| 75 |
</figure>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
<figure class="topology-card" data-topology="rsc2" hidden>
|
| 77 |
<b>2:1 resonant SC</b>
|
| 78 |
<div class="topology-image-frame">
|
|
|
|
| 18 |
<option value="c3l">C3L</option>
|
| 19 |
<option value="sp2">2:1 series-parallel SC</option>
|
| 20 |
<option value="rsc2">2:1 resonant SC</option>
|
| 21 |
+
<option value="si2">2:1 switched inductor</option>
|
| 22 |
</select>
|
| 23 |
</div>
|
| 24 |
+
<section id="sp2-fixture-info" hidden aria-label="Topology simulation parameters">
|
| 25 |
<div class="metric"><b>Nominal output voltage</b><span id="sp2-nominal-output"></span></div>
|
| 26 |
<div id="sp2-controls"></div>
|
| 27 |
<p id="sp2-settings"></p>
|
|
|
|
| 74 |
<img src="/compare/assets/sp2-candidate.svg" alt="Eight-switch 2:1 series-parallel SC">
|
| 75 |
</div>
|
| 76 |
</figure>
|
| 77 |
+
<figure class="topology-card" data-topology="si2" hidden>
|
| 78 |
+
<b>2:1 switched inductor</b>
|
| 79 |
+
<div class="topology-image-frame">
|
| 80 |
+
<img src="/compare/assets/si2-candidate.svg" alt="Two inverse-coupled synchronous buck phases">
|
| 81 |
+
</div>
|
| 82 |
+
</figure>
|
| 83 |
<figure class="topology-card" data-topology="rsc2" hidden>
|
| 84 |
<b>2:1 resonant SC</b>
|
| 85 |
<div class="topology-image-frame">
|
simulator_service.py
CHANGED
|
@@ -15,8 +15,9 @@ import uuid
|
|
| 15 |
|
| 16 |
from sp2 import sp2_preset
|
| 17 |
from rsc2 import preset as rsc2_preset
|
|
|
|
| 18 |
|
| 19 |
-
FIXED_PRESETS = {"sp2": sp2_preset, "rsc2": rsc2_preset}
|
| 20 |
|
| 21 |
|
| 22 |
STUDY = 'library/ngspice/studies/xfly6s_xfly8s_c3l_scaled_comparison'
|
|
|
|
| 15 |
|
| 16 |
from sp2 import sp2_preset
|
| 17 |
from rsc2 import preset as rsc2_preset
|
| 18 |
+
from si2 import preset as si2_preset
|
| 19 |
|
| 20 |
+
FIXED_PRESETS = {"sp2": sp2_preset, "rsc2": rsc2_preset, "si2": si2_preset}
|
| 21 |
|
| 22 |
|
| 23 |
STUDY = 'library/ngspice/studies/xfly6s_xfly8s_c3l_scaled_comparison'
|
static/compare/app.js
CHANGED
|
@@ -3,13 +3,14 @@ const $=s=>document.querySelector(s),$$=s=>[...document.querySelectorAll(s)];
|
|
| 3 |
const esc=s=>String(s??'').replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]));
|
| 4 |
const fmt=(v,n=3)=>Number(v).toLocaleString('en-US',{minimumFractionDigits:n,maximumFractionDigits:n});
|
| 5 |
let focusedTopology=null;
|
|
|
|
| 6 |
let ratio=4,catalog=[],selected=new Set(['xfly2p','xfly4p','3lbuck','2sbuck','buck']),report=null,imageData=null,timer,requestId=0;
|
| 7 |
async function api(path,p){return window.OpenPELSEngine.api(path,p)}
|
| 8 |
function toast(text){$('#toast').textContent=text;$('#toast').hidden=false;clearTimeout(timer);timer=setTimeout(()=>$('#toast').hidden=true,5000)}
|
| 9 |
function download(name,body,type='image/svg+xml'){const u=URL.createObjectURL(new Blob([body],{type})),a=document.createElement('a');a.href=u;a.download=name;a.click();setTimeout(()=>URL.revokeObjectURL(u),1000)}
|
| 10 |
-
function params(){return {ratio,topologies:[...selected],...Object.fromEntries(['rho_c','rho_l','rho_q','rho_t'].map(k=>[k,Number($('#'+k).value)]))}}
|
| 11 |
function equivalent(r){
|
| 12 |
-
const resonant=
|
| 13 |
const ink='#455c50',teal='#157e70',orange='#bb7d37',blue='#62869d',value=v=>r.valid?fmt(v)+' Rₛ':'not derived';
|
| 14 |
const blocks=[{x:480,key:'R_FET',sub:'S',v:r.coefficients?.[0],base:'Rₛ'},{x:600,key:'R_CAP',sub:'C',v:r.coefficients?.[1],base:'R꜀'},{x:720,key:'R_IND',sub:'L',v:r.coefficients?.[2],base:'Rₗ'}];
|
| 15 |
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1120 380" role="img" aria-label="${esc(r.short)} ideal DC transformer, FSL series losses, charging increment, and separate gate-drive and Coss accounting shunts"><title>${esc(r.short)} power-loss equivalent circuit</title><rect width="1120" height="380" fill="white"/>
|
|
@@ -30,28 +31,32 @@ function equivalent(r){
|
|
| 30 |
function dieAllocation(r){
|
| 31 |
const a=r.allocation;if(!a)return '';
|
| 32 |
const width=r.id===focusedTopology&&typeof sp2Analysis!=='undefined'?sp2Analysis?.deviceReport?.parameters.width_mm:null;
|
| 33 |
-
const
|
| 34 |
-
const
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
| 36 |
}
|
| 37 |
function cards(){
|
| 38 |
-
$('#circuits').innerHTML=report.rows.map(r=>{const meta=catalog.find(c=>c.id===r.id),sub=r.id==='xfly2p'?'Six-switch cell · two-command reference':r.id==='xfly4p'?'Split-middle cell · four-pulse reference':meta.family;return `<article class="circuit-card" data-topology="${r.id}"><div class="topology"><h2>${esc(meta.name)}</h2><div class="sub">${esc(sub)}</div><div class="topology-visuals"><img src="./assets/${['xfly2p','xfly4p','3lbuck','2sbuck','buck'].includes(r.id)?meta.asset.replace('.svg','-loss.svg'):meta.asset}" alt="${esc(meta.name)} ${['sp2','rsc2'].includes(r.id)?'topology schematic':'topology with individual device resistance labels'}">${dieAllocation(r)}</div>${r.allocation?`<p class="device-note">
|
| 39 |
$$('[data-svg]').forEach(b=>b.onclick=()=>download('openpels-'+b.dataset.svg+'-equivalent.svg',$(`[data-topology="${b.dataset.svg}"] .equivalent-drawing svg`).outerHTML));
|
| 40 |
$('#coefficients').innerHTML=report.rows.map(r=>`<div class="formula"><b>${esc(r.short)}</b> · ${esc(r.domain)}${(r.formulas||['Not derived for this topology.']).map((f,i)=>`<code>${['RFET','RCAP','RIND','RSSL'][i]} = ${esc(f)}</code>`).join('')}<p>${esc(r.note)}</p></div>`).join('');
|
| 41 |
}
|
| 42 |
function picker(){
|
| 43 |
const ids=OpenPELSRecommendation.familyIds(ratio),groups=[[`${ratio}:1 coupled-inductor cancellation family`,catalog.filter(c=>ids.includes(c.id))]];
|
|
|
|
| 44 |
if(ratio===2)groups.push(['Fixed 2:1 switched-capacitor references',catalog.filter(c=>['sp2','rsc2'].includes(c.id))]);
|
| 45 |
$('#topology-picker').innerHTML=groups.map(([label,items])=>`<div class="picker-group"><span>${label}</span><div>${items.map(c=>`<button data-topology-choice="${c.id}" class="${selected.has(c.id)?'active':''}" aria-pressed="${selected.has(c.id)}">${selected.has(c.id)?'✓ ':''}${esc(c.short)}</button>`).join('')}</div></div>`).join('');
|
| 46 |
-
$$('[data-topology-choice]').forEach(b=>b.onclick=()=>{const id=b.dataset.topologyChoice;if(selected.has(id)){if(typeof
|
| 47 |
}
|
| 48 |
async function update(useEnteredWeights=false){const id=++requestId;try{
|
| 49 |
-
if(typeof
|
| 50 |
const base=(await api('/api/analyze-pu',{ratio:2,topologies:[focusedTopology]})).rows[0];
|
| 51 |
if(id!==requestId)return;
|
| 52 |
prepareSp2Analysis(base,useEnteredWeights);
|
| 53 |
}
|
| 54 |
-
const result=selected.size?await api('/api/analyze-pu',params()):{rows:[],curves:[],M:1/ratio,normalization:{rho_c:1,rho_l:1,rho_q:20}};if(id!==requestId)return;report=result;$('#resonant-model').hidden=!selected.has('rsc2');$('#rho_t').parentElement.hidden=!selected.has('rsc2');cards();renderRecommendation();$('#status').textContent=`Step-down ${ratio}:1 · M = ${fmt(1/ratio)} · RS base · ${(selected.has('sp2')||selected.has('rsc2'))?'fixed switched-capacitor reference':'cancellation-point family only'} · fixed loss-sizing allocations${selected.has('boost')?' · boost uses ratio 1:'+ratio:''}`;if($('#sweep-section').open)drawSweep()}catch(e){$('#status').textContent='Check inputs';toast(e.message)}}
|
| 55 |
function chart(id,series,{xlabel='',ylabel='',logx=false,logy=false,xrange,yrange,marker=null,hline=null}={}){
|
| 56 |
const host=$('#'+id);const W=Math.max(310,host.clientWidth),H=280,L=55,R=16,T=15,B=45;const all=series.flatMap(s=>s.points).filter(p=>p.every(Number.isFinite));
|
| 57 |
if(!all.length){host.innerHTML='<p class="muted">No supported numerical model selected.</p>';return}
|
|
@@ -72,11 +77,11 @@ function chart(id,series,{xlabel='',ylabel='',logx=false,logy=false,xrange,yrang
|
|
| 72 |
host.innerHTML=svg;const canvas=host.querySelector('svg'),tip=host.querySelector('.chart-tooltip'),cursor=host.querySelector('#cursor-'+id);
|
| 73 |
canvas.addEventListener('pointermove',e=>{const point=canvas.createSVGPoint();point.x=e.clientX;point.y=e.clientY;const p=point.matrixTransform(canvas.getScreenCTM().inverse());if(p.x<L||p.x>W-R)return;let xx=tx(xmin)+(p.x-L)/(W-L-R)*(tx(xmax)-tx(xmin));if(logx)xx=10**xx;let lines=[];for(const s of series){const a=s.points;if(a.length===1?Math.abs(X(a[0][0])-p.x)>9:xx<a[0][0]||xx>a.at(-1)[0])continue;let nearest=a.reduce((a,b)=>Math.abs(a[0]-xx)<Math.abs(b[0]-xx)?a:b);lines.push(`${esc(s.name)}: ${fmt(nearest[1])}`)}tip.innerHTML=`<b>${logx?fmt(xx,0)+' Hz':'M = '+fmt(xx,3)}</b><br>${lines.join('<br>')}`;tip.hidden=false;tip.style.left=Math.min(e.clientX-host.getBoundingClientRect().left+12,host.clientWidth-170)+'px';tip.style.top='35px';cursor.setAttribute('d',`M${p.x},${T}V${H-B}`);cursor.setAttribute('visibility','visible')});canvas.addEventListener('pointerleave',()=>{tip.hidden=true;cursor.setAttribute('visibility','hidden')});
|
| 74 |
}
|
| 75 |
-
function drawSweep(){if(!report)return;chart('rout-chart',report.curves,{xlabel:'Nominal Vout / Vin',ylabel:'Req / Rs (p.u.)',logy:true,xrange:[0,.5],yrange:[Math.max(.001,Math.min(...report.curves.flatMap(s=>s.points.map(p=>p[1])))*.8),Math.max(50,...report.curves.filter(s=>s.points.length===1).map(s=>1.15*s.points[0][1]))],marker:report.M});$('#legend').innerHTML=report.curves.map(s=>`<span><i style="background:${s.color}"></i>${s.name}</span>`).join('')}
|
| 76 |
$('#sweep-section').addEventListener('toggle',()=>{if($('#sweep-section').open)drawSweep()});
|
| 77 |
$$('[data-ratio]').forEach(b=>b.onclick=()=>{ratio=Number(b.dataset.ratio);updateLoadSummary();selected=new Set(OpenPELSRecommendation.familyIds(ratio));$$('[data-ratio]').forEach(v=>v.classList.toggle('active',v===b));picker();update()});
|
| 78 |
-
$('#apply-weights').onclick=()=>update(true);$('#reset').onclick=()=>{for(const [k,v] of Object.entries({rho_c:1,rho_l:1,rho_q:20,rho_t:.61}))$('#'+k).value=v;$('#toast').hidden=true;clearTimeout(timer);update(true)};
|
| 79 |
-
$('#export-csv').onclick=()=>{if(!report)return;const hasTank=report.rows.some(r=>r.id==='rsc2');const rows=[['Topology','Target_ratio','kFET_Rs','kCAP_Rc','kIND_Rl','kSSL_over_Cf_fs','RFET_pu','RCAP_pu','RIND_pu','RSSL_pu','Req_pu','RFSL_pu','RSSL_add_pu','Switching_loss_scope','rho_C','rho_L','rho_Q','Model_domain',...(hasTank?['rho_T']:[])],...report.rows.map(r=>[r.short,ratio,...(r.valid?r.coefficients:['','','','']),...['fet','cap','ind','ssl','total','fsl','ssl_series'].map(k=>r.valid?r[k]:''),r.resonant?'Tank RMS partition in RFSL_pu; independent SSL and charging increment are inapplicable. Separate gate and optional Coss.':'Separate technology example; Coss requires energy data',report.normalization.rho_c,report.normalization.rho_l,report.normalization.rho_q,r.domain,...(hasTank?[r.id==='rsc2'?report.normalization.rho_t:'']:[])])];download('openpels-per-unit-comparison.csv',rows.map(r=>r.map(v=>'"'+String(v).replaceAll('"','""')+'"').join(',')).join('\n'),'text/csv')};
|
| 80 |
$('#open-upload').onclick=()=>$('#upload-dialog').showModal();$('#close-upload').onclick=()=>$('#upload-dialog').close();
|
| 81 |
async function loadImage(file){if(!file)return;if(!['image/png','image/jpeg','image/webp'].includes(file.type)||file.size>8000000){toast('Choose a PNG, JPEG or WebP smaller than 8 MB.');return}imageData=await new Promise((resolve,reject)=>{const r=new FileReader();r.onload=()=>resolve(r.result);r.onerror=reject;r.readAsDataURL(file)});$('#image-preview').src=imageData;$('#image-preview').hidden=false;$('#inspect').disabled=false;$('#upload-status').textContent=file.name+' · ready for interpretation';$('#interpretation').hidden=true}
|
| 82 |
$('#image-upload').onchange=e=>loadImage(e.target.files[0]);$('#dropzone').ondragover=e=>{e.preventDefault();$('#dropzone').classList.add('drag')};$('#dropzone').ondragleave=()=>$('#dropzone').classList.remove('drag');$('#dropzone').ondrop=e=>{e.preventDefault();$('#dropzone').classList.remove('drag');loadImage(e.dataTransfer.files[0])};
|
|
@@ -90,31 +95,37 @@ $('#tech-settings').innerHTML=techFields.map(([k,label,v])=>`<label>${label}<inp
|
|
| 90 |
let technologyReport;
|
| 91 |
function technologyParameters(){return Object.fromEntries(techFields.filter(([k])=>k!=='eoss_pj'||$('#tech-'+k).value.trim()!=='').map(([k])=>[k,Number($('#tech-'+k).value)]))}
|
| 92 |
function renderTechnology(){if(!report)return;try{
|
| 93 |
-
const switchedCap=typeof
|
| 94 |
const p=technologyParameters();const design=designParameters();const point=OpenPELSRecommendation.operatingPoint(design);p.vin=point.parameters.vin;p.io=point.output_current;if(selected.has('rsc2')&&!switchedCap)p.tank_nh=Number($('#design-tank_nh').value);technologyReport=switchedCap?sp2Analysis?.deviceReport:OpenPELSTechnology.example(report.rows,p);
|
| 95 |
if(!technologyReport)throw Error(sp2Error||'Enter a positive flying-capacitor budget for the device calculation.');
|
| 96 |
$('#export-technology').disabled=false;const t=technologyReport,unit=(v,scale=1)=>v==null?'unknown':!Number.isFinite(v)?'∞':fmt(v*scale);
|
| 97 |
$('#technology-status').textContent=`Rs = ${fmt(t.rs*1e3)} mΩ · RΣ = ${fmt(t.parallel*1e3)} mΩ · gate demand = ${fmt(t.gate_power*1e3)} mW · ${switchedCap?'same sized device result as the loss lineup':'physical example is separate from the per-unit weights above'}`;
|
| 98 |
-
$('#technology-results').innerHTML=`<table><caption>${switchedCap?(focusedTopology==='rsc2'?'Optimized-width resonant SC result · exact periodic RLC.':'Optimized-width SP-SC result · exact linear periodic RC.'):'Fixed-width example: flat-current buck models; exact linear periodic RC for SP-SC. Not measured efficiency.'}</caption><thead><tr><th>Topology</th><th>CF each (μF)</th><th>RFET (mΩ)</th><th>RCAP (mΩ)</th><th>RIND (mΩ)</th><th>RHC,add (mΩ)</th><th>Req (mΩ)</th><th>Rg at Vx (Ω)</th><th>Ross at Vx (Ω)</th><th>Iout²Req + Pg + known Poss (mW)</th></tr></thead><tbody>${t.rows.map(r=>r.valid?`<tr><th>${esc(report.rows.find(a=>a.id===r.id).short)}</th><td>${r.cf?unit(r.cf,1e6):'—'}</td>${['fet','cap','ind','hc','req'].map(k=>`<td>${(k==='ind'&&r.id==='sp2'||k==='hc'&&
|
| 99 |
|
| 100 |
}catch(e){technologyReport=null;$('#technology-status').textContent=e.message;$('#technology-results').innerHTML='';$('#export-technology').disabled=true}}
|
| 101 |
-
$('#apply-technology').onclick=()=>document.body.classList.contains('sp2-focused')?update():renderTechnology();$('#export-technology').onclick=()=>{if(technologyReport)download('openpels-180nm-example.json',JSON.stringify({...technologyReport,source:'User-supplied XFLY_Power_Analysis.md; not independently verified foundry data',method:document.body.classList.contains('sp2-focused')?(focusedTopology==='rsc2'?'Exact periodic RLC with separate gate and optional effective Coss energy.':'Exact periodic RC plus separate gate and optional effective Coss energy; Qoss does not establish Eoss'):'Paper FSL/SSL interpolation; separate gate demand; Qoss does not establish Eoss'},(k,v)=>typeof v==='number'&&!Number.isFinite(v)?String(v):v,2),'application/json')};
|
| 102 |
(function rcChart(){const w=600,h=210,x=a=>45+(Math.log10(a)+2)/4*530,y=v=>175-(Math.log10(v)+.3)/3*155,points=fn=>Array.from({length:161},(_,i)=>{const a=10**(-2+i/40);return `${x(a)},${y(fn(a))}`}).join(' ');$('#rc-limit-chart').innerHTML=`<svg viewBox="0 0 ${w} ${h}" role="img" aria-label="Finite RC event resistance and its SSL and FSL limits on log axes"><defs><clipPath id="rc-plot-clip"><rect x="45" y="15" width="530" height="160"/></clipPath></defs><rect width="600" height="210" fill="white"/><path d="M45 15V175H575" fill="none" stroke="#a6b6aa"/><g clip-path="url(#rc-plot-clip)"><polyline points="${points(a=>1/Math.tanh(a/2))}" fill="none" stroke="#157e70" stroke-width="2"/><polyline points="${points(a=>2/a)}" fill="none" stroke="#5c70b8" stroke-dasharray="5 4"/><polyline points="${points(()=>1)}" fill="none" stroke="#cf7b30" stroke-dasharray="5 4"/></g><g font-family="Arial" font-size="10" fill="#526b5e"><text x="65" y="18">Revent / RSSL · log axis</text><text x="340" y="18">green: finite RC · blue: FSL · orange: SSL</text>${[.01,.1,1,10,100].map(a=>`<text x="${x(a)}" y="190" text-anchor="middle">${a}</text>`).join('')}${[1,10,100].map(v=>`<text x="36" y="${y(v)+3}" text-anchor="end">${v}</text>`).join('')}<text x="310" y="207" text-anchor="middle">d / (fs Rpath C) · log axis</text></g></svg>`})();
|
| 103 |
const designFields=[
|
| 104 |
['vout','Output voltage (V)',.825],['io','Output current (A)',2],['fs_mhz','Frequency (MHz)',10],
|
| 105 |
['budget_mode','Silicon budget','area','select',[['area','Die area + Ron × area'],['width','Total FET width']]],
|
| 106 |
['die_mm2','Total die area (mm²)',1],['utilization','Usable transistor fraction',.5],['ron_area_mohm_mm2','Ron × area (mΩ·mm²)',1],['width_mm','Maximum FET width (mm)',360],
|
| 107 |
-
['cap_uf','Flying / clamp budget (μF)',4],['max_caps','Maximum flying / clamp caps',4],['max_windings','Maximum power windings',2],['rc_mohm','Main-cap ESR (mΩ)',20],['rl_mohm','DCR per winding (mΩ)',38],['tank_nh','Series inductance per leg (nH)',5.5],['lk_nh','Leakage Lk per winding (nH)',50],['lm_uh','Magnetizing Lm (μH)',1],['max_phase_ripple_percent','Max phase ripple pp (% avg)',5],['max_drop_percent','Maximum estimated droop (%)',10],
|
| 108 |
['objective','Priority','loss','select',[['loss','Lowest modeled loss'],['capacitors','Fewest capacitors, then loss'],['magnetics','Fewest power windings, then loss']]]
|
| 109 |
];
|
| 110 |
$('#design-fields').innerHTML=designFields.map(([k,label,value,type,options])=>`<label data-design-field="${k}">${label}${type==='select'?`<select id="design-${k}">${options.map(([v,t])=>`<option value="${v}" ${value===v?'selected':''}>${t}</option>`).join('')}</select>`:`<input id="design-${k}" type="number" value="${value}" min="0" step="any">`}</label>`).join('');
|
| 111 |
const loadBudgetField=$('[data-design-field="budget_mode"]');$('#design-fields').insertBefore($('#load-summary'),loadBudgetField);
|
| 112 |
let recommendationReport;
|
| 113 |
-
function designParameters(){return {ratio,voltage_mode:'output_ratio',load_mode:'current',...Object.fromEntries(designFields.filter(([k])=>k!=='tank_nh'||focusedTopology==='rsc2').map(([k,label,v,type])=>[k,type==='select'?$('#design-'+k).value:Number($('#design-'+k).value)]))}}
|
| 114 |
function showBudgetFields(){const mode=$('#design-budget_mode').value;for(const k of ['die_mm2','utilization','ron_area_mohm_mm2'])$(`[data-design-field="${k}"]`).hidden=mode!=='area';$('[data-design-field="width_mm"]').hidden=mode!=='width'}
|
| 115 |
showBudgetFields();$('#design-budget_mode').onchange=showBudgetFields;
|
| 116 |
function updateLoadSummary(){
|
| 117 |
-
try{const op=OpenPELSRecommendation.operatingPoint(designParameters());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 118 |
|
| 119 |
|
| 120 |
function inspectRecommendation(id){const r=recommendationReport?.rows.find(r=>r.id===id);if(!r||r.status!=='eligible')return;
|
|
@@ -124,27 +135,27 @@ if(document.body.classList.contains('sp2-focused')){
|
|
| 124 |
selected=new Set([id]);const p=recommendationReport.parameters;$('#rho_c').value=(p.rc_mohm/1000/r.rs).toPrecision(8);$('#rho_l').value=(p.rl_mohm/1000/r.rs).toPrecision(8);$('#rho_q').value=r.cf?(1/(r.cf*p.fs_mhz*1e6*r.rs)).toPrecision(8):0;$('#analysis-workbench').open=true;$('#inspection-context').textContent=`${r.short}: ${fmt(r.width_mm)} mm total FET width, Rs = ${fmt(r.rs*1e3)} mΩ, modeled loss = ${fmt(r.loss*1e3)} mW. Reference die-map proportions are scaled to this width; A₀ = ${fmt(r.width_mm/12)} mm of width. The shortlist uses the common full-budget RS base; these diagrams use the actual sized-device Rs. The device example below is a separate reference calculation.`;picker();update();$('#analysis-workbench').scrollIntoView({behavior:'smooth',block:'start'})}
|
| 125 |
let comparisonView='scoreboard';
|
| 126 |
function lossScoreboard(t){const data=t.loss_scoreboard;if(!data.rows.length)return '';
|
| 127 |
-
const switchedCap=t.rows[0]?.id==='sp2', resonant=t.rows[0]?.id==='rsc2';
|
| 128 |
const lossValue=(d,m)=>d.powers[m.id]===null?(m.id==='ind'?'N/A':'Unknown'):`${fmt(d.powers[m.id]*1e3,2)} <small>mW</small>`;const byId=Object.fromEntries(t.eligible.map(r=>[r.id,r]));const rating=n=>n==null?'—':String(n),tone=n=>n==null?'neutral':n>=66?'good':n>=33?'mid':'weak';
|
| 129 |
-
return `<section class="loss-scoreboard" aria-label="Loss mechanism scoreboard"><div class="scoreboard-intro"><b>THE LOSS LINEUP</b><span>Higher score = lower modeled loss · actual values in mW</span></div><div class="scoreboard-scroll"><table style="--teams:${data.rows.length}"><thead><tr><th class="mechanism-heading">Compare the same<br>mechanism across circuits</th>${data.rows.map(d=>{const r=byId[d.id];return `<th class="team-heading"><span class="team-family">${r.native_ratio}:1 FAMILY</span><h3>${esc(r.short)}</h3><img src="./assets/${r.asset.replace('.svg','-candidate.svg')}" alt="${esc(r.name)} topology"><div class="team-total">${fmt(d.total*1e3,1)} <small>mW</small></div><span class="team-total-label">TOTAL MODELED LOSS</span><div class="loss-mix" aria-label="Loss composition">${data.mechanisms.filter(m=>d.powers[m.id]!=null).map(m=>`<span style="width:${d.total?d.powers[m.id]/d.total*100:0}%;background:${m.color}" title="${m.name}: ${fmt(d.powers[m.id]*1e3,2)} mW"></span>`).join('')}</div><span class="team-rout">Rout ${fmt(r.rout*1e3,2)} mΩ</span></th>`}).join('')}</tr></thead><tbody>${data.mechanisms.map(m=>`<tr data-loss-mechanism="${m.id}"><th><span class="mechanism-symbol" style="color:${m.color}">${m.symbol}</span><span>${m.name}</span>${switchedCap&&['fet','cap'].includes(m.id)?'<small>Fast-switching baseline</small>':''}${m.id==='charging'?'<small>Finite-charge addition only</small>':''}</th>${data.rows.map(d=>`<td data-score-team="${d.id}" data-score-value="${d.ratings[m.id]??''}"><div class="mechanism-stat"><span class="mechanism-rating ${tone(d.ratings[m.id])}">${rating(d.ratings[m.id])}</span><strong>${lossValue(d,m)}</strong></div><div class="attribute-track"><span class="${tone(d.ratings[m.id])}" style="width:${d.ratings[m.id]??0}%"></span></div></td>`).join('')}</tr>`).join('')}${switchedCap?'':`<tr class="unquantified-row"><th>${resonant?'Core / dead time':'Coss / core / ripple'}<small>Outside the current loss model</small></th>${data.rows.map(()=>'<td>Not quantified<span>No score assigned</span></td>').join('')}</tr>`}<tr class="tradeoff-row"><th>PRO / TRADEOFF<small>Against the other displayed circuits</small></th>${data.rows.map(d=>`<td><p class="score-pro">+ ${esc(d.pro)}${d.pro_delta!=null?`<small>${fmt(d.pro_delta*1e3,2)} mW less than others’ mean</small>`:''}</p><p class="score-con">↔ ${esc(d.con)}${d.con_delta!=null?`<small>${fmt(d.con_delta*1e3,2)} mW more than others’ mean</small>`:''}</p><p class="score-resources">${byId[d.id].capacitors} caps · ${byId[d.id].windings} windings<br>${fmt(byId[d.id].width_mm,1)} mm FET width</p><button data-inspect-design="${d.id}">Inspect circuit →</button></td>`).join('')}</tr></tbody></table></div><p class="scoreboard-note">${esc(data.scale)} Unknown losses are not scored as zero. The stacked color strip shows each mechanism’s share of modeled loss; ratings compare mechanisms separately.</p><details class="scoreboard-method"><summary>What is included in each loss?</summary><p>${resonant?'The periodic tank RMS current gives switch conduction, flying-capacitor ESR and inductor DCR losses. Gate demand and any entered Coss energy are separate. Core and dead-time effects are unquantified.':switchedCap?'Conduction and ESR are the fast-switching baseline. The finite-charge addition is Iout² (Req − RFSL). The exact finite-RC path dissipation is represented by the baseline plus this increment; the raw SSL asymptote is never summed again. Gate demand is separate. Coss is included once when effective energy is provided. Winding DCR and magnetic losses are not applicable.':`Switch = Iout² RFET; capacitor = Iout² RCAP; winding = Iout² RIND; charging = Iout² (Req − RFSL); gate = the FOM-based gate-drive demand. These five terms sum to the displayed modeled total. The raw RSSL asymptote is not added again. Coss, core and ripple corrections remain unquantified. Pros and tradeoffs identify the largest mW difference versus the mean of the other displayed circuits; ratings are recalculated when this comparison set changes.`}</p></details></section>`;
|
| 130 |
}
|
| 131 |
function setComparisonView(view){comparisonView=view;$('#loss-scoreboard-view').hidden=view!=='scoreboard';$('#candidate-cards-view').hidden=view!=='circuits';$$('[data-comparison-view]').forEach(b=>{b.classList.toggle('active',b.dataset.comparisonView===view);b.setAttribute('aria-pressed',String(b.dataset.comparisonView===view))})}
|
| 132 |
function renderRecommendation(){if(!catalog.length)return;
|
| 133 |
-
const switchedCap=typeof
|
| 134 |
try{
|
| 135 |
if(switchedCap&&!sp2Analysis)throw Error(sp2Error||'Enter valid fixed-ratio design inputs.');
|
| 136 |
recommendationReport=switchedCap?sp2Analysis:OpenPELSRecommendation.recommend(designParameters(),{catalog},OpenPELSEngine,OpenPELSTechnology);
|
| 137 |
if(!switchedCap&&typeof focusRecommendation==='function')recommendationReport=focusRecommendation(recommendationReport);
|
| 138 |
recommendationReport.loss_scoreboard=OpenPELSScores.build(recommendationReport);$('#design-error').textContent='';$('#recommend-design').textContent=switchedCap?'Update design':'Update candidates';$('#export-recommendation').disabled=false;const t=recommendationReport,p=t.parameters,native=t.native_models;
|
| 139 |
-
$('#family-context').textContent=switchedCap?(focusedTopology==='rsc2'?'Fixed 2:1 resonant SC · two uncoupled series-RLC legs':'Fixed 2:1 switched-capacitor reference · 50% duty · two flying capacitors'):native?`${ratio}:1 cancellation family · ${native} coupled-inductor candidates. Complementary winding excitation or ideal midpoint hold is admitted; estimated phase ripple must satisfy the entered limit.`:`${ratio}:1 · no verified coupled-inductor cancellation-point model in the current library. Off-duty and uncoupled circuits are omitted.`;
|
| 140 |
$('#candidate-status').textContent=t.eligible.length?`${t.eligible.length} candidates meet the current limits · Rload = ${fmt(t.load_resistance,4)} Ω. Inspect any panel to review its model.`:!native?'No qualified coupled-inductor cancellation-point model is available for this ratio.':!t.voltage_ratio_match?'The requested output voltage does not match this ratio’s nominal cancellation point.':'No candidate passes the current constraints. Expand the excluded candidates below for reasons.';
|
| 141 |
const candidatePanel=r=>{
|
| 142 |
const supported=!!OpenPELSRecommendation.specs[r.id],eligible=r.status==='eligible';
|
| 143 |
if(!supported)return `<p class="unmodeled-candidate"><b>${esc(r.short)}</b> · ${r.reasons.map(esc).join('; ')}</p>`;
|
| 144 |
const image=r.asset.replace('.svg','-candidate.svg');
|
| 145 |
-
return `<article class="candidate-panel ${eligible?'':'candidate-excluded'}" data-candidate="${r.id}" data-candidate-status="${r.status}"><div class="candidate-heading"><span class="candidate-rank">${eligible?'#'+r.rank:'Not eligible'}</span><span class="candidate-family">${r.native_ratio}:1 ${switchedCap?'fixed ratio':'cancellation point'}</span></div><h3>${esc(r.name)}</h3><div class="candidate-drawing"><img src="./assets/${image}" alt="${esc(r.name)} schematic" loading="lazy"></div>${eligible?`<div class="candidate-metrics"><div><strong>${fmt(r.loss*1e3,1)} mW</strong><span>Modeled loss</span></div><div><strong>${fmt(r.rout*1e3,2)} mΩ</strong><span>Converter Rout · ${fmt(r.req_pu)} p.u.</span></div></div><p class="candidate-resistances">R<sub>load</sub> = ${fmt(t.load_resistance,4)} Ω · R<sub>out</sub>/R<sub>load</sub> = ${fmt(r.rout_over_rload*100,2)}%<br>R<sub>S</sub> = ${fmt(r.rs*1e3,2)} mΩ${r.capacitors?' · R<sub>C</sub> = '+fmt(p.rc_mohm,1)+' mΩ':''}${r.windings?' · R<sub>L</sub> = '+fmt(p.rl_mohm,1)+' mΩ/winding':''}</p><p class="candidate-resources">${r.capacitors} flying/clamp caps · ${r.windings} windings<br>${fmt(r.width_mm,1)} mm FET width · ${fmt(r.drop_percent,1)}% nominal droop<br>${switchedCap?`<b>${fmt(100*r.efficiency,2)}% modeled efficiency</b> · ${fmt(r.cf*1e6)} μF each`:r.ripple_model==='ideal_midpoint_hold'?'<b>Ideally zero winding ripple at 2:1</b><br>Capacitor-ripple and mismatch effects are not quantified.':`<b>${fmt(r.phase_ripple_percent,2)}% phase ripple pp</b> · ${fmt(r.phase_ripple_pp*1e3,1)} mA · ${fmt(r.effective_frequency/1e6,1)} MHz effective excitation`}</p><button data-inspect-design="${r.id}">Inspect circuit and die allocation →</button>`:`<p class="candidate-reason">${r.reasons.map(esc).join('; ')}</p>${r.ripple_model==='ideal_midpoint_hold'?'<p class="candidate-reason">Ideal 2:1 midpoint hold gives zero winding ripple; real capacitor-ripple and mismatch effects are not quantified.</p>':''}`}</article>`;
|
| 146 |
};
|
| 147 |
-
$('#shortlist-results').innerHTML=`${switchedCap?sp2EfficiencySummary(t):''}${t.eligible.length?`<div class="comparison-switch" aria-label="Comparison view"><button data-comparison-view="scoreboard">Loss scoreboard</button><button data-comparison-view="circuits">Circuit cards</button></div><div id="loss-scoreboard-view">${lossScoreboard(t)}</div>`:''}<div id="candidate-cards-view"><p class="candidate-legend">${focusedTopology==='rsc2'?'R<sub>C</sub> and R<sub>L</sub> are per-leg losses. A and B identify the two complementary clock commands. Eight devices share the used width equally.':switchedCap?'R<sub>S</sub>: unit-area MOSFET on-resistance · R<sub>C</sub>: flying-capacitor ESR. Eight equal-width devices. Gate-control annotations are omitted from these previews.':`R<sub>S</sub>: unit-area MOSFET on-resistance · R<sub>C</sub>: main-capacitor ESR · R<sub>L</sub>: winding resistance. Device multipliers follow each topology’s die allocation; clamp ESR is zero in the clamp-cell model. Gate-control annotations are omitted from these previews.`}</p><div class="candidate-grid">${t.eligible.map(candidatePanel).join('')||'<p class="no-candidates">No candidate satisfies all currently modeled screens.</p>'}</div></div><details class="excluded-list"><summary>${switchedCap?'Fixed-ratio candidates failing constraints':'Cancellation-point candidates failing constraints'} (${t.rows.length-t.eligible.length})</summary><div class="candidate-grid">${t.rows.filter(r=>r.status==='excluded').map(candidatePanel).join('')}</div>${t.rows.filter(r=>r.status==='unmodeled').map(candidatePanel).join('')}</details>`;
|
| 148 |
if(t.eligible.length){setComparisonView(comparisonView);$$('[data-comparison-view]').forEach(b=>b.onclick=()=>setComparisonView(b.dataset.comparisonView))}$$('[data-inspect-design]').forEach(b=>b.onclick=()=>inspectRecommendation(b.dataset.inspectDesign));renderTechnology();
|
| 149 |
}catch(e){recommendationReport=null;$('#design-error').textContent=e.message;$('#candidate-status').textContent='Check the design inputs to calculate the candidates.';$('#shortlist-results').innerHTML='';$('#export-recommendation').disabled=true;renderTechnology()}}
|
| 150 |
$('#design-fields').addEventListener('input',()=>{updateLoadSummary();if(document.body.classList.contains('sp2-focused'))return;$('#design-error').textContent='Inputs changed — update the recommendation.';$('#recommend-design').textContent='Update candidates';$('#export-recommendation').disabled=true;$$('[data-inspect-design]').forEach(b=>b.disabled=true)});$('#recommend-design').onclick=()=>document.body.classList.contains('sp2-focused')?update():renderRecommendation();$('#export-recommendation').onclick=()=>{if(recommendationReport)download('openpels-design-shortlist.json',JSON.stringify(recommendationReport,(k,v)=>k==='deviceReport'?undefined:v,2),'application/json')};
|
|
@@ -164,15 +175,16 @@ function focusRecommendation(result) {
|
|
| 164 |
native_models: rows.filter((row) => row.reference_match).length,
|
| 165 |
};
|
| 166 |
}
|
| 167 |
-
function
|
| 168 |
-
return ['sp2','rsc2'].includes(focusedTopology) && ratio === 2;
|
| 169 |
}
|
| 170 |
let sp2Analysis, sp2Error, manualSp2Weights = false;
|
| 171 |
function prepareSp2Analysis(base, useEnteredWeights) {
|
| 172 |
manualSp2Weights = useEnteredWeights;
|
| 173 |
try {
|
| 174 |
const {vgs, events, eoss_pj} = technologyParameters();
|
| 175 |
-
|
|
|
|
| 176 |
designParameters(), {vgs, events, eoss_pj}, base,
|
| 177 |
catalog.find((item) => item.id === focusedTopology), OpenPELSTechnology,
|
| 178 |
);
|
|
@@ -195,6 +207,12 @@ function prepareSp2Analysis(base, useEnteredWeights) {
|
|
| 195 |
// DCR assumption for any optional inductive comparison curves.
|
| 196 |
$("#rho_l").value = (Number($("#design-rl_mohm").value) / 1000 / t.rs).toPrecision(12);
|
| 197 |
$("#rho_q").value = (1 / (r.cf * t.parameters.fs_mhz * 1e6 * t.rs)).toPrecision(12);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 198 |
if (r.tank) {
|
| 199 |
$("#rho_t").value = (t.parameters.tank_nh*1e-9*t.parameters.fs_mhz*1e6/t.rs).toPrecision(12);
|
| 200 |
context.textContent = `Resonant design weights · Rs = ${fmt(t.rs*1e3)} mΩ, tank frequency ${fmt(r.tank.natural_frequency_hz/1e6)} MHz.`;
|
|
@@ -206,7 +224,7 @@ function sp2EfficiencySummary(t) {
|
|
| 206 |
const r = t.rows[0];
|
| 207 |
if (r.efficiency == null)
|
| 208 |
return '<p id="sp2-efficiency">This operating point has no positive delivered-voltage estimate or capacitance budget. Check the design constraints and load.</p>';
|
| 209 |
-
return `<p id="sp2-efficiency">Modeled efficiency: ${(100*r.efficiency).toFixed(2)}% · delivered output ${r.estimated_open_loop_vout.toFixed(4)} V / ${r.delivered_w.toFixed(4)} W · modeled loss ${(1000*r.loss).toFixed(2)} mW.</p><p>Used ${fmt(r.width_mm)} mm of ${fmt(t.available_width_mm)} mm available. Each of eight devices gets 12.5% of used width (${r.device[0].width_mm.toFixed(3)} mm each). ${r.tank?`Tank RMS ${fmt(r.tank.tank_rms_per_output_amp*t.output_current)} A per leg · commutation current magnitude ${fmt(r.tank.commutation_current_per_output_amp*t.output_current)} A. `: ''}${r.coss_power===null?'Coss energy is unknown and is excluded from this estimate.':'It includes the entered Coss energy.'}</p>`;
|
| 210 |
}
|
| 211 |
const sp2Profile = {
|
| 212 |
"design-fs_mhz": 2, "design-budget_mode": "width", "design-width_mm": 80.2666667,
|
|
@@ -214,9 +232,13 @@ const sp2Profile = {
|
|
| 214 |
"design-cap_uf": 2, "design-rc_mohm": 20, "design-max_caps": 2,
|
| 215 |
"design-max_drop_percent": 10, "design-objective": "loss",
|
| 216 |
"tech-vgs": 3.3, "tech-events": 1, "tech-eoss_pj": "",
|
| 217 |
-
rho_c: 1, rho_l: 1, rho_q: 20,
|
|
|
|
| 218 |
};
|
| 219 |
const profiles = new Map([
|
|
|
|
|
|
|
|
|
|
| 220 |
['sp2', {...sp2Profile, 'design-tank_nh':5.5, 'design-max_windings':2, 'design-rl_mohm':38, rho_t:.61}],
|
| 221 |
['rsc2', {...sp2Profile, 'design-width_mm':401.3333333333, 'design-rc_mohm':5,
|
| 222 |
'design-tank_nh':5.5, 'design-max_windings':2, 'design-rl_mohm':4, rho_t:.61}],
|
|
@@ -224,8 +246,14 @@ const profiles = new Map([
|
|
| 224 |
let otherProfile = null;
|
| 225 |
const defaultInputScope = $(".input-scope").textContent;
|
| 226 |
const defaultIntro = $(".intro p").textContent;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 227 |
function switchAnalysisScope(nextId) {
|
| 228 |
-
const entering = profiles.has(nextId), previousFixed =
|
| 229 |
if ((!entering&&!previousFixed)||nextId===focusedTopology) return;
|
| 230 |
const fields = Object.keys(profiles.get('sp2')).map((id) => document.getElementById(id));
|
| 231 |
const current = Object.fromEntries(fields.map((field) => [field.id, field.value]));
|
|
@@ -236,21 +264,23 @@ function switchAnalysisScope(nextId) {
|
|
| 236 |
}
|
| 237 |
else profiles.set(focusedTopology,current);
|
| 238 |
for (const field of fields) field.value = next[field.id];
|
|
|
|
| 239 |
if (!entering) $("#inspection-context").textContent = otherProfile.inspection;
|
| 240 |
$("#design-objective option[value=magnetics]").hidden = nextId==='sp2';
|
| 241 |
$(".selection-method summary").textContent = entering
|
| 242 |
-
? "Fixed-ratio feasibility and recommendation scope"
|
| 243 |
: "Ripple-cancellation criterion and recommendation scope";
|
| 244 |
$(".selection-method").classList.toggle("fixed-ratio-method", entering);
|
| 245 |
-
$('.sp2-method').textContent = nextId==='
|
|
|
|
| 246 |
? 'Matched resonant legs use synchronized 50% commands. The design screens component counts, damping and droop, then sizes FET width. The capacitors and windings have fixed counts under all priorities. Tank current reverses during every period.'
|
| 247 |
: sp2Method;
|
| 248 |
showBudgetFields();
|
| 249 |
$(".intro p").textContent = entering
|
| 250 |
-
? "Size the fixed 2:1 switched-capacitor design and compare its per-unit loss model with other 2:1 references."
|
| 251 |
: defaultIntro;
|
| 252 |
$(".input-scope").textContent = entering
|
| 253 |
-
? "Total FET width is sized within the silicon budget for minimum modeled loss subject to droop. Each of eight switches gets equal width. Two matched flying capacitors share the budget. Gate and optional Coss inputs are in the 180 nm device panel."
|
| 254 |
: defaultInputScope;
|
| 255 |
}
|
| 256 |
function reportOperatingPoint() {
|
|
@@ -260,7 +290,8 @@ function reportOperatingPoint() {
|
|
| 260 |
type: "pe:analysis-point",
|
| 261 |
id: focusedTopology,
|
| 262 |
ratio,
|
| 263 |
-
vout: Number(
|
|
|
|
| 264 |
iout: Number(document.querySelector("#design-io").value),
|
| 265 |
},
|
| 266 |
location.origin,
|
|
@@ -283,11 +314,13 @@ window.addEventListener("message", (event) => {
|
|
| 283 |
switchAnalysisScope(next.id);
|
| 284 |
document.body.classList.toggle("sp2-focused", profiles.has(next.id));
|
| 285 |
document.body.classList.toggle("rsc2-focused", next.id==='rsc2');
|
|
|
|
| 286 |
ratio = next.ratio;
|
| 287 |
focusedTopology = next.id;
|
| 288 |
selected = new Set([next.id]);
|
| 289 |
if (Number.isFinite(next.vout) && next.vout > 0)
|
| 290 |
-
document.querySelector("#design-vout").value = next.vout;
|
|
|
|
| 291 |
if (Number.isFinite(next.iout) && next.iout > 0)
|
| 292 |
document.querySelector("#design-io").value = next.iout;
|
| 293 |
document.body.classList.add("focused-topology");
|
|
@@ -306,10 +339,10 @@ document
|
|
| 306 |
.querySelector("#design-fields")
|
| 307 |
.addEventListener("input", () => {
|
| 308 |
reportOperatingPoint();
|
| 309 |
-
if (
|
| 310 |
});
|
| 311 |
$("#tech-settings").addEventListener("input", () => {
|
| 312 |
-
if (
|
| 313 |
});
|
| 314 |
const sp2Method = "The fixed-ratio design checks a two-capacitor minimum, a positive capacitance budget and the allowable open-loop droop. The 2:1 operating point assumes 50% duty and matched capacitors. Fewest capacitors ties for this fixed circuit, so both priorities minimize loss over width. The per-unit comparison supports other qualified 2:1 references.";
|
| 315 |
function renderSp2Method() {
|
|
|
|
| 3 |
const esc=s=>String(s??'').replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]));
|
| 4 |
const fmt=(v,n=3)=>Number(v).toLocaleString('en-US',{minimumFractionDigits:n,maximumFractionDigits:n});
|
| 5 |
let focusedTopology=null;
|
| 6 |
+
const isSI = () => focusedTopology==='si2' && ratio===2;
|
| 7 |
let ratio=4,catalog=[],selected=new Set(['xfly2p','xfly4p','3lbuck','2sbuck','buck']),report=null,imageData=null,timer,requestId=0;
|
| 8 |
async function api(path,p){return window.OpenPELSEngine.api(path,p)}
|
| 9 |
function toast(text){$('#toast').textContent=text;$('#toast').hidden=false;clearTimeout(timer);timer=setTimeout(()=>$('#toast').hidden=true,5000)}
|
| 10 |
function download(name,body,type='image/svg+xml'){const u=URL.createObjectURL(new Blob([body],{type})),a=document.createElement('a');a.href=u;a.download=name;a.click();setTimeout(()=>URL.revokeObjectURL(u),1000)}
|
| 11 |
+
function params(){return {ratio,topologies:[...selected],...(isSI()?{si_duty:Number($('#design-si_duty').value)>=.25&&Number($('#design-si_duty').value)<=.75?Number($('#design-si_duty').value):.5}:{}),...Object.fromEntries(['rho_c','rho_l','rho_q','rho_t','si_coupling','si_ripple'].map(k=>[k,Number($('#'+k).value)])),...(isSI()?{vin:Number($('#design-vout').value),vout:Number($('#design-vout').value)*Number($('#design-si_duty').value)}:{})}}
|
| 12 |
function equivalent(r){
|
| 13 |
+
const resonant=['si2','rsc2'].includes(r.id),boost=r.id==='boost',unknown=r.id==='ns',ratioText=unknown?'1 : M':boost?`1 : ${ratio}`:`${r.id==='si2'&&r.gate_duty?fmt(1/r.gate_duty):ratio} : 1`,M=unknown?null:boost?ratio:r.id==='si2'&&r.gate_duty?r.gate_duty:1/ratio;
|
| 14 |
const ink='#455c50',teal='#157e70',orange='#bb7d37',blue='#62869d',value=v=>r.valid?fmt(v)+' Rₛ':'not derived';
|
| 15 |
const blocks=[{x:480,key:'R_FET',sub:'S',v:r.coefficients?.[0],base:'Rₛ'},{x:600,key:'R_CAP',sub:'C',v:r.coefficients?.[1],base:'R꜀'},{x:720,key:'R_IND',sub:'L',v:r.coefficients?.[2],base:'Rₗ'}];
|
| 16 |
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1120 380" role="img" aria-label="${esc(r.short)} ideal DC transformer, FSL series losses, charging increment, and separate gate-drive and Coss accounting shunts"><title>${esc(r.short)} power-loss equivalent circuit</title><rect width="1120" height="380" fill="white"/>
|
|
|
|
| 31 |
function dieAllocation(r){
|
| 32 |
const a=r.allocation;if(!a)return '';
|
| 33 |
const width=r.id===focusedTopology&&typeof sp2Analysis!=='undefined'?sp2Analysis?.deviceReport?.parameters.width_mm:null;
|
| 34 |
+
const si=r.id==='si2',split=r.id==='xfly2p';
|
| 35 |
+
const ratios={xfly2p:'1 : 1 : 1 : 3',xfly4p:'1 : 1 : 1 : √5','3lbuck':'1 : 1 : √3 : √3','2sbuck':'1 : 1 : 1 : 3',buck:'1 : 1 : √3 : √3',buck2:'1 : 1',sp2:'1 : 1 : 1 : 1',rsc2:'1 : 1 : 1 : 1'};
|
| 36 |
+
const sizing=si?`Upper / lower width = ${fmt(a.areas[0]/a.areas[1])}`:ratios[r.id];
|
| 37 |
+
const columns=si?[a.areas.slice(0,2),a.areas.slice(2)]:[a.areas,a.areas];
|
| 38 |
+
const blocks=columns.map((areas,col)=>{let y=24;const prefix=['S','Q'][col];return areas.map((area,i)=>{const h=216*area/6,label=si?a.labels[2*col+i]:split?[prefix+'1',prefix+'2a',prefix+'2b',prefix+'3'][i]:prefix+(i+1),x=18+col*100,color=Math.abs(area-Math.min(...a.areas))<1e-10?'#dd544c':'#217db6';const out=`<g data-device="${label}" data-area="${area}"><title>${label}: ${fmt(area)} A₀; ${fmt(area/12*100,1)}% of total die area${width?'; '+fmt(area*width/12,3)+' mm used width':''}</title><rect x="${x}" y="${y}" width="80" height="${h}" fill="${color}"/><text x="${x+40}" y="${y+h/2}" dominant-baseline="central" text-anchor="middle" fill="white" font-size="15" font-weight="bold">${label}</text></g>`;y+=h+7;return out}).join('')}).join('');
|
| 39 |
+
return `<figure class="die-allocation"><figcaption>DIE AREA ALLOCATION</figcaption><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 216 315" role="img" aria-label="${esc(r.short)} die area allocation ${sizing}; total area 12 A0"><rect x="4" y="8" width="208" height="270" rx="4" fill="#e0f4bc"/>${blocks}<text x="108" y="301" text-anchor="middle" font-size="12" fill="#526b5e">${sizing}</text></svg><p>Block area ∝ transistor area<br>Total: 12 A₀ · ${si?'sized for selected duty':'fixed at '+a.reference_ratio+':1'}${split?'<br>S2 = S2a + S2b in series; Q2 likewise.':''}</p></figure>`;
|
| 40 |
}
|
| 41 |
function cards(){
|
| 42 |
+
$('#circuits').innerHTML=report.rows.map(r=>{const meta=catalog.find(c=>c.id===r.id),sub=r.id==='xfly2p'?'Six-switch cell · two-command reference':r.id==='xfly4p'?'Split-middle cell · four-pulse reference':meta.family;return `<article class="circuit-card" data-topology="${r.id}"><div class="topology"><h2>${esc(meta.name)}</h2><div class="sub">${esc(sub)}</div><div class="topology-visuals"><img src="./assets/${['xfly2p','xfly4p','3lbuck','2sbuck','buck'].includes(r.id)?meta.asset.replace('.svg','-loss.svg'):meta.asset}" alt="${esc(meta.name)} ${['sp2','rsc2','si2'].includes(r.id)?'topology schematic':'topology with individual device resistance labels'}">${dieAllocation(r)}</div>${r.allocation?`<p class="device-note">${r.id==='si2'?'Duty-dependent die allocation.':'Fixed '+r.allocation.reference_ratio+':1 die allocation; each device value is an on-resistance.'} ${r.id==='si2'?'Four switches sized from their RMS currents. Output capacitor ESR is included.':r.id==='rsc2'?'Matched flying capacitors and series inductors.':r.id==='sp2'?'Equal flying capacitors; no power inductors.':'Clamp ESR = 0 in clamp-cell models.'}${r.id==='si2'?'':' Input/output capacitor ESR is omitted.'}</p>`:''}</div><div class="equivalent"><div class="eq-heading"><span>IDEAL CONVERSION + LOSS MODEL</span><span class="eq-value ${r.valid?'':'unsupported'}">${r.valid?'Req / RS = '+fmt(r.total):'No numerical loss model'}</span></div><div class="equivalent-drawing">${equivalent(r)}</div><span class="scroll-note">Swipe to view the full loss circuit →</span><div class="eq-caption"><p>${r.valid?`${r.id==='si2'?'Piecewise-linear CCM RMS · ':r.id==='rsc2'?'Exact periodic RLC · ':r.id==='sp2'?'Exact periodic RC · ':''}${r.id==='si2'?'RMS loss / RS = '+fmt(r.fsl):r.resonant?'Tank RMS loss / RS = '+fmt(r.fsl):'RFSL / RS = '+fmt(r.fsl)+' · RSSL,add / RS = '+fmt(r.ssl_series)} · Rg and Ross: see FOM example`:esc(r.domain)}</p><button data-svg="${r.id}">↓ SVG</button></div>${r.valid?`<div class="components">${['RFET','RCAP','RIND','RSSL'].map((n,i)=>`<span>${n}/RS <b>${fmt(r[['fet','cap','ind','ssl'][i]])}</b></span>`).join('')}</div>`:''}</div></article>`}).join('');
|
| 43 |
$$('[data-svg]').forEach(b=>b.onclick=()=>download('openpels-'+b.dataset.svg+'-equivalent.svg',$(`[data-topology="${b.dataset.svg}"] .equivalent-drawing svg`).outerHTML));
|
| 44 |
$('#coefficients').innerHTML=report.rows.map(r=>`<div class="formula"><b>${esc(r.short)}</b> · ${esc(r.domain)}${(r.formulas||['Not derived for this topology.']).map((f,i)=>`<code>${['RFET','RCAP','RIND','RSSL'][i]} = ${esc(f)}</code>`).join('')}<p>${esc(r.note)}</p></div>`).join('');
|
| 45 |
}
|
| 46 |
function picker(){
|
| 47 |
const ids=OpenPELSRecommendation.familyIds(ratio),groups=[[`${ratio}:1 coupled-inductor cancellation family`,catalog.filter(c=>ids.includes(c.id))]];
|
| 48 |
+
if(ratio===2)groups.push(['Duty-regulated switched inductor',catalog.filter(c=>c.id==='si2')]);
|
| 49 |
if(ratio===2)groups.push(['Fixed 2:1 switched-capacitor references',catalog.filter(c=>['sp2','rsc2'].includes(c.id))]);
|
| 50 |
$('#topology-picker').innerHTML=groups.map(([label,items])=>`<div class="picker-group"><span>${label}</span><div>${items.map(c=>`<button data-topology-choice="${c.id}" class="${selected.has(c.id)?'active':''}" aria-pressed="${selected.has(c.id)}">${selected.has(c.id)?'✓ ':''}${esc(c.short)}</button>`).join('')}</div></div>`).join('');
|
| 51 |
+
$$('[data-topology-choice]').forEach(b=>b.onclick=()=>{const id=b.dataset.topologyChoice;if(selected.has(id)){if(typeof isDedicatedReference==='function'&&isDedicatedReference()&&id===focusedTopology){toast('The focused reference stays in this comparison.');return}if(selected.size===1){toast('Keep at least one topology selected.');return}selected.delete(id)}else selected.add(id);picker();update(typeof manualSp2Weights!=='undefined'&&manualSp2Weights)});
|
| 52 |
}
|
| 53 |
async function update(useEnteredWeights=false){const id=++requestId;try{
|
| 54 |
+
if(typeof isDedicatedReference==='function'&&isDedicatedReference()){
|
| 55 |
const base=(await api('/api/analyze-pu',{ratio:2,topologies:[focusedTopology]})).rows[0];
|
| 56 |
if(id!==requestId)return;
|
| 57 |
prepareSp2Analysis(base,useEnteredWeights);
|
| 58 |
}
|
| 59 |
+
const result=selected.size?await api('/api/analyze-pu',params()):{rows:[],curves:[],M:1/ratio,normalization:{rho_c:1,rho_l:1,rho_q:20}};if(id!==requestId)return;report=result;$('#si-model').hidden=!selected.has('si2');for(const id of ['si_coupling','si_ripple'])$('#'+id).parentElement.hidden=!selected.has('si2');$('#resonant-model').hidden=!selected.has('rsc2');$('#rho_t').parentElement.hidden=!selected.has('rsc2');cards();renderRecommendation();$('#status').textContent=`Step-down ${ratio}:1 · M = ${fmt(isSI()?Number($('#design-si_duty').value):1/ratio)} · RS base · ${isSI()?'positive-current CCM':(selected.has('sp2')||selected.has('rsc2'))?'fixed switched-capacitor reference':'cancellation-point family only'} · fixed loss-sizing allocations${selected.has('boost')?' · boost uses ratio 1:'+ratio:''}`;if($('#sweep-section').open)drawSweep()}catch(e){$('#status').textContent='Check inputs';toast(e.message)}}
|
| 60 |
function chart(id,series,{xlabel='',ylabel='',logx=false,logy=false,xrange,yrange,marker=null,hline=null}={}){
|
| 61 |
const host=$('#'+id);const W=Math.max(310,host.clientWidth),H=280,L=55,R=16,T=15,B=45;const all=series.flatMap(s=>s.points).filter(p=>p.every(Number.isFinite));
|
| 62 |
if(!all.length){host.innerHTML='<p class="muted">No supported numerical model selected.</p>';return}
|
|
|
|
| 77 |
host.innerHTML=svg;const canvas=host.querySelector('svg'),tip=host.querySelector('.chart-tooltip'),cursor=host.querySelector('#cursor-'+id);
|
| 78 |
canvas.addEventListener('pointermove',e=>{const point=canvas.createSVGPoint();point.x=e.clientX;point.y=e.clientY;const p=point.matrixTransform(canvas.getScreenCTM().inverse());if(p.x<L||p.x>W-R)return;let xx=tx(xmin)+(p.x-L)/(W-L-R)*(tx(xmax)-tx(xmin));if(logx)xx=10**xx;let lines=[];for(const s of series){const a=s.points;if(a.length===1?Math.abs(X(a[0][0])-p.x)>9:xx<a[0][0]||xx>a.at(-1)[0])continue;let nearest=a.reduce((a,b)=>Math.abs(a[0]-xx)<Math.abs(b[0]-xx)?a:b);lines.push(`${esc(s.name)}: ${fmt(nearest[1])}`)}tip.innerHTML=`<b>${logx?fmt(xx,0)+' Hz':'M = '+fmt(xx,3)}</b><br>${lines.join('<br>')}`;tip.hidden=false;tip.style.left=Math.min(e.clientX-host.getBoundingClientRect().left+12,host.clientWidth-170)+'px';tip.style.top='35px';cursor.setAttribute('d',`M${p.x},${T}V${H-B}`);cursor.setAttribute('visibility','visible')});canvas.addEventListener('pointerleave',()=>{tip.hidden=true;cursor.setAttribute('visibility','hidden')});
|
| 79 |
}
|
| 80 |
+
function drawSweep(){if(!report)return;chart('rout-chart',report.curves,{xlabel:'Nominal Vout / Vin',ylabel:'Req / Rs (p.u.)',logy:true,xrange:[0,selected.has('si2')?.75:.5],yrange:[Math.max(.001,Math.min(...report.curves.flatMap(s=>s.points.map(p=>p[1])))*.8),Math.max(50,...report.curves.filter(s=>s.points.length===1).map(s=>1.15*s.points[0][1]))],marker:isSI()?report.normalization.si_duty:report.M});$('#legend').innerHTML=report.curves.map(s=>`<span><i style="background:${s.color}"></i>${s.name}</span>`).join('')}
|
| 81 |
$('#sweep-section').addEventListener('toggle',()=>{if($('#sweep-section').open)drawSweep()});
|
| 82 |
$$('[data-ratio]').forEach(b=>b.onclick=()=>{ratio=Number(b.dataset.ratio);updateLoadSummary();selected=new Set(OpenPELSRecommendation.familyIds(ratio));$$('[data-ratio]').forEach(v=>v.classList.toggle('active',v===b));picker();update()});
|
| 83 |
+
$('#apply-weights').onclick=()=>update(true);$('#reset').onclick=()=>{for(const [k,v] of Object.entries({rho_c:1,rho_l:1,rho_q:20,rho_t:.61,si_coupling:.6,si_ripple:.75}))$('#'+k).value=v;$('#toast').hidden=true;clearTimeout(timer);update(true)};
|
| 84 |
+
$('#export-csv').onclick=()=>{if(!report)return;const hasTank=report.rows.some(r=>r.id==='rsc2');const hasSI=report.rows.some(r=>r.id==='si2');const rows=[['Topology','Target_ratio','kFET_Rs','kCAP_Rc','kIND_Rl','kSSL_over_Cf_fs','RFET_pu','RCAP_pu','RIND_pu','RSSL_pu','Req_pu','RFSL_pu','RSSL_add_pu','Switching_loss_scope','rho_C','rho_L','rho_Q','Model_domain',...(hasTank?['rho_T']:[]),...(hasSI?['Duty','Coupling','Vin_over_L_fs_Iout']:[])],...report.rows.map(r=>[r.short,ratio,...(r.valid?r.coefficients:['','','','']),...['fet','cap','ind','ssl','total','fsl','ssl_series'].map(k=>r.valid?r[k]:''),r.resonant?'Tank RMS partition in RFSL_pu; independent SSL and charging increment are inapplicable. Separate gate and optional Coss.':'Separate technology example; Coss requires energy data',report.normalization.rho_c,report.normalization.rho_l,report.normalization.rho_q,r.domain,...(hasTank?[r.id==='rsc2'?report.normalization.rho_t:'']:[]),...(hasSI?r.id==='si2'?[report.normalization.si_duty,report.normalization.si_coupling,report.normalization.si_ripple]:['','','']:[])])];download('openpels-per-unit-comparison.csv',rows.map(r=>r.map(v=>'"'+String(v).replaceAll('"','""')+'"').join(',')).join('\n'),'text/csv')};
|
| 85 |
$('#open-upload').onclick=()=>$('#upload-dialog').showModal();$('#close-upload').onclick=()=>$('#upload-dialog').close();
|
| 86 |
async function loadImage(file){if(!file)return;if(!['image/png','image/jpeg','image/webp'].includes(file.type)||file.size>8000000){toast('Choose a PNG, JPEG or WebP smaller than 8 MB.');return}imageData=await new Promise((resolve,reject)=>{const r=new FileReader();r.onload=()=>resolve(r.result);r.onerror=reject;r.readAsDataURL(file)});$('#image-preview').src=imageData;$('#image-preview').hidden=false;$('#inspect').disabled=false;$('#upload-status').textContent=file.name+' · ready for interpretation';$('#interpretation').hidden=true}
|
| 87 |
$('#image-upload').onchange=e=>loadImage(e.target.files[0]);$('#dropzone').ondragover=e=>{e.preventDefault();$('#dropzone').classList.add('drag')};$('#dropzone').ondragleave=()=>$('#dropzone').classList.remove('drag');$('#dropzone').ondrop=e=>{e.preventDefault();$('#dropzone').classList.remove('drag');loadImage(e.dataTransfer.files[0])};
|
|
|
|
| 95 |
let technologyReport;
|
| 96 |
function technologyParameters(){return Object.fromEntries(techFields.filter(([k])=>k!=='eoss_pj'||$('#tech-'+k).value.trim()!=='').map(([k])=>[k,Number($('#tech-'+k).value)]))}
|
| 97 |
function renderTechnology(){if(!report)return;try{
|
| 98 |
+
const switchedCap=typeof isDedicatedReference==='function'&&isDedicatedReference();
|
| 99 |
const p=technologyParameters();const design=designParameters();const point=OpenPELSRecommendation.operatingPoint(design);p.vin=point.parameters.vin;p.io=point.output_current;if(selected.has('rsc2')&&!switchedCap)p.tank_nh=Number($('#design-tank_nh').value);technologyReport=switchedCap?sp2Analysis?.deviceReport:OpenPELSTechnology.example(report.rows,p);
|
| 100 |
if(!technologyReport)throw Error(sp2Error||'Enter a positive flying-capacitor budget for the device calculation.');
|
| 101 |
$('#export-technology').disabled=false;const t=technologyReport,unit=(v,scale=1)=>v==null?'unknown':!Number.isFinite(v)?'∞':fmt(v*scale);
|
| 102 |
$('#technology-status').textContent=`Rs = ${fmt(t.rs*1e3)} mΩ · RΣ = ${fmt(t.parallel*1e3)} mΩ · gate demand = ${fmt(t.gate_power*1e3)} mW · ${switchedCap?'same sized device result as the loss lineup':'physical example is separate from the per-unit weights above'}`;
|
| 103 |
+
$('#technology-results').innerHTML=`<table><caption>${switchedCap?(isSI()?'Optimized-width switched inductor · winding and capacitor RMS loss.':focusedTopology==='rsc2'?'Optimized-width resonant SC result · exact periodic RLC.':'Optimized-width SP-SC result · exact linear periodic RC.'):'Fixed-width example: flat-current buck models; exact linear periodic RC for SP-SC. Not measured efficiency.'}</caption><thead><tr><th>Topology</th><th>${isSI()?'Cout':'CF each'} (μF)</th><th>RFET (mΩ)</th><th>RCAP (mΩ)</th><th>RIND (mΩ)</th><th>RHC,add (mΩ)</th><th>Req (mΩ)</th><th>Rg at Vx (Ω)</th><th>Ross at Vx (Ω)</th><th>Iout²Req + Pg + known Poss (mW)</th></tr></thead><tbody>${t.rows.map(r=>r.valid?`<tr><th>${esc(report.rows.find(a=>a.id===r.id).short)}</th><td>${r.cf?unit(r.cf,1e6):'—'}</td>${['fet','cap','ind','hc','req'].map(k=>`<td>${(k==='ind'&&r.id==='sp2'||k==='hc'&&['rsc2','si2'].includes(r.id))?'N/A':unit(r[k],1e3)}</td>`).join('')}<td>${unit(r.gate_r)}</td><td>${unit(r.oss_r)}</td><td>${unit(r.partial_loss,1e3)}${r.poss===null?' + unknown Coss':''}</td></tr>`:`<tr><th>${esc(r.id)}</th><td colspan="9">Outside the supported analytical model</td></tr>`).join('')}</tbody></table>`;
|
| 104 |
|
| 105 |
}catch(e){technologyReport=null;$('#technology-status').textContent=e.message;$('#technology-results').innerHTML='';$('#export-technology').disabled=true}}
|
| 106 |
+
$('#apply-technology').onclick=()=>document.body.classList.contains('sp2-focused')?update():renderTechnology();$('#export-technology').onclick=()=>{if(technologyReport)download('openpels-180nm-example.json',JSON.stringify({...technologyReport,source:'User-supplied XFLY_Power_Analysis.md; not independently verified foundry data',method:document.body.classList.contains('sp2-focused')?(isSI()?'Piecewise-linear positive-current CCM with separate gate and optional Coss energy.':focusedTopology==='rsc2'?'Exact periodic RLC with separate gate and optional effective Coss energy.':'Exact periodic RC plus separate gate and optional effective Coss energy; Qoss does not establish Eoss'):'Paper FSL/SSL interpolation; separate gate demand; Qoss does not establish Eoss'},(k,v)=>typeof v==='number'&&!Number.isFinite(v)?String(v):v,2),'application/json')};
|
| 107 |
(function rcChart(){const w=600,h=210,x=a=>45+(Math.log10(a)+2)/4*530,y=v=>175-(Math.log10(v)+.3)/3*155,points=fn=>Array.from({length:161},(_,i)=>{const a=10**(-2+i/40);return `${x(a)},${y(fn(a))}`}).join(' ');$('#rc-limit-chart').innerHTML=`<svg viewBox="0 0 ${w} ${h}" role="img" aria-label="Finite RC event resistance and its SSL and FSL limits on log axes"><defs><clipPath id="rc-plot-clip"><rect x="45" y="15" width="530" height="160"/></clipPath></defs><rect width="600" height="210" fill="white"/><path d="M45 15V175H575" fill="none" stroke="#a6b6aa"/><g clip-path="url(#rc-plot-clip)"><polyline points="${points(a=>1/Math.tanh(a/2))}" fill="none" stroke="#157e70" stroke-width="2"/><polyline points="${points(a=>2/a)}" fill="none" stroke="#5c70b8" stroke-dasharray="5 4"/><polyline points="${points(()=>1)}" fill="none" stroke="#cf7b30" stroke-dasharray="5 4"/></g><g font-family="Arial" font-size="10" fill="#526b5e"><text x="65" y="18">Revent / RSSL · log axis</text><text x="340" y="18">green: finite RC · blue: FSL · orange: SSL</text>${[.01,.1,1,10,100].map(a=>`<text x="${x(a)}" y="190" text-anchor="middle">${a}</text>`).join('')}${[1,10,100].map(v=>`<text x="36" y="${y(v)+3}" text-anchor="end">${v}</text>`).join('')}<text x="310" y="207" text-anchor="middle">d / (fs Rpath C) · log axis</text></g></svg>`})();
|
| 108 |
const designFields=[
|
| 109 |
['vout','Output voltage (V)',.825],['io','Output current (A)',2],['fs_mhz','Frequency (MHz)',10],
|
| 110 |
['budget_mode','Silicon budget','area','select',[['area','Die area + Ron × area'],['width','Total FET width']]],
|
| 111 |
['die_mm2','Total die area (mm²)',1],['utilization','Usable transistor fraction',.5],['ron_area_mohm_mm2','Ron × area (mΩ·mm²)',1],['width_mm','Maximum FET width (mm)',360],
|
| 112 |
+
['cap_uf','Flying / clamp budget (μF)',4],['max_caps','Maximum flying / clamp caps',4],['max_windings','Maximum power windings',2],['rc_mohm','Main-cap ESR (mΩ)',20],['rl_mohm','DCR per winding (mΩ)',38],['tank_nh','Series inductance per leg (nH)',5.5],['si_duty','High-side duty',.5],['si_l_nh','Self-inductance per winding (nH)',1000],['si_coupling','Inverse coupling magnitude',.6],['lk_nh','Leakage Lk per winding (nH)',50],['lm_uh','Magnetizing Lm (μH)',1],['max_phase_ripple_percent','Max phase ripple pp (% avg)',5],['max_drop_percent','Maximum estimated droop (%)',10],
|
| 113 |
['objective','Priority','loss','select',[['loss','Lowest modeled loss'],['capacitors','Fewest capacitors, then loss'],['magnetics','Fewest power windings, then loss']]]
|
| 114 |
];
|
| 115 |
$('#design-fields').innerHTML=designFields.map(([k,label,value,type,options])=>`<label data-design-field="${k}">${label}${type==='select'?`<select id="design-${k}">${options.map(([v,t])=>`<option value="${v}" ${value===v?'selected':''}>${t}</option>`).join('')}</select>`:`<input id="design-${k}" type="number" value="${value}" min="0" step="any">`}</label>`).join('');
|
| 116 |
const loadBudgetField=$('[data-design-field="budget_mode"]');$('#design-fields').insertBefore($('#load-summary'),loadBudgetField);
|
| 117 |
let recommendationReport;
|
| 118 |
+
function designParameters(){return {ratio,voltage_mode:isSI()?'input_output':'output_ratio',load_mode:'current',...Object.fromEntries(designFields.filter(([k])=>k.startsWith('si_')?isSI():k!=='tank_nh'||focusedTopology==='rsc2').map(([k,label,v,type])=>[k,type==='select'?$('#design-'+k).value:Number($('#design-'+k).value)])),...(isSI()?{vin:Number($('#design-vout').value),vout:Number($('#design-vout').value)*Number($('#design-si_duty').value)}:{})}}
|
| 119 |
function showBudgetFields(){const mode=$('#design-budget_mode').value;for(const k of ['die_mm2','utilization','ron_area_mohm_mm2'])$(`[data-design-field="${k}"]`).hidden=mode!=='area';$('[data-design-field="width_mm"]').hidden=mode!=='width'}
|
| 120 |
showBudgetFields();$('#design-budget_mode').onchange=showBudgetFields;
|
| 121 |
function updateLoadSummary(){
|
| 122 |
+
try{const op=OpenPELSRecommendation.operatingPoint(designParameters());
|
| 123 |
+
if (isSI()) {
|
| 124 |
+
const duty=op.parameters.si_duty, vin=op.parameters.vin, vo=vin*duty;
|
| 125 |
+
$('#load-summary').textContent=`Ideal output at entered duty ${fmt(vo)} V · ${fmt(vo/op.output_current,4)} Ω · ${fmt(vo*op.output_current)} W.`;
|
| 126 |
+
return;
|
| 127 |
+
}
|
| 128 |
+
$('#load-summary').innerHTML=`<div><span>Calculated load resistance R<sub>load</sub></span><strong>${fmt(op.load_resistance,4)} Ω</strong></div><div><span>Calculated output power</span><strong>${fmt(op.output_power)} W</strong></div><p>Derived input voltage: ${ratio} × ${fmt(op.requested_vout)} V = <b>${fmt(op.parameters.vin)} V</b>. Output voltage and current stay fixed when the ratio changes.</p>`}catch(e){$('#load-summary').textContent=e.message}}updateLoadSummary();
|
| 129 |
|
| 130 |
|
| 131 |
function inspectRecommendation(id){const r=recommendationReport?.rows.find(r=>r.id===id);if(!r||r.status!=='eligible')return;
|
|
|
|
| 135 |
selected=new Set([id]);const p=recommendationReport.parameters;$('#rho_c').value=(p.rc_mohm/1000/r.rs).toPrecision(8);$('#rho_l').value=(p.rl_mohm/1000/r.rs).toPrecision(8);$('#rho_q').value=r.cf?(1/(r.cf*p.fs_mhz*1e6*r.rs)).toPrecision(8):0;$('#analysis-workbench').open=true;$('#inspection-context').textContent=`${r.short}: ${fmt(r.width_mm)} mm total FET width, Rs = ${fmt(r.rs*1e3)} mΩ, modeled loss = ${fmt(r.loss*1e3)} mW. Reference die-map proportions are scaled to this width; A₀ = ${fmt(r.width_mm/12)} mm of width. The shortlist uses the common full-budget RS base; these diagrams use the actual sized-device Rs. The device example below is a separate reference calculation.`;picker();update();$('#analysis-workbench').scrollIntoView({behavior:'smooth',block:'start'})}
|
| 136 |
let comparisonView='scoreboard';
|
| 137 |
function lossScoreboard(t){const data=t.loss_scoreboard;if(!data.rows.length)return '';
|
| 138 |
+
const switchedCap=t.rows[0]?.id==='sp2', resonant=t.rows[0]?.id==='rsc2', si=t.rows[0]?.id==='si2';
|
| 139 |
const lossValue=(d,m)=>d.powers[m.id]===null?(m.id==='ind'?'N/A':'Unknown'):`${fmt(d.powers[m.id]*1e3,2)} <small>mW</small>`;const byId=Object.fromEntries(t.eligible.map(r=>[r.id,r]));const rating=n=>n==null?'—':String(n),tone=n=>n==null?'neutral':n>=66?'good':n>=33?'mid':'weak';
|
| 140 |
+
return `<section class="loss-scoreboard" aria-label="Loss mechanism scoreboard"><div class="scoreboard-intro"><b>THE LOSS LINEUP</b><span>Higher score = lower modeled loss · actual values in mW</span></div><div class="scoreboard-scroll"><table style="--teams:${data.rows.length}"><thead><tr><th class="mechanism-heading">Compare the same<br>mechanism across circuits</th>${data.rows.map(d=>{const r=byId[d.id];return `<th class="team-heading"><span class="team-family">${r.native_ratio}:1 FAMILY</span><h3>${esc(r.short)}</h3><img src="./assets/${r.asset.replace('.svg','-candidate.svg')}" alt="${esc(r.name)} topology"><div class="team-total">${fmt(d.total*1e3,1)} <small>mW</small></div><span class="team-total-label">TOTAL MODELED LOSS</span><div class="loss-mix" aria-label="Loss composition">${data.mechanisms.filter(m=>d.powers[m.id]!=null).map(m=>`<span style="width:${d.total?d.powers[m.id]/d.total*100:0}%;background:${m.color}" title="${m.name}: ${fmt(d.powers[m.id]*1e3,2)} mW"></span>`).join('')}</div><span class="team-rout">Rout ${fmt(r.rout*1e3,2)} mΩ</span></th>`}).join('')}</tr></thead><tbody>${data.mechanisms.map(m=>`<tr data-loss-mechanism="${m.id}"><th><span class="mechanism-symbol" style="color:${m.color}">${m.symbol}</span><span>${m.name}</span>${switchedCap&&['fet','cap'].includes(m.id)?'<small>Fast-switching baseline</small>':''}${m.id==='charging'?'<small>Finite-charge addition only</small>':''}</th>${data.rows.map(d=>`<td data-score-team="${d.id}" data-score-value="${d.ratings[m.id]??''}"><div class="mechanism-stat"><span class="mechanism-rating ${tone(d.ratings[m.id])}">${rating(d.ratings[m.id])}</span><strong>${lossValue(d,m)}</strong></div><div class="attribute-track"><span class="${tone(d.ratings[m.id])}" style="width:${d.ratings[m.id]??0}%"></span></div></td>`).join('')}</tr>`).join('')}${switchedCap?'':`<tr class="unquantified-row"><th>${resonant||si?'Core / dead time':'Coss / core / ripple'}<small>Outside the current loss model</small></th>${data.rows.map(()=>'<td>Not quantified<span>No score assigned</span></td>').join('')}</tr>`}<tr class="tradeoff-row"><th>PRO / TRADEOFF<small>Against the other displayed circuits</small></th>${data.rows.map(d=>`<td><p class="score-pro">+ ${esc(d.pro)}${d.pro_delta!=null?`<small>${fmt(d.pro_delta*1e3,2)} mW less than others’ mean</small>`:''}</p><p class="score-con">↔ ${esc(d.con)}${d.con_delta!=null?`<small>${fmt(d.con_delta*1e3,2)} mW more than others’ mean</small>`:''}</p><p class="score-resources">${byId[d.id].capacitors} caps · ${byId[d.id].windings} windings<br>${fmt(byId[d.id].width_mm,1)} mm FET width</p><button data-inspect-design="${d.id}">Inspect circuit →</button></td>`).join('')}</tr></tbody></table></div><p class="scoreboard-note">${esc(data.scale)} Unknown losses are not scored as zero. The stacked color strip shows each mechanism’s share of modeled loss; ratings compare mechanisms separately.</p><details class="scoreboard-method"><summary>What is included in each loss?</summary><p>${si?'Winding and channel RMS currents set resistive loss. Output-capacitor ESR uses the summed winding ripple. Gate and optional Coss energy are tracked separately.':resonant?'The periodic tank RMS current gives switch conduction, flying-capacitor ESR and inductor DCR losses. Gate demand and any entered Coss energy are separate. Core and dead-time effects are unquantified.':switchedCap?'Conduction and ESR are the fast-switching baseline. The finite-charge addition is Iout² (Req − RFSL). The exact finite-RC path dissipation is represented by the baseline plus this increment; the raw SSL asymptote is never summed again. Gate demand is separate. Coss is included once when effective energy is provided. Winding DCR and magnetic losses are not applicable.':`Switch = Iout² RFET; capacitor = Iout² RCAP; winding = Iout² RIND; charging = Iout² (Req − RFSL); gate = the FOM-based gate-drive demand. These five terms sum to the displayed modeled total. The raw RSSL asymptote is not added again. Coss, core and ripple corrections remain unquantified. Pros and tradeoffs identify the largest mW difference versus the mean of the other displayed circuits; ratings are recalculated when this comparison set changes.`}</p></details></section>`;
|
| 141 |
}
|
| 142 |
function setComparisonView(view){comparisonView=view;$('#loss-scoreboard-view').hidden=view!=='scoreboard';$('#candidate-cards-view').hidden=view!=='circuits';$$('[data-comparison-view]').forEach(b=>{b.classList.toggle('active',b.dataset.comparisonView===view);b.setAttribute('aria-pressed',String(b.dataset.comparisonView===view))})}
|
| 143 |
function renderRecommendation(){if(!catalog.length)return;
|
| 144 |
+
const switchedCap=typeof isDedicatedReference==='function'&&isDedicatedReference();
|
| 145 |
try{
|
| 146 |
if(switchedCap&&!sp2Analysis)throw Error(sp2Error||'Enter valid fixed-ratio design inputs.');
|
| 147 |
recommendationReport=switchedCap?sp2Analysis:OpenPELSRecommendation.recommend(designParameters(),{catalog},OpenPELSEngine,OpenPELSTechnology);
|
| 148 |
if(!switchedCap&&typeof focusRecommendation==='function')recommendationReport=focusRecommendation(recommendationReport);
|
| 149 |
recommendationReport.loss_scoreboard=OpenPELSScores.build(recommendationReport);$('#design-error').textContent='';$('#recommend-design').textContent=switchedCap?'Update design':'Update candidates';$('#export-recommendation').disabled=false;const t=recommendationReport,p=t.parameters,native=t.native_models;
|
| 150 |
+
$('#family-context').textContent=switchedCap?(isSI()?'Duty-regulated switched inductor · 2:1 nominal at 50%':focusedTopology==='rsc2'?'Fixed 2:1 resonant SC · two uncoupled series-RLC legs':'Fixed 2:1 switched-capacitor reference · 50% duty · two flying capacitors'):native?`${ratio}:1 cancellation family · ${native} coupled-inductor candidates. Complementary winding excitation or ideal midpoint hold is admitted; estimated phase ripple must satisfy the entered limit.`:`${ratio}:1 · no verified coupled-inductor cancellation-point model in the current library. Off-duty and uncoupled circuits are omitted.`;
|
| 151 |
$('#candidate-status').textContent=t.eligible.length?`${t.eligible.length} candidates meet the current limits · Rload = ${fmt(t.load_resistance,4)} Ω. Inspect any panel to review its model.`:!native?'No qualified coupled-inductor cancellation-point model is available for this ratio.':!t.voltage_ratio_match?'The requested output voltage does not match this ratio’s nominal cancellation point.':'No candidate passes the current constraints. Expand the excluded candidates below for reasons.';
|
| 152 |
const candidatePanel=r=>{
|
| 153 |
const supported=!!OpenPELSRecommendation.specs[r.id],eligible=r.status==='eligible';
|
| 154 |
if(!supported)return `<p class="unmodeled-candidate"><b>${esc(r.short)}</b> · ${r.reasons.map(esc).join('; ')}</p>`;
|
| 155 |
const image=r.asset.replace('.svg','-candidate.svg');
|
| 156 |
+
return `<article class="candidate-panel ${eligible?'':'candidate-excluded'}" data-candidate="${r.id}" data-candidate-status="${r.status}"><div class="candidate-heading"><span class="candidate-rank">${eligible?'#'+r.rank:'Not eligible'}</span><span class="candidate-family">${r.native_ratio}:1 ${isSI()?'nominal':switchedCap?'fixed ratio':'cancellation point'}</span></div><h3>${esc(r.name)}</h3><div class="candidate-drawing"><img src="./assets/${image}" alt="${esc(r.name)} schematic" loading="lazy"></div>${eligible?`<div class="candidate-metrics"><div><strong>${fmt(r.loss*1e3,1)} mW</strong><span>Modeled loss</span></div><div><strong>${fmt(r.rout*1e3,2)} mΩ</strong><span>Converter Rout · ${fmt(r.req_pu)} p.u.</span></div></div><p class="candidate-resistances">R<sub>load</sub> = ${fmt(t.load_resistance,4)} Ω · R<sub>out</sub>/R<sub>load</sub> = ${fmt(r.rout_over_rload*100,2)}%<br>R<sub>S</sub> = ${fmt(r.rs*1e3,2)} mΩ${r.capacitors?' · R<sub>C</sub> = '+fmt(p.rc_mohm,1)+' mΩ':''}${r.windings?' · R<sub>L</sub> = '+fmt(p.rl_mohm,1)+' mΩ/winding':''}</p><p class="candidate-resources">${r.capacitors} ${isSI()?'output capacitor':'flying/clamp caps'} · ${r.windings} windings<br>${fmt(r.width_mm,1)} mm FET width · ${fmt(r.drop_percent,1)}% nominal droop<br>${isSI()?`<b>${fmt(100*r.efficiency,2)}% modeled efficiency</b> · ${fmt(r.phase_ripple_percent,2)}% phase ripple pp`:switchedCap?`<b>${fmt(100*r.efficiency,2)}% modeled efficiency</b> · ${fmt(r.cf*1e6)} μF each`:r.ripple_model==='ideal_midpoint_hold'?'<b>Ideally zero winding ripple at 2:1</b><br>Capacitor-ripple and mismatch effects are not quantified.':`<b>${fmt(r.phase_ripple_percent,2)}% phase ripple pp</b> · ${fmt(r.phase_ripple_pp*1e3,1)} mA · ${fmt(r.effective_frequency/1e6,1)} MHz effective excitation`}</p><button data-inspect-design="${r.id}">Inspect circuit and die allocation →</button>`:`<p class="candidate-reason">${r.reasons.map(esc).join('; ')}</p>${r.ripple_model==='ideal_midpoint_hold'?'<p class="candidate-reason">Ideal 2:1 midpoint hold gives zero winding ripple; real capacitor-ripple and mismatch effects are not quantified.</p>':''}`}</article>`;
|
| 157 |
};
|
| 158 |
+
$('#shortlist-results').innerHTML=`${switchedCap?sp2EfficiencySummary(t):''}${t.eligible.length?`<div class="comparison-switch" aria-label="Comparison view"><button data-comparison-view="scoreboard">Loss scoreboard</button><button data-comparison-view="circuits">Circuit cards</button></div><div id="loss-scoreboard-view">${lossScoreboard(t)}</div>`:''}<div id="candidate-cards-view"><p class="candidate-legend">${isSI()?'R<sub>C</sub> is output-capacitor ESR. R<sub>L</sub> is DCR per winding. Device areas follow their RMS currents.':focusedTopology==='rsc2'?'R<sub>C</sub> and R<sub>L</sub> are per-leg losses. A and B identify the two complementary clock commands. Eight devices share the used width equally.':switchedCap?'R<sub>S</sub>: unit-area MOSFET on-resistance · R<sub>C</sub>: flying-capacitor ESR. Eight equal-width devices. Gate-control annotations are omitted from these previews.':`R<sub>S</sub>: unit-area MOSFET on-resistance · R<sub>C</sub>: main-capacitor ESR · R<sub>L</sub>: winding resistance. Device multipliers follow each topology’s die allocation; clamp ESR is zero in the clamp-cell model. Gate-control annotations are omitted from these previews.`}</p><div class="candidate-grid">${t.eligible.map(candidatePanel).join('')||'<p class="no-candidates">No candidate satisfies all currently modeled screens.</p>'}</div></div><details class="excluded-list"><summary>${isSI()?'Switched inductor candidates failing constraints':switchedCap?'Fixed-ratio candidates failing constraints':'Cancellation-point candidates failing constraints'} (${t.rows.length-t.eligible.length})</summary><div class="candidate-grid">${t.rows.filter(r=>r.status==='excluded').map(candidatePanel).join('')}</div>${t.rows.filter(r=>r.status==='unmodeled').map(candidatePanel).join('')}</details>`;
|
| 159 |
if(t.eligible.length){setComparisonView(comparisonView);$$('[data-comparison-view]').forEach(b=>b.onclick=()=>setComparisonView(b.dataset.comparisonView))}$$('[data-inspect-design]').forEach(b=>b.onclick=()=>inspectRecommendation(b.dataset.inspectDesign));renderTechnology();
|
| 160 |
}catch(e){recommendationReport=null;$('#design-error').textContent=e.message;$('#candidate-status').textContent='Check the design inputs to calculate the candidates.';$('#shortlist-results').innerHTML='';$('#export-recommendation').disabled=true;renderTechnology()}}
|
| 161 |
$('#design-fields').addEventListener('input',()=>{updateLoadSummary();if(document.body.classList.contains('sp2-focused'))return;$('#design-error').textContent='Inputs changed — update the recommendation.';$('#recommend-design').textContent='Update candidates';$('#export-recommendation').disabled=true;$$('[data-inspect-design]').forEach(b=>b.disabled=true)});$('#recommend-design').onclick=()=>document.body.classList.contains('sp2-focused')?update():renderRecommendation();$('#export-recommendation').onclick=()=>{if(recommendationReport)download('openpels-design-shortlist.json',JSON.stringify(recommendationReport,(k,v)=>k==='deviceReport'?undefined:v,2),'application/json')};
|
|
|
|
| 175 |
native_models: rows.filter((row) => row.reference_match).length,
|
| 176 |
};
|
| 177 |
}
|
| 178 |
+
function isDedicatedReference() {
|
| 179 |
+
return ['sp2','rsc2','si2'].includes(focusedTopology) && ratio === 2;
|
| 180 |
}
|
| 181 |
let sp2Analysis, sp2Error, manualSp2Weights = false;
|
| 182 |
function prepareSp2Analysis(base, useEnteredWeights) {
|
| 183 |
manualSp2Weights = useEnteredWeights;
|
| 184 |
try {
|
| 185 |
const {vgs, events, eoss_pj} = technologyParameters();
|
| 186 |
+
const recommend = isSI()?OpenPELSRecommendation.recommendSwitchedInductor:OpenPELSRecommendation.recommendSwitchedCap;
|
| 187 |
+
sp2Analysis = recommend(
|
| 188 |
designParameters(), {vgs, events, eoss_pj}, base,
|
| 189 |
catalog.find((item) => item.id === focusedTopology), OpenPELSTechnology,
|
| 190 |
);
|
|
|
|
| 207 |
// DCR assumption for any optional inductive comparison curves.
|
| 208 |
$("#rho_l").value = (Number($("#design-rl_mohm").value) / 1000 / t.rs).toPrecision(12);
|
| 209 |
$("#rho_q").value = (1 / (r.cf * t.parameters.fs_mhz * 1e6 * t.rs)).toPrecision(12);
|
| 210 |
+
if (r.si) {
|
| 211 |
+
$("#si_coupling").value = t.parameters.si_coupling;
|
| 212 |
+
$("#si_ripple").value = (t.parameters.vin/(t.parameters.si_l_nh*1e-9*t.parameters.fs_mhz*1e6*t.parameters.io)).toPrecision(12);
|
| 213 |
+
context.textContent = `Switched inductor design weights · Rs = ${fmt(t.rs*1e3)} mΩ at ${fmt(t.parameters.width_mm)} mm total width.`;
|
| 214 |
+
return;
|
| 215 |
+
}
|
| 216 |
if (r.tank) {
|
| 217 |
$("#rho_t").value = (t.parameters.tank_nh*1e-9*t.parameters.fs_mhz*1e6/t.rs).toPrecision(12);
|
| 218 |
context.textContent = `Resonant design weights · Rs = ${fmt(t.rs*1e3)} mΩ, tank frequency ${fmt(r.tank.natural_frequency_hz/1e6)} MHz.`;
|
|
|
|
| 224 |
const r = t.rows[0];
|
| 225 |
if (r.efficiency == null)
|
| 226 |
return '<p id="sp2-efficiency">This operating point has no positive delivered-voltage estimate or capacitance budget. Check the design constraints and load.</p>';
|
| 227 |
+
return `<p id="sp2-efficiency">Modeled efficiency: ${(100*r.efficiency).toFixed(2)}% · delivered output ${r.estimated_open_loop_vout.toFixed(4)} V / ${r.delivered_w.toFixed(4)} W · modeled loss ${(1000*r.loss).toFixed(2)} mW.</p><p>Used ${fmt(r.width_mm)} mm of ${fmt(t.available_width_mm)} mm available. ${r.si?`Width per upper switch ${fmt(r.device[0].width_mm)} mm, per lower switch ${fmt(r.device[1].width_mm)} mm. Winding ripple ${fmt(r.phase_ripple_pp)} A pp. Winding RMS ${fmt(r.operating_waveforms.winding_rms_a)} A per leg and capacitor RMS ${fmt(r.operating_waveforms.output_cap_rms_a)} A. Droop resistance ${fmt(1000*r.droop_resistance)} mΩ. Ideal capacitor ripple ${fmt(r.capacitor_ripple_vpp*1000)} mV pp before ESR. `:`Each of eight devices gets 12.5% of used width (${r.device[0].width_mm.toFixed(3)} mm each).`} ${r.tank?`Tank RMS ${fmt(r.tank.tank_rms_per_output_amp*t.output_current)} A per leg · commutation current magnitude ${fmt(r.tank.commutation_current_per_output_amp*t.output_current)} A. `: ''}${r.coss_power===null?'Coss energy is unknown and is excluded from this estimate.':'It includes the entered Coss energy.'}</p>`;
|
| 228 |
}
|
| 229 |
const sp2Profile = {
|
| 230 |
"design-fs_mhz": 2, "design-budget_mode": "width", "design-width_mm": 80.2666667,
|
|
|
|
| 232 |
"design-cap_uf": 2, "design-rc_mohm": 20, "design-max_caps": 2,
|
| 233 |
"design-max_drop_percent": 10, "design-objective": "loss",
|
| 234 |
"tech-vgs": 3.3, "tech-events": 1, "tech-eoss_pj": "",
|
| 235 |
+
rho_c: 1, rho_l: 1, rho_q: 20, si_coupling:.6, si_ripple:.75,
|
| 236 |
+
'design-si_duty':.5,'design-si_l_nh':1000,'design-si_coupling':.6,'design-max_phase_ripple_percent':5,
|
| 237 |
};
|
| 238 |
const profiles = new Map([
|
| 239 |
+
['si2',{...sp2Profile,'design-width_mm':200,'design-cap_uf':47,'design-max_caps':1,
|
| 240 |
+
'design-max_windings':2,'design-rc_mohm':5,'design-rl_mohm':4,'design-max_phase_ripple_percent':100,
|
| 241 |
+
'design-tank_nh':5.5,rho_t:.61}],
|
| 242 |
['sp2', {...sp2Profile, 'design-tank_nh':5.5, 'design-max_windings':2, 'design-rl_mohm':38, rho_t:.61}],
|
| 243 |
['rsc2', {...sp2Profile, 'design-width_mm':401.3333333333, 'design-rc_mohm':5,
|
| 244 |
'design-tank_nh':5.5, 'design-max_windings':2, 'design-rl_mohm':4, rho_t:.61}],
|
|
|
|
| 246 |
let otherProfile = null;
|
| 247 |
const defaultInputScope = $(".input-scope").textContent;
|
| 248 |
const defaultIntro = $(".intro p").textContent;
|
| 249 |
+
const siLabels = {vout:'Input voltage (V)', cap_uf:'Output capacitance (μF)',max_caps:'Maximum output capacitors',rc_mohm:'Output capacitor ESR (mΩ)'};
|
| 250 |
+
const defaultLabels = Object.fromEntries(designFields.map(([key,label])=>[key,label]));
|
| 251 |
+
function setInputLabels(si){
|
| 252 |
+
for (const [key,label] of Object.entries(siLabels))
|
| 253 |
+
$("[data-design-field='"+key+"']").firstChild.textContent=si?label:defaultLabels[key];
|
| 254 |
+
}
|
| 255 |
function switchAnalysisScope(nextId) {
|
| 256 |
+
const entering = profiles.has(nextId), previousFixed = isDedicatedReference();
|
| 257 |
if ((!entering&&!previousFixed)||nextId===focusedTopology) return;
|
| 258 |
const fields = Object.keys(profiles.get('sp2')).map((id) => document.getElementById(id));
|
| 259 |
const current = Object.fromEntries(fields.map((field) => [field.id, field.value]));
|
|
|
|
| 264 |
}
|
| 265 |
else profiles.set(focusedTopology,current);
|
| 266 |
for (const field of fields) field.value = next[field.id];
|
| 267 |
+
setInputLabels(nextId==='si2');
|
| 268 |
if (!entering) $("#inspection-context").textContent = otherProfile.inspection;
|
| 269 |
$("#design-objective option[value=magnetics]").hidden = nextId==='sp2';
|
| 270 |
$(".selection-method summary").textContent = entering
|
| 271 |
+
? (nextId==='si2'?"CCM feasibility and recommendation scope":"Fixed-ratio feasibility and recommendation scope")
|
| 272 |
: "Ripple-cancellation criterion and recommendation scope";
|
| 273 |
$(".selection-method").classList.toggle("fixed-ratio-method", entering);
|
| 274 |
+
$('.sp2-method').textContent = nextId==='si2'
|
| 275 |
+
? 'The design screens positive-current CCM, phase ripple, component counts and open-loop droop. The width budget covers all four switches. Fixed component counts leave the loss-minimizing width unchanged under every priority.' : nextId==='rsc2'
|
| 276 |
? 'Matched resonant legs use synchronized 50% commands. The design screens component counts, damping and droop, then sizes FET width. The capacitors and windings have fixed counts under all priorities. Tank current reverses during every period.'
|
| 277 |
: sp2Method;
|
| 278 |
showBudgetFields();
|
| 279 |
$(".intro p").textContent = entering
|
| 280 |
+
? (nextId==='si2'?"Size the inverse-coupled buck at the entered duty and compare its per-unit loss model.":"Size the fixed 2:1 switched-capacitor design and compare its per-unit loss model with other 2:1 references.")
|
| 281 |
: defaultIntro;
|
| 282 |
$(".input-scope").textContent = entering
|
| 283 |
+
? (nextId==='si2'?"Four switch areas follow the RMS current weights. Gate and optional Coss data are in the 180 nm device panel.":"Total FET width is sized within the silicon budget for minimum modeled loss subject to droop. Each of eight switches gets equal width. Two matched flying capacitors share the budget. Gate and optional Coss inputs are in the 180 nm device panel.")
|
| 284 |
: defaultInputScope;
|
| 285 |
}
|
| 286 |
function reportOperatingPoint() {
|
|
|
|
| 290 |
type: "pe:analysis-point",
|
| 291 |
id: focusedTopology,
|
| 292 |
ratio,
|
| 293 |
+
vout: Number($("#design-vout").value)*(isSI()?Number($("#design-si_duty").value):1),
|
| 294 |
+
...(isSI()?{vin:Number($("#design-vout").value),duty:Number($("#design-si_duty").value)}:{}),
|
| 295 |
iout: Number(document.querySelector("#design-io").value),
|
| 296 |
},
|
| 297 |
location.origin,
|
|
|
|
| 314 |
switchAnalysisScope(next.id);
|
| 315 |
document.body.classList.toggle("sp2-focused", profiles.has(next.id));
|
| 316 |
document.body.classList.toggle("rsc2-focused", next.id==='rsc2');
|
| 317 |
+
document.body.classList.toggle("si2-focused", next.id==='si2');
|
| 318 |
ratio = next.ratio;
|
| 319 |
focusedTopology = next.id;
|
| 320 |
selected = new Set([next.id]);
|
| 321 |
if (Number.isFinite(next.vout) && next.vout > 0)
|
| 322 |
+
document.querySelector("#design-vout").value = isSI()?next.vin:next.vout;
|
| 323 |
+
if (isSI()&&Number.isFinite(next.duty)) $("#design-si_duty").value=next.duty;
|
| 324 |
if (Number.isFinite(next.iout) && next.iout > 0)
|
| 325 |
document.querySelector("#design-io").value = next.iout;
|
| 326 |
document.body.classList.add("focused-topology");
|
|
|
|
| 339 |
.querySelector("#design-fields")
|
| 340 |
.addEventListener("input", () => {
|
| 341 |
reportOperatingPoint();
|
| 342 |
+
if (isDedicatedReference()) update();
|
| 343 |
});
|
| 344 |
$("#tech-settings").addEventListener("input", () => {
|
| 345 |
+
if (isDedicatedReference()) update();
|
| 346 |
});
|
| 347 |
const sp2Method = "The fixed-ratio design checks a two-capacitor minimum, a positive capacitance budget and the allowable open-loop droop. The 2:1 operating point assumes 50% duty and matched capacitors. Fewest capacitors ties for this fixed circuit, so both priorities minimize loss over width. The per-unit comparison supports other qualified 2:1 references.";
|
| 348 |
function renderSp2Method() {
|
static/compare/assets/si2-candidate.svg
ADDED
|
|
static/compare/assets/si2.svg
ADDED
|
|
static/compare/engine.js
CHANGED
|
@@ -5,12 +5,44 @@ let dataPromise;
|
|
| 5 |
const load=()=>dataPromise||(dataPromise=fetch('./models-data.json',{cache:'no-store'}).then(r=>{if(!r.ok)throw Error('Model library could not load');return r.json()}));
|
| 6 |
function num(p,k,d,lo,hi){const v=Number(p[k]??d);if(!Number.isFinite(v)||v<lo||v>hi)throw Error(`${k} must be between ${lo} and ${hi}`);return v}
|
| 7 |
const linspace=(a,b,n)=>Array.from({length:n},(_,i)=>a+(b-a)*i/(n-1));
|
| 8 |
-
|
|
|
|
| 9 |
function coefficients(k,d){if(k==='buck2')return [1/6,0,0];if(k==='sp2')return [2/3,.5,1/8];if(k==='xfly2p')return d<=.5?[(2+5*d)/12,d/4,0]:[(5*d*d-2*d+2)/(12*(1-d)),d*d/(4*(1-d)),(2*d-1)**2/8];if(k==='xfly4p')return [(3+Math.sqrt(5))/24*(3*d+(2+d)/Math.sqrt(5)),d/2,0];if(k==='3lbuck'||k==='buck')return [(1+Math.sqrt(3))/6*(d+(2-d)/Math.sqrt(3)),k==='3lbuck'?d/2:0,0];if(k==='2sbuck')return [(2+d-d*d)/(12*(1-d)),d/(8*(1-d)),d*d/8];throw Error('No verified loss model')}
|
| 10 |
function chargingResistance(k,n,s){return k==='sp2'?(n&&s?s/Math.tanh(s/n):n+s):Math.hypot(n,s)}
|
| 11 |
-
function evaluate(k,m,p){if(!valid(k,m))return null;if(k==='rsc2')return p.rs>0?(root.OpenPELSResonant??require('./resonant.js')).evaluate(p):null;const d=2*m,[a,b,c]=coefficients(k,d),fet=a*p.rs,cap=b*p.rc,ind=(k==='sp2'?0:.5)*p.rl,ssl=c/(p.cf*p.fs);return {fet,cap,ind,ssl,fsl:fet+cap+ind,total:ind+chargingResistance(k,fet+cap,ssl),coefficients:[a,b,k==='sp2'?0:.5,c],D:d,gate_duty:k==='buck2'?m:k==='sp2'?.5:null}}
|
| 12 |
-
function allocation(k,index
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
function stateModel(p){const states=p.states??[],budget=num(p,'area_budget',12,.001,1e6);if(!Array.isArray(states)||!states.length||states.length>64)throw Error('Provide 1–64 switching states');const durations=states.map(s=>num(s,'fraction',0,0,1));if(Math.abs(durations.reduce((a,b)=>a+b)-1)>1e-7)throw Error('State fractions must sum to 1');const weights={},out={};for(const field of ['switch','capacitor','inductor']){const vs=states.map(s=>s[field+'_currents']??[]);if(vs.some(a=>!Array.isArray(a)||a.length>256||a.some(v=>typeof v!=='number'||!Number.isFinite(v)||Math.abs(v)>1e6)))throw Error('Invalid normalized current');if(new Set(vs.map(a=>a.length)).size!==1)throw Error(field+' current dimensions must match in every state');weights[field]=vs[0].map((_,i)=>vs.reduce((sum,a,j)=>sum+durations[j]*a[i]**2,0));if(field==='capacitor'){const charge=vs[0].map((_,i)=>vs.reduce((sum,a,j)=>sum+durations[j]*a[i],0));if(charge.some(v=>Math.abs(v)>1e-7))throw Error('Capacitor charge balance failed: '+JSON.stringify(charge));out.capacitor_charge_residuals=charge}}
|
| 15 |
const roots=weights.switch.map(Math.sqrt),den=roots.reduce((a,b)=>a+b,0);if(den<=0)throw Error('At least one switch must carry current');return {...out,switch_weights:weights.switch,capacitor_weights:weights.capacitor,inductor_weights:weights.inductor,optimal_areas:roots.map(v=>budget*v/den),rfet:num(p,'rs_mohm',20,0,1e5)/1000*den**2/budget,rcap:num(p,'rc_mohm',20,0,1e5)/1000*weights.capacitor.reduce((a,b)=>a+b,0),rind:num(p,'rl_mohm',20,0,1e5)/1000*weights.inductor.reduce((a,b)=>a+b,0),status:'Conditional FSL result: charge balance checked; KCL, gate legality, voltage balance and graph consistency must be independently verified. SSL is not inferred from these currents.'}}
|
| 16 |
const add=(a,b)=>[a[0]+b[0],a[1]+b[1]],mul=(a,b)=>[a[0]*b[0]-a[1]*b[1],a[0]*b[1]+a[1]*b[0]],scale=(a,b)=>[a[0]*b,a[1]*b],div=(a,b)=>{const d=b[0]**2+b[1]**2;return [(a[0]*b[0]+a[1]*b[1])/d,(a[1]*b[0]-a[0]*b[1])/d]},abs=a=>Math.hypot(...a),arg=a=>Math.atan2(a[1],a[0]);
|
|
@@ -21,10 +53,13 @@ function analyzePU(payload,data){
|
|
| 21 |
const rho_c=num(payload,'rho_c',1,0,1e6),rho_l=num(payload,'rho_l',1,0,1e6),rho_q=num(payload,'rho_q',20,0,1e9),ratio=num(payload,'ratio',4,1.01,256),M=1/ratio,index=Object.fromEntries(data.catalog.map(c=>[c.id,c]));
|
| 22 |
let selected=payload.topologies??['xfly2p','xfly4p','3lbuck','2sbuck','buck'];if(!Array.isArray(selected)||!selected.length||selected.some(k=>!index[k]))throw Error('Select known topologies');selected=[...new Set(selected)];
|
| 23 |
const rho_t=num(payload,'rho_t',.61,1e-9,1e9);
|
| 24 |
-
const
|
| 25 |
-
|
| 26 |
-
const
|
| 27 |
-
return
|
|
|
|
|
|
|
|
|
|
| 28 |
'Rs is the common resistance base. rho_C=Rc/Rs; rho_L=Rl/Rs; rho_Q=1/(Cf fs Rs). No absolute resistance, current or power is assigned.',
|
| 29 |
'Table columns k_FET=RFET/Rs, k_CAP=RCAP/Rc, k_IND=RIND/Rl and k_SSL=RSSL Cf fs are independent coefficients. These columns are not directly additive. Coefficients remain defined when their corresponding loss scale is zero.',
|
| 30 |
...data.assumptions.filter(s=>!s.startsWith('Conduction efficiency'))]};
|
|
|
|
| 5 |
const load=()=>dataPromise||(dataPromise=fetch('./models-data.json',{cache:'no-store'}).then(r=>{if(!r.ok)throw Error('Model library could not load');return r.json()}));
|
| 6 |
function num(p,k,d,lo,hi){const v=Number(p[k]??d);if(!Number.isFinite(v)||v<lo||v>hi)throw Error(`${k} must be between ${lo} and ${hi}`);return v}
|
| 7 |
const linspace=(a,b,n)=>Array.from({length:n},(_,i)=>a+(b-a)*i/(n-1));
|
| 8 |
+
const si = () => root.OpenPELSSwitchedInductor??require('./switched-inductor.js');
|
| 9 |
+
function valid(k,m){if(k==='si2')return m>=.25&&m<=.75;if(k==='sp2'||k==='rsc2')return Math.abs(m-.5)<1e-12;if(k==='buck2')return m>0&&m<1;return ['xfly2p','xfly4p','3lbuck','2sbuck','buck'].includes(k)&&m>0&&(k==='xfly4p'?m<=.25+1e-12:['xfly2p','2sbuck'].includes(k)?m<.5:m<=.5)}
|
| 10 |
function coefficients(k,d){if(k==='buck2')return [1/6,0,0];if(k==='sp2')return [2/3,.5,1/8];if(k==='xfly2p')return d<=.5?[(2+5*d)/12,d/4,0]:[(5*d*d-2*d+2)/(12*(1-d)),d*d/(4*(1-d)),(2*d-1)**2/8];if(k==='xfly4p')return [(3+Math.sqrt(5))/24*(3*d+(2+d)/Math.sqrt(5)),d/2,0];if(k==='3lbuck'||k==='buck')return [(1+Math.sqrt(3))/6*(d+(2-d)/Math.sqrt(3)),k==='3lbuck'?d/2:0,0];if(k==='2sbuck')return [(2+d-d*d)/(12*(1-d)),d/(8*(1-d)),d*d/8];throw Error('No verified loss model')}
|
| 11 |
function chargingResistance(k,n,s){return k==='sp2'?(n&&s?s/Math.tanh(s/n):n+s):Math.hypot(n,s)}
|
| 12 |
+
function evaluate(k,m,p){if(!valid(k,m))return null;if(k==='si2'){const r=si().evaluate(m,p);return r.min_phase_per_amp>0?r:null}if(k==='rsc2')return p.rs>0?(root.OpenPELSResonant??require('./resonant.js')).evaluate(p):null;const d=2*m,[a,b,c]=coefficients(k,d),fet=a*p.rs,cap=b*p.rc,ind=(k==='sp2'?0:.5)*p.rl,ssl=c/(p.cf*p.fs);return {fet,cap,ind,ssl,fsl:fet+cap+ind,total:ind+chargingResistance(k,fet+cap,ssl),coefficients:[a,b,k==='sp2'?0:.5,c],D:d,gate_duty:k==='buck2'?m:k==='sp2'?.5:null}}
|
| 13 |
+
function allocation(k,index,point){
|
| 14 |
+
if(k==='si2'&&point){const areas=point.fractions.map(x=>12*x);
|
| 15 |
+
return {relative:point.fractions,areas,area_fractions:point.fractions,labels:['Q1','Q2','Q3','Q4'],total_area:12,reference_ratio:2};}
|
| 16 |
+
const relative=index[k].ratio,s=relative.reduce((a,b)=>a+b,0),areas=relative.map(v=>6*v/s);return {relative,areas,area_fractions:areas.map(v=>v/12),labels:areas.map((v,i)=>'S'+(i+1)),total_area:12,reference_ratio:['buck2','sp2','rsc2'].includes(k)?2:4}}
|
| 17 |
+
function analyze(payload,data){
|
| 18 |
+
const p={rs:num(payload,'rs_mohm',20,0,1e5)/1000,rc:num(payload,'rc_mohm',20,0,1e5)/1000,
|
| 19 |
+
rl:num(payload,'rl_mohm',20,0,1e5)/1000,cf:num(payload,'cf_nf',50,.001,1e9)*1e-9,
|
| 20 |
+
fs:num(payload,'fs_mhz',50,.000001,1e4)*1e6,lt:num(payload,'lt_nh',5.5,.001,1e9)*1e-9};
|
| 21 |
+
const ratio=num(payload,'ratio',4,1.01,256), M=1/ratio, io=num(payload,'iout',10,.001,1e6),
|
| 22 |
+
vin=num(payload,'vin',16,.001,1e6), index=Object.fromEntries(data.catalog.map(c=>[c.id,c]));
|
| 23 |
+
let selected=payload.topologies??['xfly2p','xfly4p','3lbuck','2sbuck','buck'];
|
| 24 |
+
if(!Array.isArray(selected)||!selected.length||selected.some(k=>!index[k]))throw Error('Select known topologies');
|
| 25 |
+
selected=[...new Set(selected)];
|
| 26 |
+
const siInputs=selected.includes('si2')?{...p,coupling:num(payload,'coupling',.6,0,.85),rippleScale:vin/(io*p.fs*p.lt)}:null;
|
| 27 |
+
const at=(id,m)=>evaluate(id,m,id==='si2'?siInputs:p);
|
| 28 |
+
const rows=selected.map(id=>{
|
| 29 |
+
const r=at(id,M),meta=index[id];
|
| 30 |
+
const row={id,name:meta.name,short:meta.short,color:meta.color,note:meta.note,formulas:data.formulas[id],
|
| 31 |
+
allocation:data.formulas[id]?allocation(id,index,r):null,valid:!!r,domain:meta.range};
|
| 32 |
+
if(!r)return row;
|
| 33 |
+
const loss=io*io*r.total,pout=vin*M*io,drop=io*(r.droop_resistance??r.total);
|
| 34 |
+
const delivered=pout-io*drop;
|
| 35 |
+
const eta=id==='si2'?(delivered>0?100*delivered/(delivered+loss):null)
|
| 36 |
+
:id==='rsc2'?(pout>loss?100*(pout-loss)/pout:null):100*pout/(pout+loss);
|
| 37 |
+
return Object.assign(row,r,{loss_w:loss,conduction_efficiency:eta,droop_estimate_v:drop});
|
| 38 |
+
});
|
| 39 |
+
const xs=[...new Set([...linspace(.0005,.4995,500),.25,.5,M])].sort((a,b)=>a-b);
|
| 40 |
+
const siSamples=[...new Set([...linspace(.25,.75,251),M])].sort((a,b)=>a-b);
|
| 41 |
+
const curves=selected.map(id=>({id,name:index[id].short,color:index[id].color,
|
| 42 |
+
points:(id==='si2'?siSamples:xs).flatMap(m=>{const r=at(id,m);return r?[[m,r.total*1000]]:[]})}))
|
| 43 |
+
.filter(s=>s.points.length);
|
| 44 |
+
return {ratio,M,vin,iout:io,parameters:p,rows,curves,provenance:data.provenance,assumptions:data.assumptions};
|
| 45 |
+
}
|
| 46 |
function stateModel(p){const states=p.states??[],budget=num(p,'area_budget',12,.001,1e6);if(!Array.isArray(states)||!states.length||states.length>64)throw Error('Provide 1–64 switching states');const durations=states.map(s=>num(s,'fraction',0,0,1));if(Math.abs(durations.reduce((a,b)=>a+b)-1)>1e-7)throw Error('State fractions must sum to 1');const weights={},out={};for(const field of ['switch','capacitor','inductor']){const vs=states.map(s=>s[field+'_currents']??[]);if(vs.some(a=>!Array.isArray(a)||a.length>256||a.some(v=>typeof v!=='number'||!Number.isFinite(v)||Math.abs(v)>1e6)))throw Error('Invalid normalized current');if(new Set(vs.map(a=>a.length)).size!==1)throw Error(field+' current dimensions must match in every state');weights[field]=vs[0].map((_,i)=>vs.reduce((sum,a,j)=>sum+durations[j]*a[i]**2,0));if(field==='capacitor'){const charge=vs[0].map((_,i)=>vs.reduce((sum,a,j)=>sum+durations[j]*a[i],0));if(charge.some(v=>Math.abs(v)>1e-7))throw Error('Capacitor charge balance failed: '+JSON.stringify(charge));out.capacitor_charge_residuals=charge}}
|
| 47 |
const roots=weights.switch.map(Math.sqrt),den=roots.reduce((a,b)=>a+b,0);if(den<=0)throw Error('At least one switch must carry current');return {...out,switch_weights:weights.switch,capacitor_weights:weights.capacitor,inductor_weights:weights.inductor,optimal_areas:roots.map(v=>budget*v/den),rfet:num(p,'rs_mohm',20,0,1e5)/1000*den**2/budget,rcap:num(p,'rc_mohm',20,0,1e5)/1000*weights.capacitor.reduce((a,b)=>a+b,0),rind:num(p,'rl_mohm',20,0,1e5)/1000*weights.inductor.reduce((a,b)=>a+b,0),status:'Conditional FSL result: charge balance checked; KCL, gate legality, voltage balance and graph consistency must be independently verified. SSL is not inferred from these currents.'}}
|
| 48 |
const add=(a,b)=>[a[0]+b[0],a[1]+b[1]],mul=(a,b)=>[a[0]*b[0]-a[1]*b[1],a[0]*b[1]+a[1]*b[0]],scale=(a,b)=>[a[0]*b,a[1]*b],div=(a,b)=>{const d=b[0]**2+b[1]**2;return [(a[0]*b[0]+a[1]*b[1])/d,(a[1]*b[0]-a[0]*b[1])/d]},abs=a=>Math.hypot(...a),arg=a=>Math.atan2(a[1],a[0]);
|
|
|
|
| 53 |
const rho_c=num(payload,'rho_c',1,0,1e6),rho_l=num(payload,'rho_l',1,0,1e6),rho_q=num(payload,'rho_q',20,0,1e9),ratio=num(payload,'ratio',4,1.01,256),M=1/ratio,index=Object.fromEntries(data.catalog.map(c=>[c.id,c]));
|
| 54 |
let selected=payload.topologies??['xfly2p','xfly4p','3lbuck','2sbuck','buck'];if(!Array.isArray(selected)||!selected.length||selected.some(k=>!index[k]))throw Error('Select known topologies');selected=[...new Set(selected)];
|
| 55 |
const rho_t=num(payload,'rho_t',.61,1e-9,1e9);
|
| 56 |
+
const si_coupling=num(payload,'si_coupling',.6,0,.85),
|
| 57 |
+
si_ripple=num(payload,'si_ripple',.75,0,10000), si_duty=payload.si_duty==null?M:num(payload,'si_duty',.5,.25,.75);
|
| 58 |
+
const result=(k,m)=>{if(!valid(k,m))return null;
|
| 59 |
+
if(k==='si2')return evaluate(k,m,{rs:1,rc:rho_c,rl:rho_l,coupling:si_coupling,rippleScale:si_ripple});if(k==='rsc2')return rho_q>0?evaluate(k,m,{rs:1,rc:rho_c,rl:rho_l,cf:1/rho_q,fs:1,lt:rho_t}):null;const [a,b,c]=coefficients(k,2*m),fet=a,cap=b*rho_c,ind=(k==='sp2'?0:.5)*rho_l,ssl=c*rho_q;const net=fet+cap,ssl_series=k==='sp2'?chargingResistance(k,net,ssl)-net:(net||ssl)?ssl*ssl/(Math.hypot(net,ssl)+net):0;return {fet,cap,ind,ssl,ssl_series,fsl:fet+cap+ind,total:ind+chargingResistance(k,net,ssl),coefficients:[a,b,k==='sp2'?0:.5,c],D:2*m,gate_duty:k==='buck2'?m:k==='sp2'?.5:null}};
|
| 60 |
+
const rows=selected.map(id=>{const r=result(id,id==='si2'?si_duty:M),meta=index[id];return {id,name:meta.name,short:meta.short,color:meta.color,note:meta.note,formulas:data.formulas[id],allocation:data.formulas[id]?allocation(id,index,r):null,valid:!!r,domain:meta.range,...(r||{})}});
|
| 61 |
+
const xs=[...new Set([...linspace(.0005,.4995,500),.25,.5,M])].sort((a,b)=>a-b),curves=selected.map(id=>({id,name:index[id].short,color:index[id].color,points:(id==='si2'?[...new Set([...linspace(.25,.75,251),si_duty])].sort((a,b)=>a-b):xs).flatMap(m=>{const r=result(id,m);return r?[[m,r.total]]:[]})})).filter(s=>s.points.length);
|
| 62 |
+
return {ratio,M,normalization:{base:'R_S',rho_c,rho_l,rho_q,...(selected.includes('rsc2')?{rho_t}:{}),...(selected.includes('si2')?{si_coupling,si_ripple,si_duty}:{}),component_unit:'R/R_S',coefficient_bases:['R_S','R_C','R_L','1/(C_F f_s)']},rows,curves,provenance:'XFLY-IEEE Section V-F, Table I; Figures 18–20. Dimensionless form of the current manuscript models.',assumptions:[
|
| 63 |
'Rs is the common resistance base. rho_C=Rc/Rs; rho_L=Rl/Rs; rho_Q=1/(Cf fs Rs). No absolute resistance, current or power is assigned.',
|
| 64 |
'Table columns k_FET=RFET/Rs, k_CAP=RCAP/Rc, k_IND=RIND/Rl and k_SSL=RSSL Cf fs are independent coefficients. These columns are not directly additive. Coefficients remain defined when their corresponding loss scale is zero.',
|
| 65 |
...data.assumptions.filter(s=>!s.startsWith('Conduction efficiency'))]};
|
static/compare/index.html
CHANGED
|
@@ -1,13 +1,13 @@
|
|
| 1 |
<!doctype html>
|
| 2 |
-
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="description" content="Power converter topologies and their ideal conversion ratio plus effective output resistance."><title>OpenPELS — Choose Your Converter</title><link rel="stylesheet" href="./style.css?v=
|
| 3 |
<header><a class="brand" href="../index.html"><span>╳</span>OpenPELS</a><div>Constraints → topology recommendation</div><a href="../index.html#simulator" target="_blank" rel="noopener">Simulator</a></header>
|
| 4 |
<main><div class="intro"><div><h1>Compare converter candidates for your design.</h1><p>Choose a conversion ratio and compare coupled-inductor cells at their nominal ripple-cancellation points.</p></div><button id="open-upload">+ Upload topology</button></div>
|
| 5 |
-
<section class="family-navigation" aria-label="Conversion ratio families"><div class="ratio-control"><label>1 · Target conversion ratio</label><div id="ratios"><button data-ratio="2"><strong>2:1</strong><small>Coupled buck / 3L cells</small></button><button data-ratio="4" class="active"><strong>4:1</strong><small>Coupled hybrid cells</small></button><button data-ratio="6"><strong>6:1</strong><small>Model pending</small></button><button data-ratio="8"><strong>8:1</strong><small>Model pending</small></button><button data-ratio="16"><strong>16:1</strong><small>Model pending</small></button></div></div></section><p id="family-context" class="family-context"></p><section class="design-workspace"><div class="design-inputs"><div class="section-kicker">2 · DESIGN CONSTRAINTS</div><h2>Your available resources</h2><div class="design-fields" id="design-fields"></div><div id="load-summary" class="load-summary" aria-live="polite"></div><p class="input-scope">Ron × area defaults to an illustrative 1 mΩ·mm², not a characterized TSMC layout value. Capacitor budget covers flying/clamp caps; winding limits count power windings. Driver area and Cin/Cout are outside these budgets. Lk = 50 nH and Lm = 1 μH are editable illustrative defaults, not characterized TSMC magnetics.</p><button id="recommend-design" class="primary">Update candidates</button><p id="design-error" role="status"></p></div><section id="shortlist-section" class="shortlist-section"><div class="shortlist-heading"><div><div class="section-kicker">3 · COMPARE ALL QUALIFYING CANDIDATES</div><h2>Topology candidates</h2></div><button id="export-recommendation">↓ Design JSON</button></div><p id="candidate-status" class="candidate-status" role="status"></p><div id="shortlist-results"></div><details class="selection-method"><summary>Ripple-cancellation criterion and recommendation scope</summary><p>Output voltage and output current are the operating-point inputs. The selected conversion ratio N:1 sets the nominal required input voltage Vin = N Vout. Output power and load resistance are calculated: Pout = Vout Iout and Rload = Vout/Iout. Converter Rout is the modeled output-referred series resistance (RFET + RCAP + RIND + the non-double-counted charging increment), not the load resistance. Each panel shows Rout in mΩ as well as its per-unit value. Rout/Rload gives the nominal constant-current droop fraction when requested Vout = Vin/ratio. The specified load current is used in the loss model; this is not a solved resistive-load equilibrium. Only coupled-inductor cells with a verified nominal two-level excitation pattern at this ratio are listed. The admitted patterns are matched complementary winding inputs at 50% effective duty, or the three-level buck’s ideal constant-midpoint state at 2:1. A two-phase buck reaches complementary excitation at ideal 2:1; balanced half-input hybrid cells reach it at ideal 4:1. A three-level buck also belongs to 2:1: with a balanced flying capacitor and 50% gate duty, its two redundant states both apply Vin/2 to the winding input, ideally giving zero winding voltage and ripple. This midpoint result does not require magnetic coupling, although the drawn implementation retains coupled windings. It differs from its coupling-assisted 4:1 operation. Real flying-capacitor voltage ripple, imbalance and dead time leave residual ripple that is not quantified by the midpoint-hold estimate. A four-pulse or three-level sequence must preserve the complementary winding-input pattern; arbitrary pulse permutations are not admitted by this estimate.</p><div class="equation">Lself = Lk + Lm; M = −Lm; LDM = Lk + 2Lm</div><div class="equation">Δiphase,pp ≈ Vstep / (4 feff LDM)</div><p>Vstep is Vin for buck cells and Vin/2 for the admitted hybrid cells. feff is fs for the two-command cells, and 2fs for the specified four-pulse / three-level excitation. Phase ripple percentage is Δiphase,pp divided by Iout/2. The symmetric common-mode switching excitation cancels ideally; individual phase ripple is finite and approaches zero only with sufficiently large differential-mode inductance. This is not a measured zero-ripple claim.</p><p>We screen the entered phase-ripple threshold, winding/capacitor counts, capacitance budget and estimated open-loop droop. Total FET width is searched under the silicon budget with each model’s relative allocation held fixed. Die-area mode uses RΣ = (Ron × area)/(usable transistor area); the 1 mΩ·mm² default is an illustrative editable layout assumption. Shortlist resistances share the full-budget RS base. Loss ranking remains the flat-current model plus gate drive; ripple-loss corrections and Coss energy are not inferred.</p><p>Ripple estimates assume equal winding turns, inverse polarity, balanced capacitor voltages, stiff ideal switching levels and matched timing. Capacitor ripple, imbalance, dead time, resistive voltage errors and control action can spoil cancellation. Vin is derived from the selected ideal cancellation ratio and requested output voltage. Changing ratio preserves both output voltage and current. Open-loop output under the specified current is predicted as Vin/ratio − Iout Rout, so matching the ideal target does not prove loaded regulation. Correcting loaded output voltage by duty adjustment can move away from the nominal cancellation point. Saturation, core loss and magnetic implementation need separate verification.</p><p>The current library establishes only the 2:1 and 4:1 cancellation-point families. The 6:1, 8:1 and 16:1 tabs remain empty until a higher-order switching and magnetic model is available. Off-duty buck comparisons and the nonmagnetic SC option are omitted. The stacked buck is grouped at its electrical 2:1 cancellation point while retaining its existing 4:1 loss-sizing allocation.</p><p>TI describes the three-level buck’s ideal D = 0.5 zero-inductor-voltage point in <a href="https://www.ti.com/lit/an/slyt807/slyt807.pdf" target="_blank" rel="noopener">SLYT807</a>. For coupled-inductor modal behavior, see <a href="https://www.analog.com/en/resources/analog-dialogue/articles/output-current-and-volt-ripple-in-multiphase-buck.html" target="_blank" rel="noopener">ADI’s phase- and output-ripple analysis</a>. The formulas above follow directly from the stated symmetric inductance matrix.</p></details></section></section><details id="analysis-workbench" class="analysis-workbench"><summary>Inspect schematics, die allocation, and loss derivations</summary><p id="inspection-context">Reference drawings use normalized resistances. Inspect a shortlisted design to load its loss weights.</p><div class="advanced-toolbar"><details class="weights"><summary>Per-unit loss weights</summary><div><label>R<sub>C</sub> / R<sub>S</sub><input id="rho_c" type="number" value="1" min="0" step="0.1"></label><label>R<sub>L</sub> / R<sub>S</sub><input id="rho_l" type="number" value="1" min="0" step="0.1"></label><label>1 / (C<sub>F</sub> f<sub>s</sub> R<sub>S</sub>)<input id="rho_q" type="number" value="20" min="0" step="1"></label><label hidden>ρT (L fs / Rs)<input id="rho_t" type="number" min="0.000000001" step="any" value="0.61"></label><button id="apply-weights">Apply</button><button id="reset">Reset</button></div></details><button id="export-csv" class="plain">↓ CSV</button></div>
|
| 6 |
<details class="secondary-panel" id="technology-panel"><summary>180 nm device reference · uses the specified output voltage and current</summary><p>User-supplied device example from XFLY_Power_Analysis.md; not independently verified foundry data. FOM<sub>g</sub> = 1.51102 Ω·pC; FOM<sub>oss</sub> = 0.67424 Ω·pC. First-order width scaling; same device technology for all FETs. Device voltage rating and PVT limits require a PDK check.</p><div class="tech-settings" id="tech-settings"></div><p>Optional Eoss entry: dissipated Coss energy in pJ per 1 mm of total FET width per cycle, averaged over the actual device transitions after recovery. Leave blank when unknown. Qoss is not converted to Eoss.</p><button id="apply-technology">Update example</button> <button id="export-technology">↓ Technology JSON</button><p id="technology-status" role="status"></p><div class="technology-table" id="technology-results"></div><details><summary>Derivation and model scope</summary><p>RΣ is the resistance of all available FET width in parallel. With the existing twelve-unit area budget, RΣ = RS/12. A device assigned fraction α has width αWtot and on-resistance RΣ/α. FOMg = Ron·Qg and FOMoss = Ron·Qoss are width independent under the supplied scaling.</p><div class="equation">Pg = VGS fs ng FOMg / RΣ; Rg = Vx² RΣ / (VGS fs ng FOMg)</div><p>Vx = M Vin is the ideal secondary voltage, ahead of the series loss resistances. Both loss shunts use Vx, rather than the loaded Vout. Gate power is a separate supply demand unless the driver is explicitly powered from the main input. The shunts are accounting equivalents; their current does not enter the conduction-loss calculations.</p><div class="equation">Poss = fs Σ νi Eoss,diss,i; Ross = Vx² / Poss</div><p>ng is the width-weighted number of gate-charge events per period, assumed uniform in this example. Actual four-pulse sequences require event counts for each physical device. No exact Eoss follows from FOMoss alone: Q(V), Eoss(V), switching swings, and recovery are needed. The optional aggregate Eoss input must already include these effects.</p><p>The numerical table uses matched flat winding currents for inductive converters. The added SP-SC uses an exact linear periodic RC model, with no power winding. Width allocations remain fixed at each topology’s reference ratio (2:1 for the added cells; 4:1 for the paper cells). These allocations are not automatically reoptimized at another sizing duty. The 4 μF budget covers flying and clamp capacitors only; Cin and Cout are excluded. Adopted allocation: equal main capacitors for two-capacitor cells; equal main and clamp capacitances in four-capacitor cells, consistent with the existing 2SBUCK model. This is a disclosed comparison assumption, not a capacitor-allocation optimum. Additional XFLY4P clamp recharge is not derived. Turn-on/off overlap, dead time, core loss, interconnects and ripple corrections remain outside these estimates.</p><p>RFET, RCAP and RIND use the existing closed-form duty expressions below. The charging increment uses the paper's asymptotic interpolation for the paper cells. The added SP-SC has its own exact linear periodic RC model. Unknown Coss loss is excluded from the displayed partial loss, so no total efficiency is claimed.</p></details><details><summary>Finite-RC charge-event check</summary><p>For a single linear RC charging event lasting d/fs, let q = a Iout/fs be the required transferred charge. Integrating i²R for an exponential current and eliminating its initial amplitude gives:</p><div class="equation">Revent = a²/[2 C fs] coth[d/(2 fs Rpath C)]</div><div class="equation">RSSL = a²/(2 C fs); RFSL = a² Rpath/d</div><p>Here C is the effective capacitance seen by that event. The exact result approaches both limits; they must not be added to another RMS model of the same event. It assumes a fixed linear path, settled initial conditions specified by the event, and a driving step chosen to transfer q. Each converter needs its own event capacitance, duration, charge multiplier, and periodic initial conditions before this expression can replace the existing interpolation.</p><div id="rc-limit-chart"></div></details></details>
|
| 7 |
<div id="topology-picker" class="picker" aria-label="Topologies to compare"></div><div id="status" role="status" class="status">Loading topology models…</div>
|
| 8 |
<div class="column-labels"><span>CONVERTER TOPOLOGY</span><span>AVERAGED DC EQUIVALENT CIRCUIT</span></div><section id="circuits" aria-label="Topology and equivalent circuit comparison"></section>
|
| 9 |
<details id="sweep-section" class="secondary-panel"><summary>Effective resistance versus conversion ratio</summary><div id="legend"></div><div id="rout-chart" class="chart"></div><p>The horizontal axis is the step-down ratio M = Vout/Vin. Only supported duty ranges are plotted.</p></details>
|
| 10 |
-
<details class="secondary-panel" id="model-details"><summary>How the effective resistance is calculated</summary><p>The ideal DC transformer represents the <em>averaged conversion ratio</em>; it does not imply a physical transformer or galvanic isolation. The series resistances are referred to the output. The three green blocks show the coefficient-weighted switch, capacitor-ESR and winding contributions, grouped as R<sub>FSL</sub>.</p><div class="equation">V<sub>out</sub> ≈ M V<sub>in</sub> − I<sub>out</sub> R<sub>eq</sub></div><div class="equation">R<sub>eq</sub> = R<sub>IND</sub> + √[(R<sub>FET</sub> + R<sub>CAP</sub>)² + R<sub>SSL</sub>²]</div><div class="equation">R<sub>FSL</sub> = R<sub>FET</sub> + R<sub>CAP</sub> + R<sub>IND</sub></div><div class="equation">R<sub>SSL,add</sub> = √[(R<sub>FET</sub> + R<sub>CAP</sub>)² + R<sub>SSL</sub>²] − (R<sub>FET</sub> + R<sub>CAP</sub>)</div><div class="equation">R<sub>eq</sub> = R<sub>FSL</sub> + R<sub>SSL,add</sub></div><p>The orange inset gives the estimated charge-sharing limit R<sub>SSL</sub>. The orange series block is its incremental contribution after interpolation. FSL and SSL are limits of the same charging process. Paper cells use the paper’s interpolation; the added SP-SC uses its exact linear periodic RC expression below. The limits are not added as independent series resistors. All displayed numbers divide resistance by R<sub>S</sub>. Device allocations are fixed at their reference points: 2:1 for BUCK2Φ and SP-SC, 4:1 for the paper cells; all use total area 12 A₀.</p><p>Assumptions: two matched flat phase currents, identical device technology, and zero clamp-capacitor ESR. The separate gate-drive and Coss accounting shunts sit at the ideal secondary node Vx = M Vin, ahead of the series losses: Rg = Vx²/Pg and Ross = Vx²/Poss. Their physical values are in the separate technology example; they are excluded from the per-unit resistance sweep. Gate demand is tracked separately from the main input unless its supply is specified. Gate drive, magnetic core loss, winding ripple, and dead time are excluded. XFLY2P uses the paper’s effective six-switch model with the physical split-middle area normalization. XFLY4P applies only to the specified four-pulse realization. Unsupported operating points receive no numerical resistance.</p><details><summary>2:1 family: circuit operation and derivation</summary><p>BUCK2Φ has two synchronous half bridges, with 180° phase displacement and two inverse-coupled windings. Db = M. Each winding carries Iout/2 in the flat-current approximation. At the 2:1 sizing point, all four switches receive 3 A₀: Ron = RS/3. Summing both upper/lower duty-weighted losses gives RFET = RS/6 at any duty with those fixed widths, plus RIND = RL/2. This assumes CCM and neglects triangular ripple. The opposite winding dots specify inverse coupling. Coupling changes ripple and modal inductance; without self/mutual inductance and core-loss data, no coupling-dependent loss reduction is assigned. RL remains the resistance of each winding, so the flat-current winding term is RL/2.</p><p>SP-SC has two interleaved four-switch cells. In each phase, S1/S3 (or Q1/Q3) connect CF between Vin and Vout; S2/S4 connect it between Vout and ground. A and B are 50% clocks shifted 180°. The two equal flying capacitors share the assigned budget; there is no power inductor. Ideal conversion is fixed at 1/2. The exported comparison index D = 2M is not its gate duty; SP-SC gate duty is 0.5. The eight equal switches each receive 1.5 A₀, giving Ron = 2RS/3.</p><div class="equation">RFET = 2RS/3; RCAP = RC/2; RFSL = 2RS/3 + RC/2; RSSL = 1/(8 CF fs)</div><div class="equation">Req = RSSL coth(RSSL/RFSL); RHC,add = Req − RFSL</div><p>For one phase, each half-cycle transfers q = Iout/(4fs). Integrating the exponential i²R loss through Rpath = 2Ron + RC over both half-cycles, and summing both phases, gives the expression above. It assumes matched cells, constant linear Ron/ESR, stiff input/output ports and no dead time. RFET/RCAP are FSL components; RHC,add is the finite-RC increment, not a second RMS loss. The finite-RC result tends to RFSL at high frequency and RSSL at low frequency. Only its fixed 2:1 point appears in the conversion-ratio sweep; voltage droop does not create another ideal conversion ratio.</p><p>The single-cell coth relation is also documented in <a href="https://www2.eecs.berkeley.edu/Pubs/TechRpts/2021/Archive/EECS-2021-236.pdf" target="_blank" rel="noopener">Berkeley EECS-2021-236, Eq. (3.13)</a>. The two-phase reduction and normalized coefficients shown here are derived for these drawn cells.</p></details><details id="resonant-model" hidden><summary>2:1 resonant SC derivation</summary><p>One leg charges from VIN to VOUT while the other discharges from VOUT to ground. The periodic RLC solution uses opposite half-cycle drives, current and capacitor-voltage continuity and matched parts. At each transition the tank current may be nonzero.</p><div class="equation">q = Iout/(4 fs); Req = (Vin/2 − Vout)/Iout; K = Req/(2 Ron + RC + RL)</div><p>The switch, capacitor ESR and inductor DCR terms partition the same tank RMS dissipation. The model uses constant port voltage and ideal synchronized switching. The per-unit tank input ρT = L fs / Rs controls detuning with ρQ = 1/(CF fs Rs). A comparable operating point requires its own tank settings.</p></details><div id="coefficients"></div></details>
|
| 11 |
</details><footer><span>OpenPELS · Based on the XFLY family analysis</span><span>Per-unit analytical model · verify with switched simulation</span></footer></main>
|
| 12 |
<dialog id="upload-dialog"><div class="dialog-heading"><h2>Upload a topology</h2><button id="close-upload" aria-label="Close upload">×</button></div><label class="dropzone" id="dropzone">Choose or drop a schematic<span>PNG, JPEG or WebP · up to 8 MB</span><input id="image-upload" type="file" accept="image/png,image/jpeg,image/webp" hidden></label><img id="image-preview" alt="Uploaded topology" hidden><label>Gate sequence and operating conditions<textarea id="operating-notes" rows="2" placeholder="For example: 4:1, CCM, two commands shifted 180°, D = 0.5"></textarea></label><details><summary>Vision connection</summary><p>Your inference token and image go directly from this browser to the Hugging Face inference provider for this request. Neither is saved.</p><label>Hugging Face inference token<input type="password" id="api-key" autocomplete="off" placeholder="hf_…"></label><label>Vision model<input id="vision-model" value="Qwen/Qwen2.5-VL-72B-Instruct"></label></details><button id="inspect" class="primary" disabled>Read topology →</button><p id="upload-status" role="status">Choose a schematic to begin.</p><div id="interpretation" hidden></div></dialog>
|
| 13 |
-
<div id="toast" role="status" hidden></div><script src="./resonant.js?v=
|
|
|
|
| 1 |
<!doctype html>
|
| 2 |
+
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="description" content="Power converter topologies and their ideal conversion ratio plus effective output resistance."><title>OpenPELS — Choose Your Converter</title><link rel="stylesheet" href="./style.css?v=si2"></head><body>
|
| 3 |
<header><a class="brand" href="../index.html"><span>╳</span>OpenPELS</a><div>Constraints → topology recommendation</div><a href="../index.html#simulator" target="_blank" rel="noopener">Simulator</a></header>
|
| 4 |
<main><div class="intro"><div><h1>Compare converter candidates for your design.</h1><p>Choose a conversion ratio and compare coupled-inductor cells at their nominal ripple-cancellation points.</p></div><button id="open-upload">+ Upload topology</button></div>
|
| 5 |
+
<section class="family-navigation" aria-label="Conversion ratio families"><div class="ratio-control"><label>1 · Target conversion ratio</label><div id="ratios"><button data-ratio="2"><strong>2:1</strong><small>Coupled buck / 3L cells</small></button><button data-ratio="4" class="active"><strong>4:1</strong><small>Coupled hybrid cells</small></button><button data-ratio="6"><strong>6:1</strong><small>Model pending</small></button><button data-ratio="8"><strong>8:1</strong><small>Model pending</small></button><button data-ratio="16"><strong>16:1</strong><small>Model pending</small></button></div></div></section><p id="family-context" class="family-context"></p><section class="design-workspace"><div class="design-inputs"><div class="section-kicker">2 · DESIGN CONSTRAINTS</div><h2>Your available resources</h2><div class="design-fields" id="design-fields"></div><div id="load-summary" class="load-summary" aria-live="polite"></div><p class="input-scope">Ron × area defaults to an illustrative 1 mΩ·mm², not a characterized TSMC layout value. Capacitor budget covers flying/clamp caps; winding limits count power windings. Driver area and Cin/Cout are outside these budgets. Lk = 50 nH and Lm = 1 μH are editable illustrative defaults, not characterized TSMC magnetics.</p><button id="recommend-design" class="primary">Update candidates</button><p id="design-error" role="status"></p></div><section id="shortlist-section" class="shortlist-section"><div class="shortlist-heading"><div><div class="section-kicker">3 · COMPARE ALL QUALIFYING CANDIDATES</div><h2>Topology candidates</h2></div><button id="export-recommendation">↓ Design JSON</button></div><p id="candidate-status" class="candidate-status" role="status"></p><div id="shortlist-results"></div><details class="selection-method"><summary>Ripple-cancellation criterion and recommendation scope</summary><p>Output voltage and output current are the operating-point inputs. The selected conversion ratio N:1 sets the nominal required input voltage Vin = N Vout. Output power and load resistance are calculated: Pout = Vout Iout and Rload = Vout/Iout. Converter Rout is the modeled output-referred series resistance (RFET + RCAP + RIND + the non-double-counted charging increment), not the load resistance. Each panel shows Rout in mΩ as well as its per-unit value. Rout/Rload gives the nominal constant-current droop fraction when requested Vout = Vin/ratio. The specified load current is used in the loss model; this is not a solved resistive-load equilibrium. Only coupled-inductor cells with a verified nominal two-level excitation pattern at this ratio are listed. The admitted patterns are matched complementary winding inputs at 50% effective duty, or the three-level buck’s ideal constant-midpoint state at 2:1. A two-phase buck reaches complementary excitation at ideal 2:1; balanced half-input hybrid cells reach it at ideal 4:1. A three-level buck also belongs to 2:1: with a balanced flying capacitor and 50% gate duty, its two redundant states both apply Vin/2 to the winding input, ideally giving zero winding voltage and ripple. This midpoint result does not require magnetic coupling, although the drawn implementation retains coupled windings. It differs from its coupling-assisted 4:1 operation. Real flying-capacitor voltage ripple, imbalance and dead time leave residual ripple that is not quantified by the midpoint-hold estimate. A four-pulse or three-level sequence must preserve the complementary winding-input pattern; arbitrary pulse permutations are not admitted by this estimate.</p><div class="equation">Lself = Lk + Lm; M = −Lm; LDM = Lk + 2Lm</div><div class="equation">Δiphase,pp ≈ Vstep / (4 feff LDM)</div><p>Vstep is Vin for buck cells and Vin/2 for the admitted hybrid cells. feff is fs for the two-command cells, and 2fs for the specified four-pulse / three-level excitation. Phase ripple percentage is Δiphase,pp divided by Iout/2. The symmetric common-mode switching excitation cancels ideally; individual phase ripple is finite and approaches zero only with sufficiently large differential-mode inductance. This is not a measured zero-ripple claim.</p><p>We screen the entered phase-ripple threshold, winding/capacitor counts, capacitance budget and estimated open-loop droop. Total FET width is searched under the silicon budget with each model’s relative allocation held fixed. Die-area mode uses RΣ = (Ron × area)/(usable transistor area); the 1 mΩ·mm² default is an illustrative editable layout assumption. Shortlist resistances share the full-budget RS base. Loss ranking remains the flat-current model plus gate drive; ripple-loss corrections and Coss energy are not inferred.</p><p>Ripple estimates assume equal winding turns, inverse polarity, balanced capacitor voltages, stiff ideal switching levels and matched timing. Capacitor ripple, imbalance, dead time, resistive voltage errors and control action can spoil cancellation. Vin is derived from the selected ideal cancellation ratio and requested output voltage. Changing ratio preserves both output voltage and current. Open-loop output under the specified current is predicted as Vin/ratio − Iout Rout, so matching the ideal target does not prove loaded regulation. Correcting loaded output voltage by duty adjustment can move away from the nominal cancellation point. Saturation, core loss and magnetic implementation need separate verification.</p><p>The current library establishes only the 2:1 and 4:1 cancellation-point families. The 6:1, 8:1 and 16:1 tabs remain empty until a higher-order switching and magnetic model is available. Off-duty buck comparisons and the nonmagnetic SC option are omitted. The stacked buck is grouped at its electrical 2:1 cancellation point while retaining its existing 4:1 loss-sizing allocation.</p><p>TI describes the three-level buck’s ideal D = 0.5 zero-inductor-voltage point in <a href="https://www.ti.com/lit/an/slyt807/slyt807.pdf" target="_blank" rel="noopener">SLYT807</a>. For coupled-inductor modal behavior, see <a href="https://www.analog.com/en/resources/analog-dialogue/articles/output-current-and-volt-ripple-in-multiphase-buck.html" target="_blank" rel="noopener">ADI’s phase- and output-ripple analysis</a>. The formulas above follow directly from the stated symmetric inductance matrix.</p></details></section></section><details id="analysis-workbench" class="analysis-workbench"><summary>Inspect schematics, die allocation, and loss derivations</summary><p id="inspection-context">Reference drawings use normalized resistances. Inspect a shortlisted design to load its loss weights.</p><div class="advanced-toolbar"><details class="weights"><summary>Per-unit loss weights</summary><div><label>R<sub>C</sub> / R<sub>S</sub><input id="rho_c" type="number" value="1" min="0" step="0.1"></label><label>R<sub>L</sub> / R<sub>S</sub><input id="rho_l" type="number" value="1" min="0" step="0.1"></label><label>1 / (C<sub>F</sub> f<sub>s</sub> R<sub>S</sub>)<input id="rho_q" type="number" value="20" min="0" step="1"></label><label hidden>ρT (L fs / Rs)<input id="rho_t" type="number" min="0.000000001" step="any" value="0.61"></label><label hidden>Inverse coupling magnitude<input id="si_coupling" type="number" min="0" max=".85" step="any" value=".6"></label><label hidden>Vin / (L fs Iout)<input id="si_ripple" type="number" min="0" step="any" value=".75"></label><button id="apply-weights">Apply</button><button id="reset">Reset</button></div></details><button id="export-csv" class="plain">↓ CSV</button></div>
|
| 6 |
<details class="secondary-panel" id="technology-panel"><summary>180 nm device reference · uses the specified output voltage and current</summary><p>User-supplied device example from XFLY_Power_Analysis.md; not independently verified foundry data. FOM<sub>g</sub> = 1.51102 Ω·pC; FOM<sub>oss</sub> = 0.67424 Ω·pC. First-order width scaling; same device technology for all FETs. Device voltage rating and PVT limits require a PDK check.</p><div class="tech-settings" id="tech-settings"></div><p>Optional Eoss entry: dissipated Coss energy in pJ per 1 mm of total FET width per cycle, averaged over the actual device transitions after recovery. Leave blank when unknown. Qoss is not converted to Eoss.</p><button id="apply-technology">Update example</button> <button id="export-technology">↓ Technology JSON</button><p id="technology-status" role="status"></p><div class="technology-table" id="technology-results"></div><details><summary>Derivation and model scope</summary><p>RΣ is the resistance of all available FET width in parallel. With the existing twelve-unit area budget, RΣ = RS/12. A device assigned fraction α has width αWtot and on-resistance RΣ/α. FOMg = Ron·Qg and FOMoss = Ron·Qoss are width independent under the supplied scaling.</p><div class="equation">Pg = VGS fs ng FOMg / RΣ; Rg = Vx² RΣ / (VGS fs ng FOMg)</div><p>Vx = M Vin is the ideal secondary voltage, ahead of the series loss resistances. Both loss shunts use Vx, rather than the loaded Vout. Gate power is a separate supply demand unless the driver is explicitly powered from the main input. The shunts are accounting equivalents; their current does not enter the conduction-loss calculations.</p><div class="equation">Poss = fs Σ νi Eoss,diss,i; Ross = Vx² / Poss</div><p>ng is the width-weighted number of gate-charge events per period, assumed uniform in this example. Actual four-pulse sequences require event counts for each physical device. No exact Eoss follows from FOMoss alone: Q(V), Eoss(V), switching swings, and recovery are needed. The optional aggregate Eoss input must already include these effects.</p><p>The numerical table uses matched flat winding currents for inductive converters. The added SP-SC uses an exact linear periodic RC model, with no power winding. Width allocations remain fixed at each topology’s reference ratio (2:1 for the added cells; 4:1 for the paper cells). These allocations are not automatically reoptimized at another sizing duty. The 4 μF budget covers flying and clamp capacitors only; Cin and Cout are excluded. Adopted allocation: equal main capacitors for two-capacitor cells; equal main and clamp capacitances in four-capacitor cells, consistent with the existing 2SBUCK model. This is a disclosed comparison assumption, not a capacitor-allocation optimum. Additional XFLY4P clamp recharge is not derived. Turn-on/off overlap, dead time, core loss, interconnects and ripple corrections remain outside these estimates.</p><p>RFET, RCAP and RIND use the existing closed-form duty expressions below. The charging increment uses the paper's asymptotic interpolation for the paper cells. The added SP-SC has its own exact linear periodic RC model. Unknown Coss loss is excluded from the displayed partial loss, so no total efficiency is claimed.</p></details><details><summary>Finite-RC charge-event check</summary><p>For a single linear RC charging event lasting d/fs, let q = a Iout/fs be the required transferred charge. Integrating i²R for an exponential current and eliminating its initial amplitude gives:</p><div class="equation">Revent = a²/[2 C fs] coth[d/(2 fs Rpath C)]</div><div class="equation">RSSL = a²/(2 C fs); RFSL = a² Rpath/d</div><p>Here C is the effective capacitance seen by that event. The exact result approaches both limits; they must not be added to another RMS model of the same event. It assumes a fixed linear path, settled initial conditions specified by the event, and a driving step chosen to transfer q. Each converter needs its own event capacitance, duration, charge multiplier, and periodic initial conditions before this expression can replace the existing interpolation.</p><div id="rc-limit-chart"></div></details></details>
|
| 7 |
<div id="topology-picker" class="picker" aria-label="Topologies to compare"></div><div id="status" role="status" class="status">Loading topology models…</div>
|
| 8 |
<div class="column-labels"><span>CONVERTER TOPOLOGY</span><span>AVERAGED DC EQUIVALENT CIRCUIT</span></div><section id="circuits" aria-label="Topology and equivalent circuit comparison"></section>
|
| 9 |
<details id="sweep-section" class="secondary-panel"><summary>Effective resistance versus conversion ratio</summary><div id="legend"></div><div id="rout-chart" class="chart"></div><p>The horizontal axis is the step-down ratio M = Vout/Vin. Only supported duty ranges are plotted.</p></details>
|
| 10 |
+
<details class="secondary-panel" id="model-details"><summary>How the effective resistance is calculated</summary><p>The ideal DC transformer represents the <em>averaged conversion ratio</em>; it does not imply a physical transformer or galvanic isolation. The series resistances are referred to the output. The three green blocks show the coefficient-weighted switch, capacitor-ESR and winding contributions, grouped as R<sub>FSL</sub>.</p><div class="equation">V<sub>out</sub> ≈ M V<sub>in</sub> − I<sub>out</sub> R<sub>eq</sub></div><div class="equation">R<sub>eq</sub> = R<sub>IND</sub> + √[(R<sub>FET</sub> + R<sub>CAP</sub>)² + R<sub>SSL</sub>²]</div><div class="equation">R<sub>FSL</sub> = R<sub>FET</sub> + R<sub>CAP</sub> + R<sub>IND</sub></div><div class="equation">R<sub>SSL,add</sub> = √[(R<sub>FET</sub> + R<sub>CAP</sub>)² + R<sub>SSL</sub>²] − (R<sub>FET</sub> + R<sub>CAP</sub>)</div><div class="equation">R<sub>eq</sub> = R<sub>FSL</sub> + R<sub>SSL,add</sub></div><p>The orange inset gives the estimated charge-sharing limit R<sub>SSL</sub>. The orange series block is its incremental contribution after interpolation. FSL and SSL are limits of the same charging process. Paper cells use the paper’s interpolation; the added SP-SC uses its exact linear periodic RC expression below. The limits are not added as independent series resistors. All displayed numbers divide resistance by R<sub>S</sub>. Device allocations are fixed at their reference points: 2:1 for BUCK2Φ and SP-SC, 4:1 for the paper cells; all use total area 12 A₀.</p><p>Assumptions: two matched flat phase currents, identical device technology, and zero clamp-capacitor ESR. The separate gate-drive and Coss accounting shunts sit at the ideal secondary node Vx = M Vin, ahead of the series losses: Rg = Vx²/Pg and Ross = Vx²/Poss. Their physical values are in the separate technology example; they are excluded from the per-unit resistance sweep. Gate demand is tracked separately from the main input unless its supply is specified. Gate drive, magnetic core loss, winding ripple, and dead time are excluded. XFLY2P uses the paper’s effective six-switch model with the physical split-middle area normalization. XFLY4P applies only to the specified four-pulse realization. Unsupported operating points receive no numerical resistance.</p><details><summary>2:1 family: circuit operation and derivation</summary><p>BUCK2Φ has two synchronous half bridges, with 180° phase displacement and two inverse-coupled windings. Db = M. Each winding carries Iout/2 in the flat-current approximation. At the 2:1 sizing point, all four switches receive 3 A₀: Ron = RS/3. Summing both upper/lower duty-weighted losses gives RFET = RS/6 at any duty with those fixed widths, plus RIND = RL/2. This assumes CCM and neglects triangular ripple. The opposite winding dots specify inverse coupling. Coupling changes ripple and modal inductance; without self/mutual inductance and core-loss data, no coupling-dependent loss reduction is assigned. RL remains the resistance of each winding, so the flat-current winding term is RL/2.</p><p>SP-SC has two interleaved four-switch cells. In each phase, S1/S3 (or Q1/Q3) connect CF between Vin and Vout; S2/S4 connect it between Vout and ground. A and B are 50% clocks shifted 180°. The two equal flying capacitors share the assigned budget; there is no power inductor. Ideal conversion is fixed at 1/2. The exported comparison index D = 2M is not its gate duty; SP-SC gate duty is 0.5. The eight equal switches each receive 1.5 A₀, giving Ron = 2RS/3.</p><div class="equation">RFET = 2RS/3; RCAP = RC/2; RFSL = 2RS/3 + RC/2; RSSL = 1/(8 CF fs)</div><div class="equation">Req = RSSL coth(RSSL/RFSL); RHC,add = Req − RFSL</div><p>For one phase, each half-cycle transfers q = Iout/(4fs). Integrating the exponential i²R loss through Rpath = 2Ron + RC over both half-cycles, and summing both phases, gives the expression above. It assumes matched cells, constant linear Ron/ESR, stiff input/output ports and no dead time. RFET/RCAP are FSL components; RHC,add is the finite-RC increment, not a second RMS loss. The finite-RC result tends to RFSL at high frequency and RSSL at low frequency. Only its fixed 2:1 point appears in the conversion-ratio sweep; voltage droop does not create another ideal conversion ratio.</p><p>The single-cell coth relation is also documented in <a href="https://www2.eecs.berkeley.edu/Pubs/TechRpts/2021/Archive/EECS-2021-236.pdf" target="_blank" rel="noopener">Berkeley EECS-2021-236, Eq. (3.13)</a>. The two-phase reduction and normalized coefficients shown here are derived for these drawn cells.</p></details><details id="resonant-model" hidden><summary>2:1 resonant SC derivation</summary><p>One leg charges from VIN to VOUT while the other discharges from VOUT to ground. The periodic RLC solution uses opposite half-cycle drives, current and capacitor-voltage continuity and matched parts. At each transition the tank current may be nonzero.</p><div class="equation">q = Iout/(4 fs); Req = (Vin/2 − Vout)/Iout; K = Req/(2 Ron + RC + RL)</div><p>The switch, capacitor ESR and inductor DCR terms partition the same tank RMS dissipation. The model uses constant port voltage and ideal synchronized switching. The per-unit tank input ρT = L fs / Rs controls detuning with ρQ = 1/(CF fs Rs). A comparable operating point requires its own tank settings.</p></details><details id="si-model" hidden><summary>Switched inductor CCM derivation</summary><p>Two synchronous buck legs share an output capacitor. Complementary commands within each leg and a half-period phase offset give ideal Vout = duty × Vin. The reciprocal inductance matrix has diagonal L and off-diagonal −kL for winding currents directed toward the output.</p><div class="equation">Lc = L(1 − k); Ld = L(1 + k); iC = iA + iB − Iout</div><p>Each switch state has constant winding slopes in the stiff-output approximation. Integrating the squared currents gives the channel, DCR and output ESR losses. The output capacitor has zero average current. The phase-current valley must stay above zero. At 50% duty the ideal sum ripple cancels while winding ripple remains. Device areas are proportional to their RMS currents. The loss resistance is power divided by Iout². The separate droop estimate uses the winding volt-second balance and the mean on-interval currents.</p></details><div id="coefficients"></div></details>
|
| 11 |
</details><footer><span>OpenPELS · Based on the XFLY family analysis</span><span>Per-unit analytical model · verify with switched simulation</span></footer></main>
|
| 12 |
<dialog id="upload-dialog"><div class="dialog-heading"><h2>Upload a topology</h2><button id="close-upload" aria-label="Close upload">×</button></div><label class="dropzone" id="dropzone">Choose or drop a schematic<span>PNG, JPEG or WebP · up to 8 MB</span><input id="image-upload" type="file" accept="image/png,image/jpeg,image/webp" hidden></label><img id="image-preview" alt="Uploaded topology" hidden><label>Gate sequence and operating conditions<textarea id="operating-notes" rows="2" placeholder="For example: 4:1, CCM, two commands shifted 180°, D = 0.5"></textarea></label><details><summary>Vision connection</summary><p>Your inference token and image go directly from this browser to the Hugging Face inference provider for this request. Neither is saved.</p><label>Hugging Face inference token<input type="password" id="api-key" autocomplete="off" placeholder="hf_…"></label><label>Vision model<input id="vision-model" value="Qwen/Qwen2.5-VL-72B-Instruct"></label></details><button id="inspect" class="primary" disabled>Read topology →</button><p id="upload-status" role="status">Choose a schematic to begin.</p><div id="interpretation" hidden></div></dialog>
|
| 13 |
+
<div id="toast" role="status" hidden></div><script src="./resonant.js?v=si2"></script><script src="./switched-inductor.js?v=si2"></script><script src="./engine.js?v=si2"></script><script src="./technology.js?v=si2"></script><script src="./recommend.js?v=si2"></script><script src="./scoreboard.js?v=si2"></script><script src="./app.js?v=si2"></script></body></html>
|
static/compare/models-data.json
CHANGED
|
@@ -177,6 +177,24 @@
|
|
| 177 |
"switches": 8,
|
| 178 |
"gain": "Fixed ideal M = 1/2; 50% two-state clock",
|
| 179 |
"status": "Matched periodic RLC"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 180 |
}
|
| 181 |
],
|
| 182 |
"formulas": {
|
|
@@ -227,6 +245,12 @@
|
|
| 227 |
"K Rc",
|
| 228 |
"K Rl",
|
| 229 |
"N/A; no separate charging increment. K = Req / (4Rs/3 + Rc + Rl)."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 230 |
]
|
| 231 |
},
|
| 232 |
"provenance": "XFLY-IEEE Section V-F, Table I; Figures 18\u201320. Equations transcribed from the current working manuscript.",
|
|
|
|
| 177 |
"switches": 8,
|
| 178 |
"gain": "Fixed ideal M = 1/2; 50% two-state clock",
|
| 179 |
"status": "Matched periodic RLC"
|
| 180 |
+
},
|
| 181 |
+
{
|
| 182 |
+
"id": "si2",
|
| 183 |
+
"name": "2:1 switched inductor",
|
| 184 |
+
"short": "SI",
|
| 185 |
+
"family": "Inverse-coupled interleaved synchronous buck",
|
| 186 |
+
"asset": "si2.svg",
|
| 187 |
+
"color": "#436864",
|
| 188 |
+
"switches": 4,
|
| 189 |
+
"ratio": [
|
| 190 |
+
1,
|
| 191 |
+
1,
|
| 192 |
+
1,
|
| 193 |
+
1
|
| 194 |
+
],
|
| 195 |
+
"range": "Positive-current CCM, 0.25 ≤ duty ≤ 0.75.",
|
| 196 |
+
"gain": "M = D",
|
| 197 |
+
"note": "Same four-switch graph as the flat-current two-phase coupled buck reference. Finite winding ripple, variable duty, and output-capacitor ESR are included."
|
| 198 |
}
|
| 199 |
],
|
| 200 |
"formulas": {
|
|
|
|
| 245 |
"K Rc",
|
| 246 |
"K Rl",
|
| 247 |
"N/A; no separate charging increment. K = Req / (4Rs/3 + Rc + Rl)."
|
| 248 |
+
],
|
| 249 |
+
"si2": [
|
| 250 |
+
"(Σ√wᵢ)² / 12, wᵢ = ⟨i_Qᵢ²⟩ / Iout²",
|
| 251 |
+
"(ΔIΣ / Iout)² / 12",
|
| 252 |
+
"2 ⟨i_L²⟩ / Iout²",
|
| 253 |
+
"0"
|
| 254 |
]
|
| 255 |
},
|
| 256 |
"provenance": "XFLY-IEEE Section V-F, Table I; Figures 18\u201320. Equations transcribed from the current working manuscript.",
|
static/compare/recommend.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
/* Constraint screening and width optimization within the verified analytical library. */
|
| 2 |
(function(root){'use strict';
|
| 3 |
-
const specs=Object.freeze({buck2:{ratio:2,caps:0,windings:2,magnetics:'inverse-coupled'},rsc2:{ratio:2,caps:2,windings:2,magnetics:'uncoupled resonant'},sp2:{ratio:2,caps:2,windings:0,magnetics:'none'},xfly2p:{ratio:4,caps:2,windings:2,magnetics:'coupled'},xfly4p:{ratio:4,caps:4,windings:2,magnetics:'coupled'},'3lbuck':{ratio:4,ratios:[2,4],caps:2,windings:2,magnetics:'coupled'},'2sbuck':{ratio:4,caps:4,windings:2,magnetics:'coupled'},buck:{ratio:2,caps:0,windings:2,magnetics:'coupled'}});
|
| 4 |
const excitation=Object.freeze({buck2:{level:1,pulses:1},buck:{level:1,pulses:1},xfly2p:{level:.5,pulses:1},xfly4p:{level:.5,pulses:2},'3lbuck':{level:.5,pulses:2},'2sbuck':{level:.5,pulses:1}});
|
| 5 |
function familyIds(ratio){return Object.keys(excitation).filter(id=>(specs[id].ratios??[specs[id].ratio]).includes(ratio))}
|
| 6 |
// Dedicated reference eligibility; the winding-based optimizer keeps its own domain.
|
| 7 |
-
function referenceFamilyIds(ratio){const ids=familyIds(ratio);return ratio===2?[...ids,'sp2','rsc2']:ids}
|
| 8 |
function ripplePoint(id,p){const ldm=p.lk_nh*1e-9+2*p.lm_uh*1e-6;if(id==='3lbuck'&&p.ratio===2)return {ripple_model:'ideal_midpoint_hold',phase_ripple_pp:0,phase_ripple_percent:0,effective_duty:1,gate_duty:.5,effective_frequency:0,ldm,residual_ripple_unmodeled:true,condition:'Ideal balanced flying capacitor holds winding input at Vin/2 = Vout; ideal winding voltage and ripple are zero. Real capacitor-voltage ripple, mismatch and timing effects are not quantified; coupling is not the cause of this ideal cancellation.'};const e=excitation[id],pp=p.vin*e.level/(4*p.fs_mhz*1e6*e.pulses*ldm);return {ripple_model:'complementary_excitation',phase_ripple_pp:pp,phase_ripple_percent:100*pp/(p.io/2),effective_duty:.5,effective_frequency:p.fs_mhz*1e6*e.pulses,ldm,condition:'Balanced 0/Vstep winding inputs, complementary 50% effective duty, matched inverse coupling; first-order phase-current ripple, not measured zero ripple.'}}
|
| 9 |
|
| 10 |
const defaults={ratio:4,vin:3.3,vout:null,voltage_mode:'input_output',load_mode:'current',io:2,pout_w:1.65,fs_mhz:10,vgs:3.3,budget_mode:'area',width_mm:360,die_mm2:1,utilization:.5,ron_area_mohm_mm2:1,cap_uf:4,max_caps:4,max_windings:2,rc_mohm:20,rl_mohm:38,max_drop_percent:10,lk_nh:50,lm_uh:1,max_phase_ripple_percent:5,objective:'loss'};
|
|
@@ -143,6 +143,65 @@ function recommendSwitchedCap(input, settings, base, meta, technology) {
|
|
| 143 |
rows:[row], eligible, winner:eligible[0]??null, native_models:1, deviceReport,
|
| 144 |
scope:resonant?'Fixed 2:1 resonant SC. Exact matched periodic RLC; width optimized within droop and damping limits.':'Fixed 2:1 SP-SC reference. Exact periodic RC; matched flying capacitors, ideal timing and equal per-switch allocation. Total width is optimized subject to the budget and droop ceiling. The capacitance goes to two flying capacitors. Coss requires effective energy data. Driver quiescent power, Cin/Cout ESR, dead time, overlap, reverse recovery, and layout parasitics are outside the model.'};
|
| 145 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 146 |
function recommend(input,data,engine,technology){const op=operatingPoint(input),p=op.parameters;for(const k of ['ratio','vin','io','fs_mhz','vgs','width_mm','die_mm2','lk_nh','lm_uh'])if(!Number.isFinite(p[k])||p[k]<=0)throw Error(k+' must be positive');for(const k of ['cap_uf','max_caps','max_windings','rc_mohm','rl_mohm','max_drop_percent','max_phase_ripple_percent'])if(!Number.isFinite(p[k])||p[k]<0)throw Error(k+' must be nonnegative');if(![2,4,6,8,16].includes(p.ratio))throw Error('Choose a supported ratio');if(!['width','area'].includes(p.budget_mode)||!['loss','capacitors','magnetics'].includes(p.objective))throw Error('Choose a budget mode and objective');if(!Number.isInteger(p.max_caps)||!Number.isInteger(p.max_windings))throw Error('Component limits must be integers');if(!Number.isFinite(p.utilization)||p.utilization<=0||p.utilization>1)throw Error('Usable die fraction must be in (0,1]');
|
| 147 |
const calibrated=p.budget_mode==='width'||Number.isFinite(p.ron_area_mohm_mm2)&&p.ron_area_mohm_mm2>0,Wmax=availableWidth(p,technology),fs=p.fs_mhz*1e6,m=1/p.ratio,vo=p.vin*m;
|
| 148 |
if(calibrated&&(!Number.isFinite(Wmax)||Wmax<=0))throw Error('Invalid area/width budget');
|
|
@@ -154,5 +213,5 @@ const {best,meetsDroop}=optimizeWidth(at,Wmax,p.max_drop_percent);
|
|
| 154 |
if(!meetsDroop)r.reasons.push(droopReason(p.max_drop_percent));
|
| 155 |
Object.assign(r,best,{used_die_mm2:p.budget_mode==='area'?best.width_mm*p.ron_area_mohm_mm2*1e-3/technology.reference.ron:null,available_width_mm:Wmax,reference_note:'Nominal coupled-inductor cancellation point at '+p.ratio+':1; loss allocation remains fixed at '+(['buck2','sp2'].includes(c.id)?2:4)+':1'});r.status=r.reasons.length?'excluded':'eligible';return r});
|
| 156 |
const eligible=rows.filter(r=>r.status==='eligible');eligible.sort((a,b)=>{if(p.objective==='capacitors'&&a.capacitors!==b.capacitors)return a.capacitors-b.capacitors;if(p.objective==='magnetics'&&a.windings!==b.windings)return a.windings-b.windings;return a.loss-b.loss});eligible.forEach((r,i)=>r.rank=i+1);return {parameters:p,available_width_mm:Wmax,rs_budget:calibrated?technology.reference.ron*12/Wmax:null,calibrated,requested_vout:op.requested_vout,output_current:op.output_current,output_power:op.output_power,load_resistance:op.load_resistance,requested_ratio:op.requested_ratio,voltage_ratio_match:op.voltage_ratio_match,nominal_vout:vo,eligible,rows,winner:eligible[0]??null,native_models:rows.filter(r=>r.reference_match).length,scope:'Coupled-inductor cancellation-point shortlist only. First-order phase ripple is screened with Ldm=Lk+2Lm, balanced complementary 50% effective excitation or the ideal 3L 2:1 midpoint-hold state. Finite capacitor ripple, mismatch, losses and timing errors can break ideal cancellation. Loss ranking remains flat-current FSL/SSL plus gate drive; Coss, ripple-loss corrections, core loss, saturation, layout, startup and control/headroom are not qualified. Fixed per-device allocations; total width optimized. One gate-charge event per device per period assumed. Budgets cover power FETs, flying/clamp capacitors and power windings; drivers/Cin/Cout are outside these budgets.'};}
|
| 157 |
-
const api={recommend,recommendSwitchedCap,specs,defaults,excitation,familyIds,referenceFamilyIds,availableWidth,ripplePoint,operatingPoint};root.OpenPELSRecommendation=api;if(typeof module!=='undefined')module.exports=api;
|
| 158 |
})(typeof window!=='undefined'?window:globalThis);
|
|
|
|
| 1 |
/* Constraint screening and width optimization within the verified analytical library. */
|
| 2 |
(function(root){'use strict';
|
| 3 |
+
const specs=Object.freeze({si2:{ratio:2,caps:1,windings:2,magnetics:'inverse-coupled'},buck2:{ratio:2,caps:0,windings:2,magnetics:'inverse-coupled'},rsc2:{ratio:2,caps:2,windings:2,magnetics:'uncoupled resonant'},sp2:{ratio:2,caps:2,windings:0,magnetics:'none'},xfly2p:{ratio:4,caps:2,windings:2,magnetics:'coupled'},xfly4p:{ratio:4,caps:4,windings:2,magnetics:'coupled'},'3lbuck':{ratio:4,ratios:[2,4],caps:2,windings:2,magnetics:'coupled'},'2sbuck':{ratio:4,caps:4,windings:2,magnetics:'coupled'},buck:{ratio:2,caps:0,windings:2,magnetics:'coupled'}});
|
| 4 |
const excitation=Object.freeze({buck2:{level:1,pulses:1},buck:{level:1,pulses:1},xfly2p:{level:.5,pulses:1},xfly4p:{level:.5,pulses:2},'3lbuck':{level:.5,pulses:2},'2sbuck':{level:.5,pulses:1}});
|
| 5 |
function familyIds(ratio){return Object.keys(excitation).filter(id=>(specs[id].ratios??[specs[id].ratio]).includes(ratio))}
|
| 6 |
// Dedicated reference eligibility; the winding-based optimizer keeps its own domain.
|
| 7 |
+
function referenceFamilyIds(ratio){const ids=familyIds(ratio);return ratio===2?[...ids,'sp2','rsc2','si2']:ids}
|
| 8 |
function ripplePoint(id,p){const ldm=p.lk_nh*1e-9+2*p.lm_uh*1e-6;if(id==='3lbuck'&&p.ratio===2)return {ripple_model:'ideal_midpoint_hold',phase_ripple_pp:0,phase_ripple_percent:0,effective_duty:1,gate_duty:.5,effective_frequency:0,ldm,residual_ripple_unmodeled:true,condition:'Ideal balanced flying capacitor holds winding input at Vin/2 = Vout; ideal winding voltage and ripple are zero. Real capacitor-voltage ripple, mismatch and timing effects are not quantified; coupling is not the cause of this ideal cancellation.'};const e=excitation[id],pp=p.vin*e.level/(4*p.fs_mhz*1e6*e.pulses*ldm);return {ripple_model:'complementary_excitation',phase_ripple_pp:pp,phase_ripple_percent:100*pp/(p.io/2),effective_duty:.5,effective_frequency:p.fs_mhz*1e6*e.pulses,ldm,condition:'Balanced 0/Vstep winding inputs, complementary 50% effective duty, matched inverse coupling; first-order phase-current ripple, not measured zero ripple.'}}
|
| 9 |
|
| 10 |
const defaults={ratio:4,vin:3.3,vout:null,voltage_mode:'input_output',load_mode:'current',io:2,pout_w:1.65,fs_mhz:10,vgs:3.3,budget_mode:'area',width_mm:360,die_mm2:1,utilization:.5,ron_area_mohm_mm2:1,cap_uf:4,max_caps:4,max_windings:2,rc_mohm:20,rl_mohm:38,max_drop_percent:10,lk_nh:50,lm_uh:1,max_phase_ripple_percent:5,objective:'loss'};
|
|
|
|
| 143 |
rows:[row], eligible, winner:eligible[0]??null, native_models:1, deviceReport,
|
| 144 |
scope:resonant?'Fixed 2:1 resonant SC. Exact matched periodic RLC; width optimized within droop and damping limits.':'Fixed 2:1 SP-SC reference. Exact periodic RC; matched flying capacitors, ideal timing and equal per-switch allocation. Total width is optimized subject to the budget and droop ceiling. The capacitance goes to two flying capacitors. Coss requires effective energy data. Driver quiescent power, Cin/Cout ESR, dead time, overlap, reverse recovery, and layout parasitics are outside the model.'};
|
| 145 |
}
|
| 146 |
+
function recommendSwitchedInductor(input, settings, base, meta, technology) {
|
| 147 |
+
const op=operatingPoint(input), p=op.parameters;
|
| 148 |
+
if (p.ratio!==2 || !['loss','capacitors','magnetics'].includes(p.objective))
|
| 149 |
+
throw Error('Choose a priority for the 2:1 switched inductor reference.');
|
| 150 |
+
const width=availableWidth(p,technology);
|
| 151 |
+
if (!['width','area'].includes(p.budget_mode) || !Number.isFinite(width) || width<=0 ||
|
| 152 |
+
(p.budget_mode==='area' && !(p.utilization>0 && p.utilization<=1)))
|
| 153 |
+
throw Error('Enter a positive silicon budget and a usable transistor fraction in (0, 1].');
|
| 154 |
+
if (!(p.si_duty>=.25 && p.si_duty<=.75 && p.si_coupling>=0 && p.si_coupling<=.85 &&
|
| 155 |
+
p.si_l_nh>0 && p.cap_uf>0 && p.fs_mhz>0 && p.rc_mohm>=0 && p.rl_mohm>=0 &&
|
| 156 |
+
p.max_drop_percent>=0 && p.max_phase_ripple_percent>=0) ||
|
| 157 |
+
!['max_caps','max_windings'].every(k=>Number.isInteger(p[k])&&p[k]>=0))
|
| 158 |
+
throw Error('Check duty, coupling, positive component values and nonnegative design limits.');
|
| 159 |
+
const deviceInputs={...settings,vin:p.vin,io:p.io,fs_mhz:p.fs_mhz,cap_uf:p.cap_uf,
|
| 160 |
+
rc_mohm:p.rc_mohm,rl_mohm:p.rl_mohm,si_duty:p.si_duty,si_l_nh:p.si_l_nh,si_coupling:p.si_coupling};
|
| 161 |
+
const at=width_mm=>{
|
| 162 |
+
const report=technology.example([base],{...deviceInputs,width_mm}), r=report.rows[0];
|
| 163 |
+
return {width_mm,loss:r.partial_loss,drop_percent:100*p.io*r.si.droop_resistance/r.vx,report};
|
| 164 |
+
};
|
| 165 |
+
const {best,meetsDroop}=optimizeWidth(at,width,p.max_drop_percent);
|
| 166 |
+
const deviceReport=best.report, r=deviceReport.rows[0], si=r.si;
|
| 167 |
+
const requested=r.vx, rsBudget=technology.reference.ron*12/width;
|
| 168 |
+
const phasePercent=200*si.phase_ripple_per_amp;
|
| 169 |
+
const reasons=[];
|
| 170 |
+
if (p.max_caps<1) reasons.push('Requires one output capacitor.');
|
| 171 |
+
if (p.max_windings<2) reasons.push('Requires two inverse-coupled windings.');
|
| 172 |
+
if (si.min_phase_per_amp<=0) reasons.push('The predicted winding current crosses zero. Positive-current CCM is required.');
|
| 173 |
+
if (phasePercent>p.max_phase_ripple_percent) reasons.push('Predicted phase ripple exceeds the entered limit.');
|
| 174 |
+
if (!meetsDroop) reasons.push(droopReason(p.max_drop_percent));
|
| 175 |
+
r.delivered_w=r.vo>0?r.vo*p.io:null;
|
| 176 |
+
r.efficiency=r.delivered_w===null||si.min_phase_per_amp<=0?null:r.delivered_w/(r.delivered_w+r.partial_loss);
|
| 177 |
+
r.efficiency_includes_coss=r.poss!==null;
|
| 178 |
+
if (r.vo<=0) reasons.push('The first-order model predicts nonpositive delivered voltage.');
|
| 179 |
+
const row={id:meta.id,name:meta.name,short:meta.short,asset:meta.asset,native_ratio:2,reference_match:true,
|
| 180 |
+
...specs.si2,status:reasons.length?'excluded':'eligible',reasons,rank:reasons.length?null:1,
|
| 181 |
+
width_mm:best.width_mm,available_width_mm:width,rs:deviceReport.rs,req:r.req,rout:r.req,req_pu:r.req/rsBudget,
|
| 182 |
+
req_used_width_pu:r.req/deviceReport.rs,rout_over_rload:r.req/(requested/p.io),drop_percent:best.drop_percent,droop_resistance:si.droop_resistance,
|
| 183 |
+
loss:best.loss,parts:{fet:r.fet,cap:r.cap,ind:r.ind,fsl:r.req,ssl:0,hc:0},cf:r.cf,si,
|
| 184 |
+
conduction_power:r.conduction_power,gate_power:deviceReport.gate_power,coss_power:r.poss,
|
| 185 |
+
efficiency:r.efficiency,delivered_w:r.delivered_w,device:r.device,estimated_open_loop_vout:r.vo,
|
| 186 |
+
phase_ripple_pp:p.io*si.phase_ripple_per_amp,phase_ripple_percent:phasePercent,
|
| 187 |
+
operating_waveforms:{
|
| 188 |
+
winding_average_a:p.io/2,winding_rms_a:p.io*Math.sqrt(si.winding_weight),
|
| 189 |
+
winding_valley_a:p.io*si.min_phase_per_amp,
|
| 190 |
+
channel_rms_a:[si.high_weight,si.low_weight,si.high_weight,si.low_weight].map(w=>p.io*Math.sqrt(w)),
|
| 191 |
+
channel_average_a:[p.si_duty,p.si_duty-1,p.si_duty,p.si_duty-1].map(d=>d*p.io/2),
|
| 192 |
+
output_cap_rms_a:p.io*Math.sqrt(si.capacitor_weight),
|
| 193 |
+
ideal_winding_voltage_v:[(1-p.si_duty)*p.vin,-p.si_duty*p.vin],
|
| 194 |
+
ideal_switch_blocking_v:p.vin,
|
| 195 |
+
},
|
| 196 |
+
capacitor_ripple_vpp:p.io*si.output_ripple_per_amp/(16*p.fs_mhz*1e6*r.cf),
|
| 197 |
+
used_die_mm2:p.budget_mode==='area'?best.width_mm*p.ron_area_mohm_mm2*1e-3/technology.reference.ron:null};
|
| 198 |
+
const eligible=reasons.length?[]:[row];
|
| 199 |
+
return {parameters:{...p,...settings},available_width_mm:width,rs_budget:rsBudget,calibrated:true,
|
| 200 |
+
input_voltage:p.vin,requested_vout:requested,output_current:p.io,output_power:requested*p.io,
|
| 201 |
+
load_resistance:requested/p.io,requested_ratio:1/p.si_duty,voltage_ratio_match:true,
|
| 202 |
+
nominal_vout:requested,rows:[row],eligible,winner:eligible[0]??null,native_models:1,deviceReport,
|
| 203 |
+
scope:'Two-phase inverse-coupled buck. Duty-regulated positive-current CCM with piecewise-linear winding currents and first-order loss.'};
|
| 204 |
+
}
|
| 205 |
function recommend(input,data,engine,technology){const op=operatingPoint(input),p=op.parameters;for(const k of ['ratio','vin','io','fs_mhz','vgs','width_mm','die_mm2','lk_nh','lm_uh'])if(!Number.isFinite(p[k])||p[k]<=0)throw Error(k+' must be positive');for(const k of ['cap_uf','max_caps','max_windings','rc_mohm','rl_mohm','max_drop_percent','max_phase_ripple_percent'])if(!Number.isFinite(p[k])||p[k]<0)throw Error(k+' must be nonnegative');if(![2,4,6,8,16].includes(p.ratio))throw Error('Choose a supported ratio');if(!['width','area'].includes(p.budget_mode)||!['loss','capacitors','magnetics'].includes(p.objective))throw Error('Choose a budget mode and objective');if(!Number.isInteger(p.max_caps)||!Number.isInteger(p.max_windings))throw Error('Component limits must be integers');if(!Number.isFinite(p.utilization)||p.utilization<=0||p.utilization>1)throw Error('Usable die fraction must be in (0,1]');
|
| 206 |
const calibrated=p.budget_mode==='width'||Number.isFinite(p.ron_area_mohm_mm2)&&p.ron_area_mohm_mm2>0,Wmax=availableWidth(p,technology),fs=p.fs_mhz*1e6,m=1/p.ratio,vo=p.vin*m;
|
| 207 |
if(calibrated&&(!Number.isFinite(Wmax)||Wmax<=0))throw Error('Invalid area/width budget');
|
|
|
|
| 213 |
if(!meetsDroop)r.reasons.push(droopReason(p.max_drop_percent));
|
| 214 |
Object.assign(r,best,{used_die_mm2:p.budget_mode==='area'?best.width_mm*p.ron_area_mohm_mm2*1e-3/technology.reference.ron:null,available_width_mm:Wmax,reference_note:'Nominal coupled-inductor cancellation point at '+p.ratio+':1; loss allocation remains fixed at '+(['buck2','sp2'].includes(c.id)?2:4)+':1'});r.status=r.reasons.length?'excluded':'eligible';return r});
|
| 215 |
const eligible=rows.filter(r=>r.status==='eligible');eligible.sort((a,b)=>{if(p.objective==='capacitors'&&a.capacitors!==b.capacitors)return a.capacitors-b.capacitors;if(p.objective==='magnetics'&&a.windings!==b.windings)return a.windings-b.windings;return a.loss-b.loss});eligible.forEach((r,i)=>r.rank=i+1);return {parameters:p,available_width_mm:Wmax,rs_budget:calibrated?technology.reference.ron*12/Wmax:null,calibrated,requested_vout:op.requested_vout,output_current:op.output_current,output_power:op.output_power,load_resistance:op.load_resistance,requested_ratio:op.requested_ratio,voltage_ratio_match:op.voltage_ratio_match,nominal_vout:vo,eligible,rows,winner:eligible[0]??null,native_models:rows.filter(r=>r.reference_match).length,scope:'Coupled-inductor cancellation-point shortlist only. First-order phase ripple is screened with Ldm=Lk+2Lm, balanced complementary 50% effective excitation or the ideal 3L 2:1 midpoint-hold state. Finite capacitor ripple, mismatch, losses and timing errors can break ideal cancellation. Loss ranking remains flat-current FSL/SSL plus gate drive; Coss, ripple-loss corrections, core loss, saturation, layout, startup and control/headroom are not qualified. Fixed per-device allocations; total width optimized. One gate-charge event per device per period assumed. Budgets cover power FETs, flying/clamp capacitors and power windings; drivers/Cin/Cout are outside these budgets.'};}
|
| 216 |
+
const api={recommend,recommendSwitchedCap,recommendSwitchedInductor,specs,defaults,excitation,familyIds,referenceFamilyIds,availableWidth,ripplePoint,operatingPoint};root.OpenPELSRecommendation=api;if(typeof module!=='undefined')module.exports=api;
|
| 217 |
})(typeof window!=='undefined'?window:globalThis);
|
static/compare/scoreboard.js
CHANGED
|
@@ -4,11 +4,11 @@ const mechanisms=[{id:'fet',name:'MOSFET conduction',short:'Switch loss',symbol:
|
|
| 4 |
const coss={id:'coss',name:'MOSFET Coss',short:'Output-capacitance loss',symbol:'O',color:'#648568'};
|
| 5 |
function build(report){
|
| 6 |
const switchedCap=report.eligible.length===1&&report.eligible[0].id==='sp2';
|
| 7 |
-
const
|
| 8 |
-
const mechanismsForReport=
|
| 9 |
-
const io=report.output_current,rows=report.eligible.map(r=>{const powers={fet:io*io*r.parts.fet,cap:io*io*r.parts.cap,ind:io*io*r.parts.ind,charging:io*io*Math.max(0,r.req-r.parts.fsl),gate:r.gate_power};if(
|
| 10 |
const ranges=Object.fromEntries(mechanismsForReport.map(m=>{const v=rows.map(r=>r.powers[m.id]);return [m.id,{min:Math.min(...v),max:Math.max(...v)}]}));
|
| 11 |
for(const r of rows){for(const m of mechanismsForReport){const {min,max}=ranges[m.id];r.ratings[m.id]=rows.length<2?null:Math.abs(max-min)<=Math.max(1e-12,max*1e-10)?99:Math.round(99*(max-r.powers[m.id])/(max-min))}const gains=mechanismsForReport.map(m=>{const others=rows.filter(a=>a!==r);return {id:m.id,label:m.short,delta:others.length?others.reduce((s,a)=>s+a.powers[m.id],0)/others.length-r.powers[m.id]:0}});const good=gains.filter(a=>a.delta>1e-9).sort((a,b)=>b.delta-a.delta)[0],bad=gains.filter(a=>a.delta< -1e-9).sort((a,b)=>a.delta-b.delta)[0];r.pro_delta=good?good.delta:null;r.con_delta=bad?-bad.delta:null;r.pro=good?'Lower '+good.label.toLowerCase():rows.length<2?'Only one qualified candidate':'No lower-loss category';r.con=bad?'Higher '+bad.label.toLowerCase():rows.length<2?'No relative comparison available':'No higher-loss category';}
|
| 12 |
-
return {mechanisms:mechanismsForReport,rows,scale:'Ratings 0–99 within this displayed set, per mechanism: 99 = lowest modeled loss; 0 = highest. Ties = 99. One candidate = no relative score. These are not efficiency percentages.',unknowns:
|
| 13 |
const api={build,mechanisms};root.OpenPELSScores=api;if(typeof module!=='undefined')module.exports=api;
|
| 14 |
})(typeof window!=='undefined'?window:globalThis);
|
|
|
|
| 4 |
const coss={id:'coss',name:'MOSFET Coss',short:'Output-capacitance loss',symbol:'O',color:'#648568'};
|
| 5 |
function build(report){
|
| 6 |
const switchedCap=report.eligible.length===1&&report.eligible[0].id==='sp2';
|
| 7 |
+
const rms=report.eligible.length===1&&['rsc2','si2'].includes(report.eligible[0].id);
|
| 8 |
+
const mechanismsForReport=rms?[...mechanisms.filter(m=>m.id!=='charging'),coss]:switchedCap?[...mechanisms,coss]:mechanisms;
|
| 9 |
+
const io=report.output_current,rows=report.eligible.map(r=>{const powers={fet:io*io*r.parts.fet,cap:io*io*r.parts.cap,ind:io*io*r.parts.ind,charging:io*io*Math.max(0,r.req-r.parts.fsl),gate:r.gate_power};if(['rsc2','si2'].includes(r.id)){delete powers.charging;powers.coss=r.coss_power;}if(r.id==='sp2')Object.assign(powers,{ind:null,charging:io*io*r.parts.hc,coss:r.coss_power});return {id:r.id,total:r.loss,powers,ratings:{},unknown:['rsc2','si2'].includes(r.id)?{...(r.coss_power===null?{coss:null}:{}),core:null}:r.id==='sp2'?(r.coss_power===null?{coss:null}:{}):{coss:null,core_ripple:null}}});
|
| 10 |
const ranges=Object.fromEntries(mechanismsForReport.map(m=>{const v=rows.map(r=>r.powers[m.id]);return [m.id,{min:Math.min(...v),max:Math.max(...v)}]}));
|
| 11 |
for(const r of rows){for(const m of mechanismsForReport){const {min,max}=ranges[m.id];r.ratings[m.id]=rows.length<2?null:Math.abs(max-min)<=Math.max(1e-12,max*1e-10)?99:Math.round(99*(max-r.powers[m.id])/(max-min))}const gains=mechanismsForReport.map(m=>{const others=rows.filter(a=>a!==r);return {id:m.id,label:m.short,delta:others.length?others.reduce((s,a)=>s+a.powers[m.id],0)/others.length-r.powers[m.id]:0}});const good=gains.filter(a=>a.delta>1e-9).sort((a,b)=>b.delta-a.delta)[0],bad=gains.filter(a=>a.delta< -1e-9).sort((a,b)=>a.delta-b.delta)[0];r.pro_delta=good?good.delta:null;r.con_delta=bad?-bad.delta:null;r.pro=good?'Lower '+good.label.toLowerCase():rows.length<2?'Only one qualified candidate':'No lower-loss category';r.con=bad?'Higher '+bad.label.toLowerCase():rows.length<2?'No relative comparison available':'No higher-loss category';}
|
| 12 |
+
return {mechanisms:mechanismsForReport,rows,scale:'Ratings 0–99 within this displayed set, per mechanism: 99 = lowest modeled loss; 0 = highest. Ties = 99. One candidate = no relative score. These are not efficiency percentages.',unknowns:rms?'Core and switching-overlap loss are unquantified; Coss requires an effective energy input.':switchedCap?'Coss is included only with effective energy data; magnetic losses are inapplicable.':'Coss, core and ripple-loss corrections are not quantified or included in the modeled total.',charging_definition:'Charging increment = Iout² (Req − RFSL), not the raw SSL asymptote. It is nonoverlapping with the FSL terms.'};}
|
| 13 |
const api={build,mechanisms};root.OpenPELSScores=api;if(typeof module!=='undefined')module.exports=api;
|
| 14 |
})(typeof window!=='undefined'?window:globalThis);
|
static/compare/style.css
CHANGED
|
@@ -28,7 +28,7 @@ main{max-width:1560px;padding-top:32px}.intro{margin-bottom:26px}.intro p{font-s
|
|
| 28 |
|
| 29 |
.tradeoff-row .score-pro small,.tradeoff-row .score-con small{display:block;font-size:8px;color:#8c9984;margin:3px 0 0 11px}
|
| 30 |
|
| 31 |
-
.sp2-focused:not(.rsc2-focused) #design-fields :is([data-design-field="max_windings"],[data-design-field="rl_mohm"],[data-design-field="lk_nh"],[data-design-field="lm_uh"],[data-design-field="max_phase_ripple_percent"]){display:none}
|
| 32 |
.sp2-focused #tech-settings label:has(:is(#tech-fs_mhz,#tech-width_mm,#tech-cap_uf,#tech-rc_mohm,#tech-rl_mohm)){display:none}
|
| 33 |
.focused-topology.sp2-focused main #topology-picker{display:flex}
|
| 34 |
.selection-method .sp2-method,.selection-method.fixed-ratio-method > :not(summary):not(.sp2-method){display:none}
|
|
@@ -37,5 +37,8 @@ main{max-width:1560px;padding-top:32px}.intro{margin-bottom:26px}.intro p{font-s
|
|
| 37 |
body:not(.rsc2-focused) #design-fields [data-design-field="tank_nh"],
|
| 38 |
.rsc2-focused #design-fields :is([data-design-field="lk_nh"],[data-design-field="lm_uh"],[data-design-field="max_phase_ripple_percent"]){display:none}
|
| 39 |
|
|
|
|
|
|
|
|
|
|
| 40 |
/* Embedded OpenPELS comparison workspace. */
|
| 41 |
header{display:none}main{max-width:1450px;padding-top:26px}h1{font-size:25px}.focused-topology #ratios,.focused-topology #topology-picker{display:none}
|
|
|
|
| 28 |
|
| 29 |
.tradeoff-row .score-pro small,.tradeoff-row .score-con small{display:block;font-size:8px;color:#8c9984;margin:3px 0 0 11px}
|
| 30 |
|
| 31 |
+
.sp2-focused:not(.rsc2-focused):not(.si2-focused) #design-fields :is([data-design-field="max_windings"],[data-design-field="rl_mohm"],[data-design-field="lk_nh"],[data-design-field="lm_uh"],[data-design-field="max_phase_ripple_percent"]){display:none}
|
| 32 |
.sp2-focused #tech-settings label:has(:is(#tech-fs_mhz,#tech-width_mm,#tech-cap_uf,#tech-rc_mohm,#tech-rl_mohm)){display:none}
|
| 33 |
.focused-topology.sp2-focused main #topology-picker{display:flex}
|
| 34 |
.selection-method .sp2-method,.selection-method.fixed-ratio-method > :not(summary):not(.sp2-method){display:none}
|
|
|
|
| 37 |
body:not(.rsc2-focused) #design-fields [data-design-field="tank_nh"],
|
| 38 |
.rsc2-focused #design-fields :is([data-design-field="lk_nh"],[data-design-field="lm_uh"],[data-design-field="max_phase_ripple_percent"]){display:none}
|
| 39 |
|
| 40 |
+
body:not(.si2-focused) #design-fields :is([data-design-field="si_duty"],[data-design-field="si_l_nh"],[data-design-field="si_coupling"]),
|
| 41 |
+
.si2-focused #design-fields :is([data-design-field="lk_nh"],[data-design-field="lm_uh"]){display:none}
|
| 42 |
+
|
| 43 |
/* Embedded OpenPELS comparison workspace. */
|
| 44 |
header{display:none}main{max-width:1450px;padding-top:26px}h1{font-size:25px}.focused-topology #ratios,.focused-topology #topology-picker{display:none}
|
static/compare/switched-inductor.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* First-order CCM loss model for the two-phase inverse-coupled buck. */
|
| 2 |
+
(function(root) {
|
| 3 |
+
'use strict';
|
| 4 |
+
|
| 5 |
+
function currents(duty, coupling, rippleScale) {
|
| 6 |
+
const edges = [...new Set([0, .5, duty, (duty+.5)%1, 1])].sort((a,b) => a-b);
|
| 7 |
+
const segments = [];
|
| 8 |
+
let current = 0;
|
| 9 |
+
let mean = 0;
|
| 10 |
+
for (let i=1; i<edges.length; i++) {
|
| 11 |
+
const start = edges[i-1], stop = edges[i], time = (start+stop)/2;
|
| 12 |
+
const a = Number(time < duty), b = Number((time+.5)%1 < duty);
|
| 13 |
+
const weight = stop-start;
|
| 14 |
+
const end = current+weight*rippleScale*((a+b-2*duty)/(1-coupling)+(a-b)/(1+coupling))/2;
|
| 15 |
+
segments.push({a, weight, start:current, end});
|
| 16 |
+
mean += weight*(current+end)/2;
|
| 17 |
+
current = end;
|
| 18 |
+
}
|
| 19 |
+
// Integrate the squared affine current exactly over each constant switch state.
|
| 20 |
+
const squares = [0,0];
|
| 21 |
+
const endpoints = segments.map(s => s.start+.5-mean);
|
| 22 |
+
for (const s of segments) {
|
| 23 |
+
const left = s.start+.5-mean, right = s.end+.5-mean;
|
| 24 |
+
squares[s.a] += s.weight*(left*left+left*right+right*right)/3;
|
| 25 |
+
}
|
| 26 |
+
const capRipple = rippleScale*Math.min(duty,1-duty)*Math.abs(1-2*duty)/(1-coupling);
|
| 27 |
+
return {duty, high_weight:squares[1], low_weight:squares[0],
|
| 28 |
+
winding_weight:squares[0]+squares[1], capacitor_weight:capRipple**2/12,
|
| 29 |
+
output_ripple_per_amp:capRipple,
|
| 30 |
+
phase_ripple_per_amp:Math.max(...endpoints)-Math.min(...endpoints),
|
| 31 |
+
min_phase_per_amp:Math.min(...endpoints), max_phase_per_amp:Math.max(...endpoints)};
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
function evaluate(duty, {rs, rc, rl, coupling=.6, rippleScale=.75}) {
|
| 35 |
+
const c = currents(duty,coupling,rippleScale);
|
| 36 |
+
const high = Math.sqrt(c.high_weight), low = Math.sqrt(c.low_weight);
|
| 37 |
+
const highFraction = high/(2*(high+low)), lowFraction = low/(2*(high+low));
|
| 38 |
+
const coefficients = [(2*(high+low))**2/12,c.capacitor_weight,2*c.winding_weight,0];
|
| 39 |
+
const [fet,cap,ind] = coefficients.map((k,i)=>k*[rs,rc,rl][i]);
|
| 40 |
+
// Inductor volt-second balance uses mean channel current in each interval.
|
| 41 |
+
// The RMS-based power resistance is a distinct result when there is ripple.
|
| 42 |
+
const droop_resistance = rl/2 + rs/24*(duty/highFraction+(1-duty)/lowFraction);
|
| 43 |
+
return {...c, fet, cap, ind, total:fet+cap+ind, fsl:fet+cap+ind,droop_resistance,
|
| 44 |
+
ssl:0, ssl_series:0, coefficients, D:2*duty, gate_duty:duty,
|
| 45 |
+
fractions:[highFraction,lowFraction,highFraction,lowFraction]};
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
const model = {currents,evaluate};
|
| 49 |
+
root.OpenPELSSwitchedInductor = model;
|
| 50 |
+
if (typeof module !== 'undefined') module.exports = model;
|
| 51 |
+
})(typeof window !== 'undefined' ? window : globalThis);
|
static/compare/technology.js
CHANGED
|
@@ -4,7 +4,10 @@ const reference=Object.freeze({ron:.602,qg:2.51e-12,qoss:1.12e-12,width_mm:1,len
|
|
| 4 |
const fom=Object.freeze({gate:reference.ron*reference.qg,oss:reference.ron*reference.qoss});
|
| 5 |
function finiteRC(a,c,f,d,r){if(![a,c,f,d,r].every(Number.isFinite)||a<0||c<=0||f<=0||d<=0||d>1||r<0)throw Error('Invalid RC charge-event parameters');const ssl=a*a/(2*c*f),fsl=a*a*r/d;return {ssl,fsl,total:r===0?ssl:ssl/Math.tanh(d/(2*f*r*c))}}
|
| 6 |
function example(rows,p={}){const defaults={vin:3.3,io:2,fs_mhz:10,vgs:3.3,width_mm:360,cap_uf:4,rc_mohm:20,rl_mohm:38,events:1};p={...defaults,...p};for(const k of Object.keys(defaults)){if(!Number.isFinite(p[k])||p[k]<0||(!['rc_mohm','rl_mohm'].includes(k)&&p[k]===0))throw Error('Use finite positive technology-example settings')};if(p.eoss_pj!=null&&(!Number.isFinite(p.eoss_pj)||p.eoss_pj<0))throw Error('Eoss must be nonnegative');const fs=p.fs_mhz*1e6,rs=reference.ron*12/p.width_mm,parallel=rs/12,pg=p.vgs*fs*fom.gate*p.events/parallel;
|
| 7 |
-
return {parameters:p,fom,rs,parallel,gate_power:pg,rows:rows.map(r=>{if(!r.valid)return {id:r.id,valid:false};const tank=r.id==='rsc2'?(root.OpenPELSResonant??require('./resonant.js')).evaluate({rs,rc:p.rc_mohm/1000,rl:p.rl_mohm/1000,cf:p.cap_uf*5e-7,fs,lt:(p.tank_nh??5.5)*1e-9}):null;const
|
|
|
|
|
|
|
|
|
|
| 8 |
}
|
| 9 |
const api={reference,fom,finiteRC,example};root.OpenPELSTechnology=api;if(typeof module!=='undefined')module.exports=api;
|
| 10 |
})(typeof window!=='undefined'?window:globalThis);
|
|
|
|
| 4 |
const fom=Object.freeze({gate:reference.ron*reference.qg,oss:reference.ron*reference.qoss});
|
| 5 |
function finiteRC(a,c,f,d,r){if(![a,c,f,d,r].every(Number.isFinite)||a<0||c<=0||f<=0||d<=0||d>1||r<0)throw Error('Invalid RC charge-event parameters');const ssl=a*a/(2*c*f),fsl=a*a*r/d;return {ssl,fsl,total:r===0?ssl:ssl/Math.tanh(d/(2*f*r*c))}}
|
| 6 |
function example(rows,p={}){const defaults={vin:3.3,io:2,fs_mhz:10,vgs:3.3,width_mm:360,cap_uf:4,rc_mohm:20,rl_mohm:38,events:1};p={...defaults,...p};for(const k of Object.keys(defaults)){if(!Number.isFinite(p[k])||p[k]<0||(!['rc_mohm','rl_mohm'].includes(k)&&p[k]===0))throw Error('Use finite positive technology-example settings')};if(p.eoss_pj!=null&&(!Number.isFinite(p.eoss_pj)||p.eoss_pj<0))throw Error('Eoss must be nonnegative');const fs=p.fs_mhz*1e6,rs=reference.ron*12/p.width_mm,parallel=rs/12,pg=p.vgs*fs*fom.gate*p.events/parallel;
|
| 7 |
+
return {parameters:p,fom,rs,parallel,gate_power:pg,rows:rows.map(r=>{if(!r.valid)return {id:r.id,valid:false};const tank=r.id==='rsc2'?(root.OpenPELSResonant??require('./resonant.js')).evaluate({rs,rc:p.rc_mohm/1000,rl:p.rl_mohm/1000,cf:p.cap_uf*5e-7,fs,lt:(p.tank_nh??5.5)*1e-9}):null;const si = r.id==='si2' ? (root.OpenPELSSwitchedInductor??require('./switched-inductor.js'))
|
| 8 |
+
.evaluate(p.si_duty??r.gate_duty,{rs,rc:p.rc_mohm/1000,rl:p.rl_mohm/1000,
|
| 9 |
+
coupling:p.si_coupling??.6,rippleScale:p.vin/(p.io*fs*(p.si_l_nh??1000)*1e-9)}) : null;
|
| 10 |
+
const n=si?1:['buck','buck2'].includes(r.id)?0:['xfly4p','2sbuck'].includes(r.id)?4:2,cf=n?p.cap_uf*1e-6/n:null,[a,b,l,q]=r.coefficients,fet=si?.fet??tank?.fet??a*rs,cap=si?.cap??tank?.cap??b*p.rc_mohm/1000,ind=si?.ind??tank?.ind??l*p.rl_mohm/1000,ssl=q? q/(cf*fs):0,net=fet+cap,hc=ssl?(r.id==='sp2'?(net?ssl/Math.tanh(ssl/net)-net:ssl):ssl*ssl/(Math.hypot(net,ssl)+net)):0,req=fet+cap+ind+hc,vx=si?si.duty*p.vin:p.vin/(r.D?2/r.D:4),vo=vx-p.io*(si?.droop_resistance??req),gate_r=vx*vx/pg,poss=p.eoss_pj==null?null:p.eoss_pj*1e-12*p.width_mm*fs,oss_r=poss===null?null:poss===0?Infinity:vx*vx/poss,device=si?si.fractions.map((fraction,i)=>({id:'Q'+(i+1),width_mm:fraction*p.width_mm,ron:rs/(12*fraction)})):r.allocation.areas.map(area=>({width_mm:area*p.width_mm/12,ron:rs/area}));return {id:r.id,valid:true,...(tank?{tank}:{}),...(si?{si}:{}),capacitors:si?1:n,cf,fet,cap,ind,ssl,hc,req,vx,vo,gate_r,poss,oss_r,device,conduction_power:p.io*p.io*req,partial_loss:p.io*p.io*req+pg+(poss??0)}})};
|
| 11 |
}
|
| 12 |
const api={reference,fom,finiteRC,example};root.OpenPELSTechnology=api;if(typeof module!=='undefined')module.exports=api;
|
| 13 |
})(typeof window!=='undefined'?window:globalThis);
|
static/gallery.js
CHANGED
|
@@ -1,9 +1,18 @@
|
|
| 1 |
-
import "./compare/recommend.js?v=
|
| 2 |
|
| 3 |
export const FAMILY_RATIOS = [2, 4, 6, 8, 16];
|
| 4 |
const presets = {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
rsc2: {
|
| 6 |
name: "2:1 resonant SC",
|
|
|
|
| 7 |
image: "rsc2-candidate.svg",
|
| 8 |
starter: "rsc2",
|
| 9 |
simulator: "rsc2",
|
|
@@ -11,6 +20,7 @@ const presets = {
|
|
| 11 |
},
|
| 12 |
sp2: {
|
| 13 |
name: "2:1 series-parallel SC",
|
|
|
|
| 14 |
image: "sp2-candidate.svg",
|
| 15 |
starter: "sp2",
|
| 16 |
simulator: "sp2",
|
|
@@ -88,7 +98,7 @@ export function createGallery({ onSelect, report }) {
|
|
| 88 |
const capability = document.createElement("span");
|
| 89 |
capability.className = "tile-capability";
|
| 90 |
capability.textContent =
|
| 91 |
-
entry.simulator && ratio === (entry.
|
| 92 |
? entry.simulationRelation === "related"
|
| 93 |
? "Analysis · related simulation"
|
| 94 |
: "Analysis + simulation"
|
|
|
|
| 1 |
+
import "./compare/recommend.js?v=si2";
|
| 2 |
|
| 3 |
export const FAMILY_RATIOS = [2, 4, 6, 8, 16];
|
| 4 |
const presets = {
|
| 5 |
+
si2: {
|
| 6 |
+
name: "2:1 switched inductor",
|
| 7 |
+
image: "si2-candidate.svg",
|
| 8 |
+
starter: "si2",
|
| 9 |
+
simulator: "si2",
|
| 10 |
+
magneticsLabel: "2 inverse-coupled windings",
|
| 11 |
+
simulatorRatio: 2,
|
| 12 |
+
},
|
| 13 |
rsc2: {
|
| 14 |
name: "2:1 resonant SC",
|
| 15 |
+
simulatorRatio: 2,
|
| 16 |
image: "rsc2-candidate.svg",
|
| 17 |
starter: "rsc2",
|
| 18 |
simulator: "rsc2",
|
|
|
|
| 20 |
},
|
| 21 |
sp2: {
|
| 22 |
name: "2:1 series-parallel SC",
|
| 23 |
+
simulatorRatio: 2,
|
| 24 |
image: "sp2-candidate.svg",
|
| 25 |
starter: "sp2",
|
| 26 |
simulator: "sp2",
|
|
|
|
| 98 |
const capability = document.createElement("span");
|
| 99 |
capability.className = "tile-capability";
|
| 100 |
capability.textContent =
|
| 101 |
+
entry.simulator && ratio === (entry.simulatorRatio ?? 4)
|
| 102 |
? entry.simulationRelation === "related"
|
| 103 |
? "Analysis · related simulation"
|
| 104 |
: "Analysis + simulation"
|
static/index.html
CHANGED
|
@@ -209,7 +209,7 @@
|
|
| 209 |
<iframe
|
| 210 |
id="comparison"
|
| 211 |
title="Topology loss scoreboard"
|
| 212 |
-
data-src="./compare/index.html?v=
|
| 213 |
></iframe>
|
| 214 |
</section>
|
| 215 |
<section
|
|
@@ -240,6 +240,6 @@
|
|
| 240 |
workspace</span
|
| 241 |
>
|
| 242 |
</footer>
|
| 243 |
-
<script type="module" src="./pe.js?v=
|
| 244 |
</body>
|
| 245 |
</html>
|
|
|
|
| 209 |
<iframe
|
| 210 |
id="comparison"
|
| 211 |
title="Topology loss scoreboard"
|
| 212 |
+
data-src="./compare/index.html?v=si2"
|
| 213 |
></iframe>
|
| 214 |
</section>
|
| 215 |
<section
|
|
|
|
| 240 |
workspace</span
|
| 241 |
>
|
| 242 |
</footer>
|
| 243 |
+
<script type="module" src="./pe.js?v=si2"></script>
|
| 244 |
</body>
|
| 245 |
</html>
|
static/openpels-source.zip
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bf37fc50e700421717f6e0e6a8bee3f3f02e4ac8db876ef97ba7c4afc31d9787
|
| 3 |
+
size 24933818
|
static/pe.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
-
import { createSimulator } from "./simulator.js?v=
|
| 2 |
-
import { createGallery } from "./gallery.js?v=
|
| 3 |
import { createAnalysis } from "./analysis.js";
|
| 4 |
const $ = (s) => document.querySelector(s),
|
| 5 |
$$ = (s) => [...document.querySelectorAll(s)];
|
|
@@ -26,7 +26,7 @@ let selectedTopology = null,
|
|
| 26 |
currentView = "gallery";
|
| 27 |
const fixedPresets = new Map();
|
| 28 |
const fixedPoints = new Map([
|
| 29 |
-
["sp2",{vout:1.5,iout:1.1404833}], ["rsc2",{vout:1.5,iout:1}],
|
| 30 |
]);
|
| 31 |
const fixedInBounds = (id, axis, value) => {
|
| 32 |
const range = fixedPresets.get(id)?.parameters[axis];
|
|
@@ -57,7 +57,7 @@ const analysis = createAnalysis(notify, (point) => {
|
|
| 57 |
!Number.isFinite(point.iout)
|
| 58 |
)
|
| 59 |
return;
|
| 60 |
-
operatingPoint = { vout: point.vout, iout: point.iout };
|
| 61 |
renderSelection();
|
| 62 |
});
|
| 63 |
const simulator = createSimulator(notify, (topology, point) => {
|
|
@@ -71,7 +71,7 @@ const simulator = createSimulator(notify, (topology, point) => {
|
|
| 71 |
point.vout > 0 &&
|
| 72 |
point.iout > 0
|
| 73 |
)
|
| 74 |
-
operatingPoint = { vout: point.vout, iout: point.iout };
|
| 75 |
gallery.highlight(entry.id);
|
| 76 |
renderSelection();
|
| 77 |
}
|
|
@@ -79,8 +79,9 @@ const simulator = createSimulator(notify, (topology, point) => {
|
|
| 79 |
function simulationAvailable() {
|
| 80 |
const id = selectedTopology?.simulator;
|
| 81 |
if (fixedPoints.has(id))
|
| 82 |
-
return selectedRatio === 2 && fixedInBounds(id,"vin",operatingPoint.vout*2) &&
|
| 83 |
-
fixedInBounds(id,"load",operatingPoint.iout)
|
|
|
|
| 84 |
return (
|
| 85 |
!!selectedTopology?.simulator &&
|
| 86 |
selectedRatio === 4 &&
|
|
@@ -98,7 +99,7 @@ function renderSelection() {
|
|
| 98 |
if (!entry) return;
|
| 99 |
$("#selected-name").textContent = entry.name;
|
| 100 |
$("#selected-ratio").textContent =
|
| 101 |
-
`${selectedRatio}:1 reference · Vout ${operatingPoint.vout} V · Iout ${operatingPoint.iout} A`;
|
| 102 |
$("#selected-image").src = "./compare/assets/" + entry.image;
|
| 103 |
$("#selected-image").alt = entry.name + " circuit schematic";
|
| 104 |
$("#selected-simulate").disabled = !simulationAvailable();
|
|
@@ -116,7 +117,7 @@ function renderSelection() {
|
|
| 116 |
: fixedPoints.has(entry.simulator)
|
| 117 |
? simulationAvailable()
|
| 118 |
? "Continuous inputs and configurable sweeps. Each run checks result reliability."
|
| 119 |
-
: entry.simulator === "sp2" ? "Set nominal output to 0.9–2 V and output current to 0.05–4 A to open the SP-SC Simulator." : "Set nominal output to 0.9–2 V and output current to 0.15–2 A to open the resonant SC Simulator."
|
| 120 |
: selectedRatio !== 4
|
| 121 |
? "This preset currently supports simulation in the 4:1 family; the selected ratio has an analytical model."
|
| 122 |
: !simulationAvailable()
|
|
@@ -321,8 +322,8 @@ window.addEventListener("message", (event) => {
|
|
| 321 |
const p = JSON.parse(current);
|
| 322 |
$("#project-name").textContent = p.name ?? "Power converter";
|
| 323 |
const docs = p.documents ?? [];
|
| 324 |
-
// The
|
| 325 |
-
const counted = active?.id
|
| 326 |
const instances = counted.flatMap(d => d.instances ?? []);
|
| 327 |
const types = instances.map((i) => String(i.type ?? i.symbolId ?? ""));
|
| 328 |
$("#device-count").textContent = types.filter((t) =>
|
|
|
|
| 1 |
+
import { createSimulator } from "./simulator.js?v=si2";
|
| 2 |
+
import { createGallery } from "./gallery.js?v=si2";
|
| 3 |
import { createAnalysis } from "./analysis.js";
|
| 4 |
const $ = (s) => document.querySelector(s),
|
| 5 |
$$ = (s) => [...document.querySelectorAll(s)];
|
|
|
|
| 26 |
currentView = "gallery";
|
| 27 |
const fixedPresets = new Map();
|
| 28 |
const fixedPoints = new Map([
|
| 29 |
+
["sp2",{vout:1.5,iout:1.1404833}], ["rsc2",{vout:1.5,iout:1}], ["si2",{vin:3,vout:1.5,iout:1,duty:.5}],
|
| 30 |
]);
|
| 31 |
const fixedInBounds = (id, axis, value) => {
|
| 32 |
const range = fixedPresets.get(id)?.parameters[axis];
|
|
|
|
| 57 |
!Number.isFinite(point.iout)
|
| 58 |
)
|
| 59 |
return;
|
| 60 |
+
operatingPoint = { vout: point.vout, iout: point.iout, ...(Number.isFinite(point.vin)&&Number.isFinite(point.duty)?{vin:point.vin,duty:point.duty}:{}) };
|
| 61 |
renderSelection();
|
| 62 |
});
|
| 63 |
const simulator = createSimulator(notify, (topology, point) => {
|
|
|
|
| 71 |
point.vout > 0 &&
|
| 72 |
point.iout > 0
|
| 73 |
)
|
| 74 |
+
operatingPoint = { vout: point.vout, iout: point.iout, ...(Number.isFinite(point.vin)&&Number.isFinite(point.duty)?{vin:point.vin,duty:point.duty}:{}) };
|
| 75 |
gallery.highlight(entry.id);
|
| 76 |
renderSelection();
|
| 77 |
}
|
|
|
|
| 79 |
function simulationAvailable() {
|
| 80 |
const id = selectedTopology?.simulator;
|
| 81 |
if (fixedPoints.has(id))
|
| 82 |
+
return selectedRatio === 2 && fixedInBounds(id,"vin",operatingPoint.vin??operatingPoint.vout*2) &&
|
| 83 |
+
fixedInBounds(id,"load",operatingPoint.iout) &&
|
| 84 |
+
(id!=="si2" || fixedInBounds(id,"duty",operatingPoint.duty??.5));
|
| 85 |
return (
|
| 86 |
!!selectedTopology?.simulator &&
|
| 87 |
selectedRatio === 4 &&
|
|
|
|
| 99 |
if (!entry) return;
|
| 100 |
$("#selected-name").textContent = entry.name;
|
| 101 |
$("#selected-ratio").textContent =
|
| 102 |
+
`${selectedRatio}:1 reference · ${entry.id==="si2"?`Vin ${operatingPoint.vin} V · duty ${operatingPoint.duty??.5}`:`Vout ${operatingPoint.vout} V`} · Iout ${operatingPoint.iout} A`;
|
| 103 |
$("#selected-image").src = "./compare/assets/" + entry.image;
|
| 104 |
$("#selected-image").alt = entry.name + " circuit schematic";
|
| 105 |
$("#selected-simulate").disabled = !simulationAvailable();
|
|
|
|
| 117 |
: fixedPoints.has(entry.simulator)
|
| 118 |
? simulationAvailable()
|
| 119 |
? "Continuous inputs and configurable sweeps. Each run checks result reliability."
|
| 120 |
+
: entry.simulator === "si2" ? "Set Vin to 1.8–4 V, output current to 0.25–4 A and duty to 0.25–0.75 to open the SI Simulator." : entry.simulator === "sp2" ? "Set nominal output to 0.9–2 V and output current to 0.05–4 A to open the SP-SC Simulator." : "Set nominal output to 0.9–2 V and output current to 0.15–2 A to open the resonant SC Simulator."
|
| 121 |
: selectedRatio !== 4
|
| 122 |
? "This preset currently supports simulation in the 4:1 family; the selected ratio has an analytical model."
|
| 123 |
: !simulationAvailable()
|
|
|
|
| 322 |
const p = JSON.parse(current);
|
| 323 |
$("#project-name").textContent = p.name ?? "Power converter";
|
| 324 |
const docs = p.documents ?? [];
|
| 325 |
+
// The state drawings in these starters repeat the top-cell devices.
|
| 326 |
+
const counted = ["rsc2","si2"].includes(active?.id) ? docs.filter(d => d.id === p.topDocumentId) : docs;
|
| 327 |
const instances = counted.flatMap(d => d.instances ?? []);
|
| 328 |
const types = instances.map((i) => String(i.type ?? i.symbolId ?? ""));
|
| 329 |
$("#device-count").textContent = types.filter((t) =>
|
static/simulator.js
CHANGED
|
@@ -8,7 +8,7 @@ export function createSimulator(report, onSelection = () => {}) {
|
|
| 8 |
sentKey = null,
|
| 9 |
awaitingKey = null;
|
| 10 |
const key = (value) =>
|
| 11 |
-
JSON.stringify([value.topology, value.ratio, value.vout, value.iout]);
|
| 12 |
function deliver() {
|
| 13 |
if (!ready || !pending || key(pending) === sentKey) return;
|
| 14 |
sentKey = key(pending);
|
|
@@ -41,9 +41,11 @@ export function createSimulator(report, onSelection = () => {}) {
|
|
| 41 |
if (awaitingKey !== null) return;
|
| 42 |
const reference = {
|
| 43 |
topology: data.topology,
|
| 44 |
-
ratio: ["sp2","rsc2"].includes(data.topology) ? 2 : 4,
|
| 45 |
vout: data.vout,
|
| 46 |
iout: data.iout,
|
|
|
|
|
|
|
| 47 |
};
|
| 48 |
pending = reference;
|
| 49 |
sentKey = key(reference);
|
|
|
|
| 8 |
sentKey = null,
|
| 9 |
awaitingKey = null;
|
| 10 |
const key = (value) =>
|
| 11 |
+
JSON.stringify([value.topology, value.ratio, value.vout, value.iout, value.vin, value.duty]);
|
| 12 |
function deliver() {
|
| 13 |
if (!ready || !pending || key(pending) === sentKey) return;
|
| 14 |
sentKey = key(pending);
|
|
|
|
| 41 |
if (awaitingKey !== null) return;
|
| 42 |
const reference = {
|
| 43 |
topology: data.topology,
|
| 44 |
+
ratio: ["sp2","rsc2","si2"].includes(data.topology) ? 2 : 4,
|
| 45 |
vout: data.vout,
|
| 46 |
iout: data.iout,
|
| 47 |
+
vin: data.vin,
|
| 48 |
+
duty: data.duty,
|
| 49 |
};
|
| 50 |
pending = reference;
|
| 51 |
sentKey = key(reference);
|
static/starters/index.json
CHANGED
|
@@ -67,5 +67,19 @@
|
|
| 67 |
"magneticsLabel": "2 uncoupled series inductors",
|
| 68 |
"description": "Two interleaved resonant flying-capacitor legs. The A-high and B-high cells show the complementary paths.",
|
| 69 |
"project": "starters/rsc2.icproj.json"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
}
|
| 71 |
-
]
|
|
|
|
| 67 |
"magneticsLabel": "2 uncoupled series inductors",
|
| 68 |
"description": "Two interleaved resonant flying-capacitor legs. The A-high and B-high cells show the complementary paths.",
|
| 69 |
"project": "starters/rsc2.icproj.json"
|
| 70 |
+
},
|
| 71 |
+
{
|
| 72 |
+
"id": "si2",
|
| 73 |
+
"name": "2:1 switched inductor",
|
| 74 |
+
"ratio": 2,
|
| 75 |
+
"model": "si2",
|
| 76 |
+
"switches": 4,
|
| 77 |
+
"magneticsLabel": "2 inverse-coupled windings",
|
| 78 |
+
"project": "starters/si2.icproj.json",
|
| 79 |
+
"phases": [
|
| 80 |
+
"A",
|
| 81 |
+
"B"
|
| 82 |
+
],
|
| 83 |
+
"description": "Two inverse-coupled buck phases with 180° interleaving and eight switching-state drawings."
|
| 84 |
}
|
| 85 |
+
]
|
static/starters/si2.icproj.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
static/starters/si2.sp
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
.subckt dut VIN VSS A ABAR B BBAR VOUT
|
| 3 |
+
COUT VOUT VSS 47u
|
| 4 |
+
IOUT VOUT VSS DC 1
|
| 5 |
+
L1 net3 net0 1u
|
| 6 |
+
L2 net2 net1 1u
|
| 7 |
+
XM1 VIN A net3 VSS sky130_fd_pr__nfet_g5v0d16v0 l=700n m=1 nf=1 w=5u
|
| 8 |
+
XM2 net3 ABAR VSS VSS sky130_fd_pr__nfet_g5v0d16v0 l=700n m=1 nf=1 w=5u
|
| 9 |
+
XM5 VIN B net1 VSS sky130_fd_pr__nfet_g5v0d16v0 l=700n m=1 nf=1 w=5u
|
| 10 |
+
XM6 net1 BBAR VSS VSS sky130_fd_pr__nfet_g5v0d16v0 l=700n m=1 nf=1 w=5u
|
| 11 |
+
RL1 net0 VOUT 4m
|
| 12 |
+
RL2 net2 VOUT 4m
|
| 13 |
+
K1 L1 L2 .6
|
| 14 |
+
.ends dut
|
static/testbenches/rsc2-preset.json
CHANGED
|
@@ -140,5 +140,6 @@
|
|
| 140 |
"short": "RSC",
|
| 141 |
"model_note": "Matched series-RLC legs with synchronized 50% commands, bidirectional resistive switches and optional linear Coss. Gate demand is an external estimate. Nonlinear capacitance, dead time, body diodes and core loss are outside this switch model.",
|
| 142 |
"gate_note": "Optional per-switch gate capacitance. Blank derives capacitance from the illustrative Ron × Qg, entered Ron, and drive voltage (38.2 pF per switch at default). Gate voltage changes the gate-energy estimate; it does not set channel resistance.",
|
| 143 |
-
"switch_note": "The stage includes dissipation caused by entered Coss. Modeled commutation current is reported directly. Use a hardware-specific model to evaluate dead-time behavior and voltage stress."
|
|
|
|
| 144 |
}
|
|
|
|
| 140 |
"short": "RSC",
|
| 141 |
"model_note": "Matched series-RLC legs with synchronized 50% commands, bidirectional resistive switches and optional linear Coss. Gate demand is an external estimate. Nonlinear capacitance, dead time, body diodes and core loss are outside this switch model.",
|
| 142 |
"gate_note": "Optional per-switch gate capacitance. Blank derives capacitance from the illustrative Ron × Qg, entered Ron, and drive voltage (38.2 pF per switch at default). Gate voltage changes the gate-energy estimate; it does not set channel resistance.",
|
| 143 |
+
"switch_note": "The stage includes dissipation caused by entered Coss. Modeled commutation current is reported directly. Use a hardware-specific model to evaluate dead-time behavior and voltage stress.",
|
| 144 |
+
"domain_note": "Use a clock between 0.65 and 1.35 times LC natural frequency and damping below 0.8."
|
| 145 |
}
|
static/testbenches/si2-preset.json
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"id": "si2",
|
| 3 |
+
"ratio": 2,
|
| 4 |
+
"status": "local-generic-model",
|
| 5 |
+
"run_kind": "run",
|
| 6 |
+
"parameters": {
|
| 7 |
+
"vin": {
|
| 8 |
+
"field": "input_voltage_v",
|
| 9 |
+
"label": "Input voltage",
|
| 10 |
+
"unit": "V",
|
| 11 |
+
"minimum": 1.8,
|
| 12 |
+
"maximum": 4,
|
| 13 |
+
"default": 3,
|
| 14 |
+
"optional": false
|
| 15 |
+
},
|
| 16 |
+
"load": {
|
| 17 |
+
"field": "output_current_a",
|
| 18 |
+
"label": "Output current",
|
| 19 |
+
"unit": "A",
|
| 20 |
+
"minimum": 0.25,
|
| 21 |
+
"maximum": 4,
|
| 22 |
+
"default": 1,
|
| 23 |
+
"optional": false
|
| 24 |
+
},
|
| 25 |
+
"fs": {
|
| 26 |
+
"field": "switching_frequency_mhz",
|
| 27 |
+
"label": "Switching frequency",
|
| 28 |
+
"unit": "MHz",
|
| 29 |
+
"minimum": 0.8,
|
| 30 |
+
"maximum": 4,
|
| 31 |
+
"default": 2,
|
| 32 |
+
"optional": false
|
| 33 |
+
},
|
| 34 |
+
"duty": {
|
| 35 |
+
"field": "duty",
|
| 36 |
+
"label": "High-side duty",
|
| 37 |
+
"unit": "fraction",
|
| 38 |
+
"minimum": 0.25,
|
| 39 |
+
"maximum": 0.75,
|
| 40 |
+
"default": 0.5,
|
| 41 |
+
"optional": false
|
| 42 |
+
},
|
| 43 |
+
"lt": {
|
| 44 |
+
"field": "inductance_nh",
|
| 45 |
+
"label": "Self-inductance per winding",
|
| 46 |
+
"unit": "nH",
|
| 47 |
+
"minimum": 300,
|
| 48 |
+
"maximum": 2500,
|
| 49 |
+
"default": 1000,
|
| 50 |
+
"optional": false
|
| 51 |
+
},
|
| 52 |
+
"coupling": {
|
| 53 |
+
"field": "coupling",
|
| 54 |
+
"label": "Inverse coupling magnitude",
|
| 55 |
+
"unit": "",
|
| 56 |
+
"minimum": 0,
|
| 57 |
+
"maximum": 0.85,
|
| 58 |
+
"default": 0.6,
|
| 59 |
+
"optional": false
|
| 60 |
+
},
|
| 61 |
+
"dcr": {
|
| 62 |
+
"field": "dcr_mohm",
|
| 63 |
+
"label": "DCR per winding",
|
| 64 |
+
"unit": "mΩ",
|
| 65 |
+
"minimum": 1,
|
| 66 |
+
"maximum": 40,
|
| 67 |
+
"default": 4,
|
| 68 |
+
"optional": false
|
| 69 |
+
},
|
| 70 |
+
"rs": {
|
| 71 |
+
"field": "switch_ron_mohm",
|
| 72 |
+
"label": "High-side switch Ron",
|
| 73 |
+
"unit": "mΩ",
|
| 74 |
+
"minimum": 4,
|
| 75 |
+
"maximum": 60,
|
| 76 |
+
"default": 12,
|
| 77 |
+
"optional": false
|
| 78 |
+
},
|
| 79 |
+
"rslow": {
|
| 80 |
+
"field": "low_ron_mohm",
|
| 81 |
+
"label": "Low-side switch Ron (blank uses high-side Ron)",
|
| 82 |
+
"unit": "mΩ",
|
| 83 |
+
"minimum": 4,
|
| 84 |
+
"maximum": 60,
|
| 85 |
+
"default": null,
|
| 86 |
+
"optional": true
|
| 87 |
+
},
|
| 88 |
+
"gate": {
|
| 89 |
+
"field": "gate_drive_v",
|
| 90 |
+
"label": "Gate-drive high level",
|
| 91 |
+
"unit": "V",
|
| 92 |
+
"minimum": 2.5,
|
| 93 |
+
"maximum": 4.5,
|
| 94 |
+
"default": 3.3,
|
| 95 |
+
"optional": false
|
| 96 |
+
},
|
| 97 |
+
"gatecap": {
|
| 98 |
+
"field": "gate_cap_pf",
|
| 99 |
+
"label": "Effective gate capacitance",
|
| 100 |
+
"unit": "pF",
|
| 101 |
+
"minimum": 0,
|
| 102 |
+
"maximum": 100,
|
| 103 |
+
"default": null,
|
| 104 |
+
"optional": true
|
| 105 |
+
},
|
| 106 |
+
"coss": {
|
| 107 |
+
"field": "switch_coff_pf",
|
| 108 |
+
"label": "Linear switch Coss",
|
| 109 |
+
"unit": "pF",
|
| 110 |
+
"minimum": 0,
|
| 111 |
+
"maximum": 30,
|
| 112 |
+
"default": 0,
|
| 113 |
+
"optional": false
|
| 114 |
+
},
|
| 115 |
+
"cout": {
|
| 116 |
+
"field": "output_cap_uf",
|
| 117 |
+
"label": "Output capacitance",
|
| 118 |
+
"unit": "µF",
|
| 119 |
+
"minimum": 10,
|
| 120 |
+
"maximum": 100,
|
| 121 |
+
"default": 47,
|
| 122 |
+
"optional": false
|
| 123 |
+
},
|
| 124 |
+
"esr": {
|
| 125 |
+
"field": "output_esr_mohm",
|
| 126 |
+
"label": "Output capacitor ESR",
|
| 127 |
+
"unit": "mΩ",
|
| 128 |
+
"minimum": 0.5,
|
| 129 |
+
"maximum": 40,
|
| 130 |
+
"default": 5,
|
| 131 |
+
"optional": false
|
| 132 |
+
},
|
| 133 |
+
"stop": {
|
| 134 |
+
"field": "stop_us",
|
| 135 |
+
"label": "Simulation duration",
|
| 136 |
+
"unit": "µs",
|
| 137 |
+
"minimum": 20,
|
| 138 |
+
"maximum": 1000,
|
| 139 |
+
"default": null,
|
| 140 |
+
"optional": true
|
| 141 |
+
},
|
| 142 |
+
"step": {
|
| 143 |
+
"field": "max_step_ps",
|
| 144 |
+
"label": "Refined maximum step ceiling",
|
| 145 |
+
"unit": "ps",
|
| 146 |
+
"minimum": 100,
|
| 147 |
+
"maximum": 3000,
|
| 148 |
+
"default": null,
|
| 149 |
+
"optional": true
|
| 150 |
+
}
|
| 151 |
+
},
|
| 152 |
+
"sweep_points": {
|
| 153 |
+
"minimum": 2,
|
| 154 |
+
"maximum": 15,
|
| 155 |
+
"default": 5
|
| 156 |
+
},
|
| 157 |
+
"name": "2:1 switched inductor",
|
| 158 |
+
"short": "SI",
|
| 159 |
+
"model_note": "Synchronous two-phase buck with inverse-coupled windings, complementary switching, and a half-period phase shift. Positive winding-current CCM is required.",
|
| 160 |
+
"gate_note": "Gate voltage sets the displayed ideal VGS command and gate-energy estimate. Blank effective gate capacitance uses the illustrative Ron × Qg technology data.",
|
| 161 |
+
"switch_note": "The stage includes optional linear Coss. Complementary switch transitions have zero dead time. Body diodes, overlap, core loss and saturation require a device-specific model.",
|
| 162 |
+
"nominal_gain_axis": "duty"
|
| 163 |
+
}
|