summaryrefslogtreecommitdiff
path: root/chap_13.tex
blob: 9757ce280fb5b55e516b44f16dc559e420829f6d (plain)
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
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
\chapter{Solved Examples}
\thispagestyle{empty}
\label{chap12}

\section{Solved Examples}

%---------------RC circuit-------------------
\subsection{Basic RC Circuit}
\subsubsection{Problem Statement:} Plot the Input and Output Waveform of an RC circuit whose input voltage (Vs) is 50Hz, 3V peak to peak. The values of Resistor (R) and Capacitor(C) are $1k$ and $1uf$ respectively.
\subsubsection{Solution:}
\begin{itemize}
\item Creating a Project:
The new project is created by clicking the {\tt New} icon on the menubar. The name of the project is given in the pop up window as shown in \figref{rc1}.
\begin{figure}[!htp]
    \centering
    \includegraphics[width=\hgfig]{figures/rc1.png}
    %\includegraphics[width=\linewidth]{figures/rc1.png}
    \caption{Creating New Project}
    \label{rc1}
\end{figure}

\item Creating the Schematic:
To create the schematic, click the very first icon of the left toolbar as shown in the \figref{rc2}. This will open KiCad Eeschema.

\begin{figure}[!htp]
    \centering
    \includegraphics[width=\smfigp]{figures/rc2.png}
    %\includegraphics[width=\linewidth]{figures/rc2.png}
    \caption{Open Schematic Editor}
    \label{rc2}
\end{figure}

To create a schematic in KiCad, we need to place the required components. \figref{rc_component} shows the icon on the right toolbar which opens the component library.

\begin{figure}[!htp]
    \centering
    \includegraphics[width=\tnfig]{figures/rc_component.png}
    %\includegraphics[width=\linewidth]{figures/rc_component.png}
    \caption{Place Component Icon}
    \label{rc_component}
\end{figure}

\pagebreak

After all the required components of the simple RC circuit are placed, wiring is done using the {\tt Place Wire} option as shown in the \figref{rc_wire} 

\begin{figure}[!htp]
    \centering
    \includegraphics[width=\tnfig]{figures/rc_wire.png}
    %\includegraphics[width=\linewidth]{figures/rc_wire.png}
    \caption{Place Wire Icon}
    \label{rc_wire}
\end{figure}

Next step is {\tt ERC (Electric Rules Check)}. \figref{erc1} shows the icon for {\tt ERC}.

\begin{figure}[!htp]
    \centering
    \includegraphics[width=\lgfig]{figures/erc1.png}
    %\includegraphics[width=\linewidth]{figures/erc1.png}
    \caption{Electric Rules Check Icon}
    \label{erc1}
\end{figure}

\figref{rc_complete1} shows the RC circuit after connecting the components by wire.

\begin{figure}[!htp]
    \centering
    \includegraphics[width=\lgfig]{figures/rc_complete1.png}
    \caption{RC circuit}
    \label{rc_complete1}
\end{figure}

\pagebreak

After clicking the {\tt ERC} icon a window opens up. Click the {\tt Run} button to run rules check. The errors are listed in as shown in \figref{erc2}. This error is handled by adding {\tt Power Flag} as shown in \figref{rc_pwr}.

\begin{figure}[!htp]
    \centering
    \subfloat[ERC Run]{
        \includegraphics[width=\smfig]{figures/erc2.png}
    \label{erc2}} \hfill
    \subfloat[Power Flag]{
        \includegraphics[width= 5cm, height=5cm]{figures/rc_pwr.png}
    \label{rc_pwr}}
    \caption{ERC check and POWER FLAG}
\end{figure}

After adding the {\tt Power Flag} the completed RC circuit is shown in \figref{rc_schematic} and the netlist is generated as shown in \figref{rc_netlist}.


