Energy Pulsation Reduction in Modular Multilevel Converters Using Optimized Current Trajectories

In power electronics, the modular multilevel converter (MMC) is an easily scalable topology with an high output voltage quality. It is suitable for the transmission of large amounts of electrical power over long distances, which supports the realization of the ongoing energy transition. State-of-the-art methods require a comparatively large total cell capacitance in the system for energy pulsations during operation. In the present paper, in order to minimize this total capacitance, first a new method is developed to model the system, and second, by help of this model, optimal current trajectories are calculated. These currents are used for control to reduce the energy pulsation over the complete operating range, and thus, to better utilize the hardware. The new method independent on the Clarke transformations is implemented on a laboratory scale setup, and measurement results are presented which validate the new method. Furthermore, the new method is compared to the state-of-the-art method of the compensation of the 2nd harmonic and outperforms the latter significantly. This applies to the entire operating range for different power factors. A total reduction of up to 44% of the energy pulsations is achieved.


I. INTRODUCTION
Grid expansion is the backbone of the energy transition.
Especially in Germany, renewable electricity must be transported from the sea and windy coasts to the consumption areas in the centre of the country. The energy grid and its components must be improved, strengthened and expanded for the growing task of future energy distribution.
The Modular Multilevel Converter (MMC) as shown in Fig. 1 was presented in 2002 [1], [2] and has become established in the last years as the system of choice, when it comes to the transmission of large amounts of power over long distances [3]. Therefore the MMC is a promising topology for the application in high and extra-high voltage networks. The development of multilevel converters enables the development of large high and extra-high AC and DC grids [4]- [6]. In addition to the transport of large amounts of electrical energy, modular multilevel converters are also used as components to improve the quality of the grid voltage.
As FACTS or STATCOM, they exploit the existing line capacities and provide reactive power to support the grid [7], [8]. Due to the DC fault handling capability of the MMC and additional DC breakers, extensive DC networks can be established [9], [10]. The topology is also considered promising as galvanically isolated grid inverters [11], [12]. Furthermore, this topology also becomes increasingly popular as a drive converter [13]- [15] especially in the medium voltage range above 1 kV. The motor friendly behaviour of the MMC enables thereby efficient and reliable variable frequency drive solutions.
In order to meet the requirements for grid connected power converters, the control of the MMC system must be designed accordingly. The control of this converter type requires a high degree of model understanding of the controlled system and the electrical network. This enables control strategies to be developed that support the grid and ensure the safe operation of MMCs. Different methods provide approaches for energy control or voltage control in systems based on the MMC [13], [16]- [23].
In this present paper a new systematic, control engineering based derivation of the model equations is presented. This results in degrees of freedom for controlling and reducing the unavoidable energy pulsations [24], [25]. With the knowledge gained, it is possible to set up a highly dynamic grid control system and to operate the converter in a stable manner and thereby provides stability even in the event of a grid fault. The fault behavior is, however, not the focus of this publication.
Instead a new approach is presented to reduce the inherit energy pulsations within the system. Using the degrees of freedom, optimal current trajectories are calculated, that allow a significant reduction of the energy pulsations compared to state of the art methods [13], [52], [58]. This enables a far better utilization of the installed capacitance and reduces overall system costs. A converter-based island network in the low-voltage laboratory is then set up and used to validate the modeling and control algorithms. This paper is organized as follows. The notation is summarized in Section II. Section III contains the fundamentals of modeling used for optimization.
In Section IV the main idea for optimal power feedforward control of the MMC is presented and compared to the state-of-the-art method. The new approach is verified with the laboratory setup in Section V. Final measurements in Section VI show the capability of the energy pulsation reduction. Conclusions follow.

II. NOTATION
Throughout the paper, a variable v describes a vector in R n .
The index notation v m−n indicates an subvector of v with the entries v m , . . . , v n . An underlined uppercase letter M denotes a matrix in R m×n to avoid confusion with electrical quantities that are constant in time. I n describes the n × n identity matrix. 1 m , 1 m×n as well as 0 m , 0 m×n are vectors, respectively matrices of the corresponding dimensions completely filled with 1 or 0. In this paper, w • v is used for the Hadamard product -the element-wise multiplication of the vector entries. M + is the pseudo inverse of a matrix M and M N denotes a matrix which columns form a basis for the nullspace of M.

III. MODELING AND DECOUPLING
The control of the MMC has two objectives: First, the currents at the terminals to the connected grid must be controlled. Second, it must be ensured that the stored energy in the cell capacitors is kept within a tolerance band. These control objectives are generally pursued for all MMC topologies. Both aspects have been investigated with different emphases and approaches. They differ by focusing on switched or averaged models [26], [27], generalized approaches [28], [29] and the straightforward use of the Clarke transformation [1], [5], [13], [30]- [32] or they deal directly with predictive control approaches [33].
The paper at hand uses the averaged model for scalability and to ensure the real-time capability of a digital signal processing system. Taking previous approaches into account, the system equations are derived from the physical domain. To be able to apply modern control algorithms, like a model predictive control approach (MPC), a systematic analytical state space model is needed which describes the converter comprehensively and mathematically. This work focuses on the degrees of freedom in the system and how they can be utilized to reduce energy pulsations in the system. Fig. 1 depicts the schematic of an MMC that couples a DC network with a 3-phase AC grid with the grid frequency f g = ω g /2π . The MMC consists of the adjustable voltage sources v 1−6 , the branch inductors L and the parasitic resistors R. V dc , R dc and L dc model the connected DC network. v s1-s3 , R ac , and L ac represent a three-phase AC grid. Each of the voltage sources v 1−6 consists of a series connection of N cell cells.

A. PROBLEM DESCRIPTION
Many different cell topologies have been proposed [34]. The most common topologies are the full bridge cell and the half bridge cell [5] which can also be mixed depending on the application related requirements regarding efficiency and DC blocking capability.
Both topologies consist of a local energy storage capacitor C cell with a voltage v cell and the switches. From an electrical point of view, the cells are a two-pole circuit with no external power supply. The full bridge cell can provide the voltages v cell,out with −v cell ≤ v cell,out ≤ +v cell . The half-bridge cell, on the other hand, can provide a voltage range of 0 ≤ v cell,out ≤ +v cell . The voltage v branch of a branch is the sum of its cell voltages.
In the averaged model of an MMC, each series connection is assumed to be an adjustable equivalent voltage source v k ; k = 1, . . . , 6 with an equivalent branch capacitance C branch . The cell capacitance is assumed to be identical for all cells. On average, the branch capacitance is calculated by C branch = 1 N cell C cell [13]. With suitable modulation of the cells and with sufficiently large N cell the model errors for the analysis can be neglected [13], [17], [18].
Since each cell contains an energy storage device, it must be ensured that the energy is evenly distributed within a branch. There are different methods of balancing the energy among the cells in each branch [13]. The energy per branch is then equal to the sum of its cell energies. The voltages v 1−6 are used to control the branch currents i 1−6 and in consequence the grid currents. In order to meet the requirements of controlling the grid currents and keeping the energies within their permissible limits, a physical model is developed based on the circuit diagram.
A mathematical control model is subsequently derived from the schematic, which serves as the basis for the further control of the MMC.

B. PHYSICAL MODELING
First the Kirchhoff's circuit laws for the currents and voltages are applied and solved. Then, equations for the energy stored in the branches are set up and investigated. It is assumed, that all branch inductances L and resistors R identical.

1) MODELING OF THE BRANCH CURRENTS
For each inductor current i 1−6 an equation of the form can be specified. Furthermore, the secondary condition, that the sum of all currents must be 0 applies, since the star point of the AC side is not connected (1a) to (1c) create a differential-algebraic system and are rewritten in matrix notation i, v and v s are vectors of the corresponding numbered values. R is a diagonal matrix with the parasitic resistors R as diagonal entries The inductance matrix L describes the branch inductors. In this case, the branch inductors are not coupled. It follows that L is also a diagonal matrix with the branch inductances L as entries L = L I 6 . (2d) Additionally, the branch inductors might also be coupled [35]. This means that the upper and lower branches are inductively coupled using a common iron core. As a result, only the leakage inductance of the coupled reactors is effective on the DC side and the AC side respectively. This leads to a further coupling via the inductance matrix. For the basic consideration without loss of generality, it is irrelevant whether coupled inductors are used in the actual system implementation or not. In the following, uncoupled inductors are assumed. The matrices M k ; k ∈ {a, dc, s} in (2a) are defined as (2e)

2) MODELING OF THE BRANCH ENERGIES
Equations are required to describe the energy of the voltage sources. In this case, energies are used for description because unlike the capacitor voltages, the energies only depend on the currents and voltages over time. They are independent of the specific cell parameter design and moreover are used to simulate the system beforehand and are the basis for the hardware design. The branch energy w k is calculated as an integral of the branch power p k , such that w k can be determined by measuring the cell voltages v cell,n,k of all N cell cells of each branch k; k = 1, . . . , 6. On average, the cell voltages v cell,n,k within one branch are assumed to be the same. Using The average of the voltage v k can be set precisely by suitable modulation of the cells' semiconductor switches within one branch. To perform an analytical examination of the model, the switching operations of the individual cells are neglected and an adjustable voltage source within a branch is assumed. Model errors are reduced, the more cells are available within a branch. The laboratory setup in Section V shows that even with N cell = 5 cells the model error is negligible. A sorting method is implemented, which was already used in [13], [17], [18]. This ensures, that the assumption of all cells in one branch having the same stored energy, holds. Concerning the control of the system, each branch therefore can be described as an adjustable voltage source including an energy storage. The branch energies represent additional state variables which are included in the control and are kept within a tolerance band.

