A method for controlling an electrical converter, the electrical converter comprising at least one of an active rectifier configured to convert an AC current into a DC current, a DC link and an inverter configured to convert a DC current into an AC current interconnecting an electrical source with an electrical load; the method comprising: receiving at least one estimated control variable, which is estimated from measurement values measured in the electrical converter; receiving at least one outer loop control variable provided by an outer control loop, the at least one outer loop control variable providing a desired steady-state operation point of the electrical converter; determining a control region (56a, 56b) based on a control error, which is a difference between the at least one estimated control variable and the at least one outer loop control variable, wherein the control region is defined by one or more intervals of the at least one control variable; selecting control parameters based on the control region (56a, 56b), whereby the control parameters have been assigned to each control region (56a, 56b) and have been selected offline, whereby each control region (56a, 56b) has the same calculation scheme and different control parameters, wherein, when the control error is in an inner control region, first control parameters are selected, and, when the control error is outside the inner control region but inside an outer control region, second control parameters are selected; switching, between two or more control methods, which differ in control parameters, by calculating at least one reference control value based on an offline solution of a physical model of the electrical converter, which comprises the selected control parameters, the physical model being based on differential equations modelling the at least one estimated control variable and the solution being based on a constraint minimization of a difference between the at least one estimated control variable and the at least one outer loop control variable; and determining switching states of the electrical converter based on the reference control value. receiving at least one estimated control variable, which is estimated from measurement values measured in the electrical converter; receiving at least one outer loop control variable provided by an outer control loop, the at least one outer loop control variable providing a desired steady-state operation point of the electrical converter; determining a control region (56a, 56b) based on a control error, which is a difference between the at least one estimated control variable and the at least one outer loop control variable, wherein the control region is defined by one or more intervals of the at least one control variable; selecting control parameters based on the control region (56a, 56b), whereby the control parameters have been assigned to each control region (56a, 56b) and have been selected offline, whereby each control region (56a, 56b) has the same calculation scheme and different control parameters, wherein, when the control error is in an inner control region, first control parameters are selected, and, when the control error is outside the inner control region but inside an outer control region, second control parameters are selected; switching, between two or more control methods, which differ in control parameters, by calculating at least one reference control value based on an offline solution of a physical model of the electrical converter, which comprises the selected control parameters, the physical model being based on differential equations modelling the at least one estimated control variable and the solution being based on a constraint minimization of a difference between the at least one estimated control variable and the at least one outer loop control variable; and determining switching states of the electrical converter based on the reference control value.