\begin{figure}[!htp]
    \centering
    \subfloat[Schematic of RC circuit]{
        \includegraphics[width=\smfig]{figures/rc_schematic.png}
    \label{rc_schematic}} \hfill
    \subfloat[Generating KiCad Netlist of RC circuit]{
        \includegraphics[width=\smfig]{figures/rc_netlistgeneration.png}
    \label{rc_netlist}}
    \caption{RC Schematic and Netlist Generation}
\end{figure}

\pagebreak
\item Convert KiCad to Ngspice:
To convert KiCad netlist of RC circuit to NgSpice compatible netlist click on KiCad to Ngspice icon as shown in \figref{rcki2ng}.

\begin{figure}[!htp]
\centering
\includegraphics[width=\tnfig]{figures/rc_ki2ng.png}
\caption{Convert KiCad to Ngspice Icon}
\label{rcki2ng}
\end{figure}

Now you can enter the type of analysis and source details as shown in \figref{rc_analysistab} and \figref{rc_sourcedetailstab} respectively.

\begin{figure}[!htp]
    \centering
    \subfloat[RC Analysis]{
        \includegraphics[width=\smfig]{figures/rc_analysistab.png}
    \label{rc_analysistab}} \hfill
    \subfloat[RC Source Details]{
        \includegraphics[width=\smfig]{figures/rc_sourcedetailstab.png}
    \label{rc_sourcedetailstab}}
    \caption{RC Analysis and Source Detail}
\end{figure}
The other tab will be empty as RC circuit do not use any Ngspice model, device library and subcircuit.

After entering the value, press the convert button. It will convert the netlist into Ngspice compatible netlist.

\pagebreak

\item Simulation:
To run Ngspice simulation click the simulation icon in the tool bar as shown in the \figref{rcplot}.
\begin{figure}[!htp]
\centering
\includegraphics[width=\tnfig]{figures/rc_plot.png}
\caption{Simulation Icon}
\label{rcplot}
\end{figure}

In eSim, there are two types of plot. First is normal Ngspice plot and second is interactive python plot as shown in \figref{rc_ngspiceplot} and \figref{rc_pythonplot} respectively.

\begin{figure}[!htp]
    \centering
    \subfloat[Ngspice Plot of RC]{
        \includegraphics[width=\lgfig]{figures/rc_ngspiceplot.png}
    \label{rc_ngspiceplot}}  \hfill
    \subfloat[Python Plot of RC]{
        \includegraphics[width=\lgfig]{figures/rc_pythonplot.png}
    \label{rc_pythonplot}}
    \caption{Ngspice and Interactive Python Plotting}
\end{figure}

In the interactive python plot you can select any node or branch to  plot voltage or current across it. Also it has the facility to plot basic functions across the node like addition, substraction, multiplication, division and v/s.  

\end{itemize}
%-----------------------Half Wave Rectifier---------------------------
\pagebreak

\subsection{Half Wave Rectifier}

\subsubsection{Problem Statement:} Plot the Input and Output Waveform of Half Wave Rectifier circuit where the input voltage (Vs) is 50Hz, 2V peak to peak. The value for Resistor (R) is 1k.

\subsubsection{Solution:}
The new project is created by clicking the {\tt New} icon on the menubar. The name of the project is given in the window shown in \figref{rc1}.

\begin{itemize}
\item Creating Schematic:
To create the schematic, click the very first icon of the left toolbar as shown in the \figref{rc2}. This will open KiCad Eeschema.\\

After the KiCad window is opened, to create a schematic we need to place the required components. \figref{rc_component} shows the icon on the 
right toolbar which opens the component library.\\

After all the required components of the simple Half Wave rectifier circuits are placed, wiring is done using the {\tt Place Wire} option as shown in the \figref{rc_wire}\\

Next step is {\tt ERC (Electric Rules Check)}. \figref{erc1} shows the icon for {\tt ERC}. After completing all the above steps the final Half Wave Rectifier schematic will look like \figref{hwr_schematic}.\\

\begin{figure}[!htp]
    \centering
    \includegraphics[width=\lgfig]{figures/hwr_schematic.png}
    \caption{Schematic of Half Wave Rectifier circuit}
    \label{hwr_schematic}
\end{figure}

\pagebreak

KiCad netlist is generated as shown in the \figref{hwr_netlistgeneration} \\

\begin{figure}[!htp]
    \centering
    \includegraphics[width=\lgfig]{figures/hwr_netlistgeneration.png}
    \caption{Half Wave Rectifier circuit Netlist Generation}
    \label{hwr_netlistgeneration}
\end{figure}

\item Convert KiCad to Ngspice: After creating KiCad netlist, click on the {\tt KiCad-Ngspice converter} button. This will open converter window where you can enter details of Analysis, Source values and Device library.

\begin{figure}[!htp]
    \centering
    \subfloat[Half Wave Rectifier Analysis]{
        \includegraphics[width=\smfig]{figures/hwr_analysistab.png}
    \label{hwr_analysistab}} \hfill
    \subfloat[Half Wave Rectifier Source Details]{
        \includegraphics[width=\smfig]{figures/hwr_sourcedetailstab.png}
    \label{hwr_sourcedetailstab}} \hfill
    \subfloat[Half Wave Rectifier Device Modeling]{
        \includegraphics[width=\smfig]{figures/hwr_devicemodelingtab.png}
    \label{hwr_devicemodelingtab}}
    \caption{Analysis, Source and Device Tab}
\end{figure}

Under device library you can add the library for diode used in the circuit. If you do not add any library it will take default Ngspice model.


\item Simulation: Once the KiCad-Ngspice converter runs successfully, you can run simulation by clicking the simulation button in the toolbar.
\begin{figure}[!htp]
    \centering
    \subfloat[Ngspice Plot of Half Wave Rectifier]{
        \includegraphics[width=\lgfig]{figures/hwr_ngspiceplot.png}
    \label{hwr_ngspiceplot}} \hfill
    \subfloat[Python Plot of Half Wave Rectifier]{
        \includegraphics[width=\lgfig]{figures/hwr_pythonplot.png}
    \label{hwr_pythonplot}}
    \caption{Half Wave Rectifier Simulation Output}
\end{figure}


\end{itemize}

\pagebreak
%-------------- Precision rectifier--------------------------------------

%\pagebreak

%\subsection{Precision Rectifier}
%\subsubsection{Problem Statement:} Plot the input and output waveform of the Precision Rectifier circuit where input voltage (Vs) is $50Hz$ , $3V$ peak to peak.

%\subsubsection{Solution:}
%The new project is created by clicking the {\tt New} icon on the menubar. The name of the project is given as shown in the \figref{rc1}.

%\begin{itemize}
%\item Creating Schematic:
%To create the schematic, click the very first icon of the left toolbar as shown in the \figref{rc2}. This will open KiCad Eeschema.\\
%After the KiCad window is opened, to create a schematic we need to place the required components. \figref{rc_component} shows the icon on the right toolbar which opens the component library.\\
%After all the required components of the precision rectifier circuit are placed, wiring is done using the {\tt Place Wire} option as shown in the \figref{rc_wire}.\\
%Next step is {\tt ERC (Electric Rules Check)}. \figref{erc1} shows the icon for {\tt ERC}.
%The \figref{pr_schematic} shows the complete Precision Rectifier schematic after removing the errors.

%\begin{figure}[!htp]
%\centering
%\includegraphics[width=\hgfig]{figures/pr_schematic.png}
%\caption{Schematic of Precision Rectifier circuit}
%\label{pr_schematic}
%\end{figure}

%The KiCad netlist is generated as shown in \figref{pr_netlistgeneration}.\\

%\begin{figure}[!htp]
%    \centering
%    \includegraphics[width=\lgfig]{figures/pr_netlistgeneration.png}
%    \caption{Precision Rectifier circuit Netlist Generation}
%    \label{pr_netlistgeneration}
%\end{figure}

