-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreport.tex
More file actions
347 lines (323 loc) · 15.6 KB
/
Copy pathreport.tex
File metadata and controls
347 lines (323 loc) · 15.6 KB
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
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
\documentclass[a4paper]{report}
\usepackage{tikz}
\usepackage{xeCJK}
\usepackage{float}
\usepackage{amsmath}
\usepackage{fancyhdr}
\usepackage{titlesec}
\usepackage{graphicx}
\usepackage{circuitikz}
\setCJKmainfont [
Path = fonts/,
Extension = .ttf,
UprightFont = *-Regular,
ItalicFont = *-Regular,
AutoFakeBold = true] {LXGWWenKaiMono}
\setCJKmonofont[
Path = fonts/,
Extension = .ttf,
UprightFont = *-Regular,
ItalicFont = *-Regular,
AutoFakeBold = true] {LXGWWenKaiMono}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[C]{模拟电子技术基础课程设计——BJT差动放大器电路}
\fancyfoot[C]{\thepage}
\fancypagestyle{plain}{
\fancyhf{}
\fancyhead[C]{模拟电子技术基础课程设计——BJT差动放大器电路}
\fancyfoot[C]{\thepage}
}
\titleformat{\chapter}[display] {\normalfont\bfseries}{}{0pt}{\Huge}
\titlespacing*{\chapter}{0pt}{-30pt}{20pt}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\renewcommand{\contentsname}{目录}
\usepackage[colorlinks=true, linkcolor=black, urlcolor=blue]{hyperref}
\begin{document}
\pagenumbering{roman}
\tableofcontents
\newpage
\clearpage
\pagenumbering{arabic}
\chapter{课程设计题目}
本次课程设计题目为:设计一个带有恒流源的单端输入-单端输出的差动放大器。
\section{设计要求}
\begin{itemize}
\item 电源电压为:$\pm 12\mathrm{V}$
\item 输入信号参数:$f_{in} = 1kHz$,$U_{in} = 10mV$
\item 负载电阻:$R_{L} = 20k\Omega$
\item 设计指标:
\begin{itemize}
\item 电压增益$A_{v} > 15$
\item 差模输入阻抗$R_{id} > 10k\Omega$
\item 共模抑制比$CMRR > 50\mathrm{dB}$
\end{itemize}
\end{itemize}
\section{仿真方案}
本次课程设计中,我们采用以下的仿真方案:
\begin{itemize}
\item 对于电路仿真,我们采用LTSpice软件
\item 对于数据处理,我们采用Python语言,使用ltspice库读取仿真数据,使用NumPy库和SciPy库进行数据处理
\item 对于数据可视化,我们采用Matplotlib库
\item 对于需要放在文章中的电路图,我们采用KiCAD重新绘制以保证美观
\end{itemize}
如果需要实际运行这个工程,请确保你的电脑上存在以下环境:
\begin{enumerate}
\item LTSpice软件 (笔者的软件版本号为:24.1.10)
\item Python解释器,需要安装以下库:
\begin{itemize}
\item ltspice库
\item NumPy库
\item SciPy库
\item Matplotlib库
\end{itemize}
\item 如果需要编译tex版本的实验报告,请确保安装了xelatex编译器
\end{enumerate}
\textbf{注意}:本次课程设计的所有代码、电路图均在GitHub上公开,GitHub地址为:\\
\url{https://github.com/ZhiYi-R/AnalogCircuitCourseDesign_Amplifier}
\chapter{设计思路及详细实现}
\section{三极管的小信号模型推导}
考虑到临近期末,笔者决定在编写报告时顺便推导一次三极管的小信号模型,权当期末复习。 \\
首先我们作如下约定:
\begin{enumerate}
\item 因为输入信号很小,我们忽略$V_{in}$对$I_{CE}$的影响,即$I_{CE} \approx I_{CEQ}$
\item 计算过程中,我们认为同型号的BJT参数完全一致,因此可以使用对称性简化计算
\item BJT是理想的,其满足Shockley方程,和$I_{CE} = \beta I_{BE}$
\item 由于$\beta$相当大,我们可以忽略$I_{BE}$对$I_{E}$的影响,即$I_{E} \approx I_{CE}$
\end{enumerate}
我们以经典的共射放大电路为例:
\begin{figure}[H]
\centering
\begin{circuitikz}[american]
\draw (0, 0) node[npn](Q1) {$Q_{1}$};
\draw (Q1.base)
to[short, -*] ++(-0.5, 0)
coordinate(n1)
to[short] ++(0, 1)
to[R=$R_{B_{1}}$] ++(0, 1.5)
coordinate(n2);
\draw (Q1.collector)
to[short, -*] ++(0, 0.5)
coordinate(n3)
to[short] ++(0, 0.5)
to[R=$R_{C}$] ++(0, 1.5)
to[short, -*] ++(0, 0.5)
coordinate(n4)
to[short] ++(0, 0.5)
node[vcc] {$V_{CC}$};
\draw (Q1.emitter)
to[short, -*] ++(0, -0.5)
coordinate(n5)
to[short] ++(0, -0.5)
to[R=$R_{E}$] ++(0, -1.5)
to[short, -*] ++(0, -0.5)
coordinate(n6)
to[short] ++(0, -0.5)
node[tlground] {};
\draw (n1)
to[short] ++(0, -1)
to[R=$R_{B_{2}}$] ++(0, -1.5)
coordinate(n7);
\draw (n1)
to[short] ++(-0.5, 0)
to[C=$C_{in}$] ++(-1.5, 0)
to[short] ++(-0.5, 0)
node[ocirc] {}
node[left] {$U_{in}$};
\draw(n3)
to[short] ++(0.5, 0)
to[C=$C_{out}$] ++(1.5, 0)
to[short] ++(0.5, 0)
node[ocirc] {}
node[right] {$U_{out}$};
\draw(n5)
to[short] ++(1.5, 0)
to[short] ++(0, -0.5)
to[C=$C_{E}$] ++(0, -1.5)
coordinate(n8);
\draw (n2) |- (n4);
\draw (n8) |- (n6);
\draw (n7) |- (n6);
\end{circuitikz}
\caption{共射放大电路}
\end{figure}
\newpage
\subsection{基本参数推导}
我们定义这样两个参数:
\begin{itemize}
\item 电路的电压增益: $A_{v} = \dfrac{\partial U_{out}}{\partial U_{in}}$
\item 三极管的跨导: $g_{m} = \dfrac{\partial I_{CE}}{\partial U_{BE}}$
\end{itemize}
我们对三极管的输出回路写出KVL方程,对于$R_{C}$写出欧姆定律:
$$
\left\{\begin{aligned}
&U_{R_{C}} + U_{out} = U_{CC} \\
&U_{R_{C}} = I_{CE} R_{C}
\end{aligned}\right.
$$
可以容易地得到:$U_{out} = U_{CC} - I_{CE} R_{C}$ \\
由于$R_{C}$是一个常量,我们可以有:
$$
A_{v} = \dfrac{\partial U_{out}}{\partial U_{in}} = -R_{c}\dfrac{\partial I_{CE}}{\partial U_{in}}
$$
对于这个电路我们通常取足够大的$C_{in}$、$C_{out}$和$C_{E}$,因此我们可以认为:$U_{BE} = U_{BQ} + U_{in} - U_{EE}$,
又静态基极电压$U_{BQ}$和静态发射极电压$U_{EQ}$都是常数,因此我们可以得到:
$$
A_{v} = -R_{c}\dfrac{\partial I_{CE}}{\partial U_{in}} = -R_{c}\dfrac{\partial I_{CE}}{\partial U_{BE}} = -g_{m} R_{c}
$$
我们接下来只需要求出$g_{m}$,即可完成对$A_{v}$的计算。我们首先写出Shockley方程:
$$I_{E} = I_{S}\left( e^{\tfrac{U_{BE}}{V_{T}}} - 1 \right)$$
我们将这个表达式对$U_{BE}$求偏导,得到:
$$g_{m} = \dfrac{\partial I_{E}}{\partial U_{BE}} = \dfrac{I_{S}}{V_{T}} e^{\tfrac{U_{BE}}{V_{T}}}$$
常温下$V_{T} \approx 26mV$,而BJT的$U_{BEQ}$通常为数百 $mV$,于是:
$$
e^{\tfrac{U_{BE}}{V_{T}}} \gg 1
$$
即我们认为:$I_{E} \left( e^{\tfrac{U_{BE}}{V_{T}}} - 1 \right) \approx I_{S} e^{\tfrac{U_{BE}}{V_{T}}}$
将$g_{m}$的表达式中的$I_{S} e^{\tfrac{U_{BE}}{V_{T}}}$用$I_{E}$替换,我们即可得到:
$$
\boxed{\ g_{m} \approx \dfrac{I_{E}}{V_{T}} }
$$
我们接下来考虑这个电路的输入和输出阻抗,我们可以很容易的分析出:
$$
\boxed{\ R_{o} = R_{c}\ }
$$
\newpage
我们将三极管BE结的动态电阻记作$r_{be}$,可以写出其定义式:
$$r_{be} = \dfrac{\partial U_{BE}}{\partial I_{BE}}$$
由于有:$I_{E} = \beta I_{BE}$,于是:
$$r_{be} = \beta\dfrac{\partial U_{BE}}{\partial I_{CE}}$$
又有$g_{m} = \dfrac{\partial I_{CE}}{\partial U_{BE}}$于是: $r_{be} = \dfrac{\beta}{g_{m}}$
我们将$g_{m} = \dfrac{I_{E}}{V_{T}}$代入即可得到$r_{be}$:
$$r_{be} = \dfrac{\beta V_{T}}{I_{E}} = \boxed{\ \dfrac{V_{T}}{I_{BE}}\ }$$
而这个电路的输出电阻实际上等于:
$$r_{be} + R_{E}\ //\ R_{B_{1}}\ //\ R_{B_{2}}$$
\subsection{共射放大电路分析}
对于Figure 2.1所示的共射放大电路,我们有$U_{BEQ} = U{BQ} - U_{BEQ}$、$U_{BEQ} \approx 0.7V$(硅管),于是:
$$
U_{BQ} \approx U_{CC}\ \cdot \ \dfrac{R_{B_{2}}}{R_{B_{1}} + R_{B_{2}}}
$$
我们可以进一步得到:$U_{EQ} = U_{BQ} - U_{BEQ}$,于是我们对$R_{E}$写出欧姆定律即可求出$I_{EQ}$
$$I_{EQ} = \dfrac{U_{EQ}}{R_{E}}$$
根据三极管的特征方程我们可以求得:$I_{BEQ} \approx \dfrac{I_{EQ}}{\beta}$
将这些参数代入上一小节我们得出的结论,即可容易地算出该电路的各种参数。\par
对于其它的放大电路,推导过程类似,其核心在于Shockley方程的求导和近似,这里不再赘述。
\newpage
\section{电路方案选择与参数计算}
\subsection{长尾电路参数计算}
对于带尾电流源的差动放大器,其基本结构如下:
\begin{figure}[H]
\centering
\includegraphics[width=0.8\textwidth]{Images/Basic_Amplifier_Circuit.png}
\caption{带尾电流源的差动放大器}
\end{figure}
这个结构实际上就是两个共射放大电路并联,并共用一个尾电流源来提供静态工作点。其增益计算与上一节中给出的共射放大电路的增益计算一样,公式为:
$$A_{v} = -g_{m} R_{c} = -\dfrac{R_{C}I_{EQ}}{V_{T}}$$
我们不妨取$R_{C} = 10k\Omega$,而由于负载仅$20k\Omega$,且单端输出的增益仅为差分输出增益的一半,我们取$A_{v} = 100$来留出足够的余量。我们可以计算出,对于半个差动放大器:
$$I_{EQ} = \dfrac{A_{v}V_{T}}{R_{C}} \approx 260 \mu A$$
而由于对称性,尾电流源的电流$I_{tail}$满足:
$$I_{tail} = 2I_{EQ} \approx 520 \mu A$$
\newpage
接下来我们计算这个电路的理论差模输入阻抗,对于这个电路,其理论差模输入阻抗$R_{id}$实际上等价于两个$r_{be}$的串联,即:
\begin{equation}
R_{id} = 2r_{be} = 2\beta\dfrac{V_{T}}{I_{EQ}}
\end{equation}
由于我们还没有选择仿真的器件,这个表达式我们暂且按$\beta = 100$进行估算:
$$R_{id} = 2\beta\dfrac{V_{T}}{I_{EQ}} \approx 10k\Omega$$
恰好满足题目要求,因此我们在选择器件时,其必须满足$\beta \geq 100$
\subsection{尾电流源参数计算}
为了让这个电路性能尽可能的好,笔者选择使用一个PNP管参考电流源+两个NPN管构成电流镜的方案,其基本结构如下:
\begin{figure}[H]
\centering
\includegraphics[width=0.8\textwidth]{Images/Current_Source_Circuit.png}
\caption{尾电流源电路}
\end{figure}
\newpage
由于电路的对称性,这个电流源的电流实际上就等于参考电流源的电流,即:
$$I_{tail} = \dfrac{U_{CC} \left(\dfrac{R_{B_{2}}}{R_{B_{1}} + R_{B_{2}}} - 1 \right) + U_{BEQ}}{R_{E}}$$
我们取$U_{BEQ} = 0.7V$、$R_{E} = 10k\Omega$,又有:$I_{tail} = 520uA$,我们可以得到:
$$U_{B} \approx 5.9 V$$
为了工程上的便利,我们取$U_{B} \approx 6 V$,故而可以取$R_{B_{1}} = R_{B_{1}} = 10k\Omega$ \\
对于BJT,我们差分对选取FZT849, 尾电流源的NPN管选择2N3904,PNP管选择2N3906,这都是很常见的BJT型号 \\
至此我们完成了所有的参数计算,设计部分完成,其整体电路如下图,参数在上面的计算中已经给出:
\begin{figure}[H]
\centering
\includegraphics[width=0.8\textwidth]{Images/Full_Circuit.png}
\caption{带尾电流源的差动放大器}
\end{figure}
\newpage
\subsection{BJT参数验证}
由于LTSpice中并不能直接找到三极管的$\beta$(事实上任何spice仿真软件都不能直接找到$\beta$),因此我们通过这样一个电路来测试三极管的$\beta$
\begin{figure}[H]
\centering
\includegraphics[width=0.8\textwidth]{Images/Parameter_Measure_BJT.png}
\caption{BJT参数测试}
\end{figure}
对于PNP管只需稍加改动即可,这里不再重复。我们对这样一个电路进行直流参数扫描,扫描参数为 $I_{BE}$ 。同时使用Python脚本分析扫描数据,使用SciPy的curve\_fit拟合出 $I_{BE}$ 与 $U_{BE}$ 的关系,即可得到 $\beta$ ,最终我们得到的 $\beta$ 如下表:
\begin{table}[H]
\centering
\begin{tabular}{|c|c|c|c|}
\hline
三极管型号 & 三极管极性 & $\beta$ & 拟合$R^{2}$ \\
\hline
FZT849 & NPN & 212.07 & 1.00 \\
\hline
2N3904 & NPN & 250.91 & 0.98 \\
\hline
2N3906 & PNP & 167.28 & 0.98 \\
\hline
\end{tabular}
\caption{三极管参数拟合结果}
\end{table}
可以看到,我们拟合出的 $\beta$ 满足上面计算中对于 $\beta \geq 100$ 的要求,因此我们选择的三极管合理的。
\newpage
\textbf{附}:参数测试的拟合图与残差图
\begin{figure}[H]
\centering
\includegraphics[width=1.0\textwidth]{Images/BJT_ParameterFit.png}
\caption{三极管参数拟合图与残差图}
\end{figure}
\chapter{功能验证与仿真结果}
\section{尾电流源参数验证}
我们对于Figure 2.3所示的电路进行驯服电压-输出电流测试,测试得到的曲线如下:
\begin{figure}[H]
\centering
\includegraphics[width=1.0\textwidth]{Images/CurrentSource_Character.png}
\caption{电流源特性}
\end{figure}
可以看到这个电流源的输出电压,可以保证输出的电流基本恒定,确保了电路的静态工作点稳定。同时这个电流源的驯服电压几乎为0,确保了电路的动态范围足够大,符合我们的设计要求。
\newpage
\section{放大电路参数验证}
\subsection{增益与THD+N}
我们对于Figure 2.4所示的电路进行时域仿真,我们取$f_{in} = 10kHz$,$U_{pp_{in}} = 20mV$,仿真结果如下:
\begin{figure}[H]
\centering
\includegraphics[width=1.0\textwidth]{Images/Amplifier_GainAndDistortion.png}
\caption{放大电路增益与THD+N测试结果}
\end{figure}
最终的增益为$A_{v} = 36.48V/V(31.24dB)$, $THD+N = 0.44\%$,增益满足设计要求,并且失真非常小。
\newpage
\subsection{幅频响应、相频响应与输入阻抗谱}
我们对于Figure 2.4所示的电路进行AC分析,从$1Hz$扫描到$100MHz$,将输入相位设置为:$-pi$,我们可以得到其响应如下:
\begin{figure}[H]
\centering
\includegraphics[width=0.8\textwidth]{Images/Amplifier_FrequencyDomain.png}
\caption{放大电路幅频响应与相频响应}
\end{figure}
可以看到在题目要求的条件下,阻抗和增益都满足要求。同时放大器的截止频率经脚本分析为:$316.23kHz$,远大于题目要求的输入信号频率,符合设计要求。
\section{共模抑制比}
我们将电路切换到差分-差分形式,输入一个共模信号并进行AC扫描,得到其CMRR-f曲线如下:
\begin{figure}[H]
\centering
\includegraphics[width=0.4\textwidth]{Images/Amplifier_CMRR.png}
\caption{CMRR曲线}
\end{figure}
可以看到CMRR全程大于200dB,远大于设计要求的50dB,符合设计要求。所有参数均已通过验证,符合设计要求。
\chapter{心得与体会}
本次课程设计中,我从零开始推导出了三极管的混合$\Pi$模型,并利用这一模型进行了放大电路的设计与验证。在设计过程中,我从理论上推导了电路的参数,包括增益、幅频响应、相频响应、输入阻抗谱、共模抑制比等。同时,我还利用LTSpice进行了仿真验证,确保了设计的正确性。
\vspace{1em}
\par 通过这次课程设计,我对三极管的混合$\Pi$模型有了更深入的理解,同时也将曾经视为经验和魔法的放大电路设计完成了理论化,这为我今后的电路设计提供了扎实理论基础。
\vspace{1em}
\par 在仿真和验证过程中,由于LTSpice自带的数据分析功能过于局限。我还学会了使用Python配合ltspice库对LTSpice的仿真数据进行处理,提取出需要的参数进行分析。这对我之后的电路仿真和分析提供了极大的便利。我可以利用Python的灵活性,对仿真数据进行任意处理,进行更复杂的分析,而不是局限于测量电压、电流或是计算FFT。
\end{document}