# FOC: Compensation Control

 When it comes to the design of the field-oriented current control loop, the most common control structures make use of two simple PI-regulators. This is a good choice, because they are easy to implement and -correcty parameterized-, they fit our demands for the control system (see: Is PID control superior to PI-control?) Many application notes and control unit manufacturers are recommending to parameterize the PI-controller gains by the use of the compensation control scheme, a special case of the optimum magnitude criteria. The calcultion is based on the fundamental electrical equations in the dq-reference frame: $u_d = R_s \, i_d + L_d\,\frac{d i_d}{d t} – L_q\,\Omega_{el}\,i_q$ $u_q = R_s \, i_q + L_q\,\frac{d i_q}{d t} + L_d\,\Omega_{el}\,i_d + \Omega_{el}\,\Psi_m$ Now, let’s assume that we feedforward-compensated the coupling terms correctly and there are no distrubance terms (caused by harmonics, cross-couplings, interlocking-time…). This simplifies our equations to: $u_d = R_s \, i_d + L_d\,\frac{d i_d}{d t}$ $u_q = R_s \, i_q + L_q\,\frac{d i_q}{d t}$ It can be seen that the equation for both axis have the same structure, so as further example, we’ll stick with the equation for the d-axis. The Laplace tramsform of the feedfordward-compensated d-axis equation leeds us to: $G_p(s) = \frac{1}{L_d\,s+R_s} = \frac{1/R_s}{(L_d/R_s)\,s+1}$ That’s a simple first-order lag with a steady state gain of $$G = 1/R_s$$ and a time constant of $$\tau = L_d/R_s$$. This plant structure makes it possible to design a PI-controller as a so called compensation controller. Using a PI-controller $G_r(s)=k_p+\frac{k_i}{s}$ with the control gains $$k_p = L_d/T_w$$ and $$k_i = R_s/T_w$$ leads to the closed loop reference transfer function $G_w(s)=\frac{L_d\,s+R_s}{L_d\,T_w\,s^2+(R_s\,T_w+L_d)s+R_s}=\frac{1}{T_w\,s+1}$ Notice that this compensation only takes place in the closed loop reference path. The disturbance the closed loop transfer function $G_z(s)=-\frac{T_w\,s}{(T_w\,s+1)(L_d\,s+R_s)}\neq\frac{1}{T_w\,s+1}$ of the reference path leads to Using the compensation control scheme, the control gains are given as $k_p = \frac{L_d}{T_w}=2\,\pi\,f_w\,L_d\qquad k_i = \frac{R_s}{T_w} = 2\,\pi\,f_w\,R_s$ whereas T_w is our desired time-constant for the closed loop system. Now, we can adjust the bandwidth of the closed loop system by adjusting T_w. But is there a catch?

### 3. Control Parameters

#### a. Continuous Design

When it comes to the design of the field-oriented current control loop, the most common control structures make use of two simple PI-regulators. This is a good choice, because they are easy to implement and -correcty parameterized-, they fit our demands for the control system (see: Is PID control superior to PI-control?)

Many application notes and control unit manufacturers are recommending to parameterize the PI-controller gains by the use of the compensation control scheme, a special case of the optimum magnitude criteria. The calcultion is based on the fundamental electrical equations in the dq-reference frame:

\begin{aligned} u_d &= R_s \, i_d + L_d\,\frac{d i_d}{d t} – L_q\,\omega_{el}\,i_q \\[3px] u_q &= R_s \, i_q + L_q\,\frac{d i_q}{d t} + L_d\,\omega_{el}\,i_d + \omega_{el}\,\Psi_m \end{aligned}

Now, let’s assume that we feedforward-compensated the coupling terms correctly and there are no distrubance terms (caused by harmonics, cross-couplings, interlocking-time…).

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.

### Case 1: Low Bandwidth / Slow Control

When it comes to the design of the field-oriented current control loop, the most common control structures make use of two simple PI-regulators. This is a good choice, because they are easy to implement and -correcty parameterized-, they fit our demands for the control system (see: Is PID control superior to PI-control?) Many application notes and control unit manufacturers are recommending to parameterize the PI-controller gains by the use of the compensation control scheme, a special case of the optimum magnitude criteria. The calcultion is based on the fundamental electrical equations in the dq-reference frame:  $u_d = R_s \, i_d + L_d\,\frac{d i_d}{d t} – L_q\,\Omega_{el}\,i_q$ $u_q = R_s \, i_q + L_q\,\frac{d i_q}{d t} + L_d\,\Omega_{el}\,i_d + \Omega_{el}\,\Psi_m$ Now, let’s assume that we feedforward-compensated the coupling terms correctly and there are no distrubance terms (caused by harmonics, cross-couplings, interlocking-time…). This simplifies our equations to: $u_d = R_s \, i_d + L_d\,\frac{d i_d}{d t}$ $u_q = R_s \, i_q + L_q\,\frac{d i_q}{d t}$ It can be seen that the equation for both axis have the same structure, so as further example, we’ll stick with the equation for the d-axis. The Laplace tramsform of the feedfordward-compensated d-axis equation leeds us to: $G_p(s) = \frac{1}{L_d\,s+R_s} = \frac{1/R_s}{(L_d/R_s)\,s+1}$ That’s a simple first-order lag with a steady state gain of $$G = 1/R_s$$ and a time constant of $$\tau = L_d/R_s$$. Using the compensation control scheme, the control gains are given as $k_p = \frac{L_d}{T_w}=2\,\pi\,f_w\,L_d\qquad k_i = \frac{R_s}{T_w} = 2\,\pi\,f_w\,R_s$ whereas T_w is our desired time-constant for the closed loop system. Now, we can adjust the bandwidth of the closed loop system by adjusting T_w. But is there a catch?