%\pagebreak

%\item Convert KiCad to Ngspice: After creating KiCad netlist, click on KiCad-Ngspice converter button.\\ 

%    This will open converter window where you can enter details of Analysis, Source values, Device library and Subcircuit.

%\begin{figure}[!htp]
%   \centering
%    \subfloat[Precision Rectifier Analysis]{
%        \includegraphics[width=\smfig]{figures/pr_analysistab.png}
%    \label{pr_analysistab}} \hfill
%    \subfloat[Precision Rectifier Source Details]{
%        \includegraphics[width=\smfig]{figures/pr_sourcedetailstab.png}
%    \label{pr_sourcedetailstab}} \vfill
%    \subfloat[Precision Rectifier Device Modeling]{
%        \includegraphics[width=\smfig]{figures/pr_devicemodelingtab.png}
%    \label{pr_devicemodelingtab}}\hfill
%    \subfloat[Precision Rectifier Subcircuit]{
%        \includegraphics[width=\smfig]{figures/pr_subcircuitstab.png}
%    \label{pr_subcircuitstab}}
%    \caption{Analysis, Source, Device library and Subcircuit tab}
%\end{figure}

%Under device library you can add the library for the diode used in the circuit. If you do not add any library it will take default Ngspice 
%model for diode.\\

%Under subcircuit tab you have to add the subciruit used in your circuit. If you forget to add subcircuit it will throw an error.


%\pagebreak
%\item Simulation: Once the KiCad-Ngspice converter runs successfully, you can run the simulation by clicking the simulation button in the toolbar.
%\begin{figure}[!htp]
%    \centering
%    \subfloat[Ngspice Plot of Precision Rectifier]{
%        \includegraphics[width=\lgfig]{figures/pr_ngspiceplot.png}
%    \label{pr_ngspiceplot}} \hfill
%    \subfloat[Python Plot of Precision Rectifier]{
%        \includegraphics[width=\lgfig]{figures/pr_pythonplot.png}
%    \label{pr_pythonplot}}
%    \caption{Precision Rectifier Simulation Output}
%\end{figure}

%\end{itemize}

%-------------- Inverting Amplifier--------------------------------------

\pagebreak
\subsection{Inverting Amplifier}
\subsubsection{Problem Statement:}
Plot the Input and Output Waveform of Inverting Amplifier circuit where the input voltage (Vs) is $50Hz$, $2V$ peak to peak and gain is 2.
\subsubsection{Solution:}

\begin{itemize}
\item Creating Schematic:
To create the schematic, click the very first icon of the left toolbar as shown in the \figref{rc2}. This will open KiCad Eeschema.\\
After the KiCad window is opened, to create a schematic we need to place the required components. \figref{rc_component} shows the icon on the right toolbar which opens the component library.\\
After all the required components of the inverting amplifier circuit are placed, wiring is done using the {\tt Place Wire} option as shown in the \figref{rc_wire}.\\
Next step is {\tt ERC (Electric Rules Check)}. \figref{erc1} shows the icon for {\tt ERC}.

The \figref{ia_schematic} shows the complete Precision Rectifier schematic after removing the errors.

\begin{figure}[!htp]
    \centering
    \includegraphics[width=\hgfig]{figures/ia_schematic.png}
    \caption{Schematic of Inverting Amplifier circuit}
    \label{ia_schematic}
\end{figure}

The KiCad netlist is generated as shown in \figref{ia_netlistgeneration}.\\
\begin{figure}[!htp]
    \centering
    \includegraphics[width=\lgfig]{figures/ia_netlistgeneration.png}
    \caption{Inverting Amplifier circuit Netlist Generation}
    \label{ia_netlistgeneration}
\end{figure}


\item Convert KiCad to Ngspice:
After creating KiCad netlist, click on KiCad-Ngspice converter button.\\

