-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrcrc.tex
313 lines (248 loc) · 8.65 KB
/
rcrc.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
% Warn about obsolete things
\RequirePackage[l2tabu, orthodox]{nag}
% KOMA-Script class
% \documentclass[12pt, paper=a4]{scrartcl}
% Regular class
\documentclass[12pt, a4paper]{article}
\usepackage[a4paper]{geometry}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{svg}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{siunitx}
\sisetup{
inter-unit-product = \ensuremath{{}\cdot{}},
per-mode = fraction,
% fraction-function = \tfrac,
% unit-color = purple
}
\usepackage{microtype}
\usepackage[siunitx]{circuitikz}
\usepackage{listings}
\usepackage{color}
% Always load hyperref in the end
\usepackage{hyperref}
\hypersetup{pdftex,colorlinks=true,allcolors=blue}
\usepackage{hypcap}
% Images directory
\graphicspath{{images/}}
% Display next functions as upright text
\DeclareMathOperator{\atantwo}{atan2}
\renewcommand{\Re}{\operatorname{Re}}
\renewcommand{\Im}{\operatorname{Im}}
% \abs(): Display vertical bars for things like |z|
\providecommand{\abs}[1]{\lvert#1\rvert}
% Macro for roman numbers
\makeatletter
\newcommand*{\rom}[1]{\expandafter\@slowromancap\romannumeral #1@}
\makeatother
% \appname command
\newcommand{\appname}[1]{\texttt{#1}}
% Don't show warnings: "multiple pdfs with page group included in a single page"
\pdfsuppresswarningpagegroup=1
% Listing: caption setup
\DeclareCaptionFont{white}{\color{white}}
\DeclareCaptionFormat{listing}{\colorbox{gray}{\parbox{\textwidth}{#1#2#3}}}
\captionsetup[lstlisting]{format=listing,labelfont=white,textfont=white,
singlelinecheck=false,margin=0pt,font={bf,footnotesize}}
% Listings: Maxima language markup support
\lstdefinelanguage{Maxima}{
keywords={ratsimp,ev,load,solve,sqrt,rhs,lhs,define,expand,subst,realpart,
imagpart,cabs,bode_gain,bode_phase},
sensitive=true,
comment=[s][\color{gray}\itshape]{/*}{*/}
}
% Listings: configuration
\lstset{
language=Maxima,
basicstyle=\small\sffamily,
numbers=left,
numberstyle=\tiny,
% frame=tb,
columns=fullflexible,
showstringspaces=false,
commentstyle=\color{gray},
keywordstyle=\color{blue}\bfseries,
numberstyle=\color{purple},
}
\title{Passive Second Order Low Pass Filter}
\author{Sam Protsenko}
\date{\today}
% ------------------------------------------------------------------------------
\begin{document}
\maketitle
\begin{abstract}
Article shows calculating of passive 2nd order LPF (Low Pass Filter) parameters,
using Linux software like \appname{Maxima} and \appname{Qucs}.
\end{abstract}
\section{Transfer function calculation}
\subsection{Calculating output voltage}
\begin{figure}[h!]
\centering
\begin{circuitikz}[european, scale=3.5]
\draw
(0,0) to[sV, l=$v_I$] (0,1) node[label={[font=\footnotesize]$v_I$}]{}
to[R, l=$R_1$, i_=$i_1$] (1,1)
node[label={[font=\footnotesize]$v_{C_1}$}]{}
to[C, l=$C_1$, i>^=$i_2$] (1,0)
to[short] (0,0)
(1,1) to[R, l=$R_2$, i>_=$i_3$, *-] (2,1)
node[label={[font=\footnotesize]$v_O$}]{}
to[C, l=$C_2$] (2,0)
to[short, -*] (1,0)
(1,0) node[ground]{}
;
\end{circuitikz}
\caption{Passive 2nd order LPF}
\end{figure}
Let's find out $v_O$ using \textbf{node method}. All currents:
\[ i_1 = \frac{v_I - v_{C_1}}{R_1} \]
\[ i_2 = \frac{v_{C_1}}{X_{C_1}} = \frac{v_{C_1}}{\frac{1}{s C_1}} \]
\[ i_3 = \frac{v_{C_1}}{R_2 + X_{C_2}}
= \frac{v_{C_1}}{R_2 + \frac{1}{s C_2}} \]
KCL for $v_{C_1}$ node:
\[ i_1 - i_2 - i_3 = 0 \]
Substitute currents equations to KCL and solve it for $v_{C_1}$:
\[ v_{C_1} = v_I \frac{R_2 C_2 s + 1}{(R_1 C_1 s + 1)(R_2 C_2 s + 1)
+ R_1 C_2 s} \]
Output voltage:
\[ v_O = v_{C_1} - i_3 R_2 = v_I \frac{1}{(R_1 C_1 s + 1)(R_2 C_2 s + 1)
+ R_1 C_2 s} \]
Transfer function:
\begin{equation*}
\begin{split}
H(s) = \frac{v_O}{v_I}
&= \frac{1}{(R_1 C_1 s + 1)(R_2 C_2 s + 1) + R_1 C_2 s} \\
&= \frac{1}{R_1 R_2 C_1 C_2 s^2 + (R_1 C_1 + R_1 C_2 + R_2 C_2) s + 1} \\
&= \frac{1}{m s^2 + b s + k}
\end{split}
\end{equation*}
Where coefficients:
\begin{equation*}
\begin{split}
& m = R_1 R_2 C_1 C_2 \\
& b = R_1 C_1 + R_1 C_2 + R_2 C_2 \\
& k = 1
\end{split}
\end{equation*}
Transfer function was calculation in \appname{Maxima}, see
listing~\ref{lst:transfer}.
\lstinputlisting[
caption=Transfer function calculation,
label=lst:transfer
]{listings/transfer.mac}
\subsection{Standard form of transfer function}
Standard form of transfer function for second order LPF:
\[ H(s) = \frac{k_{dc}}{\frac{s^2}{\omega_n^2} + 2 \frac{\zeta}{\omega_n} s + 1}
= \frac{k_{dc} \omega_n^2}{s^2 + 2 \zeta \omega_n s + \omega_n^2} \]
Let's calculate coefficients for standard form from our transfer function:
\begin{alignat*}{3}
&k_{dc} &&= \frac{1}{k} &&= 1 \\
&\omega_n &&= \sqrt{\frac{k}{m}} &&= \frac{1}{\sqrt{R_1 R_2 C_1 C_2}} \\
&\zeta &&= \frac{b}{2 m \sqrt{k / m}}
&&= \frac{R_1 C_1 + R_1 C_2 + R_2 C_2}{2 \sqrt{R_1 R_2 C_1 C_2}}
\end{alignat*}
where
\begin{itemize}
\item $k_{dc}$ -- gain
\item $\omega_n$ -- natural frequency
\item $\zeta$ -- damping ratio
\end{itemize}
Also, quality factor is:
\[ Q = \frac{1}{2 \zeta} = \frac{m \sqrt{k / m}}{b}
= \frac{\sqrt{R_1 R_2 C_1 C_2}}{R_1 C_1 + R_1 C_2 + R_2 C_2} \]
Let's check if calculations are correct so far (see listing~\ref{lst:check}).
\lstinputlisting[
caption=Verify if transfer function in standard form is correct,
label=lst:check
]{listings/check-transfer.mac}
\section{Cut-off frequency calculation}
From Laplace transform to Fourier transform:
\[ H(j \omega) = H(s)\bigr\rvert_{s = j \omega}
= \frac{\omega_n^2}{-\omega^2 + 2 \zeta \omega_n j \omega + \omega_n^2} \]
Real part:
\[ \Re(H(j \omega)) =
\frac{\omega_n^2 (\omega_n^2 - \omega^2)}
{(\omega_n^2 - \omega^2)^2 + 4 \zeta^2 \omega^2 \omega_n^2} \]
Imaginary part:
\[ \Im(H(j \omega)) =
- \frac{2 \zeta \omega \omega_n^3}
{(\omega_n^2 - \omega^2)^2 + 4 \zeta^2 \omega^2 \omega_n^2} \]
Magnitude:
\[ \abs{H(j \omega)} = \sqrt{\Re(H(j \omega))^2 + \Im(H(j \omega))^2}
= \frac{\omega_n^2}{\sqrt{(\omega_n^2 - \omega^2)^2
+ 4 \zeta^2 \omega^2 \omega_n^2}} \]
Cut-off frequency is where magnitude at \textit{half-power point}, which is
$\frac{1}{\sqrt{2}}$ (approximately at \SI{-3}{\decibel}):
\[ 20 \log_{10}{K} = 20 \log_{10}{\frac{1}{\sqrt{2}}} \approx
\SI{-3}{\decibel} \]
So the equation is:
\[ \abs{H(j \omega)} = \frac{1}{\sqrt{2}} \]
\[ \frac{\omega_n^2}{\sqrt{(\omega_n^2 - \omega^2)^2
+ 4 \zeta^2 \omega^2 \omega_n^2}}
= \frac{1}{\sqrt{2}} \]
Solve it for $\omega = \omega_c$:
\[ \omega_c = \omega_n \sqrt{1 - 2 \zeta^2
+ \sqrt{4 \zeta^4 - 4 \zeta^2 + 2}} \]
All calculations were done in \appname{Maxima}, see listing~\ref{lst:wc}.
\lstinputlisting[
caption=Calculate cut-off frequency,
label=lst:wc
]{listings/wc.mac}
\section{Simulating the filter}
\subsection{Simplification}
To simplify calculations, let's make an assumption:
\[ R = R_1 = R_2 \]
\[ C = C_1 = C_2 \]
Then transfer function parameters will be:
\[ \omega_n = \frac{1}{R C} \]
\[ \zeta = 1.5 \]
The quality factor:
\[ Q = \frac{1}{3} \]
$Q < \frac{1}{2}$, so the system is overdamped (doesn't oscillate).
For calculated $\zeta$ and $\omega_N$, we can recalculate out $\omega_c$:
\[ \omega_c = \frac{\omega_n}{2.672} \]
The cut-off frequency can be calculated:
\[ f_c = \frac{\omega_c}{2 \pi} = \frac{\omega_n}{16.789}
= \frac{1}{16.789 R C} \]
\subsection{RC calculations}
Let's calculate $R$ and $C$ values for given cut-off frequency:
\[ f_c \geqslant \SI{16}{\kilo\hertz} \]
Let's choose resistors from E24 series, and capacitors from E6 series, so
that $f_c \geqslant \SI{16}{\kilo\hertz}$:
\[ R = \SI{11}{\kilo\ohm} \]
\[ C = \SI{330}{\pico\farad} \]
Then real cut-off frequency is:
\[ f_c = \frac{1}{16.789 R C} = \SI{16.408}{\kilo\hertz} \]
Or in angular form:
\[ \omega_c = 2 \pi f_c = \SI{103094.5}{\radian\per\second} \]
\subsection{Simulation in Maxima}
Listing~\ref{lst:bode} shows the way to plot bode diagrams in \appname{Maxima}.
\lstinputlisting[
caption=Bode plot,
label=lst:bode
]{listings/bode.mac}
The resulting plot is shown on figure~\ref{fig:bode}.
\begin{figure}[h!]
\centering
\includesvg[width = 400pt]{images/bode}
\caption{Bode gain plot from Maxima}
\label{fig:bode}
\end{figure}
One can also use \appname{COMA} package in \appname{Maxima} for Control
Engineering calculations and visualization.
\subsection{Simulation in Qucs}
\begin{figure}[h!]
\centering
\includegraphics[width = 400pt]{images/qucs-scheme.png}
\caption{Scheme from Qucs}
\label{fig:qucs_scheme}
\end{figure}
\begin{figure}[h!]
\centering
\includegraphics[width = 420pt]{images/qucs-plot.png}
\caption{Plot from Qucs}
\label{fig:qucs_plot}
\end{figure}
\end{document}