An electrical converter (10) comprising: a main stage (12) adapted to convert a
DC voltage to an intermediate
voltage comprising at least two
voltage levels; and a filter
cell stage (14) having, for each phase of the main stage (12), a filter
cell (30), each filter
cell (30) being adapted to add or subtract a
cell voltage of said filter cell (30) to or from an intermediate
voltage. A method for controlling an electrical converter (10) comprises a pattern determination section (44) comprising the steps of: selecting and reading an off-line calculated optimized
pulse pattern (OPPbase) from a
database, where the selected optimized
pulse pattern (OPPbase) comprises switching timings of a primary stage (12) and a filter unit (30) on a next calculation window (alphawin) of a predetermined width (alphaw); the optimization
pulse pattern (OPPbase) is adjusted by shifting the
switching time of the optimization pulse pattern (OPPbase) in such a way that an average output voltage generated in the filter unit (30) is shifted towards an average output
voltage reference (Uba1, abc) of the filter unit (30), which average output
voltage reference (Uba1, abc) is determined as a function of a measurement in the filter unit (30), and the adjustments are compensated by a corresponding modification of the
switching time of the main stage (12). The method further includes a
model predictive control section (46) including steps performed several times during the next calculation window ([alpha] win): modifying the adjusted optimization pulse pattern (66) by moving at least one
transition time of the
switching time, such that a flux error determined from the difference between the estimated flux (74) of the electrical converter (10) and the reference flux trajectory (psi ref) is minimized; and applying at least a next switching time to the electrical converter (10) according to the modified adjusted pulse pattern.