This will open converter window where you can enter details of Analysis, Source values, Device library and Subcircuit.

Subcircuit of Op-Amp is shown in \figref{ia_sub}
    \begin{figure}[!htp]
        \centering
        \subfloat[Inverting Amplifier Analysis]{
            \includegraphics[width=\smfig]{figures/ia_analysistab.png}
        \label{ia_analysistab}} \hfill
        \subfloat[Inverting Amplifier Source Details]{
            \includegraphics[width=\smfig]{figures/ia_sourcedetailstab.png}
        \label{ia_sourcedetailstab}} \vfill
        \subfloat[Inverting Amplifier Subcircuit]{
            \includegraphics[width=\smfig]{figures/ia_subcircuitstab.png}
        \label{ia_subcircuitstab}}\hfill
        \subfloat[Sub-Circuit of Op-Amp]{
            \includegraphics[width=\lgfig]{figures/ia_sub.png}
        \label{ia_sub}}
        \caption{Analysis, Source, and Subcircuit tab}
    \end{figure}

\pagebreak
Under subcircuit tab you have to add the subciruit used in your circuit. If you forget to add subcircuit, it will throw an error.\\


\item Simulation: Once the KiCad-Ngspice converter runs successfully, you can run simulation by clicking the simulation button in the toolbar.
\begin{figure}
    \centering
    \subfloat[Inverting Amplifier Ngspice Plot]{
        \includegraphics[width=\lgfig]{figures/ia_ngspiceplot.png}
    \label{ia_ngspiceplot}}\vfill
    \subfloat[Inverting Amplifier Python Plot]{
        \includegraphics[width=\lgfig]{figures/ia_pythonplot.png}
    \label{ia_pythonplot}}
    \caption{Inverting Amplifier Simulation Output}
\end{figure}



\end{itemize}

%-------------------------Half Adder------------------------------------------

\pagebreak

\subsection{Half Adder}

\subsubsection{Problem Statement:}  Plot the Input and Output Waveform of Half Adder circuit.

\subsubsection{Solution:}

\begin{itemize}

\item Creating Schematic:  To create the schematic, click the very first icon of the left toolbar as shown in the \figref{rc2}. This will open KiCad Eeschema.\\
After the KiCad window is opened, to create a schematic we need to place the required components. \figref{rc_component} shows the icon on the right toolbar which opens the component library.\\
After all the required components of the Half Adder circuit are placed, wiring is done using the {\tt Place Wire} option as shown in the \figref{rc_wire}.\\
Next step is {\tt ERC (Electric Rules Check)}. \figref{erc1} shows the icon for {\tt ERC}.

The \figref{ha_schematic} shows the complete Half Adder schematic after removing the errors.
\begin{figure}[!htp]
    \centering
    \includegraphics[width=\hgfig]{figures/ha_schematic.png}
    \caption{Schematic of Half Adder circuit}
    \label{ha_schematic}
\end{figure}

The KiCad netlist is generated as shown in \figref{ha_netlistgeneration}.\\
\begin{figure}[!htp]
    \centering
    \includegraphics[width=\lgfig]{figures/ha_netlistgeneration.png}
    \caption{Half Adder circuit Netlist Generation}
    \label{ha_netlistgeneration}
\end{figure}

\pagebreak

\item Convert KiCad to Ngspice:
After creating KiCad netlist click on KiCad-Ngspice converter button.\\

This will open converter window where you can enter details of Analysis, Source values, Ngspice model and Subcircuit.