C. CONTROL ENGINEERING MODELING
In order to establish a state space model of the converter, the physical quantities are mapped to control engineering quantities. This ensures a uniform nomenclature.
In Table 1 the mapping of the variables is given. (2a) is rewritten, such that d dt i is on the left-hand side of the equation. Together with (3), a state space representation results, which reads in the control engineers notation according to Table 1 aṡ A, B, F are dense matrices. Together with C, they describe the MMC system.
The matrices are easily derived from (2a) and not explicitly shown for reasons of brevity. Note that in addition to reformulation and variable renaming, a normalization based on the SI unit standard is carried out. Therefore, all matrices consist of unit-free numbers and the signals are unit-free too.

1) SYSTEM DECOUPLING
In order to control the currents and energies as easily as possible, the system has to be decoupled. There are different approaches for decoupling [36]- [38] using basically the Clarke transformation of certain variables. In the following, a new approach to the mathematical derivation of decoupling is presented. Since A and B are symmetric matrices which commute, i.e. A B = B A, they can be simultaneously diagonalized with an orthogonal matrix [39, p. 172].
Such a transformation matrix T is spanned by an orthogonal system of eigenvectors of A and one of such matrices has the form Subsequently, a similarity transformation on (6a) is performed. Using a new set of state space variablesx = T x, the transformed system is given bẏ For further simplification an input transformationũ = T u is applied, which leads tȯ Moreover, the output (6c) is transformed by usingỹ = T C ỹ For a reduced notation, are defined. In summary, with the abbreviations, (9) the MMC reads in transformed coordinates aṡ The matricesÃ,B,F andC describe the MMC in transformed coordinates. These matrices are diagonal matrices ex-ceptF . Therefore, the transformed currents of the system are decoupled.
The relation between the transformed statesx and the output y can be calculated By exploiting the orthogonality of T , it follows 1

2) ELECTRICAL ENGINEERING INTERPRETATION
A depends on the branch inductance L and the resistance R.
In addition, the DC side inductance L dc and resistance R dc as well as the AC side parameters L ac and R ac influence the system matrix. B and F only depend on the inductances L, L dc and L ac . The MMC is described completely by those relations.

FIGURE 2. Decoupled representation of the MMC
After transforming the system, the equations can be interpreted. The first row ofB is a zero row. Taking the starting point from Fig. 1 into account, this leads to the fact that only 5 of the branch currents can be set freely using the 6 branch voltages. The neutral points are not connected and (1c) must be satisfied. For simplification, transformed physical parameters are introduced as a direct result of the transformed state space representation in (10a). The coupled MMC system from Fig. 1 can be represented in transformed coordinates as shown in Figs. 2(a) to 2(d). The line numbers refer to the lines from (10a).
Where Fig. 2(a) is the zero voltage system.ṽ 1 has no effect on the currents in the system at all. Fig. 2(b) represents the second line from (10a).ṽ 2 influences the current 2, which corresponds to the transformed DC current. The AC side and internal currents are not affected. Lines 3 and 4 of the equation are represented in Fig. 2(c). 3 and 4 can be adjusted using the voltagesṽ 3 andṽ 4 . They have no influence on the DC side or the AC side. These currents and zero sequence voltage can later be used to distribute and balance energy within the converter. Fig. 2(d) represents lines 5 and 6. With the voltages v 5 andṽ 6 the AC currents 5 and 6 can be controlled. Since the star point of the AC side is not connected, the sum of all currents must be 0, too. This means that only 2 of the 3 AC currents can be set independently.
Keep in mind, that the state variablex represents the transformed currentsĩ. (11d) shows, that the grid currents are only composed of the transformed currentsĩ 5 andĩ 6 under the assumption that the zero sequence currentĩ 1 is 0.
This allows DC and AC currents to be set independently of each other. In addition, the mathematical analysis provides further degrees of freedom in the form ofĩ 3,4 and the zero voltageṽ 1 , which can be adjusted without affecting the AC side or the DC side. Based on these results, terms can be identified in a simple way that can be used to adjust the energies of the system in a targeted manner.
In contrast to known decoupling approaches, the presented method does not depend on the intuitive application of Clarke transformations or sum and difference calculations of the given currents. With the presented modeling, straightforward control engineering approaches can be quickly designed and implemented. Furthermore, the procedure is not limited to the MMC topologies. The formalism also allows a simple analysis and decoupling of other topologies such as the M3C, the hexverter or 3AC-1AC MMC systems. Even new topologies like the modular multilevel solid state transformer [12] or the parallel hybrid converter [40], [41] can be described in an easy, unified manner.

D. SUMMARY OF MODELING AND DECOUPLING
In Section III the MMC was introduced and analyzed. Based on Kirchhoff's circuit laws a set of equations was derived. Subsequently, the physical quantities were mapped to control engineering quantities and the state space representation of the MMC was obtained.
An easy to use mathematical formalism was presented, which enables the decoupling of the system. In the following, the model serves for controlling the currents and can be used to reach another design objective for the energies with the remaining degrees of freedom.
This analysis can also be undertaken for other modular cell based topologies such as the M3C and provides an approach to control these topologies.

