A Thamed PI controller (PI controller with a low pass filter) with variable sample-times.
More...
template<class T>
class controlpp::timevar::PT1IControl< T >
A Thamed PI controller (PI controller with a low pass filter) with variable sample-times.
The purely proportional component of a PI controller can amplify high-frequency noise. * While this does not improve control performance, it may lead to increased power consumption due to rapid steering actions. * To mitigate this, the proportional gain (P) can be replaced with a first-order low-pass filter (PT1), effectively transforming the PI controller into a PT1I controller.
With the transfer function:
\[
\text{PI} = \frac{s k_p + k_i}{s + \frac{s^2}{\omega}}
\]
and the discretisation using the tustin transformation:
\[
s = \frac{2}{T_s} \frac{1 - z^{-1}}{1 + z^{-1}}
\]
resulting in the controlers time series:
\[
y_k = (K * (b_0 * u_k + b_1 * u_{k-1} + b_2 * u_{k-2}) - a_1 * y_{k-1} - a_2 * y_{k-2}) / a_0
\]
where:
\[
K = \omega * T_s
a0 = 4 + 2 * \omega * T_s
a1 = -8
a2 = 4 - 2 * \omega * T_s
b0 = 2 * k_p + k_i * T_s
b1 = 2 * k_i * T_s
b2 = k_i * T_s - 2 * k_p
\]
with:
- \(T_s\) the sample-time in seconds
- \(u_{k}\) and \(u_{k-1}\) are current and previous control inputs
- \(y_{k}\) and \(y_{k-1}\) are current and previous control outputs
- \(k_p\) the proportional gain
- \(k_i\) the integral gain
- \(\omega\) the characteristic frequency of the low pass filter aimed to thame the P control at high frequencies
- See also
- controlpp::vartime::PT1I
- Template Parameters
-
| T | Value type of the filter like float or double |