A PT2 (proportional time second order) filter (=low-pass element of order 1), with varying smaple-time.
More...
template<class T>
class controlpp::timevar::PT2Control< T >
A PT2 (proportional time second order) filter (=low-pass element of order 1), with varying smaple-time.
With the transfer function:
\[
\text{PT}_{2} = \frac{K}{\frac{s^2}{\omega^2} + \frac{2 D s}{\omega} + 1}
\]
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 = \frac{K \left( u_k + 2 u_{k-1} + u_{k-2} \right) - b y_{k-1} - c y_{k-2}}{a} \\
a = \frac{4}{\omega^2 + T_s^2} + 4 D + 1 \\
b = 2 - \frac{8}{\omega^2 T_s^2} \\
c = \frac{4}{\omega^2 + T_s^2} - 4 D + 1
\]
with:
- \(K\) the gain of the filter
- \(T_s\) the sample-time in seconds
- \(\omega\) the characteristic frequency of the filter (bandwidth)
- \(D\) the dampening factor
- Aperiodic borderline case: D = 1
- Overdamped(creep-in) : D > 1
- Underdamped(exponential decreasing oscillations): 0 < D < 1
- Oscillating: D = 0
- \(u_{k}\), \(u_{k-1}\) and \(u_{k-2}\) are current and previous control inputs
- \(y_{k}\), \(y_{k-1}\) and \(y_{k-2}\) are current and previous control outputs
- Template Parameters
-
| T | Value type of the filter like float or double |
TODO: calculate the tustin discretised states space manuall and build the state space matrices directly to improve performance-