IV. FEEDFORWARD CONTROL OF THE MMC
Modern controllers are mostly of two-degree-of-freedom type, i.e. they consist of a feedforward and a feedback part. In this paper only the feedforward part is discussed. Normally two tasks are to be solved: firstly, to derive the relation between the reference signal, the reference state and the required input signal, secondly to design the reference signal if the application allows it. The second task has not to be applied because in the MMC application the ideal, sinusoidal, symmetrical three-phase voltage system permits no freedom in the reference signal design. While there is no degree of freedom in the design of the reference output, there is some degree of freedom in the input. This is because more inputs than necessary are available to control the outputs. These degrees of freedom can be used for optimizing the current trajectories. At first, the relations between the reference signals and the inputs are derived in Section IV-A. Subsequently the current trajectories are optimized in Section IV-B.

A. RELATIONS BETWEEN REFERENCE SIGNALS
Based on the state space equations (10a) to (10c), the system is analyzed. First, the current related statesx 1-6 are examined in detail. Second, the energy related statesx 7-12 are studied.

1) CURRENT RELATED STATES
In steady state operation the system limits the possible freely adjustable variables u = T ũ. The necessary input valuesũ ref to followỹ ref are calculated and reveal the remaining degrees of freedom. For simplicity, all indices k = 1, . . ., 6 are omitted in this subsection since onlyx 1−6 are considered whereC N is choosen to bẽ x f is a vector with the degrees of freedom in the current related states.
To calculate the correspondingũ, (10a) is solved with respect to the input variable. The equation is decomposed in three parts with respect toũ: whereB N = 1 0 0 0 0 0 . The first partũ ref is calculated using the referenceỹ ref and the measurable input disturbance z. u fx is determined by choosing the degrees of freedom ofx f from (12b).x f andũ ff can be chosen to optimize the feedforward control of the MMC.
u allows to follow the reference signal independently ofx f andũ ff Thus, the first control objective is already achieved. The degrees of freedom inx f andũ f are subsequently chosen in accordance with their ability to ensure stable operation of the system under given boundary conditions. An analysis would have been possible in untransformed coordinates. However, this would result in a multidimensional control problem due to the coupling.
In contrast to state of the art methods, the result is a mathematical consistent description that can be easily exchanged with other fields of research without any misunderstandings.

2) ENERGY RELATED STATES
Due to the identityẋ 7−12 =ẋ 7−12 the notation for transformed coordinates is omitted for this variable.
The results from the previous subsection are inserted into the energy related state equation (10b). This yields the power terms that occur in the system for given quantities. Together with the knowledge about the degrees of freedom in the system, conclusions are drawn, which power terms are immanently given by the disturbance z and referenceỹ ref . In addition, terms are obtained which can be adjusted using the remaining degrees of freedom.
With (10b), (12b) and (13) the result iṡ To enable stationary operation, the average value ofẋ 7−12 must be 0 over a time period T g = 2π/ω g , resulting in a periodicity constraint The degrees of freedom in (14b) are subsequently chosen in a way that safe operation is possible and that the energy pulsations in the system are reduced.

B. OPTIMIZATION OF CURRENT TRAJECTORIES
There are two important objectives when designing an MMC system. For one thing, the losses of the system should be minimal. For another thing, the stored energy in the system should be as minimal as possible to reduce the necessary capacitance and destructive power in case of a hardware failure. In addition, the safety margin between the nominal cell voltage and turn off limits in case of a transient state of the system have to be taken into account. This results in two optimization goals in the design of the control system in addition to the general and stable operation of the system. On the one hand, the branch current should be as low as possible to reduce the conduction and switching losses of the semiconductors. On the other hand, the stored energy should be minimized in order to use fewer and smaller capacitors. However, these two goals are in opposition to each other, because the easiest way to influence the energy is to add additional branch currents.
Various methods for power feedforward control and reduction of the energy pulsation are already known. Therefore, internal currents and the zero sequence voltage are adjusted accordingly [42]- [45]. Basically, the methods can be divided into offline [44], [46], online [47], [48] and analytical [19], [43], [49], [50] methods. The principles are based on different modeling and assumptions, but all of them use the same physical system and address different aspects of energy control and reduction of the energy pulsation.
The analytical approach to compensate for the second harmonic in the energy pulsation was already presented in [13], [36]. Due to its simplicity, this method has been accepted so far and serves as a benchmark for the new method presented in this paper.
In the following, the stationary operating mode as well as the state of the art compensation for the second harmonic is derived easily, using the description from Section III. An approach to improve the state of the art method is presented. In addition, it will be shown in this section how to reduce the pulsation over the entire working range by optimizing the degrees of freedomx f even further.
Different methods -online and offline -are presented and analyzed.

1) PREREQUISITES
To compare the different approaches to power feedforward control, the grid variables z 1−3 are assumed to be an ideal, sinusoidal, symmetrical three-phase voltage system with the frequency ω g . z 4 is a constant DC voltage The grid current reference signal y ref is also assumed to form a symmetrical three-phase system

