A method for controlling an electrical converter, the electrical converter comprising a main stage having an output comprising at least three phases of an intermediate voltage, the main stage configured to convert a DC voltage into the intermediate voltage, the intermediate voltage comprising at least two voltage levels, and a filter cell stage with a filter cell for each phase of the main stage, each filter cell configured to add or subtract a cell voltage of the filter cell to the intermediate voltage,
- the method comprising a pattern determination part comprising the following:
- selecting and reading an offline-computed optimized pulse pattern from a database, wherein the selected optimized pulse pattern (OPPbase) comprises switching instants for the main stage and the filter cells over a next computation window of a predetermined width;
- and
- adjusting the optimized pulse pattern (OPPbase) by moving its switching instants such that average output voltages generated in the filter cells are shifted towards an average output voltage reference of the filter cells, which is determined from measurements in the filter cells, and compensating these adjustments by corresponding modifications of switching instants of the main stage, wherein the average output voltage reference has at least three phases,
- the method further comprising a model predictive control part comprising the following, which are performed several times during the next computation window:
- modifying the adjusted optimized pulse patterns by moving at least one transition time of a switching instant, such that a flux error determined from a difference between an estimated flux of the electrical converter and a reference flux trajectory is minimized;
- and
- applying at least a next switching instant from the modified adjusted pulse pattern to the electrical converter.