A method for controlling an electrical converter, the method comprising: determining an error value ( ψ s, err) based on a difference between an estimated output value ( ψ s) and a reference output value ψ s *, the estimated output value being based on measurements in the electrical converter; comparing the error value ( ψ s. err) with a first error band and in the case of the error value being within the first error band, controlling the electrical converter with a modified pre-calculated switching sequence by: determining a pre-calculated switching sequence for the converter based on an actual state of the electrical converter, the switching sequence comprising a sequence of switching transitions of the converter; modifying the pre-calculated switching sequence by modifying transition times of switching transitions of the pre-calculated switching sequence, such that the error value ( ψ s, err) is minimized; applying at least a part of the modified switching sequence to the electrical converter; in the case where the error value ( ψ s, err) exceeds the first error band, controlling the electrical converter by switching to a different control scheme; whereby the different control scheme is based on inserting an additional switching transition (42a, 42b) into the pre-calculated switching sequence before the pre-calculated switching sequence is modified and the additional switching transition (42a, 42b) generate an additional pulse with an infinitesimal small width, resembing a virtual pulse; selecting an error band associated with the error value from a plurality of error bands (46a, 46b, 46c), whereby a voltage level of the inserted switching transition (42a, 42b) is dependent on the determined error band and a selection of an error band is based on past error values. determining an error value ( ψ s, err) based on a difference between an estimated output value ( ψ s) and a reference output value ψ s *, the estimated output value being based on measurements in the electrical converter; comparing the error value ( ψ s. err) with a first error band and in the case of the error value being within the first error band, controlling the electrical converter with a modified pre-calculated switching sequence by: determining a pre-calculated switching sequence for the converter based on an actual state of the electrical converter, the switching sequence comprising a sequence of switching transitions of the converter; modifying the pre-calculated switching sequence by modifying transition times of switching transitions of the pre-calculated switching sequence, such that the error value ( ψ s, err) is minimized; applying at least a part of the modified switching sequence to the electrical converter; in the case where the error value ( ψ s, err) exceeds the first error band, controlling the electrical converter by switching to a different control scheme; whereby the different control scheme is based on inserting an additional switching transition (42a, 42b) into the pre-calculated switching sequence before the pre-calculated switching sequence is modified and the additional switching transition (42a, 42b) generate an additional pulse with an infinitesimal small width, resembing a virtual pulse; selecting an error band associated with the error value from a plurality of error bands (46a, 46b, 46c), whereby a voltage level of the inserted switching transition (42a, 42b) is dependent on the determined error band and a selection of an error band is based on past error values. determining a pre-calculated switching sequence for the converter based on an actual state of the electrical converter, the switching sequence comprising a sequence of switching transitions of the converter; modifying the pre-calculated switching sequence by modifying transition times of switching transitions of the pre-calculated switching sequence, such that the error value ( ψ s, err) is minimized; applying at least a part of the modified switching sequence to the electrical converter; in the case where the error value ( ψ s, err) exceeds the first error band, controlling the electrical converter by switching to a different control scheme; whereby the different control scheme is based on inserting an additional switching transition (42a, 42b) into the pre-calculated switching sequence before the pre-calculated switching sequence is modified and the additional switching transition (42a, 42b) generate an additional pulse with an infinitesimal small width, resembing a virtual pulse; selecting an error band associated with the error value from a plurality of error bands (46a, 46b, 46c), whereby a voltage level of the inserted switching transition (42a, 42b) is dependent on the determined error band and a selection of an error band is based on past error values.