2) CALCULATION OF THE DC CURRENT FOR STATIONARY OPERATION
Let us at first discuss some simplifications. Looking at (10a), it is noticeable that the system matrixÃ is orders of magnitude smaller thanB because it is multiplied by a matrix containing the small parasitic resistances. Therefore we setÃ = 0 6×6 . Starting from (14b), the terms with small coefficients are neglected. This simplification omits the losses due to ohmic voltage drops in the system. In addition, the small inductive voltage drops are also omitted for simplification [13], [20]. Under the assumption that the superimposed energy control compensates these losses the analysis is sufficiently accurate. The zero sequence voltage and thereforeũ f = 0 as well, since it does not contribute to the power balance of the system at all. It has already been shown that the zero sequence voltage can be used to reduce the energy pulsations [51].
The zero sequence voltage will be included in the optimization as an optional degree of freedom for energy pulsation reduction in future work.
To ensure stable operation, the power on the AC side must be equal to the power on the DC side if losses are neglected. Therefore at least one of the freely adjustable currentsx f has to be a DC current to generate the power in combination with z 4 = V dc and to satisfy the branch energies according to (15).
A constant value approach forx f (DC current for stationary operation) isx f = a 10 a 20 a 30 .
Considering (15) whenẋ 7−12 given by (14b) is replaced using (11a), (16a), (16b), (17) and (18) as well as the simplified u =ũ ref results in (noteÃ = 0 6×6 ,x f is constant andũ ff = 0 6 , sinceũ f = 0) Thus only remains, from which the unique solution can be concluded a 10 corresponds to a DC current forx f1 , which compensates the power of the AC side and keeps the total energy constant on average.
In addition to the total energy of the system, the symmetrical distribution of energy between the branches is also required. However, balancing is not necessary under idealized considerations.
x f is completely determined for stationary operation.

3) ANALYTICAL COMPENSATION OF THE 2ND HARMONIC IN THE ENERGY PULSATION
From (19c) follows a 20 = 0 and a 30 = 0 for stationary operation.x f1 is set to a 10 .
To compensate for the second harmonic, the Fourier series approach forx f is The way to calculate the required coefficients is analogous to (19a). Solving the equation with respect to a 22 , b 22 , a 32 and b 32 provides the amplitudes for (20) which completely compensate the second harmonic in the energy under idealized considerations Thus, for the transformed currents follows If the MMC operates in stationary mode, the reference currents y ref can be set. In addition, the energy pulsations with the frequency of the second harmonics of the grid frequency can be compensated. The newly presented description of the system is used to determine the corresponding trajectories easily and quickly. The results are the transformed branch currents from (20). With (13) the input variable u 1−6 = T ũ 1−6 can be calculated directly. However, this approach assumes a lossless system. In addition, it neglects all inductive voltage drops across the inductors L x since v Lx = L x d dt i x . If the inductive voltage drops are taken into account, the inductances can no longer be neglected. A closed analytical solution of the currents for compensation is no longer easily possible. [52] has already shown that the analytically calculated compensation depends not only on the inductors but also on the ratio of the DC and AC voltages. Furthermore, a reduction of the energy pulsation is only achieved if the power factor of the AC side is close to 1. In cases where the reactive power is increased, the compensation can achieve the opposite and the energy pulsation increases. An extension of the approach is to compensate not only the 2nd harmonic but to determine the first q harmonic terms which contribute to a reduction of the energy pulsation. A compensation up to the 4th harmonic was already presented while neglecting the inductive voltage drops [19].

4) MINIMIZING THE ENERGY PULSATION VIA PARAMETER OPTIMIZATION
While Sections IV-B2 and IV-B3 aimed to calculate the DC current and compensation currents analytically to eliminate the 2nd harmonic, the parameter optimization targets the reduction of the energy pulsation directly. Without neglecting losses and inductive voltage drops, it is possible to reduce the energy pulsation over the entire operation range.
However, a closed analytical solution is impossible. Therefore a numerical approach shall be considered. In order to determine the coefficients for reduction, a cost function is required.
Normally, any branch energy of the converter pulsates around a constant mean value.
With a symmetric built MMC all mean values are set to the same constant w 0 . Then, a minimizing of the energy pulsation is equal to minimizing the amplitude around the point of operation.
This results in the optimization function For the currents in the transformed system the following ansatz applies k=2 a 2k cos k ω g t + 6 k=2 b 2k sin k ω g t 6 k=2 a 3k cos k ω g t + 6 k=2 b 3k sin k ω g t ⎤ ⎥ ⎦ .
To perform the optimization efficiently, the Optimization Toolbox of the MathWorks' MATLAB is used.
With the particle swarm optimization (PSO) algorithm [53] we achieved the best results in this case.
For the sake of comparability and reproducibility, the default settings of MATLAB for the initial conditions are used. Slightly better results may be achieved with random selection for other points of operation. This must be examined separately for each implementation. The calculation can be prepared offline and stored in lookup tables easily.