\begin{figure}[!htp]
    \centering
    \subfloat[Half Adder Analysis]{
        \includegraphics[width=\smfig]{figures/ha_analysistab.png}
    \label{ha_analysistab}} \hfill
    \subfloat[Half Adder Source Details]{
        \includegraphics[width=\smfig]{figures/ha_sourcedetailstab.png}
    \label{ha_sourcedetailstab}} \vfill
    \subfloat[Half Adder Ngspice Model]{
        \includegraphics[width=\smfig]{figures/ha_ngspicemodeltab.png}
    \label{ha_ngspicemodeltab}} \hfill
    \subfloat[Half Adder Subcircuit Model]{
        \includegraphics[width=\smfig]{figures/ha_subcircuitstab.png}
    \label{ha_subcircuitstab}}
    \caption{Analysis, Source, Ngspice Model and Subcircuit tab}
\end{figure}

Subcircuit of Half Adder in \figref{ha_sub}
\begin{figure}[!htp]
    \centering
    \includegraphics[width=\lgfig]{figures/ha_sub.png}
    \caption{Half Adder Subcircuit}
    \label{ha_sub}
\end{figure}

\pagebreak

\item Simulation: Once the KiCad-Ngspice converter runs successfully, you can run simulation by clicking the simulation button in the toolbar.
    \begin{figure}[!htp]
    \centering
    \subfloat[Half Adder Ngspice Plot]{
        \includegraphics[width=\lgfig]{figures/ha_ngspiceplot.png}
    \label{ha_ngspiceplot}} \hfill
    \subfloat[Half Adder Python Plot]{
        \includegraphics[width=\lgfig]{figures/ha_pythonplot.png}
    \label{ha_pythonplot}}
    \caption{Half Adder Simulation Output}
\end{figure}

\end{itemize}


%-------------------------Full Wave Rectifier using SCR------------------------------------------


\pagebreak

\subsection{Full Wave Rectifier using SCR}

\subsubsection{Problem Statement:}  Plot the Input and Output Waveform of Full Wave Rectifier using SCR.

\subsubsection{Solution:}

\begin{itemize}

\item Creating Schematic:  To create the schematic, click the very first icon of the left toolbar as shown in the \figref{rc2}. This will open KiCad Eeschema.\\
After the KiCad window is opened, to create a schematic we need to place the required components. \figref{rc_component} shows the icon on the right toolbar which opens the component library.\\
After all the required components of the Full Wave Rectifier using SCR circuit are placed, wiring is done using the {\tt Place Wire} option as shown in the \figref{rc_wire}.\\
Next step is {\tt ERC (Electric Rules Check)}. \figref{erc1} shows the icon for {\tt ERC}.

The \figref{fwrscr_schematic} shows the complete Rectifier circuit using SCR after removing the errors.
\begin{figure}[!htp]
    \centering
    \includegraphics[width=\hgfig]{figures/fwrscr_schematic.png}
    \caption{Schematic of Full Wave Rectifier using SCR}
    \label{fwrscr_schematic}
\end{figure}

The KiCad netlist is generated as shown in \figref{fwrscr_netlistgeneration}.\\
\begin{figure}[!htp]
    \centering
    \includegraphics[width=\lgfig]{figures/fwrscr_netlistgeneration.png}
    \caption{Full Wave Rectifier using SCR Netlist Generation}
    \label{fwrscr_netlistgeneration}
\end{figure}

\pagebreak

\item Convert KiCad to Ngspice:
After creating KiCad netlist click on KiCad-Ngspice converter button.\\

This will open converter window where you can enter details of Analysis, Source values, Ngspice model and Subcircuit.

\begin{figure}[!htp]
    \centering
    \subfloat[Full Wave Rectifier using SCR Analysis]{
        \includegraphics[width=\smfig]{figures/fwrscr_analysistab.png}
    \label{fwrscr_analysistab}} \hfill
    \subfloat[Full Wave Rectifier using SCR Source Details]{
        \includegraphics[width=\smfig]{figures/fwrscr_sourcedetailstab.png}
    \label{fwrscr_sourcedetailstab}} \vfill
    \subfloat[Full Wave Rectifier using SCR Subcircuit Model]{
        \includegraphics[width=\smfig]{figures/fwrscr_subcircuitstab.png}
    \label{fwrscr_subcircuitstab}}
    \caption{Analysis, Source and Subcircuit tab}
