Voltecx is in beta. The macOS build comes first; Windows and Linux packages are still being tested.Beta. macOS comes first; Windows and Linux are still in testing. What's new
Documentation

15. Examples

Voltecx comes with ready-made circuits. Each one is a working circuit with a known answer, so you can open it, run it and change it. They are built in code, so they work in the browser version too, where there are no files.

Open an example

There are three ways.

  • File > Open Example has one submenu for each category. Point at an example to read what it shows.
  • Help > Examples opens the examples browser.
  • Cmd+K opens Quick Open. Type part of an example's name (buck, pfc, 馬達): the examples come first, with the selected one's schematic and waveform on the right. Enter opens it; Cmd+Enter opens it and runs it. See Quick Open.

The browser lists the examples by category on the left. Each row shows a small picture of the schematic, the level (Beginner, Intermediate or Advanced) and about how long the example takes.

Over the categories, Shelves splits the examples in two. Application circuits are each built around one commercial part, with the values of its data sheet's design example; the preview names that part under the title ("Built around TPS54360B"), and pointing at the line shows the document, revision and section the values come from. Teaching circuits show an analysis, a topology or a simulator feature. Click a shelf to show only its examples, together with any category you pick; click it again to show both shelves.

A part's application example also opens from its Component Guide page (Help › Component Guide, or F1 on the part). The page of a library IC lists, under Application examples, one button for each of its real parts that has an example ("Open TPS54360B example"); with a placed part selected, it offers only that part's. Pointing at a button shows the example's title and the document it is built from.

The examples browser, marked 1 to 5

  1. Type in the search box to narrow the list. The search looks at the names in English and Chinese, the descriptions and the key specs, so buck closed, 返馳 or 400 V all work. Press ↑ and ↓ to move through the list and Enter to open the selected example.
  2. Click a category to show only that category. Click it again, or All categories, to show every example.
  3. Click a row to see the example on the right: its schematic, its main signals from a real run, its key specs (such as input and output voltage, switching frequency and control) and what you will learn from it. Double-click a row to open it.
  4. Open and run opens it in a new tab and starts the simulation (⌘Enter does the same). Open only, beside it, opens it without running.
  5. Use as Auto Design starting point opens Design > Automate > Requirements Interview with the example's input voltage, output voltage, load current and isolation filled in. Answer the other questions and confirm to run Auto Design. It is offered for the DC-DC examples with a DC load.

The pictures and waveforms come from the examples themselves: the schematic is drawn the way file.exportSchematic draws it, and the waveform is the example's own simulation, thinned for the preview. Each trace is scaled to the height of the preview, so read the values in the scope after you run the example.

An example opens in a new tab. The schematic fits the window, and the scope is set to show the main signals of that example. Press F5 to run it.

The same thing from a command: file.openExample with the example's name, for example {"name": "buckSync"}.

What is there

Basics

  • rc, rl and rlc show the step response of a first-order and a second-order circuit.
  • relaxationOscillator, timer555Astable, wienBridge and colpitts are oscillators built from comparators, a 555 timer and op-amps.