5) MINIMIZING THE ENERGY PULSATION VIA FUNCTION OPTIMIZATION
In contrast to the parameter optimization from Section IV-B4, in this section an optimal periodic function rather than an approximation shall be determined. A core difficulty is the cost function. It must be continuously differentiable for the calculation. Therefore the cost functional (23b) cannot be applied. However, the L ∞ -norm can be approximated by an L 2p −norm i.e. x 7−12 (t ) − 1 6 for sufficiently large p. Instead of the norm, we optimize the power of the norm to simplify the calculation. The minimizers remain the same.
This results in the differentiable cost functional A satisfactory reduction of the energy pulsation is obtained for the choice p = 5. The optimization aims at an optimal solution forx f (t ).
We take and and T g 0 x 7−12 dt = w 0 T g 1 6 .
For function optimization, software packages exist that can directly process the equations of the state space representation. The software used here is a Python implementation of CasADi [54]. It can be used to calculate optimal solutions of differential equation systems.
Due to the complex nature of the system the optimization can take -depending on the used hardware -up to several minutes. However, the averaged model is calculated and therefore an increase of the cell numbers does not effect the computation time at all. The approach is scalable for all kinds of MMC systems.
Simulations show, that this new kind of approach results in the best possible energy pulsation over the complete operating range of the converter.
The comparison with respect to the energy pulsation and additional currents will be shown in Section VI. Due to the complex nature of the system, a general statement is not possible, which approach is best in each case. The theory presented here gives an easy access to calculate currents and energies for any given system.

C. SUMMARY OF THE FEEDFORWARD CONTROL OF THE MMC
In Section IV a feedforward control of the MMC is derived. Based on the previously presented modeling, the energies and their variation in time can be described. The relations between reference signals provide degrees of freedom, which can be used to enable stationary operation and to reduce the energy pulsation. The corresponding currents can be calculated online and offline.
Compared to known approaches like the analytical compensation of the 2nd harmonic or the new approach using parameter optimization, the function optimization delivers the optimal feedforward trajectories with respect to minimal pulsation.
The reduced energy pulsation can already be considered during the design of a MMC system not only for grid applications. Together with the safety margin of the capacitor voltage, the maximum capacitor voltage value is decreased and in the last consequence the installed capacitance can be reduced. Fig. 3 depicts the optimization process to determine the current trajectories.
In addition to feedforward control for energy pulsation reduction, however, the state variables must also be feedback controlled in order to be able to react to model errors or occurring disturbances.
For this purpose it is assumed, that the MMC control takes care of the safe operation of the system. To verify the presented algorithms for optimized feedforward control, a state of the art cascaded scheme based on the design of [13], [18], [55] is designed and implemented.

V. LABORATORY SETUP FOR VALIDATION OF THE FEEDFORWARD CONTROL
The described control algorithms for the operation of the MMC as a grid connected converter are derived and designed. For verification, the algorithms are implemented on a signal processing system and tested on a real grid using a laboratory  scaled prototype. In the following section the concept of signal processing and the design of the prototype are presented. The setup is based on a laboratory prototype from [17] with a modified power section and signal processing unit [56].
To ensure that the grid connection conditions are reproducible, an inverter-based island grid was developed [57]. This allows for the emulation of fixed grid conditions and the verification of control algorithms. Table 2 lists the parameters of the built prototype.
Coupled iron sheet chokes are used as branch inductors. Due to the very good coupling of the branch inductors, additional ferrite inductors are used as line inductors on the AC side. Figs. 4(a) to 4(c) show the laboratory setup of the MMC with power terminals and signal processing. Each of the 6 converter branches is realized on a PCB shown in Fig. 4(b). The power unit is adopted from [17].
For the power supply of the cell logic and gate drivers, a flyback converter is integrated, which is locally fed from the intermediate circuit of the cells. The communication between the cells and the higher-level control system is realized galvanically isolated via fiber optics. Full bridge control and measurement of the DC link voltage of a cell is done with an FPGA 10M08SAE144 from Intel. Fig. 4(c) shows a close-up of the cell logic and the FPGA plug-in boards for an entire branch. The DC side of the MMC is fed by a galvanically isolated AC-DC two level converter. The AC side is connected to a inverter based standalone grid as shown in Fig. 5. As an alternative, it can be connected to the laboratory grid directly. However in that case, reproducible grid conditions cannot be ensured.

VI. MEASUREMENT RESULTS
In this section, measurement results obtained from the laboratory setup are presented. The modeling of the system presented and the control structures derived from it are verified and validated with the setup shown. Quasi-stationary and dynamic measurements at the laboratory grid and the inverterbased island grid are presented to demonstrate the basic functionality of the control.
The focus of this work is on modeling the system and reducing the energy pulsation. Accordingly, the cascaded control concept of current controller and superimposed energy controller is given based on [13], [18]. In the following the different approaches to reduce the energy pulsation are validated and compared.