\end{figure}

Subcircuit of SCR in \figref{scr_sub}
\begin{figure}[!htp]
    \centering
    \includegraphics[width=\lgfig]{figures/scr_sub.png}
    \caption{SCR Subcircuit}
    \label{scr_sub}
\end{figure}

\pagebreak

\item Simulation: Once the KiCad-Ngspice converter runs successfully, you can run simulation by clicking the simulation button in the toolbar.
    \begin{figure}[!htp]
    \centering
    \subfloat[Full Wave Rectifier using SCR Ngspice Plot]{
        \includegraphics[width=\lgfig]{figures/fwrscr_ngspiceplot.png}
    \label{fwrscr_ngspiceplot}} \hfill
    \subfloat[Full Wave Rectifier using SCR Python Plot]{
        \includegraphics[width=\lgfig]{figures/fwrscr_pythonplot.png}
    \label{fwrscr_pythonplot}}
    \caption{Full Wave Rectifier using SCR Simulation Output}
\end{figure}

\end{itemize}


%-------------------------Oscillator------------------------------------------
\pagebreak

\subsection{Oscillator Circuit}

\subsubsection{Problem Statement:} Plot the Oscillation Waveforms for Phase Shift Oscillator circuit.

\subsubsection{Solution:}
The new project is created by clicking the {\tt New} icon on the menubar. The name of the project is given in the window shown in \figref{rc1}.

\begin{itemize}
\item Creating Schematic:
To create the schematic, click the very first icon of the left toolbar as shown in the \figref{rc2}. This will open KiCad Eeschema.\\

After the KiCad window is opened, to create a schematic we need to place the required components. \figref{rc_component} shows the icon on the 
right toolbar which opens the component library.\\

After all the required components of the Oscillator circuits are placed, wiring is done using the {\tt Place Wire} option as shown in the \figref{rc_wire}\\sss

Next step is {\tt ERC (Electric Rules Check)}. \figref{erc1} shows the icon for {\tt ERC}. After completing all the above steps the Oscillator schematic will look like \figref{osc_schematic}.\\

\begin{figure}[!htp]
    \centering
    \includegraphics[width=\lgfig]{figures/osc_schematic.png}
    \caption{Schematic of Phase Shift Oscillator circuit}
    \label{osc_schematic}
\end{figure}

\pagebreak

KiCad netlist is generated as shown in the \figref{osc_netlistgeneration} \\

\begin{figure}[!htp]
    \centering
    \includegraphics[width=\lgfig]{figures/osc_netlistgeneration.png}
    \caption{Phase Shift Oscillator circuit Netlist Generation}
    \label{osc_netlistgeneration}
\end{figure}

\item Convert KiCad to Ngspice: After creating KiCad netlist, click on the {\tt KiCad-Ngspice converter} button. This will open converter window where you can enter details of Analysis, Source values and Device library.

\begin{figure}[!htp]
    \centering
    \subfloat[Phase Shift Oscillator Analysis]{
        \includegraphics[width=\smfig]{figures/osc_analysistab.png}
    \label{osc_analysistab}} \hfill
    \subfloat[Phase Shift Oscillator Details]{
        \includegraphics[width=\smfig]{figures/osc_sourcedetailstab.png}
    \label{osc_sourcedetailstab}} \hfill
    \subfloat[Phase Shift Oscillator Device Modeling]{
        \includegraphics[width=\smfig]{figures/osc_devicemodelingtab.png}
    \label{osc_devicemodelingtab}}
    \caption{Analysis, Source and Device Tab}
\end{figure}

Under device library you can add the library for diode used in the circuit. If you do not add any library it will take default Ngspice model.


