A method for controlling a modular converter connected to an electrical grid for active power filtering the electrical grid to compensate for a load connected to the electrical grid, comprises: receiving an actual load current and an actual converter state of the modular converter; determining, from the actual load current and a history of previous load currents, a sequence of future load currents over a prediction horizon; predicting a sequence of future converter states of the modular converter and a sequence of manipulated variables for the modular converter over the prediction horizon by solving an optimization problem based on the actual converter state and the future load currents by minimizing an objective function mapping control objectives to a scalar performance index subject to the dynamical evolution of a prediction model of the modular converter and subject to constraints; and applying a next switching state, which is determined from a first element of the sequence of manipulated variables, to the modular converter.
展开▼