A. QUASI STATIONARY OPERATION OF THE SYSTEM
The MMC is pre-charged and operated quasi stationarily using the 400 V/50 Hz laboratory supply grid. The grid is connected via a Yz-transformer. This results in a string voltage amplitude of the feeding network ofV AC = 400 V/ √ 2 = 282 V. On the DC side, the MMC is controlled by a machine set with V dc = 450 V. The ratio is V dc /V AC ≈ 1.6. A power of P = 8.5 kW at a power factor of cos ϕ d = 1 is delivered to the AC grid. Figs. 6(a) and 6(b) show measurements of the grid voltages and grid currents in this operating point. The grid currents are precisely controlled in a stationary manner. The laboratory AC voltage grid has a 5th and 7th harmonic present but only the fundamental frequency of the current is controlled in the MMC. Therefore, additional 5th and 7th current harmonics can be seen in the grid currents. The measured values are recorded with the sampling period T C = 125 μs of the digital signal processor (DSP). Voltage feedforward control and the phase locked loop (PLL) on the FPGA operate with factor five of this frequency. Fig. 6(c) shows the measured branch currents of all 6 inverter branches. As derived these are composed of a superposition of the AC currents and the DC current. In addition, currents are controlled to generate balancing power. With 0.5 A these currents are small compared to the total current in the branch. The energy control is steady-state accurate and ensures stable operation of the system. Fig. 6(d) shows the branch energies calculated from the measured branch voltages v branch,k ; k = 1, . . . , 6. The occurring energy pulsation is W = 8.567 J per branch. On average all energies are constant around the mean value W mean = 264.92 J, which corresponds to a branch voltage of V mean ≈ 650 V. This operating point serves as benchmark for the different approaches of reduction, since no additional currents are necessary.
In addition, Fig. 7(a) shows the branch voltages measured using Keysight N2790 A 100 MHz differential probes directly at the hardware and evaluated with an Keysight MSOX3034 T 350 MHz/GSs −1 oscilloscope. Fig. 7(b) shows a zoom of these voltages where the switching behaviour is clearly visible.

B. REDUCTION OF THE ENERGY PULSATION
In this paper new methods for reducing the energy pulsation W are presented. Depending on the operating point, current trajectories for the internal currents are calculated in advance. Compared to the reduction of the second harmonic in the energy pulsation, W can be significantly reduced.
The feedforward control of the 2nd harmonic is used according to the state of the art to reduce the energy pulsation. The presented optimization method allows for a further reduction of the energy pulsation and a better utilization of the installed capacitors.
To validate the statement of the performance from Section IV-B5, the converter is operated in a stable operating point. A line current with an amplitude ofÎ AC = 20 A is generated at a power factor of cos ϕ d = 0.5 ind . This corresponds to an apparent power of S AC = 8.5 kV.A. To show the effect of the reduction in the energy pulsation with the help of optimized current trajectories, both methods are applied successively and the energy trajectories are shown. Since the optimization only affects the currents of the system, that are not seen at the converter's terminals, the measurements for the DC voltage and current and the AC voltages and currents are congruent to the measurements shown in Figs. 6(a) and 6(b). Fig. 8(a) depicts the energy pulsation of the branches. Note that the most important aspect are the maximum and minimum of the enveloping curvature. Until t 1 = 150 ms no reduction is activated. The energy pulsation is W no = 16.07 J. In Fig. 8(b) the corresponding branch currents are shown. Fig. 8(c) are circulating currents in transformed coordinates. Please note that the transformation using T is power invariant, resulting in a current amplitude scale of the currents in comparison to the untransformed currents. At time t 1 the reduction of the second harmonic is activated. After the transient process the energy pulsation is only 62.5% of the original W . At t 2 = 300 ms the current trajectories calculated with function optimization are applied. The energy pulsation can thus be decreased by further 6.5 percentage points to 56.0%. On the other hand, the reduction in energy pulsation results in higher branch currents which cause additional losses.
The RMS value of the branch currents increases from 7.1 A to 8.0 A and to 9.62 A, respectively. This corresponds to an increase of the RMS current of 11.25% for the 2nd harmonic compensation and 26.20% for the function optimized currents in comparison to no compensation. Table 3 lists the energy pulsation reduction and the increase of the RMS branch current in a concise manner.
For the given setup with C branch = 13 mF an energy pulsation without any compensation of W no = 16.07 J around the initial energy of W 0 = 265 J corresponds to an voltage pulsation in the range of 644.5 V ≤ v branch ≤ 655.4 V. The function optimized compensation reduces the DC voltage ripple down to 640 V ≤ v branch ≤ 660 V. To achieve the same voltage ripple without any compensation, simulations show that a total branch capacitance of C branch = 17.7 mF and therefore 36% more is necessary. As trade-off, no additional compensating current would be needed.
The reduction of the energy pulsation using the optimized current trajectories is thus also proven and validated on the hardware design.