\item Simulation: Once the KiCad-Ngspice converter runs successfully, you can run simulation by clicking the simulation button in the toolbar.
\begin{figure}[!htp]
    \centering
    \subfloat[Ngspice Plot of Phase Shift Oscillator]{
        \includegraphics[width=\lgfig]{figures/osc_ngspiceplot.png}
    \label{osc_ngspiceplot}} \hfill
    \subfloat[Python Plot of Phase Shift Oscillator]{
        \includegraphics[width=\lgfig]{figures/osc_pythonplot.png}
    \label{osc_pythonplot}}
    \caption{Phase Shift Oscillator Simulation Output}
\end{figure}


\end{itemize}

%-------------------------BJT CB Characteristics------------------------------------------

\pagebreak

\subsection{Characteristics of BJT in Common Base Configuration}

\subsubsection{Problem Statement:} Plot Characteristics of BJT in Common Base Configuration.

\subsubsection{Solution:}
The new project is created by clicking the {\tt New} icon on the menubar. The name of the project is given in the window shown in \figref{rc1}.

\begin{itemize}
\item Creating Schematic:
To create the schematic, click the very first icon of the left toolbar as shown in the \figref{rc2}. This will open KiCad Eeschema.\\

After the KiCad window is opened, to create a schematic we need to place the required components. \figref{rc_component} shows the icon on the 
right toolbar which opens the component library.\\

After all the required components of the simple Half Wave rectifier circuits are placed, wiring is done using the {\tt Place Wire} option as shown in the \figref{rc_wire}\\

Next step is {\tt ERC (Electric Rules Check)}. \figref{erc1} shows the icon for {\tt ERC}. After completing all the above steps the BJT in CB Configuration schematic will look like \figref{cb_schematic}.\\

\begin{figure}[!htp]
    \centering
    \includegraphics[width=\lgfig]{figures/cb_schematic.png}
    \caption{Schematic of BJT in CB Configuration circuit}
    \label{cb_schematic}
\end{figure}

\pagebreak

KiCad netlist is generated as shown in the \figref{cb_netlistgeneration} \\

\begin{figure}[!htp]
    \centering
    \includegraphics[width=\lgfig]{figures/cb_netlistgeneration.png}
    \caption{BJT in CB Configuration circuit Netlist Generation}
    \label{cb_netlistgeneration}
\end{figure}

\item Convert KiCad to Ngspice: After creating KiCad netlist, click on the {\tt KiCad-Ngspice converter} button. This will open converter window where you can enter details of Analysis, Source values and Device library.

\begin{figure}[!htp]
    \centering
    \subfloat[BJT in CB Configuration Analysis]{
        \includegraphics[width=\smfig]{figures/cb_analysistab.png}
    \label{cb_analysistab}} \hfill
    \subfloat[BJT in CB Configuration Source Details]{
        \includegraphics[width=\smfig]{figures/cb_sourcedetailstab.png}
    \label{cb_sourcedetailstab}} \hfill
    \subfloat[BJT in CB Configuration Device Modeling]{
        \includegraphics[width=\smfig]{figures/cb_devicemodelingtab.png}
    \label{cb_devicemodelingtab}}
    \caption{Analysis, Source and Device Tab}
\end{figure}

Under device library you can add the library for diode used in the circuit. If you do not add any library it will take default Ngspice model.


\item Simulation: Once the KiCad-Ngspice converter runs successfully, you can run simulation by clicking the simulation button in the toolbar.
\begin{figure}[!htp]
    \centering
    \subfloat[Ngspice Plot of BJT in CB Configuration]{
        \includegraphics[width=\lgfig]{figures/cb_ngspiceplot.png}
    \label{cb_ngspiceplot}} \hfill
    \subfloat[Python Plot of BJT in CB Configuration]{
        \includegraphics[width=\lgfig]{figures/cb_pythonplot.png}
    \label{cb_pythonplot}}
    \caption{BJT in CB Configuration Simulation Output}
\end{figure}


\end{itemize}