Modular multilevel converter: submodules, balancing and the circulating current
A modular multilevel converter (MMC) builds its output from many small steps instead of two big ones. Each phase leg has two arms, and each arm is a stack of identical submodules, a capacitor with two switches, that are inserted or bypassed one by one. The output has many levels and a low distortion with a slow switching rate. The price is control: the capacitors must stay at the same voltage, and the two arms exchange a current of their own, the circulating current. You open the mmcInverter example, read its arms and its controller, then follow the arm currents, the circulating current, the four submodule capacitor voltages, the output levels and the distortion. Last, you switch the circulating-current controller off and see what it was doing. About 30 minutes.
Pictures: a numbered red box is what you click or read, ▶ Run is a button, File › Open Example a menu path, ⌘⇧Y a key (⌘ is Cmd on a Mac, Ctrl elsewhere).
1. Open the example
Step 1 of 15 · about 1 minChoose File › Open Example › Inverters › MMC inverter leg.
File.Open Example.Inverters.MMC inverter leg.
2. Read the power stage
Step 2 of 15 · about 1 minOne phase leg stands between two 200 V sources, a 400 V bus with its middle at ground. The upper arm hangs from the positive rail, the lower arm from the negative rail, and the load takes the middle point ac of the leg back to ground. The rails and the signals iu, il, mu and ml are drawn as labels, so the leg is one short column.
Vp: the upper 200 V source;Vnbelow it is the lower one. Together they are the 400 V bus.AmU: an ammeter in the upper arm. Its output is the arm currentiu;AmLgivesilin the lower arm.AU: the upper arm, four submodules in series.ALis the lower arm. The labelmubrings the arm its insertion index: 0 bypasses every submodule, 1 inserts all four.LU: a 5 mH arm inductor.LLis the lower one. The arms must have them: they limit the current between two stacks of capacitors that are never at exactly the same voltage.AmLoad: the load currentiload, taken at the middle pointac.RL: a 10 Ω load resistor, withLO, 10 mH, in series to ground.AmL: the lower arm's currentil.AL: the lower arm, a copy ofAU.
The upper arm inserts a share mu = (1 − 0.8·sin ωt)/2 of its submodules and the lower arm ml = (1 + 0.8·sin ωt)/2: while one arm inserts more, the other inserts fewer, so the two always insert four between them. The leg puts 0.8 · 400 V / 2 = 160 V peak at 50 Hz across the load.
3. Read one arm
Step 3 of 15 · about 1 minClick AU on the schematic. Its parameters are in Properties.
Submodules in series in the arm:nis 4.Capacitance of each submodule:cis 2 mF.Voltage of each submodule capacitor:v0is 100 V, the bus divided byn, so the capacitors start at their working voltage.Carrier frequency:fcis 1 kHz. The four submodules switch with carriers shifted by a quarter of a period each, so the arm steps at an apparent 4 kHz.
With level switched, the arm is built from its parts when you run: for every submodule an upper switch to the capacitor and a lower switch that bypasses it. An mmcBalance block (the library part MMC Submodule Selection) sits inside the arm. It reads the insertion index, the arm current and the four capacitor voltages, and it decides how many submodules are inserted and which ones. Step 9 shows its output.
4. Read the control
Step 4 of 15 · about 1 minThe control sits below the power stage. The two arms get the same sine references, and one small loop adds a correction to both.
Sum: adds the two arm currentsiuandil;Halfhalves the sum. The resulticirc = (iu + il)/2is the circulating current: the part of the current that goes through both arms and not through the load.Bp: a band-pass at 100 Hz, twice the output frequency. It keeps the second harmonic of the circulating current and drops its DC part.Kc: a gainkcof 0.025. The resultdmis added to both arm references. For the circulating current this is a resistance ofkc· 400 V = 10 Ω, and it acts at 100 Hz only. The DC part and the output are not touched.RefU: the upper arm's sine reference,0.5 + 0.4·sin(ωt + 180°);RefLis the lower one.MixU: addsdmto the reference and givesmu;MixLgivesml.
5. Run it and read the output
Step 5 of 15 · about 1 minClick ▶ Run. The scope shows the voltage v(ac) at the middle point on the top axis and the load current iload below it.
v(ac): the voltage at the middle point, a 50 Hz sine of about 117 V rms with a ripple on it. Step 11 looks at that ripple.iload: the load current, a sine of 15.4 A peak. The table says 10.7 A rms; the load takes 10 Ω · (10.7 A)² = 1.15 kW.
6. Read the arm currents and the circulating current
Step 6 of 15 · about 1 minIn the signal list tick iu, il and icirc, then give icirc its own axis: click the plot button at the end of its row (its tooltip names the plot it is on), and icirc moves to the next plot, stacked under the others.
iu: the upper arm current.il: the lower arm current. Its load part is the opposite ofiu's: when one arm carries more, the other carries less.icirc: the circulating current. It starts at 0, because the capacitors start charged and the bus has not yet pushed current through the leg. It overshoots to 5.1 A and settles near 3 A with a small ripple at 100 Hz.
7. Choose a window of whole cycles
Step 7 of 15 · about 1 minThe scope folds the table away while the plots would get less than half its width, so click Measurements in the toolbar to show it. Click Cursors (Shift+C) and place the two lines at 100 ms and 200 ms: five whole cycles after the start.
Cursors: shows two vertical lines and the values at each.- The table's heading reads
between the cursors 100ms – 200ms. Every figure below is taken over that window.
In the table, iu has a mean of 2.88 A, il 2.90 A, and icirc 2.89 A. The mean of an arm current is the DC part of the circulating current, the current that brings the power in from the bus: 400 V · 2.89 A = 1.16 kW, and the load takes 1.15 kW. On top of it each arm carries half of the load current: iu swings from −5.1 A to 10.85 A, which is 2.89 A plus or minus 7.6 A (half of the 15.1 A load current), plus the ripple. The circulating current itself moves between 2.04 A and 3.82 A, a second harmonic of 1.78 A peak to peak.
8. Read the capacitor voltages
Step 8 of 15 · about 1 minUntick the currents and tick AU:v1, AU:v2, AU:v3 and AU:v4 on one axis, and AU:vsum on its own.
AU:v1: the capacitor voltage of the first submodule of the upper arm. The traces ofAU:v2andAU:v3lie on top of it.AU:v4: the fourth. The four means are 99.31, 99.31, 99.31 and 99.30 V, within 0.01 V of each other, and each swings 10.3 V peak to peak, from 94.8 V to 105.1 V.AU:vsum: the sum of the four, the voltage the arm can make: 397.2 V on average, 41 V peak to peak at 50 Hz. The arm gives and takes energy as the output swings, and the voltage rides up and down by 10 %.
The four traces are indistinguishable at this scale. The submodules are identical, and one that is inserted more often than the others charges and discharges more, so only the control keeps them together. The next two steps show how.
9. See which submodules are inserted
Step 9 of 15 · about 1 minUntick the voltages and tick AU:g1 to AU:g4, each with its own axis. Choose Scope > Zoom Axis > Time Only, then click Zoom In six times.
AU:g1: the output ofmmcBalancefor submodule 1: 1 while it is inserted, 0 while it is bypassed.AU:g4: the same for submodule 4.
No submodule stays on or off. Over the 100 ms of the window, AU:g1 to AU:g4 average 0.497, 0.495, 0.503 and 0.505: each submodule is inserted half of the time, and a submodule that has been inserted a little more than the others is bypassed next. That is the sorting: the block ranks the four capacitor voltages, and while the arm current charges the capacitors it inserts the lowest ones; while it discharges them, the highest. A submodule changes state only when the number of inserted submodules changes, not each time two voltages cross, so the switching is as slow as the modulation needs it to be.
10. See the sorting at work on the voltages
Step 10 of 15 · about 1 minUntick the selection signals, tick AU:v1 to AU:v4 on one axis and click Autoscale Y.
Autoscale Y: fits the voltage axis to the zoomed window, so the 10 V swing of step 8 becomes a 1 V window.AU:v1: each voltage is a staircase. A slope is the submodule inserted, charging or discharging with the arm current; a flat part is the submodule bypassed. The four climb in turn and cross, and at no point are two of them more than about 0.5 V apart.
11. Count the output levels
Step 11 of 15 · about 1 minClick Show signals on the left edge of the scope window to unfold its signal list, then + (Add Math Signal) at the top of the list; type AU:g1+AU:g2+AU:g3+AU:g4 in Expression and click Add. The sum is the number of submodules inserted in the upper arm; the scope calls it math1. Put v(ac) and math1 on their own axes and zoom in four times on the time axis.
v(ac): the output rises in steps of about 100 V, the bus divided by the four submodules, with a 4 kHz ripple around each step. Every PWM period it switches between two adjacent levels.math1: the number of inserted submodules of the upper arm, 0 to 4. Its mean over whole cycles is 2.0; the table shows a minimum of 0 and a maximum of 4. The lower arm inserts the rest, so the leg has five levels,N + 1forNsubmodules.
12. Read the distortion
Step 12 of 15 · about 1 minZoom back to the whole run (Zoom to Fit), keep v(ac) and iload, click Measurements to show and tick THD.
Measurements to show: the columns of the table.THD: the total harmonic distortion up to the 50th harmonic, as a share of the fundamental.
13. Compare the voltage and the current
Step 13 of 15 · about 1 minPress Esc to close the picker.
THDofv(ac): 0.578 % (scope.measurewith the fundamental given as 50 Hz reads 0.57 %). The fundamental is 158.7 V peak, a little under the 160 V the modulation asks for.THDofiload: 0.423 %. The 10 mH load filters the output voltage further, and the 15.1 A fundamental is clean. Four submodules, a carrier of 1 kHz each and a small arm inductor are enough.
14. Keep this run and turn the circulating-current controller off
Step 14 of 15 · about 1 minIn the signal list put icirc, AU:v1 and iload on one axis each, click Keep as reference, then Dock Back on the scope. Press ⌘⇧Y to open the console and type:
circuit.variables {"set":{"kc":"0"}}
circuit.variablessets the circuit variablekcto 0.Kchas a gain ofkc, sodmis now 0 and the arm references are the plain sines. This edits the circuit; undo it to get 0.025 back.- The reply lists the variable as 0.
This step turns off the balance between the two arms of the leg. The sorting inside each arm is a separate balance with its own switch, the arm's sorting parameter: set to 0, the submodules go in by index and their capacitor voltages drift apart. It stays on here.
15. Run again and compare
Step 15 of 15 · about 1 minType simulation.run, put the cursors at 100 ms and 200 ms again, and keep the same three signals on the scope.
icirc · Ref 1: the first run, kept as a reference and drawn lighter, with the controller on.icirc: the new run. The second harmonic is now 9.6 A peak to peak, against 1.78 A: its rms value is 2.41 A against 0.43 A, 5.6 times as much. The mean is the same 2.90 A, so the power from the bus does not change.
Scroll the measurements down: Runs lists the two runs and what changed between them (kc 25m→0).
The rest follows from the larger circulating current:
- The capacitor voltage
AU:v1swings 17.3 V peak to peak, from 91.3 V to 108.6 V, against 10.3 V: the second harmonic of the arm current charges and discharges the capacitors at 100 Hz on top of the 50 Hz swing. - The arm current has an rms value of 6.83 A against 6.10 A. That is 12 % more, so the conduction loss in the arm's switches is about 25 % higher, and the arm needs bigger capacitors and bigger switches for the same load.
- The load current has a THD of 1.35 % against 0.42 %. The arm voltages move more, and some of it reaches the output.
So an MMC has two balances. The sorting inside an arm keeps the four capacitors together (steps 8 to 10). The circulating-current controller keeps the two arms from swinging energy against each other, and it is the one you switched off here.
The same steps from a script
powercraft-cli run \
--cmd file.openExample --params '{"name":"mmcInverter"}' \
--cmd simulation.run --params '{}' \
--cmd scope.measure --params '{"signals":["icirc","AU:v1","AU:g1","iload","v(ac)"],"t0":"0.1","t1":"0.2","thd":{"fundamental":50}}' \
--cmd circuit.variables --params '{"set":{"kc":"0"}}' \
--cmd simulation.run --params '{}' \
--cmd scope.measure --params '{"signals":["icirc","AU:v1","iload"],"t0":"0.1","t1":"0.2","thd":{"fundamental":50}}'
The first scope.measure gives an icirc of 1.78 A peak to peak, an AU:v1 of 10.3 V peak to peak and a thd.iload.thdPercent of 0.42. The second gives 9.6 A, 17.3 V and 1.34 (the table's 1.35 % is the same figure with the fundamental found by the scope).
Back to the learning path.