1) COMPENSATION FOR ALL POWER FACTORS
As already derived and shown in [52] for the compensation of the 2nd harmonic, the degree of reduction depends on the phase angle of the AC side. For the hardware setup, the energy pulsation can be calculated for all power factors. In addition, the theoretical values for the compensation of the 2nd harmonic are calculated. The theoretical values are then compared with the measured values. In parallel, the current trajectories for the optimal reduction of the energy pulsation are determined, tested in a simulation and validated by measurement on the setup. Fig. 9 shows the measured energy pulsation over the whole range of values of the phase angle ϕ d . In all cases the energy pulsations of the different methods, which theoretically occur, are shown.
The reduction of the energy pulsation by using the optimal current trajectories leads to very good results in all operating points. For all three approaches it can be seen that the measurement corresponds very well with the theoretical values. However, the measured pulsations tend to be higher than the theoretically calculated values.
These deviations have two basic causes. The theoretical values are calculated with a lossless model. The losses will be covered at constant AC power for ϕ ≤ ±90 • via the DC side. The DC current is thus greater than in the lossless case.
Due to the additional power, the energy pulsation is increased accordingly. The second source of inaccuracies is the measurement value acquisition itself. Besides quantization errors and errors of the amplifications and offsets of the measuring device, the energies of the branches are only determined indirectly via the voltage of the capacitors. For the cell capacitance, the same nominal value is assumed for all 30 cells. The nominal values of the electrolytic capacitors can deviate from the real values by up to ±20%.
Nevertheless, the measurements show very good congruence between the theoretical and measured values. Furthermore, it is clear that the new method for reducing the energy pulsation at any phase angle is superior to the state of the art as long as the maximum allowable branch current is not reached and the semiconductor losses do not result in excessive junction temperatures.

C. ENERGY PULSATION DURING A LOAD STEP
The largest energy pulsation is reached during transient processes. This is due to the fact that at the moment of the change of the operating point, the power for balancing is no longer calculated correctly. Since the stored energy cannot be changed instantaneously, compensating processes take place until the control of the system has reached the new operating point. This leads to deviations and, in the worst case, can cause the energy to leave the permissible tolerance band.
This results in a shut down of the converter As already shown in [17], the dynamics of the energy control can be increased by removing the mandatory filters from the controlled system and predicting the energy trajectories online. [58] shows that it is possible to improve the design of transient crossovers by calculating the energy trajectories before and after the transition. By optimizing the current trajectories, the energy pulsations in certain operating points can be significantly reduced. As a disadvantage it has to be mentioned that the energy trajectories have to be available as analytical functions. However, if the current trajectories as presented in this paper are used for the optimal energy pulsation, the pulsation can already be reduced in stationary operation. Thus the peak during the transient process does not become larger compared to [58]. Fig. 10 depicts a load step of the system, using different kinds of energy pulsation reduction. The output power is changed from 1.7 kVA to 8.5 kVA with a phase angle of ϕ = π/3. For reasons of clarity, only the enveloping curves of the energy pulsations are shown. It can be seen that the greatest energy pulsation occurs without additional compensating currents (red curve). The peak during the load jump can be reduced by the trajectory-based method according to [58] (blue curve). However, the energy pulsation is not reduced in stationary operation. If, on the other hand, the enveloping curve with optimal current trajectories is considered, a clear improvement can be seen in all operating points (yellow curve). Both before and after the transition, the energy pulsation is significantly reduced. During the transition, an overshoot of the energy pulsation can also be seen. However, this peak is smaller in absolute terms, since the energy pulsation has already been reduced before.
This shows that the new approach to modeling and optimization leads to smaller energy pulsation not only in steady state but also in transient operation. However, it must be mentioned that the branch current is increased accordingly. A tradeoff will always have to be made when reducing the energy pulsation in MMC based systems.

D. SUMMARY OF MEASUREMENT RESULTS
Section VI presents measurement results obtained at the laboratory setup in order to verify the model and the control structure derived from it. It shows the performance of the control in steady-state operation. The new approach of modeling allows a quick and easy decoupling of the system. An analytical and systematical derivation of the transformation matrices allows a simple design of the energy and current controls.
The developed calculation of the optimal current trajectories for energy pulsation reduction allows a significant reduction of the energy pulsation in stationary operation. It is proven that the energy pulsation can be significantly reduced in contrast to the reduction by means of the 2nd harmonic in the energy pulsation. This applies to the entire range of the power factor. With pure reactive power injection, the effect can even be observed considerably larger. It is shown that the optimal current trajectories in case of a load step allow a reduction of the maximum occurring energy pulsation, even compared to optimal transition trajectories for currents and energies. The modeling and the design of the control are verified by means of the implementation in the laboratory.

VII. CONCLUSION
A new approach for modeling MMC systems is introduced. With the help of this modeling it is possible to apply efficient optimization methods for the system.
From the analytical description of the differential equations, a state space model of MMC is derived. Starting from the state of the art, methods are shown to decouple the system. Mathematical tools are used which enable a systematical analysis of the occurring control and output variables. Subsequently, the degrees of freedom of the internal currents and the zero sequence voltage known from the MMC are derived, which can be used to reduce the energy pulsation.
Different approaches to the reduction are presented. Parameter optimization and function optimization are introduced and carried out for an exemplary system. It is shown with a laboratory setup, that this approach is superior to the state of the art methods in many operation conditions regarding the energy pulsations. This even includes the pulsation during a load step in comparison to a dedicated load step optimization method. In stationary operation, a reduction down to 56% of the energy pulsation is possible.
This reduction in energy pulsation allows to save costs in the design of the capacitors.
All of this factors together make a dynamic, efficient and grid-compatible use of the modular multilevel converter even more effective and enables it as tomorrow's backbone of the sustainable power supply.