DC-DC

  • buck and boost run open loop at a fixed duty cycle.
  • buckClosedLoop holds 12 V from 48 V with a PI controller.
  • buckSync is a synchronous buck: a MOSFET with dead time takes the place of the diode, and a PI controller holds 12 V from 48 V.
  • buckGan is a synchronous buck with two GaN transistors (EPC2218 data) at 500 kHz. A GaN transistor has no body diode: in the dead time it conducts in reverse at its threshold voltage minus its turn-off voltage, here about 3.1 V, so the switch node dips to −3.1 V where a silicon MOSFET would sit near −0.8 V.
  • boostClosedLoop holds 24 V from 12 V with a slow PI controller.
  • zvtBoost is a zero-voltage-transition boost after Hua, Leu, Jiang and Lee (IEEE Transactions on Power Electronics 9(2), 1994, pp. 213–219): 200 V to 400 V at 500 W and 200 kHz, open loop at a duty of 0.5. An auxiliary switch Qa with a 2 µH resonant inductor Lr turns on 70 ns before the main switch Q1, at zero current. Lr takes the inductor current from the boost diode, then rings with the 470 pF node capacitance Cr (the switch's output capacitance, drawn as a part) and brings the switch node sw from 400 V to zero, so Q1 turns on at zero volts. Set the variable zvt to 0 and the same circuit runs hard-switched: Q1 turns on at 400 V and burns Cr's ½·C·V² every cycle. The switches and diodes are ideal with a small on-resistance; the part values are the example's own design values, not a data sheet's. Plot v(sw), i(Lr), g and ga.
  • bjtRegulator is a discrete linear regulator built from two vendor bipolar transistors at the Gummel–Poon level, each with its maker's whole SPICE card (Diodes Incorporated MJD31CQ as the pass element, DI_MMBT3904 as the error amplifier). The error amplifier compares the divided output with a 2.5 V reference and holds about 5.01 V from 12 V, (Vref + Vbe2)·(1 + R1/R2). While the input ramps up, below about 10 V the bias resistor cannot feed the pass element enough base current and the output follows the input (dropout). At 3 ms the load steps from 0.5 A to 1 A and the output settles about 67 mV lower. Plot vin with vout, and iout.
  • buckThermal adds a thermal model that heats the MOSFET junction.
  • halfBridgeParallelSic is a synchronous half-bridge whose switches each stand for three paralleled SiC MOSFETs from the device library (nParallel 3): the losses are three devices' worth, the junction temperature is one device's (chapter 4, Paralleled devices).
  • tps54360bBuck is the TPS54360B data sheet's design example (SNVSB93 section 8.2): 12 V to 5 V at 3.5 A and 600 kHz. The IC is the library's buckRegulator with the part's electrical characteristics, and every external part (L1 8.2 µH, two 47 µF, the 53.6 kΩ / 10.2 kΩ divider, the 13 kΩ / 6.8 nF / 39 pF compensation, the UVLO pair) comes from the data sheet's own design procedure, as ic.designExternals runs it. Its supply and load are the connectors J1 (input) and J2 (output), not a source and a resistor on the schematic: the test bench drives them in a run, 12 V on J1 and a 1.43 Ω load on J2 (Properties › Simulation › Test bench ports). It opens with four measurements: Vout (5.004 V by Equation 42), Vout ripple (under Table 1's 25 mV), IL ripple (about 0.63 A) and Efficiency (about 0.90, between the section 8.2.2.13 loss estimates). A note under the drawing says to check every value against the data sheet before using it.
  • tps54560bBuck is the TPS54560B data sheet's design example (SLVSF00 section 8.2, Figure 32): 12 V to 5 V at 5 A and 400 kHz. It is built the same way as tps54360bBuck: the library's buckRegulator with the part's electrical characteristics, and every external part (L1 7.2 µH, three 47 µF, four 2.2 µF at the input, the 53.6 kΩ / 10.2 kΩ divider, the 16.9 kΩ / 4.7 nF / 47 pF compensation, the 442 kΩ / 90.9 kΩ UVLO pair) from the data sheet's own design procedure. Its supply and load are the connectors J1 (input) and J2 (output), which the test bench drives in a run: 12 V on J1 and a 1 Ω load on J2 (Properties › Simulation › Test bench ports). It opens with four measurements: Vout (5.004 V by Equation 42), Vout ripple (under Table 1's 25 mV), IL ripple (about 1.06 A) and Efficiency (about 0.89, between the section 8.2.2.13 loss estimates). A note under the drawing says to check every value against the data sheet before using it.
  • tps54331Buck is the TPS54331 data sheet's design example (SLVS839H section 8.2, Figure 8-1): 3.3 V at 3 A and the part's fixed 570 kHz, run at 12 V (Table 8-1 gives the input only as 7 V to 28 V). It is built the same way as tps54360bBuck: the library's buckRegulator with the part's electrical characteristics, and every external part (L1 6.8 µH, two 47 µF, two 4.7 µF at the input, the 10.2 kΩ / 3.24 kΩ divider, the 29.4 kΩ / 1000 pF / 47 pF compensation, the 0.01 µF slow-start capacitor) from the data sheet's own design procedure; Figure 8-1's 332 kΩ / 68.1 kΩ EN divider and the B340A's 0.5 V are placed as printed. Its supply and load are the connectors J1 (input) and J2 (output), which the test bench drives in a run: 12 V on J1 and a 1.1 Ω load on J2. It opens with four measurements: Vout (3.32 V by Equation 5), Vout ripple (under Table 8-1's 30 mV), IL ripple (about 0.68 A) and Efficiency (about 0.88, between the section 8.2.2.11 loss estimates). A note under the drawing says to check every value against the data sheet before using it.
  • lm5146Buck is Design 1 of the LM5146 data sheet (SNVSBV0A section 9.2.1, Figure 9-5): 48 V to 5 V at 12 A and 300 kHz. The IC is the library's syncBuckController with the LM5146's electrical characteristics, and every external part is the one Figure 9-5 prints: LF 3.3 µH, five 47 µF, Q1 22 mΩ and Q2 6 mΩ, the 23.2 kΩ / 4.42 kΩ divider, the type III network (7.5 kΩ, 6.8 nF, 150 pF, 150 Ω, 820 pF), the 47 nF soft start, the 100 kΩ / 17.8 kΩ UVLO pair and RILIM 499 Ω. SYNCIN is not modelled, so the oscillator runs at the 300 kHz clock directly. Its supply and load are the connectors J1 (input) and J2 (output), which the test bench drives in a run: 48 V on J1 and a 0.417 Ω load (5 V at 12 A) on J2 (Properties › Simulation › Test bench ports). It opens with three measurements: Vout (4.999 V), Vout ripple (about 8 mV) and IL ripple (about 4.6 A, by Equation 7). A note under the drawing says to check every value against the data sheet before using it.
  • lm5146Buck12v is Design 2 of the LM5146 data sheet (SNVSBV0A section 9.2.2, Figure 9-16, Tables 9-7 and 9-8): the 48 V telecom input to 12 V at 8 A, with RRT 24.9 kΩ setting about 400 kHz. It is built like lm5146Buck, with every external part Figure 9-16 prints: LF 6.8 µH, five 22 µF ceramics, Q1 22 mΩ and Q2 10 mΩ, the 21 kΩ / 1.5 kΩ divider (12.0 V), the type III network (8.06 kΩ, 4.7 nF, 100 pF, 100 Ω, 1 nF), the 47 nF soft start, the 100 kΩ / 9.31 kΩ UVLO pair (on at 14.1 V, off at 13.1 V) and RILIM 619 Ω (a 12 A limit). Its supply and load are the connectors J1 (input) and J2 (output), which the test bench drives in a run: 48 V on J1 and a 1.5 Ω load (12 V at 8 A) on J2 (Properties › Simulation › Test bench ports). Figure 9-16 draws no PGOOD pull-up, so none is drawn. The MOSFETs' gate stand-ins are drawn as one block, GD1. It opens with three measurements: Vout (12.0 V), Vout ripple (about 9.5 mV) and IL ripple (about 3.3 A). RBST, CIN, the VIN filter, CVCC, the optional D1, CILIM, SYNCIN, the inductor's DCR and the capacitors' ESR are left out, and the example's description says why.
  • lm5145BuckDsp is Design 4 of the LM5145 data sheet (SNVSAI4B section 9.2.4, Figure 9-46, Tables 9-11 and 9-12): a DSP core rail from 24 V to 1.1 V at 10 A, with RRT 33.2 kΩ setting about 300 kHz and a 4.6 % duty cycle (a 153 ns on-time). It is built like lm5145Buck, with every external part Figure 9-46 prints: LF 1 µH, four 100 µF ceramics, Q1 8.5 mΩ and Q2 4 mΩ, the 6.81 kΩ / 18.2 kΩ divider (1.099 V), the type III network (2.32 kΩ, 10 nF, 470 pF, 100 Ω, 2.7 nF), the 47 nF soft start and RILIM 249 Ω (a 12.5 A limit). VCC comes from the 8 V auxiliary rail Vaux. Its supply and load are the connectors J1 (input) and J2 (output), which the test bench drives in a run: 24 V on J1 and Figure 9-48's 0.11 Ω load on J2 (Properties › Simulation › Test bench ports). Figure 9-46 leaves EN/UVLO unconnected and draws no PGOOD pull-up, so EN/UVLO is tied to VIN (section 8.3.4) and PGOOD is left open. The MOSFETs' gate stand-ins are drawn as one block, GD1. It opens with three measurements: Vout (1.099 V), Vout ripple (about 3.8 mV) and IL ripple (about 3.6 A). The LM10011 VID programmer and the DSP have no model, so the output stays at the divider's 1.1 V. D1, CIN, CVIN, CVCC, CILIM, SYNCIN, the inductor's DCR and the capacitors' ESR are left out, and the example's description says why.
  • lm5145Buck is Design 1 of the LM5145 data sheet (SNVSAI4B section 9.2.1, Figure 9-5): 48 V to 5 V at 20 A and 230 kHz. It is built the same way as lm5146Buck: the library's syncBuckController with the LM5145's electrical characteristics, and every external part the one Figure 9-5 prints: LF 3.3 µH, seven 47 µF with the 220 µF bulk capacitor, Q1 12 mΩ and Q2 4 mΩ, the 23.2 kΩ / 4.42 kΩ divider, the type III network (11 kΩ, 4.7 nF, 150 pF, 1 kΩ, 1.8 nF), the 47 nF soft start, the 49.9 kΩ / 11.3 kΩ UVLO pair and RILIM 422 Ω. SYNCIN is not modelled, so the oscillator runs at the 230 kHz clock directly. Its supply and load are the connectors J1 (input) and J2 (output), which the test bench drives in a run: 48 V on J1 and a 0.25 Ω load on J2 (Properties › Simulation › Test bench ports). It opens with three measurements: Vout (4.999 V), Vout ripple (about 5.9 mV) and IL ripple (about 5.9 A). A note under the drawing says to check every value against the data sheet before using it.
  • lm5145Buck12v is Design 2 of the LM5145 data sheet (SNVSAI4B section 9.2.2, Figure 9-20, Tables 9-7 and 9-8): 48 V to 12 V at 10 A, with RRT 24.9 kΩ setting about 400 kHz. It is built like lm5145Buck, with every external part Figure 9-20 prints for the 12 V rail: LF 4.7 µH, five 47 µF ceramics, Q1 and Q2 6 mΩ, the 33.2 kΩ / 2.37 kΩ divider (12.01 V), the type III network (15 kΩ, 3.3 nF, 56 pF, 100 Ω, 680 pF), the 33 nF soft start, the 80.6 kΩ / 7.5 kΩ UVLO pair (on at 14.1 V, off at 13.3 V) and RILIM 402 Ω (a 13.4 A limit). Its supply and load are the connectors J1 (input) and J2 (output), which the test bench drives in a run: 48 V on J1 and Figure 9-23's 1.2 Ω load on J2 (Properties › Simulation › Test bench ports). Figure 9-20 takes PGOOD to the LP38798's EN pin and draws no pull-up, so PGOOD is left open. The MOSFETs' gate stand-ins are drawn as one block, GD1. It opens with three measurements: Vout (12.01 V), Vout ripple (about 6.5 mV) and IL ripple (about 4.8 A). The LP38798 LDO that makes the auxiliary 10 V rail has no model, so that rail is left out. D1 (VCC from the output), RBST, CIN, CVIN, CVCC, CILIM, SYNCIN, the inductor's DCR and the capacitors' ESR are left out too, and the example's description says why.
  • lm5145Buck24v is Design 3 of the LM5145 data sheet (SNVSAI4B section 9.2.3, Figure 9-33, Tables 9-9 and 9-10): 48 V to 24 V at 5 A, with RRT 22.6 kΩ setting about 440 kHz, and an output that tracks a master supply. It is built like lm5145Buck, with every external part Figure 9-33 prints: LF 15 µH, seven 10 µF, Q1 and Q2 13 mΩ, the 72.3 kΩ / 2.49 kΩ divider (24.03 V), the type III network (41.2 kΩ, 1 nF, 18 pF, 1 kΩ, 390 pF), the 200 kΩ / 8.87 kΩ UVLO pair (on at 28.3 V) and RILIM 499 Ω. Its supply and load are the connectors J1 (input) and J2 (output), which the test bench drives in a run: 48 V on J1 and a 4.8 Ω load (24 V at 5 A) on J2 (Properties › Simulation › Test bench ports). There is no soft-start capacitor: the 13.3 kΩ / 2.49 kΩ divider from VTRACK to SS/TRK makes the output ramp to 24 V as VTRACK ramps from 0 V to 5 V (section 9.2.3.2). The data sheet gives no ramp time, so the bench ramps VTRACK in 1 ms. The MOSFETs' gate stand-ins are drawn as one block, GD1. It opens with three measurements: Vout (24.03 V), Vout ripple (about 7.5 mV) and IL ripple (about 1.83 A). CIN, CVCC, CILIM, SYNCIN, the inductor's DCR and the capacitors' ESR are left out, and the example's description says why.
  • lm5122Boost is the LM5122 data sheet's typical application (SNVS954H section 8.2, Figure 40): 12 V to 24 V at 4.5 A, with RT 36.5 kΩ setting 246.6 kHz for the 250 kHz design. The IC is the library's syncBoostController with the LM5122's electrical characteristics, and every external part is the one Figure 40 prints: LIN 10 µH, the 4 mΩ current-sense resistor, four 10 µF, three 330 µF and one 1 µF at the output, the 49.9 kΩ + 825 Ω / 2.67 kΩ divider, RCOMP 68.1 kΩ with CCOMP 22 nF and CHF 330 pF, RSLOPE 100 kΩ, CSS 0.1 µF, CRES 0.47 µF and the 49.9 kΩ / 8.06 kΩ UVLO divider. The data sheet prints no on-resistance for its MOSFETs, so they keep the library circuit's generic 10 mΩ and the example has no efficiency row. Its supply and load are the connectors J1 (input) and J2 (output), which the test bench drives in a run: 12 V on J1 and a 5.33 Ω load (24 V at 4.5 A) on J2 (Properties › Simulation › Test bench ports). It opens with Vout (24.0 V), Vout ripple and IL ripple (2.43 A), each read over the last millisecond of the 20 ms run, after the 12 ms soft start and the loop has settled.
  • lp5907Ldo is the LP5907 data sheet's typical application (SNVS798Q section 7.2, Figure 7-1, Table 7-1): the 1.8 V option, LP5907MFX-1.8, at 200 mA with the 1 µF input and 1 µF output capacitors Figure 7-1 prints. The IC is the library's ldo with section 5.5's values and the 1.8 V option's output and load regulation. Table 7-1 gives the input only as a range, 2.2 V to 5.5 V, so the example runs at 2.8 V, the VIN = VOUT(NOM) + 1 V of section 5.5's test conditions; the supply is the connector J1, which the test bench drives. EN is tied to the input, so the part starts with the supply (80 µs turn-on); at 300 µs the load ramps from section 5.5's 1 mA test load to Table 7-1's 200 mA in 10 µs, section 5.5's load-transient condition. It opens with Vout 1 mA (1.8 V within ±2 %), Vout 200 mA (1.796 V: the 0.001 %/mA load regulation), Load-step dip (below section 5.5's 40 mV) and PD, equation 2's (VIN − VOUT) × IOUT, about 0.2 W. Input ripple, the capacitors' ESR, noise and the thermal limits are left out, and the example's description says why.
  • sepic is an open-loop SEPIC that turns 12 V into 12 V at a duty cycle of 0.5. A SEPIC steps up or down without inverting; its switch node swings to the input plus the output voltage, 24 V.
  • cuk is an open-loop Ćuk converter that turns 12 V into −12 V at a duty cycle of 0.5. Its input and output currents are both smooth, because each flows through an inductor.
  • zeta is an open-loop Zeta converter that turns 12 V into 12 V at 1 A, duty cycle 0.5, 100 kHz. Like the SEPIC it steps up or down without inverting, Vout = Vin·D/(1 − D), but its switch sits on the input side and the output current is smooth, because it flows through the second inductor. Each 150 µH inductor ripples by Vin·D/(L·fsw) = 0.4 A, and the node between the coupling capacitor and the diode swings between 0 and Vin + Vout, 24 V. It opens with Vout and IL1 ripple.
  • invertingBuckBoost is an open-loop inverting buck-boost that turns 12 V into −12 V at 1 A, duty cycle 0.5, 100 kHz: Vout = −Vin·D/(1 − D). One 150 µH inductor carries the input and the output current together, 2 A on average with 0.4 A of ripple, and the output capacitor alone feeds the load while the switch is on. It opens with Vout and IL1 ripple.
  • ledBoostDriver boosts 12 V onto a string of ten LEDs near 33 V and holds its current with a PI loop. Analog dimming scales the reference (Ifull·Adim, 0.3 A): the current itself falls and the light does not flicker. PWM dimming (Ddim, 200 Hz) cuts the string off with a series switch between pulses and holds the loop's integrator, so the output capacitor keeps the string's voltage and each pulse starts near the regulated current after about 0.3 ms of ringing; the mean current is Ddim times the held current. Compare ledBuckDriver, a hysteretic buck with PWM dimming.
  • poePd powers up a Type 2 Power over Ethernet powered device (PD) through 12.5 Ω of cable from a 50 V PSE, with the PD interface (module PD) drawn as behaviour from the TPS2378 data sheet. The PSE probes at 4 V and 8 V and sees the 24.9 kΩ signature; at 18 V the PD sinks the class 4 current, 39.9 mA, and between the two class events it shows the 10 kΩ mark, so t2p latches a type 2 PSE. At 50 V the hotswap switch charges the 47 µF bulk at 140 mA, and the converter (its input power, 25.5 W) starts 80 ms later; the PD's input then sits at 42.5 V, where the cable delivers 25.5 W. Plot ipse with vpd and en.
  • poePdFlyback puts an isolated flyback behind the poePd front end in place of its converter's input power: the same detection, classification, 140 mA inrush and 80 ms start-up, then a 3:1 flyback at 100 kHz regulating 12 V at 20 W on its isolated side. Its controller (module CTRL) ramps the reference over 5 ms once en goes high, so the PI loop holds still and the switch stays off during the start-up, and the output rises without overshoot; the PD then draws about 22 W, inside the 25.5 W a Type 2 PD may. Plot vo, duty, vpd and ipse.
  • usbPd is a 27 W USB Power Delivery source and its sink, with the limits of the USB Power Delivery Specification Release 3.2: a synchronous buck from 20 V (module CTRL: a voltage loop, a current limit and a current loop) set by the source's policy engine (module PE), and a sink (module SNK) whose Requests are drawn as signals. VBUS starts at vSafe5V; the sink asks for the fixed 9 V supply, the source accepts 1 ms later, waits tSrcTransition (30 ms), ramps at 25 mV/µs (the limit is 30) and sends PS_RDY once VBUS is within ±5 %, and the sink then draws 27 W. Next the sink asks for the 9 V Prog PPS APDO at 7.8 V with 2 A and closes the switch to its battery (7.4 V behind 0.1 Ω): the source enters Current Limit mode, holds 2 A, and the battery sets VBUS below 7.8 V. A last Request in the same APDO raises the limit to 3 A at the Accept, with no tSrcTransition. Plot vbus, ibus, vset, psrdy and ibat.
  • fourSwitchBuckBoost is a four-switch buck-boost: a buck leg and a boost leg on either side of one inductor, 9–16 V in, 5, 9, 15 or 20 V out (the USB Power Delivery fixed levels, variable Vout) at 3 A and 400 kHz. Well above the output only the buck leg switches, well below it only the boost leg, and near Vin = Vout both; the duties Ctrl.d1 and Ctrl.d2 show which. The ratio Vout/Vin comes forward from the measured input and a slow PI trims it, so the input step from 9 V to 16 V at 3 ms crosses from the boost to the buck region with the output within 5 %. Set Vin and VinStep to the same value for a steady input. "Use as Auto Design starting point" asks design.auto for its four-switch template.
  • flyingCapBuck is a three-level flying-capacitor buck, 48 V to 12 V at 20 A, with four switches (BSC070N10NS5 data) at 200 kHz and a voltage-mode PI. The flying capacitor Cf sits at half the input, so every switch blocks only 24 V. The two switch pairs run half a period apart, so the switch node SW steps between 0 V and 24 V twice per period: the inductor sees 400 kHz and half the voltage step of a two-level buck. The two flying-capacitor states last equally long, which keeps vfc at 24 V with no balancing loop. Set the variable phB to 0 to drive both pairs in phase: the middle level is gone and SW jumps to 48 V again.
  • switchedCap is a 4:1 Dickson switched-capacitor converter, 48 V to 12 V at about 200 W with no inductor. Ten switches (BSC070N10NS5 data) on two non-overlapping 200 kHz clock phases stack three 22 µF flying capacitors at 12 V, 24 V and 36 V, so every switch blocks only 12 V. The output sags with load like a source behind a resistor: Seeman and Sanders' slow- and fast-switching limits give about 43 mΩ, and the loaded run reads 11.29 V into 0.65 Ω, about 5 % under that estimate. Each flying capacitor swings about 1 V per phase as it passes its charge on.
  • threeLevelBoost is a three-level boost from a 300 V PV string to a split 800 V DC link, 4 kW and 5 kW after a load step, after Zhang, Jiang, Lee and Jovanović (IEEE APEC 1995): two switches (C3M0060065D data) in series across the inductor's ends with their midpoint on the link midpoint, and two SiC diodes (IDW20G65C5 data), so every switch and diode blocks only 400 V (vds1, vds2). Their carriers at 50 kHz run half a period apart, so the inductor current i(L1) ripples at 100 kHz and about 1.3 A peak to peak. A voltage loop sets the inductor current, a current loop sets the duty, and a balancing loop moves the two duties apart (Ctrl.ub) to keep vc1 and vc2 equal. At 15 ms a 160 Ω load joins the bottom half only: the halves stay within 1.5 % of each other and the link within 1 % of 800 V.
  • batteryCharger is a synchronous buck stage that charges a pack of four lithium-ion cells from 24 V. It holds 5 A until the pack reaches 16.6 V, and then it holds 16.6 V while the current falls. The battery capacity is set very small, so that the whole charge fits in a run of 0.6 s.
  • batteryChargerLongRun is the same charger on a real pack: four Molicel INR-21700-P45B cells in series, 4.5 Ah, with the charge voltage (4.2 V a cell), the standard charge current (4.5 A) and the DC resistance (15 mΩ a cell) from the cell's data sheet. A switching run of its 1.5-hour charge would take billions of steps; run simulation.batteryRun with tEnd 5400 instead, and the charge from 20 % runs in under a second: 4.5 A for about 44 minutes, then the current falls at 16.8 V until the pack is full.

Isolated

  • flyback is an open-loop flyback with a coupled inductor.
  • flybackClosedLoop holds 12 V from 12 V through a 1:1 coupled inductor with a PI controller.
  • forward is a single-switch forward converter: 48 V to 12 V at 5 A through a 1.6:1 transformer. A reset winding with as many turns as the primary returns the magnetising current to the input while the switch is off, so the drain rises to twice the input, 96 V, and the duty cycle stays below 0.5.
  • activeClampForward is the same 48 V to 12 V converter with an active clamp instead of the reset winding. A clamp switch and a 470 nF capacitor hold the primary at −48 V while the main switch is off, so the drain sits flat at 96 V and the magnetising current swings evenly about zero.
  • pushPull is a push-pull converter, 48 V to 12 V at 5 A. Two switches take turns on the halves of a centre-tapped primary, each on for 0.4 of the 100 kHz period, and a centre-tapped secondary with two diodes rectifies both halves into one LC filter, so the output is 2·D·Vin·Ns/Np less a diode drop. The switch that is off holds twice the input, 96 V; at each turn-off the leakage inductance drives its drain to about 120 V, where an RCD clamp catches it. The magnetising current swings evenly about zero, because the two halves give the core equal and opposite volt-seconds.
  • halfBridgeDcdc is a symmetrical half-bridge converter with a current-doubler rectifier, 380 V to 12 V at 20 A (240 W), each switch on for 0.4 of its 100 kHz period. Two split capacitors hold the midpoint v(mid) at 190 V, so the primary sees ±190 V and no DC reaches the transformer. The secondary has no centre tap: two output inductors each carry half the load, and their ripples, half a period apart, partly cancel, so i(L1)+i(L2) ripples by about a third of one inductor's 3.6 A. The transformer sits on the isolation barrier, and the modulator is a module below the primary.
  • twoSwitchForward is a two-switch forward converter, 48 V to 12 V at 5 A, 100 kHz, D = 0.4. A high-side and a low-side switch turn on together, and when they turn off two clamp diodes return the magnetising current to the input, so the core resets with no reset winding and each switch stands only 48 V. Read i(Lm): it rises to 0.38 A and falls back to zero inside every period. The Vout and ILo ripple measurements read the output.
  • classEAmplifier is a class-E resonant amplifier: one switch at 1 MHz and D = 0.5, fed from 24 V through a 470 µH choke, with a 2.92 nF shunt capacitor and a series tank (0.844 nF, 31.8 µH, loaded Q of 20) into 10 Ω, designed with Raab's idealized constants. Read v(sw): it rises in humps to about 87 V (about 3.6 times the supply) and each hump comes back to zero at a small fraction of its steepest slope just before the switch turns on, and the body diode holds it there, so the turn-on loses almost nothing. The output is about 33 W; pout over pin gives the efficiency, about 98.7 %, set by the switch's 50 mΩ on-resistance.
  • classDAmplifier is a class-D audio amplifier: a half bridge on ±40 V rails switched at 400 kHz by a comparator that compares a 1 kHz, 1 V input tone (scaled to a modulation index of 0.8) with a triangle carrier, with a 10 ns dead time, and a second-order Butterworth LC filter (60 µH, 469 nF, 30 kHz corner) into an 8 Ω speaker. The modulator is a module; the input va, the reference ref, the carrier tri and the gates join it to the rest by label. Read vo: a 22.3 V rms sine (about 62 W) whose THD is about 0.5 % in the audio band (scope.measure with thd); v(sw) is the ±40 V pulse train, and the filter leaves about 0.19 V of the 400 kHz carrier at the speaker, (fc/fsw)² of the switch node's. The dead time is the main distortion; the Summary's efficiency, about 99.5 %, is set by the switches' 42 mΩ on-resistance (Infineon BSC520N15NS3G).
  • sicHalfBridgeFiber is an 800 V SiC half bridge (two Wolfspeed C3M0016120K at the dynamic switching level) whose gate signals cross the barrier on fiber: the PWM module and two fiberTx on the control ground, two fiberRx on the power side, each on its switch's source with its own 15 V supply. Each gate edge comes 55 ns after its command (the fiber parts' typical values). The schematic draws the barrier between the transmitters and the receivers, and fiber.linkBudget gives 14.6 dB of margin.
  • llcHalfBridge is an LLC resonant half bridge run at its resonant frequency of 100 kHz. It makes about 48 V from 400 V through a 4:1 transformer, and the resonant current is close to a sine.
  • dab is a dual active bridge. Two full bridges and a 2:1 transformer move about 4.4 kW from a 400 V bus to a 200 V bus. The phase shift between the bridges (the variable Phs, 30 degrees) sets the power.
  • threePortDab is a three-port dual active bridge (a triple active bridge): a 400 V source, a 200 V battery and a 100 V load, each a full bridge, on one transformer core at 50 kHz. Two phase shifts set the power flow: the battery bridge lags the source by Phs2 (20 degrees) and the load bridge by Phs3 (30 degrees), so the source gives about 6.3 kW, the battery takes 2.3 kW and the load 4.1 kW. Seen as a delta of one inductance between each pair of ports, every pair is a two-port dual active bridge, and the port powers follow its phase-shift equation. The three modulators are the module Mod. To find the phase shifts for the powers you want, run the command design.multiportDab with the port voltages, turns ratios and inductances and the power wanted at the battery and the load; it returns Phs2 and Phs3 in degrees, and each pair's mesh inductance and power.
  • threePortDabClosedLoop is the same three-port bridge with two loops closed on its phase shifts. A PI on the battery current sets Phs2 and a PI on the load port's voltage sets Phs3, each updated once per switching period. The battery set point steps from 5 A charging to 5 A discharging at 2 ms: the battery bridge goes from lagging the source to leading it, the source's power falls from about 3 kW to 1 kW, and the 2 kW load stays at 100 V.
  • threePhaseDab is a three-phase dual active bridge: an 800 V bus and a 400 V bus, each with a three-phase bridge, joined by three 2:1 transformers in wye-wye with 60 µH of leakage per phase, at 50 kHz. Each bridge makes the six-step wave, and the secondary bridge lags the primary by Phs (30 degrees), which moves about 10.4 kW to the 400 V bus; a negative Phs sends the power back. The power follows the three-phase phase-shift equation of De Doncker, Divan and Kheraluwala (1991), and with the 400 V side at its share every primary switch turns on at zero voltage. The two sides have separate grounds, with the transformers as the isolation barrier. The six modulators are the module Mod.
  • solidStateTransformer is a solid-state transformer from the 230 V, 50 Hz mains to an isolated, regulated 200 V at 1 kW. The front end is the pfcBoost stage, which draws a sine from the mains and holds a 400 V link; the isolated stage is a dual active bridge at 20 kHz through a 2:1 transformer. A PI on the output sets the bridge's phase shift phs (about 20 degrees at full load), updated once per switching period, and the power follows the phase-shift equation of dab. The output loop is much faster than the 100 Hz ripple on the link, so the output barely shows it. Each stage's control is a module: PfcCtl and DabCtl.
  • solidStateTransformerAc carries the same two stages on to an AC output: a single-phase inverter with sine PWM and an LC filter on the isolated 200 V bus makes 115 V, 50 Hz at 1 kW, so the mains reaches the load as AC through the 20 kHz link. A single-phase load takes its power at twice the output frequency; the bus capacitor (1 mF) and the bridge's loop share that 100 Hz pulsation, so the phase shift phs swings with it while the bus stays within a few volts of 200 V. The inverter's modulators are the module InvCtl.
  • psfb is a phase-shifted full bridge. A PI moves the phase between the two legs to hold 48 V from 400 V at 1 kW through a 6:1 transformer. Both legs switch at zero voltage at full load: the leading leg on the reflected load current, the lagging leg on the energy in the 30 µH series inductor. That inductor also costs a duty-cycle loss of about 0.1.
  • ucc28950Psfb is the UCC28950 data sheet's typical application (SLUSDB2B section 7.2, Figure 7-3, Table 7-1): a 600 W phase-shifted full bridge from 390 V to 12 V at 100 kHz. The IC is the library's psfbController with the UCC28950's electrical characteristics, and the parts are the ones the section 7.2.2 procedure sizes: the 2.8 mH transformer, the 26 µH shim inductor, 7.5 mF of output capacitance, and the 2.37 kΩ / 9.09 kΩ divider that sets 12.09 V. It runs at 5 A, the load the loop is compensated at; the controller runs peak current mode as the data sheet's design does, with RSUM from equation 146. Its supply and load are the connectors J1 (input) and J2 (output), which the test bench drives in a run: 390 V on J1 and a 2.4 Ω load (12 V at 5 A) on J2 (Properties › Simulation › Test bench ports). It opens with Vout, Vout ripple and Pin, the power the bench supply delivers. The synchronous rectifier is a diode bridge, and the example's description lists what else is left out.
  • uc2842Flyback is the UCx84x data sheet's typical application (SLUS223H section 8.2, Figure 8-2, Table 8-1): a 48 W off-line flyback from 115 VAC, 60 Hz to 12 V at 4 A, peak current mode at 111.7 kHz, with its loop closed on the secondary through a TL431 and an optocoupler. The IC is the library's pwmController as the UC2842 (the UCx842's 16 V / 10 V UVLO), and every part is the one Figure 8-2 prints: the 180 µF bulk, the 1.5 mH transformer with NP:NS and NP:NA of 10, the 10 nF ∥ 50 kΩ clamp, RCS 0.75 Ω with 4.2 kΩ / 100 pF, RRT 15.4 kΩ and CCT 1000 pF, the 10 nF / 24.9 kΩ slope compensation from the RT/CT ramp, 2200 µF with the 43 mΩ ESR the text gives, the 9.53 kΩ / 2.49 kΩ divider, the 88.7 kΩ + 0.01 µF TL431 zero, RLED 1.3 kΩ and the 10 kΩ ∥ 10 nF error-amplifier pole. It opens with Vout (12.06 V by hand), Vout ripple, Isw peak (below equation 18's 1.36 A) and Isw rms (below equation 19's 0.97 A). The ripple is about 0.4 V, almost all of it the ESR carrying the rectifier's current step: more than Table 8-1's 100 mV, which the printed 2200 µF and 43 mΩ without a post filter do not give. The soft-start network, the gate and VCC clamps, the transformer's leakage and the optocoupler's part are not printed, and the example's description lists each.
  • ucc28c42Flyback is the UCCx8C4x data sheet's typical application (SLUS458I section 8.2, Figure 8-3, Table 8-1): the same 48 W off-line flyback class, 115 VAC, 60 Hz to 12 V at 4 A, around the BiCMOS UCC28C42 (the library's pwmController with its 14.5 V / 9 V UVLO and 1 V current-sense limit). Every part is the one Figure 8-3 prints, and where it differs from the UC2842 design it is the BiCMOS sheet's own: RCSF 3.8 kΩ for the 1.9 V RT/CT ramp of equation 37, the 420 kΩ start-up resistor and the 18 V Zener on VDD; the rest is the 180 µF bulk, the 1.5 mH transformer with NP:NS and NP:NA of 10, RCS 0.75 Ω, RRT 15.4 kΩ and CCT 1000 pF, 2200 µF with 43 mΩ ESR, the 9.53 kΩ / 2.49 kΩ divider, the 88.7 kΩ + 0.01 µF TL431 zero, RLED 1.3 kΩ and the 10 kΩ ∥ 10 nF error-amplifier pole. It opens with Vout (12.06 V by hand), Vout ripple, Isw peak (below equation 12's 1.36 A) and Isw rms (below equation 13's 0.97 A). The data sheet gives no oscillator equation, so U1 keeps the UCx84x's 1.72/(RT·CT) = 111.7 kHz against the text's 110 kHz; the soft-start network, the transformer's leakage and the optocoupler's part are not printed, and the example's description lists each.
  • qrFlyback is a quasi-resonant flyback, 325 V to 12 V at 2 A. After the core has given its energy to the output, the drain rings, and the switch turns on in the first valley of that ringing, at about 226 V instead of 426 V. A voltage loop sets the on-time; the frequency follows the load (83 kHz at full load).
  • activeClampFlyback is an active-clamp flyback, 375 V to 20 V at 5 A (100 W) and 120 kHz, with two C3M0060065D switches and a 6:1 transformer with 3 µH of leakage. The clamp switch Qc and the 1 µF clamp capacitor Cc sit across the primary; Qc is gated as the complement of Q1 with a 250 ns dead time. The leakage energy rings into Cc and on to the output instead of heating a resistor, the clamp holds vc near 126 V, so the drain v(SW) peaks near 504 V, and the magnetising current i(T1.Lm) falls to −0.65 A before Qc turns off. That negative current discharges the drain within the dead time, so Q1 turns on at zero voltage. A PI (module Ctrl) holds v(VOUT) at 20 V. Replace Qc by a diode and put a resistor across Cc to see the resistor clamp: the drain peaks higher and Q1 turns on hard.
  • cllc is a CLLC resonant converter between two 400 V sides at 2 kW: two SiC full bridges, a 1:1 transformer and the same resonant tank on each side. Both bridges switch together at the resonant frequency, so it works as a DC transformer, every primary switch turns on at zero voltage, and power flows to whichever side is loaded.
  • srcConverter is a full-bridge series-resonant converter: a 390 µH and 6.8 nF tank (97.7 kHz) and a 2:1 transformer into a diode bridge and 20 Ω. The first-harmonic approximation gives its gain, M = 1/√(1 + Q²·(fn − 1/fn)²) with Q = 3.69. It runs at 1.15 times resonance by default, about 133 V out, with every switch turning on at zero voltage; set fnorm to 0.9 and the output rises to about 164 V, but the tank current now leads and the switches turn on hard. At resonance the output is about 198 V, the input over the turns ratio.
  • inductionHeating is a half-bridge induction heater: 325 V, a 100 nF capacitor and a 270 µH work coil with the workpiece's 12 Ω, resonant at 30.6 kHz. A comparator on the coil current drives the gates, so the bridge switches at the current's zero crossings and the frequency follows the resonance by itself: change Lw and it moves with it. The coil current is about 17 A peak and the workpiece takes about 1.76 kW.
  • wptSeriesSeries is an inductive wireless power transfer link at 85 kHz, the SAE J2954 frequency. A full bridge drives a primary coil, and a secondary coil across an air gap picks up the field; the coupling factor k is 0.2, far below a transformer. Each coil is tuned by a series capacitor (series-series compensation), so the link behaves as a current source: the secondary current is V1/(ω·M) whatever the load, about 5 A peak, and the 10 Ω load gets about 31 V and 100 W. Set k to 0.1 and the output current doubles while the primary current grows four times; double Rload and the output voltage doubles at the same current. Each coil carries its winding resistance (Rc1, Rc2, from a quality factor Q of 300), so the link passes about 96 % at k = 0.2. To see efficiency against coupling, run Analysis › Parameter Sweep on k (say 0.1 to 0.3) with two measures, meanProduct of vab and i1 (power into the link) and meanProduct of v2 and i2 (power into the rectifier): their ratio follows η = Rac/(Rac + Rc2) · (ω·M)²/((ω·M)² + Rc1·(Rc2 + Rac)), falling to about 93 % at k = 0.1 as the primary current grows.
  • wptSeriesParallel is the same 85 kHz link with series-parallel compensation: the primary keeps its series capacitor, but the secondary coil is tuned by a capacitor across it and feeds the diode bridge through a 1 mH inductor. The primary capacitor is tuned to L1·(1 − k²), not to L1, because the parallel secondary reflects a capacitive part into the primary; with it the bridge sees a pure resistance (M/L2)²·Rac and switches at zero current. The output is now a voltage source: the tank voltage is V1·L2/M, about 108 V peak at k = 0.2, whatever the load, so the 32 Ω load gets about 65 V and 135 W. Double Rload and the output voltage stays while the primary current halves; set k to 0.1 and the output voltage doubles. Sweep k with Analysis › Parameter Sweep, measuring meanProduct of vab and i1 and of v2 and ir: the efficiency goes from about 96.5 % at k = 0.2 to 92 % at k = 0.1, as the two mesh equations of the link say.
  • wptDoubleLcc is the same 85 kHz link with double-sided LCC compensation: on each side a series inductor Lf (30 µH), a capacitor Cf across the network tuned with it, and the coil with its series capacitor tuned to L − Lf, so no part depends on k. The primary coil then carries V1/(ω·Lf1) whatever the load or the coupling, and the rectifier is fed M·V1/(ω·Lf1·Lf2), a current source: 50 V in gives 38 V and 74 W into 20 Ω at 96.4 % link efficiency. Halving k halves the output current but leaves the primary current alone. The square rectifier voltage drives a third harmonic through Lf2, so v2 leads the fundamental of io by about 15°, and the bridge sees that same angle. Plot i1, io and v(out); sweep k with meanProduct(vab, iin) and meanProduct(v2, io) for the efficiency curve.
  • wptRobotDock is a wireless charging dock for the 13S4P lithium-ion pack of amrRobotSystem (Samsung SDI INR21700-50E cells: 4.9 Ah and 14 mΩ each): a series-series link at 85 kHz (60 µH coils, k = 0.25 for the parked robot) charges the pack straight from its diode bridge, with no converter on the robot. The tuned link makes the secondary current V1/(ω·M) whatever it feeds, so 48 V in charges the pack at 4.7 A (about 230 W, 97 % link efficiency) at 20 %, 50 % or 90 % charge alike: the constant-current stage of a lithium-ion charge comes from the link itself. Misalignment lowers k and raises the current as 1/k (7.65 A at k = 0.15), so a real dock must cut or lower Vdc when the robot parks off its pad, and to end the charge at constant voltage. Plot i1, ibat and vbat; set soc0 or k to see each effect.
  • wptEvCharger is a wireless charger for an electric car in the WPT1 class of SAE J2954 (at most 3.7 kVA from the supply): a 400 V bus drives a double-sided LCC link at 85 kHz (200 µH pads, 50 µH LCC inductors, k = 0.2 for the aligned car) that charges a 96S20P pack of Samsung SDI INR21700-50E cells straight from its diode bridge. The ground pad carries V1/(ω·Lf1) = 19 A peak whatever the car does, and the pack is fed M·V1/(ω·Lf1·Lf2), so it charges at 9.1 A (3.3 kW, 96.6 % link efficiency) at 20 % or 90 % charge alike. Unlike the series-series dock above, misalignment lowers the charge current in proportion to k (k = 0.15 gives about three quarters of it) while the pad's current stays put, so a car parked off its pad charges more slowly instead of drawing more current; the series capacitors see about 1.5 kV peak. Plot i1, ibat and vbat; set k or soc0 to see each effect.

Rectifiers

  • rectifier is a half-wave rectifier.

  • bridgeRectifier is a single-phase diode bridge with a 2200 µF capacitor on a 12 V rms winding. Two diodes conduct on each half cycle, the output ripples at 100 Hz, and the winding current flows in short pulses near each crest of the line.

  • rectifier3Phase is a three-phase diode bridge with a DC-link capacitor. The DC voltage settles close to 1.35 times the line-to-line voltage.

  • scrRectifier3Phase is a three-phase six-pulse thyristor rectifier on a 400 V, 50 Hz supply with 3 mH of source inductance per phase, feeding a 100 mH smoothing inductor and a 10 Ω load. A PLL-synchronised firing unit, in its own module, fires the six thyristors at the angle alpha (30° by default). The mean DC voltage follows 1.35·VLL·cos α less the drop the source inductance causes, (3/π)·ω·Ls·Id, and each commutation takes the overlap angle µ (about 13° at 30°). Set Ed to 400 and alpha to 120 and the DC voltage turns negative: the bridge sends power back to the supply as a line-commutated inverter.

  • cockcroftWalton is a four-stage Cockcroft-Walton voltage multiplier: an ideal half bridge makes a 400 V, 50 kHz square wave (an AC peak of 200 V) and drives, through 10 Ω, a ladder of eight 100 nF capacitors and eight diodes into 160 kΩ. Unloaded, every stage adds twice the drive's peak, so the output is 2·n·Vpk = 1600 V, less two diode drops per stage (the diodes are ideal; set Vf to see the drops). Loaded, read vo: about 1512 V with a 17.5 V sawtooth ripple. The textbook gives, with I/(f·C) = 1.89 V, a ripple of n(n+1)/2·I/(f·C) = 18.9 V and a droop of the peak of (2n³/3 + n²/2 − n/6)·I/(f·C) = 94.5 V; the run's droop is 80 V, because a square wave holds its peak through each half period and the diodes keep feeding the load from the drive, so the textbook is an upper bound here. The droop grows with the cube of the stage count, which is why a ladder is not made taller. The charge passed between capacitors at different voltages is lost as heat, so the efficiency is about Vout/(2n·Vpk), 94 %. Change Rload, fsw or C with circuit.variables to watch both scale.

  • electrolyzer12Pulse is a twelve-pulse thyristor rectifier feeding a 200-cell water electrolyzer stack at about 395 V and 1.22 kA (0.48 MW). A 10 kV, 50 Hz supply feeds two transformers, one Yy0 and one Yd11, whose 200 V secondaries are 30° apart; each drives a six-pulse thyristor bridge, and the two bridges are in series. The stack is a module holding the electrolyzer part: 200 cells of 0.5 m² at 70 °C on Ulleberg's polarisation law, so its voltage rises with the activation curve, not a straight line; set Ncell, Acell and Tstack for your stack. The firing unit fires both bridges at alpha (40° by default), the delta bridge 30° earlier. The mean DC voltage is twice the six-pulse bridge's, 2·(1.35·VLL2·cos α − (3/π)·ω·Lk2·Id). Run analysis.fft on ia with fundamental 50 over whole line cycles: each secondary carries the six-pulse harmonics 5, 7, 11, 13, but in the supply current the 5th, 7th, 17th and 19th cancel and only the orders 12k ± 1 (11, 13, 23, 25) remain, at about 1/h of the fundamental.

  • electrolyzerInterleavedBuck feeds the same 200-cell stack from a 1 kV DC link, the DC side of an active-front-end supply: four buck phases at 10 kHz, their carriers a quarter period apart, into one output. The stack is stiff (84 mΩ at its operating point) and the phases share only through their few milliohms, so a 10 ns shift of one gate edge would move tens of amperes between them. Each phase therefore has its own average-current loop (the CurrentLoops module): its inductor current is sampled once a period in the middle of the on time, where it equals its average, and a PI adds to the feedforward vo/Vdc to set that phase's duty (d1 … d4). The loops hold the stack at Iref = 1.27 kA, where it takes about 399 V and the duty settles near 0.4, and they keep each phase at a quarter of it even when one switch has ten times the others' on resistance. Each inductor ripples 120 A peak to peak, but the sum io ripples at 40 kHz and only 30 A, a quarter of that; set Iref so the duty settles at 0.5 and the sum's ripple all but vanishes, since two phases are always on.

  • electrolyzerAfe is the whole active-front-end supply: a two-level IGBT bridge at 5 kHz draws 0.51 MW from a 690 V, 50 Hz grid through an LCL filter (0.5 mH on the bridge side, 100 µF damped by 0.41 Ω, 0.1 mH on the grid side, in the module LclFilter) and holds a 1.1 kV link, which feeds the four current-controlled buck phases and the 200-cell stack of electrolyzerInterleavedBuck. The link is 1.1 kV, not 1 kV, because the bridge must make the grid's 976 V line peak plus the inductors' 113 V drop and SVPWM reaches a line peak only as high as the link. The control (module AfeControl) locks a PLL to the grid, feeds the stack's power forward as the d-axis current 2·vo·io/(3·Vpk) (600 A peak), trims it with a PI on the link voltage, holds the q-axis current at zero and closes two dq current loops; the dead times are in the module GateDrive. The run starts near its operating point (the line currents and the q-axis PI preset), so expect the link to dip only to about 1050 V and to be within 1 % of 1.1 kV after about 25 ms, the line currents to be sines in phase with the phase voltages (idm 600 A, iqm 0) and the stack to take about 99.5 % of the grid's power. Run analysis.gridHarmonics on ia over the last two line cycles: the TDD is about 0.6 % and every order passes even the strictest row of IEEE Std 519-2014, Table 2, where electrolyzer12Pulse fails. The grid has its own inductance (120 µH a phase), so its short-circuit current is 25 times the rated current: give analysis.gridHarmonics that iscRatio for the row it really falls in. The filter keeps the bridge's switching ripple off the grid: at 4.9 kHz only about 8 % of the bridge-side current i(La) reaches ia, the ratio of the damped capacitor branch to the grid side (Liserre, Blaabjerg and Hansen, IEEE Trans. Ind. Appl. 41(5), 2005). Its switches and diodes name 1700 V power modules of the device library (an Infineon FF600R17ME4 per bridge leg, the IGBT and diode of an FF450R17ME4 per buck phase), so analysis.losses over the same window gives their data-sheet losses at 125 °C: about 8.7 kW in the bridge and 16.3 kW in the buck, 14 kW of it switching, since 10 kHz is fast for a 1700 V IGBT. With every loss counted the stack takes about 95 % of the input; the circuit itself still passes 99.5 %, because the switching energies are counted rather than drawn from it. Side by side, at the same 0.5 MW stack: on ia over whole line cycles, analysis.gridHarmonics at each row of IEEE Std 519-2014, Table 2 (pulseNumber 12 for the twelve-pulse rectifier), and the power factor P/(Vrms·Irms) of phase a.

    Supply TDD Table 2 rows passed Power factor
    electrolyzer12Pulse (α = 40°) about 13 % none, not even Isc/IL ≥ 1000 with the √(q/6) allowance about 0.73, cos(α + μ/2)·0.989
    electrolyzerAfe about 0.6 % all five, Isc/IL < 20 included over 0.99

    At the front end's own grid (Isc/IL = 25, row 20–50) the twelve-pulse current fails its TDD limit of 8 % and its 11th harmonic (about 9 % of IL against 3.5·√2 = 4.9 %). Its power factor follows the firing angle and the overlap μ (Mohan, Undeland and Robbins, ch. 6), so a thyristor supply also needs reactive compensation that the front end does without. crates/engine/tests/example_electrolyzer_supplies_ieee519.rs checks these figures (slow tier).

  • viennaRectifier is a three-phase Vienna rectifier: a diode bridge with one switch per phase and a split DC link. It draws 5 kW at unity power factor from a 400 V grid and holds the link at 800 V, with dq current control and a DC voltage loop.

Inverters

  • halfBridge and inverter3 are a half bridge and a three-phase inverter with sine-triangle PWM.
  • inverter3Thermal adds dq current control and a thermal model for every device.
  • fullBridgeSpwm is a single-phase full bridge with sine PWM and an LC filter. It makes a 50 Hz output of about 320 V peak from a 400 V link.
  • upsInverter is the island-mode inverter of an online UPS: a 400 V full bridge with unipolar PWM at 20 kHz and a 1 mH, 20 µF LC filter make 230 V rms at 50 Hz. A proportional-resonant voltage loop (with load-current feedforward) runs around a proportional inductor-current loop, both in the upsControl module. The load steps from 500 W to 1 kW at 65 ms and a diode rectifier with a 220 µF capacitor comes on at 120 ms. Read vo against vref: the output holds 230 V rms within 1 % with a THD of about 0.2 % on the linear load and under 1 % with the rectifier, and the load step costs a dip of about 6 V that is gone within 2 ms. The Vout rms and Vout rms rect measurements read the RMS at 1 kW and with the rectifier.
  • upsOnline is an online (double-conversion) UPS around upsInverter's bridge, filter and control: the 230 V, 50 Hz mains, a 1:1.4 input transformer and a diode bridge charge a 1 mF link to about 436 V, and a 96-cell lithium-ion battery (about 393 V at rest) sits on the link behind a diode. Smains opens at tFail = 100 ms: the link falls onto the battery within about 20 ms and the battery takes the 1 kW load (ibat goes from zero to about 2.6 A), while vo stays at 230 V rms with a THD under 1 % in both modes. The run has no charger, so the battery only discharges. To stage the failure (or the return of the mains) as an IEC 62040-3 mode transfer, set tFail past the run and run Analysis › UPS Mode Transfer Test (analysis.upsTransferStage) on Vmains: the output stays within curve 1 both ways. With Ncell at 70 (286 V, under the output's 325 V peak) the output clips on the battery and fails every curve.
  • sogiPllInverter is a 3 kW single-phase grid-tied inverter whose point is its grid synchronisation. A SOGI-PLL, built from integrators and products in the Pll module (sogiPll), locks to a 230 V, 50 Hz grid that carries a 3 % 5th harmonic (h5), sags by 30 % from 0.1 s to 0.15 s and steps to 51 Hz at 0.2 s; the Ctl module (gridCurrentCtl) sets the grid current with a proportional-resonant controller and grid-voltage feedforward. Read perr (the PLL's phase error, degrees) and fpll: before the sag the error stays under 0.2°, the frequency estimate is within 0.2 Hz of 51 Hz 60 ms after the step, and the grid current ig has a THD of about 2 %. Set the variable ksogi to 0 and the PLL never follows the step. The Grid current rms and Injected power measurements read the current and pg before the sag.
  • npcInverter is a three-level neutral-point-clamped inverter on a split 800 V link. Each phase has four switches and two clamp diodes, so the output takes three levels and every switch blocks only half of the link. Sine PWM makes a line-to-line voltage of 554 V peak at 50 Hz.
  • flyingCapInverter is a single-phase three-level flying-capacitor leg on a split 800 V link. A 47 µF capacitor between the two upper and the two lower switches makes the middle level; the two switch pairs compare the same sine reference (index 0.8) with 10 kHz carriers half a period apart, so the two middle states last equally long, the capacitor holds 400 V by itself, and the output's first harmonics sit at 20 kHz, twice the carrier. The output is 320 V peak at 50 Hz into 16 Ω and 10 mH (3.1 kW). The modulator and the capacitor's sensing (vfc, and vfcPu per unit) are in the module Ctrl.
  • anpcInverter is a single-phase three-level active NPC leg: the NPC leg with two clamp switches in place of its diodes, on the same link and load. A switching-state table of six formula blocks drives the gates; the variable zs picks the zero state, so with zs = 0 the outer switches commutate at 10 kHz and with zs = 1 the inner ones do, which moves the switching losses with the same output. The midpoint drift of the link capacitors is vnp.
  • tTypeInverter is a three-level T-type inverter on the same kind of split 800 V link. Each phase is a two-level leg of 1200 V SiC switches plus a bidirectional switch of two 650 V SiC switches from the output to the midpoint, so the output takes three levels with four switches and no clamp diodes. Sine PWM with a modulation index of 0.9 makes a line-to-line voltage of 624 V peak into an 8 kW load. Each phase has its own modulator module.
  • fourLegInverter is a four-leg three-phase inverter on an 800 V split DC link feeding an unbalanced resistive star load: 100 %, 50 % and 20 % of a 10 kW rating on phases a, b and c (ka, kb, kc), through a 2 mH, 20 µF filter per phase, at 20 kHz with 100 ns of dead time. The fourth leg drives the load neutral. Its modulator (a module, gates by label) adds a common offset, minus the mean of the largest and the smallest phase reference, to the three phase references and gives the fourth leg that offset alone, the carrier-based form of 3D space-vector modulation (Zhang, Prasad, Boroyevich and Lee, IEEE Trans. Power Electron. 17(3), 2002). Each phase leg minus the neutral leg then averages its own 230 V rms reference whatever the load: va, vb and vc read 226.8, 231.0 and 230.0 V rms with 14.4, 7.4 and 3.3 A, and the neutral leg carries their sum back, ineutral = 10.1 A rms. The circuit variable legs = 3 stops the fourth leg and leaves the neutral floating: the star point moves and the phases read 158, 243 and 317 V. legs = 3 with split = 1 ties the neutral to the link's midpoint instead: the neutral current then flows through the two link capacitors, and with 1 mF each phase b sags to 214 V (Cdc = 4.7m brings it to 226 V). 400 V of link could not make 230 V rms: with a fourth leg the phase peak is at most Vdc/√3.
  • chbInverter is a five-level cascaded H-bridge inverter. Two H-bridge cells, each on its own isolated 400 V source, are in series, so the output takes the levels 0, ±400 V and ±800 V. Each cell uses unipolar sine PWM at 2.5 kHz, and the carrier of the second cell is shifted by a quarter period (π/N for N = 2 cells). The first harmonics of the output then sit at 2·N·fc = 10 kHz, four times the switching frequency of each switch. With a modulation index of 0.9 the fundamental is 720 V peak into a 5.4 kW RL load, and each cell delivers half the power. The modulator is one module whose pins are the eight gates. Plot vo, io and v(mid), the output of the second cell.

Motor drives

  • imVf, imIfoc, pmsmFoc, pmsmSmo and dcMotor are the drives of chapter 10.
  • imDtc is direct torque control of the induction motor of imIfoc, after the classic scheme of Takahashi and Noguchi. A flux estimator integrates the measured stator voltage minus the resistive drop. Two hysteresis comparators, one for the flux and one with three levels for the torque, pick the next switching state of the inverter from a table every 10 µs. There is no current loop and no PWM. The motor is first magnetised for 0.15 s. Then the torque reference is 2 N·m, and at 0.25 s it steps to 5 N·m. The torque follows within about a millisecond, and the stator flux stays in its band of 0.5 ± 0.01 Wb. Plot Te(M1) with Tref, and psis.
  • bldcSixStep drives a brushless dc motor with six-step commutation. The Hall signals of the machine pick the two phases that conduct, and a speed PI sets the duty cycle until the motor reaches 150 rad/s.
  • stepperMicrostep drives a NEMA 17 class two-phase stepper from 24 V through two H-bridges. A hysteresis chopper holds each winding current to a sine and cosine microstep table (1/8 step by default, MS = 1, 2 or 8), and the rotor turns one 1.8° step per 8 table steps, one turn per second.
  • srmDrive drives a three-phase 6/4 switched reluctance machine from 48 V. Each phase has an asymmetric half bridge. A position sensor gives the electrical angle, a table opens each phase for 120° while its inductance rises, and a hysteresis comparator holds the current at 8 A by chopping. The phases take turns, the average torque is about 0.88 N·m, and a fan load brings the speed to about 98 rad/s in 1.5 s.
  • dcMotor4q is the four-quadrant dc drive: a maxon RE 40 (article 148867, 24 V) on a bipolar-PWM H-bridge from a 24 V bus, with a 20 kHz current PI inside a speed PI, a 20 A limit and a reference that ramps to +400 rad/s, then to −400 rad/s. The bus sits behind a diode that cannot pass current back, so braking through zero charges the 2 mF link (second quadrant, negative armature current at positive speed) and a brake chopper clamps it below 28 V.
  • matrixConverter is a three-phase direct matrix converter. Nine bidirectional switches, each two MOSFETs in anti-series, join every input phase of a 400 V, 50 Hz supply to every output phase, with an LC filter on the input and a star RL load on the output. Venturini's modulation gives each switch its share of every 10 kHz period, m = (1 + 2·v_in·v_out/V_im²)/3, so each output averages a 30 Hz sine at half the input voltage, about 16 A in the load, while the supply current stays a 50 Hz sine. In each output exactly one switch is on at a time, never two (a short between input phases) and never none (an open inductive load); the monitor mon stays at zero.
  • amrRobotSystem is a whole autonomous mobile robot's electrical system over a 40 s pick-and-return task: 10 m to a shelf with a 90° turn on the way, a 15 kg payload lifted 0.5 m, held and lowered, and 10 m back with it, taking the corner the other way. A 13S4P pack of Samsung SDI INR21700-50E cells (47.2 V nominal, 19.6 Ah) feeds a 48 V bus with two wheel drives (maxon EC 45 flat motors through a 20:1 gear on 75 mm wheels, 0.5 m apart), a lift joint (the same motor on a 5 mm ball screw), a turntable joint (the same motor through a 50:1 gear, turning the set-down payload a quarter turn before the robot drives back) and three rails: 48 → 24 V for the actuators, 48 → 12 V for the compute and 12 → 5 V for the sensors. The pack's BMS (a TI BQ76952 driving two CSD19536KTT FETs back to back) opens its discharge FET below 2.5 V per cell or above 39.2 A, and its charge FET above 4.2 V per cell or 19.6 A into the pack, the cells' data-sheet limits; a trip latches, and the open FET's body diode still passes the other direction. Over the task both FETs stay on and lose 0.15 J; gdsg and gchg show their gates. Lower Iocd or Vov to watch a protection trip. Every drive and converter has an undervoltage lockout on the bus (uven): it stops below 29.9 V (Vlo, 2.3 V per cell, under the BMS's trip) and restarts above 32.5 V (Vlon), so once the BMS cuts the pack off the loads drain the bus capacitor only down to the lockout and the bus then holds. Each stage is an averaged module joined by labels: the motors' copper loss and the EPC2302 bridges' conduction loss are in, switching, iron and friction losses are not yet. Braking and lowering send energy back to the pack. On the turns the inner wheel slows to 0.75 m/s and the outer one speeds up to 1.25 m/s, so as a turn begins one drive brakes into the bus while the other draws: plot pL with pR. Over the task the pack gives 1.90 kJ: the wheels take a net 18 J, the lift 66 J (holding the payload costs its copper loss; lowering returns the lift's 74 J of potential energy), the turntable about 1.2 J (the turn starts and ends at rest, so only its ramps' copper loss remains), the 24 V rail 0.50 kJ and the 12 V rail with the 5 V one 1.32 kJ. The charge falls from 80 % to 79.95 %, and Meter.runtime gives 15.5 h at the task's mean power. crates/engine/tests/amr_robot_system.rs checks the wheel, lift and turntable energy against their equations, each wheel's speed on the turns and the quarter turn they give, the pack's energy against its consumers and its charge against its current, the FETs' loss against their resistance, both protections tripping, and the lockout stopping every load once a tripped pack leaves the bus to its capacitor. The run takes 1 ms steps and finishes in under a second. The task repeats every Ttask = 40 s, so simulation.batteryRun with cycle 40 and model asDrawn runs a whole shift in whole tasks: two hours take 13 tasks on the solver and 6 jumps, and the charge falls to 70.5 % (chapter 4, "A repeating mission"). The switched drives and converters follow.
  • amrRail12Gan runs the 48 V to 12 V rail of amrRobotSystem switched, beside the averaged rail the system uses: a 500 kHz synchronous buck of two EPC EPC2302 GaN switches with 20 ns of dead time, 10 µH and 47 µF, on the 52 V bus into the same 25 W load, over 3 ms. The switched rail holds 12 V with a 1.9 A inductor ripple and draws 25.15 W where the averaged one draws 25.006 W: 99.4 % against 99.98 %. The difference is the GaN switch conducting in reverse at 3.3 V through each dead time, 2·td·fsw·3.3 V·Iout = 0.14 W, which the averaged model leaves out. Gate charge, output capacitance and inductor losses are not modelled, so the real rail loses more still. The load is a 5.76 Ω resistor rather than a constant-power load: a constant-power load is a negative resistance that makes the undamped output filter ring up.
  • amrRail24Gan does the same for the 48 V to 24 V actuator rail, at the 30 W it carries while the gripper holds the payload: the same two EPC2302 switches, 500 kHz and 20 ns, with 47 µH and 22 µF so that the 19.2 Ω load damps the filter (Q of 13 at 4.95 kHz, against 41 with the 12 V rail's 10 µH and 47 µF). The switched rail holds 24 V with a 0.55 A ripple and draws 30.09 W where the averaged one draws 30.002 W: 99.7 % against 99.99 %. At half the 12 V rail's current, the conduction loss the average keeps falls to a quarter, while the dead-time loss, 0.083 W, falls only to about half, so the higher the rail's voltage at the same power, the larger the share of the loss the average leaves out.
  • amrRail5Gan switches the 12 V to 5 V sensor rail, fed from the 12 V rail, at its 8 W: the same two EPC2302 switches, 500 kHz and 20 ns, with the 12 V rail's 10 µH and 47 µF (Q of 6.8 at 7.3 kHz into 3.125 Ω) and a trimming integrator four times stronger, since a 12 V input gives the loop a quarter of the 52 V bus's gain. The switched rail holds 5 V and draws about 8.11 W where the averaged one draws 8.004 W: 98.7 % against 99.96 %. Relative to the power, the dead-time loss is 2·td·fsw·Vrev/Vout, and the GaN channel's 3.3 V reverse drop is two thirds of 5 V, so this rail loses 1.3 % of its power to the dead time, against 0.55 % on the 12 V rail and 0.28 % on the 24 V rail.
  • amrWheelGan runs the left wheel drive of amrRobotSystem switched, beside the averaged wheel module the system uses: three legs of EPC2302 GaN switches at 40 kHz with 50 ns of dead time drive the maxon EC 45 flat motor under robotJointServo's field-oriented current loop, on the 52 V bus, at the end of the task's first acceleration (1 m/s, 0.5 m/s², carrying the payload). The current reference is the averaged module's torque over the torque constant, 0.476 A at 340 Hz, and the shaft is held at the operating point's speed. Over the last 5 ms of a 10 ms run the switched drive draws 15.571 W where the averaged module draws 15.564 W, 0.04 % apart: the motor's own copper loss, 1.17 W, dwarfs the bridge's conduction and the 12 mW the GaN switches lose conducting in reverse through the dead times, so the averaged model the system runs for its 40 s task leaves out little. Iron and friction losses are in neither model.
  • amrLiftGan does the same for the lift joint while it raises the 15 kg payload at 0.1 m/s on the 5 mm-lead ball screw: the averaged liftJoint module's torque, 117.1 mN·m at 125.7 rad/s, over the torque constant gives the switched FOC drive's 1.032 A at 160 Hz. The run is 12.5 ms and the last 6.25 ms are one whole electrical period. There the switched drive draws 20.24 W where the averaged module draws 20.21 W, 0.15 % apart: the motor's copper loss, 5.50 W, is 27 % of the power lifting, more than three times the wheel's share, and the dead time costs 26 mW. Iron and friction losses and the screw's efficiency are in neither model.
  • amrTurntableGan does the same for the turntable joint at the end of its first ramp, where it works hardest: the set-down 15 kg box (0.3125 kg·m²) reaching 2 rad/s while still speeding up at 10 rad/s² through the 50:1 gear. The averaged turntableJoint module's torque, 71.6 mN·m at 100 rad/s, over the torque constant gives the switched FOC drive's 0.631 A at 127.3 Hz. The run is two electrical periods, 15.71 ms, and the tests read the second. There the switched drive draws 9.24 W where the averaged module draws 9.21 W, 0.34 % apart: the motor's copper loss, 2.06 W, is 22 % of the power, between the wheel's share and the lift's, and the dead time costs 16 mW. Iron and friction losses and the gear's efficiency are in neither model.
  • robotJointServo is a robot-joint servo drive. A 48 V link feeds a three-phase inverter of EPC2302 GaN FETs switched at 40 kHz. It drives a maxon EC 45 flat motor (the 48 V winding, 402687) through a 50:1 strain-wave gear into a 0.025 kg·m² joint load. An 18-bit encoder on the motor closes three cascaded loops, all in one control module joined to the power stage by labels: a 2 kHz current loop on currents sampled once per PWM period, a 200 Hz speed loop and a 20 Hz position loop. The joint moves 0.2 rad at 2 rad/s, then takes a 1 mrad fine step and a 5 N·m load step. analysis.loopGain measures each crossover within a few percent of its design value, and the steps follow the linear cascade.
  • regenBrake brakes an AMR wheel (10 kg on a 75 mm wheel through a 20:1 gear, 1 m/s) to rest in 0.4 s with the 48 V GaN drive of robotJointServo. The battery's BMS has opened its charge FET, so the bus cannot send energy back and the 1 mF link would climb to about 100 V. A brake chopper (a 10 Ω resistor switched by a GaN FET, on above 58 V, off below 56 V) holds the link in its band. Of the 5.6 J of kinetic energy, the windings take 1.8 J and the brake resistor 3.5 J.
  • evDriveCycle drives a mid-size electric car over the FTP-75 urban schedule (the EPA's UDDS speed trace, 1369 s and 11.99 km, stored with its source). The car is the EPA test-car-list sedan of 5000 lb test weight with its coast-down coefficients A, B and C; the wheels must give m·dv/dt + A + B·v + C·v². A 96S46P pack of INR21700-50E cells (348 V nominal, 78.5 kWh) supplies that wheel power through an ideal traction drive, a controlled current source on the HV bus. While the car brakes, the battery management lets back only what the cells allow: at most their 4.9 A maximum charge current each and no more than holds each cell at its 4.2 V charging voltage; the friction brakes take the rest (Meter.efric, with Meter.eregen and the regen share Meter.regen). A 12 V system hangs on the HV bus: an averaged 3.6 kW DC-DC (TI TIDA-020031, at its 95 % full-load efficiency target, up to 300 A) feeds 400 W of low-voltage loads, 1.5 kW from 300 s to 360 s, on a 4S16P battery of A123 ANR26650M1-B LFP cells (13.2 V, 40 Ah) that floats while the converter carries the loads and gives the rest above its limit (lower Ildc to see it); plot vlv, idcout and iblv. Each part is a module joined by labels: the drive cycle, the road load, the drive, the 12 V system and an energy meter that gives the pack energy, the distance, the wheel energy out and back and the consumption Meter.kwh100. Over the cycle the wheels take 6.5 MJ and braking gives back 3.8 MJ (59 %), the DC-DC draws 0.65 MJ for the 12 V loads' 0.61 MJ (Meter.eldc, Meter.elv), so the pack gives 3.3 MJ, 7.7 kWh/100 km, and its charge falls from 90 % to 88.9 %. The 12 V bus stays between 13.07 and 13.33 V. At 90 % charge all of the braking stays under the limit; started full (soc0 1), the pack stays at 403.2 V, the friction brakes take 1.15 MJ and the regen share falls from 59 % to 41 %. The run takes 0.1 s steps and finishes in well under a second. This is the first part of the EV system example: the averaged inverter and PMSM with their losses, and the on-board charger follow.

Grid

  • gridTieInverter feeds a 10 A peak current into a 230 V, 50 Hz grid through an LCL filter. A phase-locked loop follows the grid, and a resonant current controller keeps the current in phase with the voltage.
  • afe3Phase is a three-phase active front end. It draws 5 kW from a 400 V grid at unity power factor and holds its DC link at 700 V, with dq current control and a DC voltage loop.
  • statcom is a STATCOM: a two-level bridge on a floating 700 V link that exchanges only reactive power with a 400 V grid. Its q-axis current steps from 0 to 20 A at 50 ms, so it supplies 9.8 kvar like a capacitor, and to −20 A at 150 ms, so it takes 9.8 kvar like an inductor. The link holds its voltage with a small d-axis current that covers the losses. Plot iqm with iqref, and ia with va.
  • svcTcr is a static VAR compensator on a weak 11 kV, 50 Hz bus (90 MVA short-circuit level, a short-circuit ratio of about 3): a delta-connected thyristor-controlled reactor (TCR, 16 Mvar at full conduction) beside a 14 Mvar capacitor bank tuned to 4.7 times the line frequency. A PI on the bus voltage sets the firing angle alpha between 90 and 180 degrees, and the TCR's fundamental susceptance follows B(α) = (2π − 2α + sin 2α)/(π·ω·Lr) (Miller 1982; Mathur and Varma 2002). An inductive load (0.5 MW, 6 Mvar) switches in at 0.7 s: the bus dips, then alpha rises from about 110 to 131 degrees and the bus is back at 11 kV within about 0.2 s. The firing control is the module SvcControl. Plot vbus, alpha, bTcr and qsvc.
  • droopLoadSharing shows two grid-forming inverters on an island: a 10 kW and a 5 kW inverter (averaged bridges) feed a 400 V, 50 Hz load bus over their own lines, each with a droop block in its control module. With the same 1 % P-f and 5 % Q-V droops they share the load 2:1, before and after a load step at 0.5 s, with no link between them, and the bus frequency falls with the load. Plot p1 with p2, q1 with q2, and w1 with w2.
  • aiPsuHoldup opens one 3 kW rack PSU (OCP Open Rack V3 48V PSU, Rev 0.96): the PFC's 400 V bulk capacitor, sized for the 20 ms hold-up at full load (1.71 mF), and the LLC stage behind it, both averaged and lossless. The mains fails at 50 ms; the bulk gives the load's 3 kW, its voltage squared falling in a straight line, and the 48 V bus stays inside 47.5–51 V until the bulk reaches 300 V (the example's choice for where the LLC stops regulating), 20 ms later. Plot vbulk with vbus.
  • aiPsuLlc opens the same PSU's DC/DC stage switched in full: a 3.3 kW half-bridge LLC from the 400 V bulk to the 50.5 V bus (Infineon AN094110 Rev 1.0: Lr 10.5 µH, Cr 465 nF split with clamping diodes, a 15:4 transformer, an 18 mΩ half bridge, synchronous rectifiers drawn as 0.62 mΩ ideal diodes). The controller module CTRL sets the switching frequency from the bus voltage through a PI and a VCO limited to 45–250 kHz, and holds the bridge off below the 350 V input UVLO. At 1 ms the load steps from 35 A to 59.4 A (3 kW) at 1 A/µs and the bus moves by about 0.3 V, within the note's 1 V. At 2 ms the mains fails; the bulk, sized by the note's hold-up equation for 20 ms at 3 kW (3.26 mF), falls towards 350 V while the LLC lowers its frequency from about 79 kHz to about 61 kHz, below the tank's 72 kHz resonance, to keep the bus within 0.2 V of 50.5 V; the bulk reaches 350 V 20.3 ms after the failure and the UVLO stops the bridge. Plot vbus with vbulk, and fsw.
  • aiPsuPfc opens the same PSU's PFC stage switched in full: a 3.3 kW totem pole from the 230 V, 50 Hz line to the 400 V bulk (Infineon AN205739 V1.0: a 500 µH choke, a 65 kHz fast leg of 62 mΩ SiC MOSFETs, a return leg of 17 mΩ MOSFETs drawn as ideal diodes, 1.88 mF of bulk). The controller module CTRL runs average current mode with duty feed-forward: a PI on the bulk voltage, its 100 Hz ripple taken out by a notch and crossing over at the note's 35 Hz, sets the peak ipk of the line current, and a fast PI makes the current follow the line voltage. At full load the bulk sits on 400 V with 14 V of ripple and the power factor is above 0.99. At 42.5 ms the line is lost for 10 ms: the bulk falls to about 350 V, above the 300 V trip, and comes back to 400 V. At 110 ms the load drops to 10 % and at 180 ms it steps to 90 % at 0.2 A/µs; the bulk stays within 379–419 V. Plot vdc with iac and vac, and ipk.
  • aiServerVrm opens the power below the rack bus, switched in full: the intermediate bus converter (module IBC) and a 16-phase GPU core regulator. The IBC is the fixed 4:1 48 V → 12 V converter of Liang et al., CPSS Trans. Power Electron. Appl. vol. 7 no. 3 (2022), Table IV (97.92 % efficient at 720 W), drawn as an ideal 4:1 transformer behind the resistance that loses that 2.08 %, two modules sharing the rail and drawn as one, from the 50.5 V bus of aiRackWorkload. The regulator is 16 modules PH1 to PH16, each a 1 MHz synchronous buck phase (Infineon BSC0902NS high side and BSC0901NS low side, the paper's 85 nH, 0.39 mΩ inductor, the TI TPS28225's 14 ns dead time) with its own current loop; their carriers are 1/16 of a period apart, so the ripples largely cancel at the core. The controller module CTRL holds the core at 0.8 V with a PI that sets the phases' common current reference iref. On the core sit 200 Murata 47 µF MLCCs (ESL 0.82 nH each, from the self-resonance) and ten Panasonic 1000 µF polymer capacitors. The GPU (Igpu) steps from 650 A to 1000 A at 1000 A/µs at 30 µs, holds 35 µs and steps back. Through both edges the core stays inside 10 % of 0.8 V (0.72–0.88 V) and settles within 2 %; the phases share the current; the IBC is about 99 % efficient at the run's current and the regulator about 86 %; the voltage loop crosses over near 95 kHz with about 57° of phase margin. Plot vcore with igpu, iL1 with iL9, and v12s.
  • aiServerChain opens the whole chain on one rack bus slot, through a mains failure: a 3 kW PSU (module PSU, averaged as in aiRackWorkload), a 3 kW battery backup module (an 11S6P pack of 1.5 Ah cells and a 150 kHz boost to 48 V, after Analog Devices' ORv3 BBU design article; controller module BBUCTRL), the 4:1 IBC to 12 V (module IBC) and the GPU core regulators averaged (module VRM), feeding three GPUs on the training workload. The mains fails at 5 ms; once the PSU's hold-up is over the BBU holds the bus at 48 V and carries every swing of the workload, the bus never below 46 V. The default run is the 30 ms hand-over, switched; simulation.batteryRun {tEnd: 240} runs the BBU's 4 minutes on the averaged model in a few seconds of solver time, the pack falling from full to about 64 %. Plot vbus with ipsu and ibbu, and soc.
  • aiRackHvdc opens an AI rack fed at ±400 V DC (800 V pole to pole) instead of from AC. A power sidecar (module Sidecar, after the OCP Diablo 400 rack specification 0.7.0: each rail 410 V at no load and 400 V at full load, Table 4) feeds six 18 kW ±400 V to 50 V PSUs (module PSU, after the OCP ±400 V to 50 V 18 kW PSU specification 1.0.0: 50 V at no load, 49 V at full load, at least 97.5 % efficient at full load, a 6 ms hold-up), which carry a 90 kW GPU training workload on a 60 mF bus. The PSUs draw from the rails only while their input is inside ±380 V. At 1.1 s the DC feed is lost: the PSUs hold the bus for 6 ms from their own bulk capacitors, signal the loss to the 50 V battery backup (module BBU) 1 ms after it, and the BBU ramps up in 5 ms and carries the load from then on. The bus stays on the droop line, between 48.5 and 50 V, throughout. Plot vbus with ipsu and ibbu, and vin with iin.
  • microgridIslanding is a microgrid that loses its grid. A 10 kW battery inverter forms the voltage with a droop block set to 2 kW, a 6 kW PV inverter follows the bus with a phase-locked loop, and the local loads take about 12 kW. While the grid is connected it holds 50 Hz, so the battery delivers its set point and the grid supplies the rest. At 0.5 s the grid breaker opens: the battery takes over what the grid supplied, the island settles at about 49.83 Hz on the battery's droop line within 0.1 s, and the PV keeps delivering. Plot p1 with ppv and pgrid, and w1 with wpv.
  • microgridResync is the same microgrid going back onto the grid. The island forms at 0.5 s; from 1 s a synchroniser module (SyncCtrl) measures the phase angle between the bus and the grid side of the tie and, through a PI, shifts the battery's droop until the island runs in step with the grid. A sync check closes the tie once the frequency, voltage and phase-angle differences are within 0.3 Hz, 10 % and 20° (IEEE Std 1547-2003, clause 4.1.3, Table 5, for 0 to 500 kVA); the synchroniser waits for 1° (dphiClose) to keep the surge small. The tie closes at about 1.6 s, and the battery then hands the load back to the grid and returns to its 2 kW set point. Plot dphi with tie, w1, and p1 with pgrid.
  • vsmLoadSharing is the same island with a vsm block (a virtual synchronous machine with an inertia constant of 2 s) in each control module instead of the droop. The steady state is the droop's: 2:1 sharing on the same droop line. After the load step the frequency falls gradually, slowed by the virtual inertia, and settles in about 0.15 s. Plot w1 with p1.
  • hvdcMmc is a point-to-point HVDC link. Two three-phase MMC stations of arm-averaged arms, each on its own 220 kV grid, are joined by a 100 km, ±200 kV overhead line drawn as two pi-section lines. Station A sets the power: it ramps to 400 MW and then reverses to −200 MW, while the DC voltage keeps its polarity. Station B holds the DC voltage at 400 kV. The difference between PA and PB is the line's loss.
  • lccHvdc12Pulse is a line-commutated HVDC link scaled down to a few hundred volts. Each station has two transformers, one Yy0 and one Yd11, feeding two six-pulse thyristor bridges in series: a twelve-pulse converter. The two stations, each on its own 400 V grid, are joined by smoothing reactors and a DC line, with the earth as the return. The rectifier sets its firing angle with a PI so that the DC current follows its order, which steps from 8 A to 10 A at 0.2 s. The inverter fires early enough that each thyristor it turns off keeps 18° of reverse voltage, its extinction angle. Each station's DC voltage follows 2·(Vd0·cos α − (3/π)·ω·Lk·Id), the overlap of about 24° shows in the thyristor currents, and the supply current has the 11th and 13th harmonics but almost none of the 5th and 7th.

Renewable energy

  • pvMppt is a solar charger. Two modules in series feed a boost converter that charges a 104 V battery. A perturb-and-observe tracker moves the duty cycle step by step until the array gives its most power, about 558 W.
  • qzsiInverter is a quasi-Z-source inverter for a PV string. A 200 V source feeds an impedance network of two inductors, two capacitors and a diode ahead of a three-phase bridge. In shoot-through intervals both switches of a leg are on, the DC link falls to zero and the inductors charge, so the bridge sees 400 V with a shoot-through duty D0 of 0.25. Simple-boost control puts the shoot-through only in the zero states, so the output is that of sine PWM: a 140 V phase peak at 50 Hz with M = 0.7. The input current never stops. Change D0 and compare vc1 and vc2 with (1−D0)/(1−2·D0)·Vin and D0/(1−2·D0)·Vin.
  • h5Inverter is a transformerless PV inverter, 400 V of PV into a 230 V, 50 Hz grid at 10 A peak (1.6 kW), with a 2 mH inductor in each line. Without a transformer the PV array's capacitance to its earthed frame (Cpv, 150 nF here, split between PV+ and PV−) closes a loop through the earthed grid neutral, and the ammeter AmL in the frame's earth path measures the leakage current ileak. The fifth switch Q5 between PV+ and the bridge opens while the bridge freewheels through its upper switches, so the bridge never connects both legs to the same rail: the common-mode voltage vcm = (va + vb)/2, measured from PV−, stays at 200 V with nothing at the switching frequency, and about 29 mA RMS leaks. Set fb to 1 and the same circuit runs as a plain full bridge with unipolar PWM: vcm then jumps between 0, 200 V and 400 V and carries (2·Vdc/π)·J0(π·M/2) = 160 V at 20 kHz, and about 1.7 A RMS leaks, 57 times as much. fb = 2 runs it bipolar, which keeps vcm steady too, at the price of a two-level output.
  • hericInverter is the HERIC transformerless PV inverter on the same PV array, grid and filter: two back-to-back switches across the bridge outputs (Q5, Q6) carry the freewheeling current while all four bridge switches are off. The floating bridge stays at half the PV voltage, since its four equal output capacitances share the charge, so vcm holds at 200 V and about 24 mA RMS leaks; with fb = 1 (bypass off, unipolar PWM) it is about 1.7 A, 68 times as much. Plot ig, vg, vcm and ileak.
  • pvMicroinverter is a module-level microinverter: one 350 W panel (the AUO PM072MW0 data sheet's 38.48 V, 9.10 A maximum power point) into a 230 V, 50 Hz grid. Two flyback cells, 1:6 and 50 kHz, half a period apart, run in discontinuous conduction with the duty Dpk·|sin(ωt)|, so each draws a power that goes as sin² and together they deliver a rectified-sine current into the film capacitor Cf; the unfolding bridge Qu1…Qu4 flips every other half cycle at the grid's zero crossings. No current loop is needed: a perturb-and-observe tracker, sampling once per line period, moves only Dpk, and the panel settles at about 348 W, 99.4 % of its maximum. The 10 mF input capacitor Cin carries the power's 100 Hz ripple (about 3 V peak to peak on the panel). The grid current has a distortion of about 3.6 % and a power factor of 0.996, and the switches and diodes take about 2.9 W. The flyback transformers are the isolation barrier. Plot vpv, ppv, ig and vg.
  • passiveBalancing4s is a pack of four lithium-ion cells in series at rest. The cells start at different charges (70 to 80 %) and differ a little in capacity and resistance. Each has a 33 Ω bleed resistor and a switch across it; the module Bal finds the lowest cell voltage and switches on the bleed of every cell more than 15 mV above it, until it is within 5 mV. The fuller cells come down to the emptiest one in about 3 s and their extra charge becomes heat in the resistors. The cell capacity is set to about 1 mAh so that this fits in a run of 6 s. Plot v1 to v4, soc1 to soc4 and the gates g1 to g4.
  • activeBalancing4s balances the same four cells with a switched-capacitor balancer. Each cell has a pole of two switches across it, and a 4.7 mF capacitor joins each pair of neighbouring poles. One 1 kHz clock flips every pole together, so each capacitor sits across one cell and then the next, and carries charge from the higher to the lower. Nothing is sensed or decided. The cells meet at the pack's mean charge (74.9 %), not at the lowest cell, and the switches lose about 4 mJ against the 0.17 mAh the bleed resistors of passiveBalancing4s burn. Plot v1 to v4, soc1 to soc4 and i(Cf2).
  • inductorBalancing4s balances the same four cells with inductors. Three buck-boost stages each span two neighbouring cells: an upper and a lower switch across the pair and a 10 mH inductor from their pole to the joint between the cells. One 1 kHz clock drives every stage at a duty of one half, so each inductor's mean voltage is half the difference of its two cells, and its current carries charge from the higher cell to the lower one; En 0 holds every switch off. As with the switched capacitors, nothing is sensed, and the cells meet at the mean charge (74.9 %), within about 2 mV by 8 s, losing under 0.01 % of the charge. Plot v1 to v4, soc1 to soc4 and i(L2).
  • hybridStorage shares a pulsed load on a 48 V DC bus between a battery and a supercapacitor. Each store has its own bidirectional buck-boost (a half bridge and a 100 µH inductor at 50 kHz): the battery is seven lithium-ion cells (about 26 V), the supercapacitor 0.1 F starting at 24 V. The load draws 5 A, with 25 A pulses for 4 ms in every 16 ms. The control module Ctrl adds the bus voltage loop to the load current and passes the sum through a low-pass filter (tauF 20 ms): the filtered part is the battery's, the rest, the pulses and their edges, the supercapacitor's, and a slow trim (Kw) has the battery bring the supercapacitor back towards Vsc0, inside its window of 18 V to 30 V. Each share goes through an average-current loop on its inductor. Read ibat: a smooth wave about 19 A that peaks at 24 A, where with Split set to 0 (battery only) it follows the load to 52.5 A, 54 % more; the battery's rms current falls from 26.3 A to 19.2 A and its mean stays the same. isc carries the pulses (about 36 A out and 18 A back), vsc swings between 23 V and 24.7 V and vbus stays within 1.5 V of 48 V. Set tauF to 50u and the filter passes the pulses on to the battery again.
  • packThermal4s is a pack of four LiFePO4 cells in series delivering 10 A for 10 minutes. Each cell's loss, I²·r0 = 1.14 W, flows into the core of its own two-node thermal model: the core's heat capacity, the conduction to the can, the can's heat capacity and the convection to the 25 °C air, all measured on a 2.3 Ah A123 26650 cell by Lin et al. (J. Power Sources 257, 2014, Table 1). The battery names its core net with its thermal param. After 10 minutes the core is 4.9 K above the air and the can 3.0 K, so a sensor on the can reads 1.9 K low; settled, they would be 5.8 K and 3.6 K. Give one cell rAge 1.5 and its core rises half as much again: the pack's hot spot. ea is 0 because the paper only plots how the resistance follows temperature; set it to have each cell's resistance follow its core. Plot T(tc1) to T(tc4), T(ts1) to T(ts4) and soc1 to soc4.
  • agedPack4s is a pack of four 75 Ah graphite/NMC cells in series, the cell of NREL's life model (Smith et al., NREL/CP-5400-67102, 2017: 75.1 Ah and 0.984 mΩ new), each aged by battery.age for 300 days of one 50 % cycle a day: three at 25 °C (soh 0.9298, rAge 1.5575) and B2 by the pack's hot spot at 35 °C (0.8648 and 2.2629). From 95 % the pack delivers 75 A (1 C) for 45 minutes. The same current takes charge out of every cell, so B2, with less capacity, falls 7.5 % faster and ends at 8.4 % while the others are at 14.4 %; it is also the lowest cell from the start, 52 mV down on its larger resistance. A BMS's undervoltage cutoff trips on B2 first, so the pack delivers only what its weakest cell holds and the rest is stranded. The rest-voltage table is the battery part's illustrative default, since the paper gives none. Age a cell for another life with battery.age and apply, or from a run with fromRun. Plot soc1 to soc4 and v1 to v4.

Power quality

  • pfcBoost is a boost power-factor corrector. It draws a sine current from 230 V, 50 Hz and holds 400 V DC for a 1 kW load. An outer loop sets the size of the current and an inner loop makes it follow the rectified voltage.
  • ucc28180Pfc is the UCC28180 data sheet's design example (SLUSBQ5D section 9.2, Figure 29): a 360 W universal-input boost PFC at 118 kHz, run at 115 VAC, 60 Hz. The IC is the library's ccmPfcController with the UCC28180's electrical characteristics, and every external part is the one Figure 29 prints: L2 327 µH, C16 270 µF, R4 32 mΩ, RFREQ 17.8 kΩ, CICOMP 2700 pF, the 1.004 MΩ / 13.3 kΩ divider, and 22.6 kΩ, 4.7 µF and 0.47 µF on VCOMP. Figure 29's 13.3 kΩ sets 382.5 V where the text's 13 kΩ gives 391 V; both are inside Table 1's 379 V to 402 V. It opens with Vout, Vout ripple (the twice-line ripple, 9.25 V by hand), Iline rms and Pline; Pline over 115 V times Iline rms is the power factor. The EMI filter, the switching losses and capacitor ESR are left out, and the example's description says so.
  • ucc28056Pfc is the UCC28056 data sheet's typical application (SLUSD37E section 9.2, Figure 26 and Table 1): the 165 W transition-mode boost PFC preregulator with a 390 V output, run at 230 VAC, 50 Hz and full load. The IC is the library's tmPfcController with the UCC28056's electrical characteristics: each on-time starts at the drain's valley, which the ZCD/CS pin finds through a divider from the drain instead of an auxiliary winding, and the COMP voltage sets the on-time with line feed-forward. Every part is the one Figure 26 prints: L3 200 µH, C16 + C17 136 µF, R9 ∥ R10 65 mΩ, the 9.72 MΩ / 24.3 kΩ ZCD/CS divider, the VOSNS divider for 390 V and the 33 nF, 180 kΩ and 1 µF COMP network. The EMI filter, the inrush parts and the VCC filter are left out (the line is ideal and VCC a 12 V source). After one run it reads Vout 388.5 V, a twice-line ripple of 10.8 V peak to peak (equation 97: 9.9 V), an inductor peak of 2.27 A and 165.5 W from the line.
  • ucc256404Llc is the UCC256404 data sheet's design example (SLUSD90F section 8.2, Table 8-1 and the section 8.2.2 procedure): a half-bridge LLC converter from a 390 V bulk to 12 V, run at the 10 A of Table 8-1's ripple row. The IC is the library's llcController with the UCC256404's electrical characteristics, and every value is the one section 8.2.2 selects: CR 30 nF, LR 85 µH and LM 510 µH (99.7 kHz), NPS 16.5, the 3 × 4.99 MΩ / 41.2 kΩ BLK divider (start at 365 V), CISNS 150 pF with RISNS 133 Ω, the 68 pF / 8.2 nF VCR divider, the 30.9 kΩ / 5.36 kΩ BW divider on the bias winding, and CLL/SS 68 nF with 549 kΩ / 316 kΩ. The data sheet gives no output capacitance, MOSFET or rectifier part, so those keep the library circuit's values; the secondary regulator and optocoupler are a PI on the output; the example's description lists each. It opens with Vout (12 V), Vout ripple (below Table 8-1's 120 mV), Ir rms (between equation 26's 0.673 A and equation 28's 1.367 A) and VCR pin pk-pk (below equation 65's 4.17 V).
  • uc3854Pfc is the UC3854 data sheet's typical application (SLUS336A section 9.2, Figure 9 and Table 1): the 250 W boost PFC preregulator at 100 kHz, run at 115 VAC, 60 Hz and full load. The IC is the library's multiplierPfcController with the UC3854's electrical characteristics: average current mode with a multiplier that follows the line through IAC and RMS feedforward through VRMS, so the input power stays the same at any line. Every external part is the one Figure 9 prints: 1 mH, 450 µF, R14 0.25 Ω, IAC 910 kΩ / 220 kΩ, the VRMS filter 910 kΩ, 91 kΩ, 20 kΩ with 0.1 µF and 0.5 µF, RSET 15 kΩ with CT 820 pF, 24 kΩ, 620 pF and 62 pF on the current amplifier, the 511 kΩ / 10 kΩ divider with 180 kΩ and 47 nF on the voltage amplifier. Where Figure 9 and its text differ, the drawn part is used (PKLMT's R12 1.6 kΩ, a 4.8 A trip, where the text computes 6 A with 2 kΩ). R7 makes the voltage loop proportional, so the output sits near 396 V at full load, above the divider's 390.75 V. It opens with Vout, Vout ripple (the twice-line ripple, 3.7 V by hand), Iline rms and Pline; Pline over 115 V times Iline rms is the power factor (0.99 in section 9.2). The EMI filter, the bias winding that supplies VCC, the MOSFET's part and capacitor ESR are left out, and the example's description says so.
  • ucc38050Pfc is the UCC38050 data sheet's typical application (SLUS515G section 8.2, Figure 19 and Table 1): the universal-line 100 W transition-mode boost PFC preregulator, run at Table 1's 85 VAC, 60 Hz and full load. The IC is the library's crmPfcController with the UCC38050's electrical characteristics: each switching cycle starts when the zero-current detector sees the inductor current end and stops when the switch current reaches the multiplier's threshold, so the line current follows the line. Every external part is the one Figure 19 prints: L1 1.0 mH, C5 560 nF, C3 220 µF, R7 0.2 Ω, the MULTIN string 1.1 MΩ + 1.1 MΩ over 15 kΩ and 1 nF from D2 and D3, CS 330 Ω with 1 nF, the 1.02 MΩ / 6.34 kΩ divider (404.7 V), 11.5 kΩ with 1 µF and 120 nF on COMP, ZCD 22 kΩ with 18 pF, and the 10 Ω gate resistor. Figure 19 prints no turns ratio for the auxiliary winding, so it is sized by the data sheet's ZCD rules (1/15). It opens with Vout, Vout ripple (the twice-line ripple, 2.98 V by hand), Isw peak (equation 3's 2·√2·PIN/VAC, about 3.4 A) and Pline. There is no line-current RMS row: with only C5 before the bridge, the line current carries the triangular switching current itself. The bias winding that supplies VCC, the IRF840's own data, the fuse and capacitor ESR are left out, and the example's description says so.
  • crmPfc is a critical-conduction-mode boost corrector for 150 W at 400 V. The on-time is the same in every switching cycle, and an auxiliary winding on the boost inductor starts the next cycle once the inductor current is back at zero. The average current then follows the line voltage with no current loop, and the switching frequency moves over the half-cycle, from about 42 kHz at the mains peak to several times that near the zero crossing.
  • interleavedPfc is a two-phase interleaved boost corrector for 2 kW. The two legs switch half a period apart, so their ripple currents cancel in the sum. The cancellation is complete where the duty cycle is 0.5.
  • coupledBoost is a two-phase interleaved boost from 24 V to 200 V at 300 W and 100 kHz, its two phases half a period apart on one inverse-coupled inductor pair with 100 µH leakage. The variable k sets the coupling (0 gives two separate 100 µH inductors). Average current-mode control: a voltage PI sets the input-current reference, a current PI trims the duty. Set Vin to 100 V and Pout to 1500 W for a duty of 0.5: the input ripple falls to about 0.07 A against about 5 A in one uncoupled phase, and with k = 0.6 each phase ripples about 1.3 A instead of 5 A at the same leakage.
  • totemPolePfc is a totem-pole bridgeless corrector for 1 kW. A GaN half bridge (GS66508T data) switches at 65 kHz and a pair of silicon rectifiers takes the return current at 50 Hz, so the current passes through one rectifier instead of two in a diode bridge. A comparator on the line voltage picks which GaN switch is the boost switch in each half cycle. The control is a module; open it to see the two loops.
  • bridgelessPfc is a dual-boost bridgeless corrector for 400 W, 230 V in and 400 V out. Each mains terminal has its own boost inductor (2.2 mH) with a switch to the output return, a fast diode to the output and a slow diode from the return; one gate signal at 65 kHz drives both switches, so the line current crosses one fast and one slow diode per half cycle instead of two bridge diodes. The ammeter at the line terminal reads both half cycles. The control is a module (the same average-current loops as totemPolePfc); read vdc settling to 400 V and iac following vac.
  • activePowerFilter is a shunt active power filter. A 10 kW six-pulse diode rectifier draws a line current with a THD of about 26 %. A two-level inverter at the point of common coupling supplies the harmonics and the reactive part of that current, so the grid supplies a sine with a THD of about 3 %. Measure isa and iLa with the total harmonic distortion option of the scope measurement.

Control

  • pcmBuckArch is a 12 V to 5 V, 2 A synchronous buck closed through the architecture blocks of a peak-current-mode controller: pcmModulator at 500 kHz with a slope-compensation ramp of half the sensed down-slope, an opAmp type II error amplifier, softStartRef, uvloComparator and ocpHiccup. The output rises with the 470 µs soft start and holds 5 V when the load halves at 1 ms. Plot v(comp) to see the control voltage the averaged modulator predicts.
  • cotBuckArch is a 12 V to 3.3 V buck with a 550 ns constant on-time: it switches near 500 kHz, and the feedback valley sits on the reference. Lower the ESR of Resr below tOn/(2·C) and the pulses bunch together.
  • hystBuckArch is the same buck with a 10 mV hysteresis window at the feedback. Its frequency follows the ESR: double Resr and it doubles.

The blocks are described in Models.

The power electronics course

Four lessons of a power electronics course are built on these examples: diodes and rectifiers, the buck, the boost and buck-boost, and the flyback. Click Guided Lessons in the activity bar and choose Course 1 to Course 4. Each lesson opens its circuit, asks you to predict a number, and checks your answer against your own run; Next waits until it is right (a small Skip this step link moves on anyway). The theory, the answers and a lab handout for each lesson are on the website's course pages (/course), with a page for instructors.

Things to try

  • Open a closed-loop example and run it. The output voltage settles at the reference. Change the circuit variable Vref in Circuit > Variables and run again to see the loop follow.
  • Change the load resistor R1 and run again. A closed-loop converter holds its output; the open-loop one does not.
  • In fullBridgeSpwm, change Mi (the modulation index) and measure the fundamental with the total harmonic distortion option of the scope measurement.
  • In dab, change Phs and run again. The power grows with the phase shift up to 90 degrees.
  • In threePortDab, set Phs2 to −10 and run again. The battery bridge now leads the source, so the battery discharges and, with the source, feeds the load (i(V2) turns negative).
  • In threePortDabClosedLoop, set Idis to 0 and run again. After the step the battery neither charges nor discharges, and the source alone feeds the load; plot phs2 and phs3 to see both loops move.
  • In threePhaseDab, set Phs to −30 and run again. The secondary bridge now leads, so the 400 V bus gives about 10.4 kW back to the 800 V bus (i(V2) turns negative).
  • In solidStateTransformer, set Rload to 80 and run again. The output stays at 200 V while the phase shift phs falls to about 10 degrees, and the mains current halves.
  • In solidStateTransformerAc, plot vout and phs together: the phase shift follows the 100 Hz pulsation of the output power. Set Vout to 100 and run again; the modulation index Mi follows, and the output drops to about 99 V rms.
  • In pfcBoost and afe3Phase, measure the power factor with the power option of the scope measurement, for example the voltage vac and the current iac.
  • In interleavedPfc, plot il and i(L1) together and zoom in on a few switching periods. The ripple of the total current is much smaller than the ripple of one inductor.
  • In imDtc, change the torque band dTe or the flux band dPsi and run again. A narrower band gives less ripple and more switching.
  • In batteryCharger, change the circuit variable Icc and run again. The current holds the new limit until the pack voltage reaches Vcv.
  • In batteryChargerLongRun, run simulation.batteryRun with tEnd 5400 and plot ibat and soc. Then run simulation.batteryZoom with at 1800 and span 0.005 to see the inductor ripple half an hour into the charge.
  • In passiveBalancing4s, set the circuit variable Rbleed to 100 and run again. The bleed current falls to about 40 mA and the cells need about three times as long to come together; set Vth to 1 and they stay apart.
  • In passiveBalancing4s, age the fullest cell with battery.age {days: 300, temp: 45, voc: 4.2, component: "B2", apply: true} (300 days stored full at 45 °C: soh 0.86, rAge 2.8) and run again. With 14 % less capacity the same bleed current empties it faster: B2 bleeds for 2.2 s instead of 2.6 s, and the pack still ends balanced.
  • In activeBalancing4s, set Cfly to 1m and run again. Each capacitor now acts as about 1 Ω instead of 0.21 Ω, and the cells take several times as long to meet.
  • In activePowerFilter, set the current gain Kpi lower, for example to 10, and run again. The filter follows the load's harmonics less closely, and the THD of the grid current rises.
  • In droopLoadSharing, set the inductance l of Line2 to 3m, the same as Line1, and run again. Active power still shares 2:1, but reactive power no longer does.
  • In microgridIslanding, set the circuit variable Pbat to 5k and run again. On the grid the battery now delivers 5 kW and the grid less; after islanding the frequency settles closer to 50 Hz.
  • In microgridResync, set the circuit variable dphiClose to 20 and run again. The tie closes earlier, at the 20° edge of the limit, and the power through it surges several times higher.
  • In vsmLoadSharing, set the circuit variable H to 0 and run again. Without inertia the frequency drops at once at the load step; it ends at the same value.
  • In matrixConverter, set the circuit variable fout to 70 and run again. The output now runs faster than the input; the modulation is the same law, so any output frequency works. Set Cf to 1u and the supply current carries the 10 kHz switching pulses.
  • In switchedCap, set Cfly to 11u or fsw to 100k and run again: the output resistance doubles, as the slow-switching limit 3/(16·C·fsw) says. Set Cout to 47u and it reads about a quarter below the estimate, since a small output capacitor shares charge with C1 and the output is no longer a stiff source.
  • In threeLevelBoost, set the circuit variables Kpb and Kib to 0 and run again. With no balancing loop, the load step pulls the halves apart until each load draws the same current: about 435 V on top and 365 V below, so one switch blocks more than half the link. Set phB to 0 instead and the middle level is gone: the inductor ripples at 50 kHz and about five times higher.
  • In fourLegInverter, set the circuit variable legs to 3 and run again. Without the fourth leg the unbalanced load pulls its star point off centre and the three phase voltages part by about 160 V; set split to 1 as well and the link's midpoint holds the neutral, but only as well as the link capacitors can carry the neutral current.
  • In hvdcMmc, set v0 of LineP and LineN to 0 and run again. The line now starts uncharged: switched onto ±200 kV, it rings at its top mode near 4.5 kHz, and the ringing in idc and the line currents takes a few hundred milliseconds to die out.
  • In lccHvdc12Pulse, set the circuit variable gamma0 to 10 and run again. The inverter now runs with less margin and a higher DC voltage, higher than the rectifier can reach at its 5° limit, so alphar sits at 5° and the DC current settles below its order. With group of TDr set to Yy0, the station becomes six-pulse, and the 5th and 7th harmonics come back in iar.

All values in the examples are illustrative. They are chosen to show the circuit working, not to match a product.

For people who add examples

An example is a function in crates/circuit/src/examples/, in the file of its category. A row in the catalogue (catalog.rs) gives it a category, a one-line description in English and in Traditional Chinese, and the signals the scope shows when it opens. The menus and the window read that table, so nothing else in the interface changes. Every example needs a test that simulates it and checks a physical result.