Skip to content
Snippets Groups Projects
Commit 2d43bf8c authored by Alan Wai Hou Lio's avatar Alan Wai Hou Lio
Browse files

corrected: first-order filter and time constant

parent 66352804
No related branches found
No related tags found
1 merge request!5Update manual
Pipeline #40685 passed
......@@ -8,50 +8,50 @@ This appendix contains the derivations of the discrete filters and a test of the
\subsection{Low pass filter}
In continuous form the first order low-pass filter can be written as
\begin{equation}\label{e:f1cont}
\dot{\bar x} + \omega \bar x = \omega x
\tau\dot{\bar x} + \bar x = x
\end{equation}
where $x=x(t)$ is the original signal, $\bar x(t)$ is the filtered signal, $\omega$ is the user-defined cut-off frequency of the filter in radian per second, and $\dot{(\,)}=d/dt$ denotes the time derivative. The discrete first order low-pass filter used in the controller is derived from this continuous formulation by approximating the states and their time derivatives as an average based on the previous and current step:
where $x=x(t)$ is the original signal, $\bar x(t)$ is the filtered signal, $\tau$ is the user-defined time constant of the filter, and $\dot{(\,)}=d/dt$ denotes the time derivative. The discrete first order low-pass filter used in the controller is derived from this continuous formulation by approximating the states and their time derivatives as an average based on the previous and current step:
\begin{equation}\label{e:1storder}
x(t)\approx \frac{x_k+x_{k-1}}2 \;\;\;\;\mbox{and} \;\;\;\;\dot x(t)\approx \frac{x_k-x_{k-1}}{\Delta t}
\end{equation}
where $k$ is the index of the current time step, and $\Delta t$ is the time step length. Substitution into \eqref{e:f1cont} and rearranging the terms, the $f_1$-function is obtained as
\begin{equation}
\label{e:f1}
f_1 \left(\omega; \bar x_{k-1} , x_{k} , x_{k-1} \right) = a_1 \bar x_{k-1} + b_0 x_k + b_1 x_{k-1}
f_1 \left(\tau; \bar x_{k-1} , x_{k} , x_{k-1} \right) = a_1 \bar x_{k-1} + b_0 x_k + b_1 x_{k-1}
\end{equation}
where
\begin{equation}
\label{e:f1coef}
a_1=\frac {2\omega-\Delta t}{2\omega+\Delta t} , \;\;\;\; b_0 = \frac {\Delta t}{2\omega+\Delta t}, \;\;\;\; b_1 = b_0
a_1=\frac {2\tau-\Delta t}{2\tau+\Delta t} , \;\;\;\; b_0 = \frac {\Delta t}{2\tau+\Delta t}, \;\;\;\; b_1 = b_0
\end{equation}
To test this discrete filter, the Finite-Difference Method for constructing periodic solutions \cite{Nayfeh95} has been used to obtain the period solutions to harmonic excitation of the filter with a large number of different excitation frequencies. Figure~\ref{f:f1} shows the amplitude and phase of these solutions (red circles) compared to the transfer function obtained by transformation of the continuous formulation \eqref{e:f1cont} into the frequency domain.
\begin{figure}[t]
\centerline{\epsfig{figure=f1.eps,width=0.95\textwidth} }
\caption{Test of the first order low-pass filter function \eqref{e:f1} with a cut-off frequency of $\omega=1~\mathrm{rad/s} \approx 0.159~\mathrm{Hz}$ and a time step of $\Delta t = 0.125$~s. \label{f:f1}}
\caption{Test of the first order low-pass filter function \eqref{e:f1} with a time constant $\tau=1~\mathrm{s}$ and a time step of $\Delta t = 0.125$~s. \label{f:f1}}
\end{figure}
\subsection{First order high pass filter}
The continuous-time representation of the first order high pass filter can be written as follows:
\begin{align}\label{eq:highpass}
\dot{\bar{x}} + \omega \bar{x} = \dot{x},
\tau \dot{\bar{x}} + \bar{x} = \tau \dot{x},
\end{align}
where $x = x(t)$ and $\bar{x}$ are the original and filtered signals, respectively. The user-defined cut-off frequency of the filter in radian per second is denoted as $\omega$ and $\dot{(\, )} = d/dt$ denotes the time derivative. Substituting the approximation of the states and their time derivatives~\eqref{e:1storder} into~\eqref{eq:highpass}, the discrete-time form of the first order high pass filter can be written as follows:
where $x = x(t)$ and $\bar{x}$ are the original and filtered signals, respectively. The user-defined time constant of the filter is denoted as $\omega$ and $\dot{(\, )} = d/dt$ denotes the time derivative. Substituting the approximation of the states and their time derivatives~\eqref{e:1storder} into~\eqref{eq:highpass}, the discrete-time form of the first order high pass filter can be written as follows:
\begin{align}\label{eq:f_1,hp}
f_{1,hp} \left(\omega; \bar x_{k-1} , x_{k} , x_{k-1} \right) = a_1 \bar x_{k-1} + b_0 x_k + b_1 x_{k-1}
f_{1,hp} \left(\tau; \bar x_{k-1} , x_{k} , x_{k-1} \right) = a_1 \bar x_{k-1} + b_0 x_k + b_1 x_{k-1}
\end{align}
where
\begin{align}
a_1 = \frac{2-\omega\Delta t}{2+\omega\Delta t}, \quad b_0 = \frac{2}{2 +\omega \Delta t}, \quad b_1 = -b_0
a_1 = \frac{2\tau -\Delta t}{2\tau + \Delta t}, \quad b_0 = \frac{2\tau }{2 \tau+ \Delta t}, \quad b_1 = -b_0
\end{align}
Test and validation of the filter are shown in Figure~\ref{f:f_hp_1st}.
\begin{figure}[t]
\centerline{\epsfig{figure=f_hp_1st.eps,width=0.95\textwidth} }
\caption{Test of the first order high-pass filter function \eqref{eq:f_1,hp} with a cut-off frequency of $\omega=1~\mathrm{rad/s} \approx 0.159~\mathrm{Hz}$ and a time step of $\Delta t = 0.125$~s. \label{f:f_hp_1st}}
\caption{Test of the first order high-pass filter function \eqref{eq:f_1,hp} with a time constant of $\tau=1~\mathrm{s}$ and a time step of $\Delta t = 0.125$~s. \label{f:f_hp_1st}}
\end{figure}
\section{Second order filters}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment