From eee965197bd83b44946ff2e218c5e5487e0cfe2e Mon Sep 17 00:00:00 2001
From: Fahim
Date: Tue, 15 Sep 2015 15:11:02 +0530
Subject: Subject: Updated User Manual
Description: Updated User Manual
---
src/browser/pages/User-Manual/eSim.html | 4539 +++++++++-----------
src/browser/pages/User-Manual/figures/RC1.png | Bin 9168 -> 0 bytes
.../Screenshot from 2015-08-21 20:49:35.png | Bin 0 -> 142374 bytes
.../pages/User-Manual/figures/afterplace.png | Bin 5564 -> 3129 bytes
src/browser/pages/User-Manual/figures/anno.png | Bin 143129 -> 90491 bytes
.../pages/User-Manual/figures/blockdiagram.png | Bin 65691 -> 92127 bytes
.../pages/User-Manual/figures/capacitor.png | Bin 0 -> 30683 bytes
.../pages/User-Manual/figures/createsubcktsch.png | Bin 0 -> 2356 bytes
.../documentation/bkp/hwr/hwr_analysistab.png | Bin 0 -> 71187 bytes
.../figures/documentation/bkp/hwr/hwr_chematic.png | Bin 0 -> 5751 bytes
.../bkp/hwr/hwr_devicemodelingtab.png | Bin 0 -> 33588 bytes
.../bkp/hwr/hwr_netlistgeneration.png | Bin 0 -> 40743 bytes
.../documentation/bkp/hwr/hwr_ngspiceplot.png | Bin 0 -> 22902 bytes
.../documentation/bkp/hwr/hwr_pythonplot.png | Bin 0 -> 74453 bytes
.../documentation/bkp/hwr/hwr_sourcedetailstab.png | Bin 0 -> 45594 bytes
.../documentation/bkp/ia/ia_analysistab.png | Bin 0 -> 71136 bytes
.../documentation/bkp/ia/ia_netlistgeneration.png | Bin 0 -> 40152 bytes
.../documentation/bkp/ia/ia_ngspiceplot.png | Bin 0 -> 23147 bytes
.../figures/documentation/bkp/ia/ia_pythonplot.png | Bin 0 -> 100096 bytes
.../figures/documentation/bkp/ia/ia_schematic.png | Bin 0 -> 6689 bytes
.../documentation/bkp/ia/ia_sourcedetailstab.png | Bin 0 -> 45664 bytes
.../documentation/bkp/ia/ia_subcircuitstab.png | Bin 0 -> 32156 bytes
.../documentation/bkp/pr/pr_analysistab.png | Bin 0 -> 71117 bytes
.../documentation/bkp/pr/pr_devicemodelingtab.png | Bin 0 -> 46925 bytes
.../documentation/bkp/pr/pr_netlistgeneration.png | Bin 0 -> 39686 bytes
.../documentation/bkp/pr/pr_ngspiceplot.png | Bin 0 -> 26064 bytes
.../figures/documentation/bkp/pr/pr_pythonplot.png | Bin 0 -> 98758 bytes
.../figures/documentation/bkp/pr/pr_schematic.png | Bin 0 -> 7926 bytes
.../documentation/bkp/pr/pr_sourcedetailstab.png | Bin 0 -> 45600 bytes
.../documentation/bkp/pr/pr_subcircuitstab.png | Bin 0 -> 32181 bytes
.../documentation/bkp/rc/rc_analysistab.png | Bin 0 -> 71244 bytes
.../documentation/bkp/rc/rc_netlistgeneration.png | Bin 0 -> 39192 bytes
.../documentation/bkp/rc/rc_ngspiceplot.png | Bin 0 -> 22091 bytes
.../figures/documentation/bkp/rc/rc_pythonplot.png | Bin 0 -> 78958 bytes
.../figures/documentation/bkp/rc/rc_schematic.png | Bin 0 -> 7303 bytes
.../documentation/bkp/rc/rc_sourcedetailstab.png | Bin 0 -> 46035 bytes
.../figures/documentation/ha/ha_analysistab.png | Bin 71465 -> 70672 bytes
.../documentation/ha/ha_ngspicemodeltab.png | Bin 69988 -> 68645 bytes
.../documentation/ha/ha_sourcedetailstab.png | Bin 85029 -> 84205 bytes
.../figures/documentation/ha/ha_subcircuitstab.png | Bin 32988 -> 30066 bytes
.../figures/documentation/hwr/hwr_analysistab.png | Bin 71187 -> 70672 bytes
.../documentation/hwr/hwr_devicemodellingtab.png | Bin 0 -> 31215 bytes
.../documentation/hwr/hwr_sourcedetailstab.png | Bin 45594 -> 45253 bytes
.../figures/documentation/ia/ia_analysistab.png | Bin 71136 -> 70672 bytes
.../documentation/ia/ia_sourcedetailstab.png | Bin 45664 -> 45253 bytes
.../figures/documentation/ia/ia_subcircuitstab.png | Bin 32156 -> 29654 bytes
.../figures/documentation/pr/pr_analysistab.png | Bin 71117 -> 70672 bytes
.../documentation/pr/pr_sourcedetailstab.png | Bin 45600 -> 45305 bytes
.../figures/documentation/pr/pr_subcircuitstab.png | Bin 32181 -> 29654 bytes
.../figures/documentation/rc/rc_analysistab.png | Bin 71244 -> 70672 bytes
.../documentation/rc/rc_sourcedetailstab.png | Bin 46035 -> 45253 bytes
src/browser/pages/User-Manual/figures/erc1.png | Bin 8784 -> 16555 bytes
src/browser/pages/User-Manual/figures/erc2.png | Bin 0 -> 38401 bytes
src/browser/pages/User-Manual/figures/erc3.png | Bin 0 -> 28496 bytes
.../pages/User-Manual/figures/esim-subckt.png | Bin 0 -> 24331 bytes
.../pages/User-Manual/figures/guitoolbar.png | Bin 0 -> 48077 bytes
.../pages/User-Manual/figures/ha_analysistab.png | Bin 71465 -> 12358 bytes
.../User-Manual/figures/ha_ngspicemodeltab.png | Bin 69988 -> 49412 bytes
.../User-Manual/figures/ha_sourcedetailstab.png | Bin 85029 -> 16088 bytes
src/browser/pages/User-Manual/figures/ha_sub.png | Bin 0 -> 15061 bytes
.../User-Manual/figures/ha_subcircuitstab.png | Bin 32988 -> 10560 bytes
.../pages/User-Manual/figures/hwr_analysistab.png | Bin 71187 -> 12358 bytes
.../pages/User-Manual/figures/hwr_chematic.png | Bin 0 -> 5751 bytes
.../User-Manual/figures/hwr_devicemodelingtab.png | Bin 33588 -> 11071 bytes
.../User-Manual/figures/hwr_sourcedetailstab.png | Bin 45594 -> 25279 bytes
.../pages/User-Manual/figures/ia_analysistab.png | Bin 71136 -> 12358 bytes
.../User-Manual/figures/ia_sourcedetailstab.png | Bin 45664 -> 25279 bytes
src/browser/pages/User-Manual/figures/ia_sub.png | Bin 0 -> 8059 bytes
.../User-Manual/figures/ia_subcircuitstab.png | Bin 32156 -> 11269 bytes
.../pages/User-Manual/figures/lefttoolbar.png | Bin 0 -> 9539 bytes
.../pages/User-Manual/figures/libraries.png | Bin 0 -> 27932 bytes
src/browser/pages/User-Manual/figures/maingui.png | Bin 80843 -> 137381 bytes
.../pages/User-Manual/figures/modeledit.png | Bin 77489 -> 75032 bytes
.../pages/User-Manual/figures/modeleditor.png | Bin 25293 -> 33006 bytes
.../pages/User-Manual/figures/modeleditor_new.png | Bin 58190 -> 16699 bytes
.../User-Manual/figures/newsubcktschematic.png | Bin 0 -> 33834 bytes
src/browser/pages/User-Manual/figures/port_lib.png | Bin 0 -> 30986 bytes
.../pages/User-Manual/figures/pr_analysistab.png | Bin 71117 -> 12358 bytes
.../User-Manual/figures/pr_devicemodelingtab.png | Bin 46925 -> 21645 bytes
.../User-Manual/figures/pr_sourcedetailstab.png | Bin 45600 -> 25279 bytes
.../User-Manual/figures/pr_subcircuitstab.png | Bin 32181 -> 11269 bytes
src/browser/pages/User-Manual/figures/rc1.png | Bin 0 -> 121379 bytes
src/browser/pages/User-Manual/figures/rc2.png | Bin 0 -> 32279 bytes
.../pages/User-Manual/figures/rc_analysistab.png | Bin 71244 -> 12718 bytes
src/browser/pages/User-Manual/figures/rc_comp.png | Bin 0 -> 3693 bytes
.../pages/User-Manual/figures/rc_complete1.png | Bin 0 -> 5022 bytes
.../pages/User-Manual/figures/rc_component.png | Bin 0 -> 9888 bytes
src/browser/pages/User-Manual/figures/rc_ki2ng.png | Bin 0 -> 32912 bytes
src/browser/pages/User-Manual/figures/rc_plot.png | Bin 0 -> 30548 bytes
src/browser/pages/User-Manual/figures/rc_pwr.png | Bin 0 -> 24901 bytes
.../User-Manual/figures/rc_sourcedetailstab.png | Bin 46035 -> 25279 bytes
src/browser/pages/User-Manual/figures/rc_wire.png | Bin 0 -> 9658 bytes
src/browser/pages/User-Manual/figures/resistor.png | Bin 0 -> 29757 bytes
.../pages/User-Manual/figures/rightoolbar.png | Bin 0 -> 25404 bytes
.../pages/User-Manual/figures/schematic1.png | Bin 0 -> 90156 bytes
src/browser/pages/User-Manual/figures/schemfin.png | Bin 6538 -> 7787 bytes
.../User-Manual/figures/subcirciut_window.png | Bin 0 -> 14655 bytes
.../pages/User-Manual/figures/subcktnewcomp.png | Bin 0 -> 46407 bytes
.../pages/User-Manual/figures/toptoolbar.png | Bin 0 -> 42595 bytes
src/browser/pages/User-Manual/figures/wire1.png | Bin 5352 -> 3176 bytes
src/browser/pages/User-Manual/figures/wirefin.png | Bin 5597 -> 7094 bytes
101 files changed, 1980 insertions(+), 2559 deletions(-)
delete mode 100644 src/browser/pages/User-Manual/figures/RC1.png
create mode 100644 src/browser/pages/User-Manual/figures/Screenshot from 2015-08-21 20:49:35.png
create mode 100644 src/browser/pages/User-Manual/figures/capacitor.png
create mode 100644 src/browser/pages/User-Manual/figures/createsubcktsch.png
create mode 100644 src/browser/pages/User-Manual/figures/documentation/bkp/hwr/hwr_analysistab.png
create mode 100644 src/browser/pages/User-Manual/figures/documentation/bkp/hwr/hwr_chematic.png
create mode 100644 src/browser/pages/User-Manual/figures/documentation/bkp/hwr/hwr_devicemodelingtab.png
create mode 100644 src/browser/pages/User-Manual/figures/documentation/bkp/hwr/hwr_netlistgeneration.png
create mode 100644 src/browser/pages/User-Manual/figures/documentation/bkp/hwr/hwr_ngspiceplot.png
create mode 100644 src/browser/pages/User-Manual/figures/documentation/bkp/hwr/hwr_pythonplot.png
create mode 100644 src/browser/pages/User-Manual/figures/documentation/bkp/hwr/hwr_sourcedetailstab.png
create mode 100644 src/browser/pages/User-Manual/figures/documentation/bkp/ia/ia_analysistab.png
create mode 100644 src/browser/pages/User-Manual/figures/documentation/bkp/ia/ia_netlistgeneration.png
create mode 100644 src/browser/pages/User-Manual/figures/documentation/bkp/ia/ia_ngspiceplot.png
create mode 100644 src/browser/pages/User-Manual/figures/documentation/bkp/ia/ia_pythonplot.png
create mode 100644 src/browser/pages/User-Manual/figures/documentation/bkp/ia/ia_schematic.png
create mode 100644 src/browser/pages/User-Manual/figures/documentation/bkp/ia/ia_sourcedetailstab.png
create mode 100644 src/browser/pages/User-Manual/figures/documentation/bkp/ia/ia_subcircuitstab.png
create mode 100644 src/browser/pages/User-Manual/figures/documentation/bkp/pr/pr_analysistab.png
create mode 100644 src/browser/pages/User-Manual/figures/documentation/bkp/pr/pr_devicemodelingtab.png
create mode 100644 src/browser/pages/User-Manual/figures/documentation/bkp/pr/pr_netlistgeneration.png
create mode 100644 src/browser/pages/User-Manual/figures/documentation/bkp/pr/pr_ngspiceplot.png
create mode 100644 src/browser/pages/User-Manual/figures/documentation/bkp/pr/pr_pythonplot.png
create mode 100644 src/browser/pages/User-Manual/figures/documentation/bkp/pr/pr_schematic.png
create mode 100644 src/browser/pages/User-Manual/figures/documentation/bkp/pr/pr_sourcedetailstab.png
create mode 100644 src/browser/pages/User-Manual/figures/documentation/bkp/pr/pr_subcircuitstab.png
create mode 100644 src/browser/pages/User-Manual/figures/documentation/bkp/rc/rc_analysistab.png
create mode 100644 src/browser/pages/User-Manual/figures/documentation/bkp/rc/rc_netlistgeneration.png
create mode 100644 src/browser/pages/User-Manual/figures/documentation/bkp/rc/rc_ngspiceplot.png
create mode 100644 src/browser/pages/User-Manual/figures/documentation/bkp/rc/rc_pythonplot.png
create mode 100644 src/browser/pages/User-Manual/figures/documentation/bkp/rc/rc_schematic.png
create mode 100644 src/browser/pages/User-Manual/figures/documentation/bkp/rc/rc_sourcedetailstab.png
create mode 100644 src/browser/pages/User-Manual/figures/documentation/hwr/hwr_devicemodellingtab.png
create mode 100644 src/browser/pages/User-Manual/figures/erc2.png
create mode 100644 src/browser/pages/User-Manual/figures/erc3.png
create mode 100644 src/browser/pages/User-Manual/figures/esim-subckt.png
create mode 100644 src/browser/pages/User-Manual/figures/guitoolbar.png
create mode 100644 src/browser/pages/User-Manual/figures/ha_sub.png
create mode 100644 src/browser/pages/User-Manual/figures/hwr_chematic.png
create mode 100644 src/browser/pages/User-Manual/figures/ia_sub.png
create mode 100644 src/browser/pages/User-Manual/figures/lefttoolbar.png
create mode 100644 src/browser/pages/User-Manual/figures/libraries.png
create mode 100644 src/browser/pages/User-Manual/figures/newsubcktschematic.png
create mode 100644 src/browser/pages/User-Manual/figures/port_lib.png
create mode 100644 src/browser/pages/User-Manual/figures/rc1.png
create mode 100644 src/browser/pages/User-Manual/figures/rc2.png
create mode 100644 src/browser/pages/User-Manual/figures/rc_comp.png
create mode 100644 src/browser/pages/User-Manual/figures/rc_complete1.png
create mode 100644 src/browser/pages/User-Manual/figures/rc_component.png
create mode 100644 src/browser/pages/User-Manual/figures/rc_ki2ng.png
create mode 100644 src/browser/pages/User-Manual/figures/rc_plot.png
create mode 100644 src/browser/pages/User-Manual/figures/rc_pwr.png
create mode 100644 src/browser/pages/User-Manual/figures/rc_wire.png
create mode 100644 src/browser/pages/User-Manual/figures/resistor.png
create mode 100644 src/browser/pages/User-Manual/figures/rightoolbar.png
create mode 100644 src/browser/pages/User-Manual/figures/schematic1.png
create mode 100644 src/browser/pages/User-Manual/figures/subcirciut_window.png
create mode 100644 src/browser/pages/User-Manual/figures/subcktnewcomp.png
create mode 100644 src/browser/pages/User-Manual/figures/toptoolbar.png
(limited to 'src/browser/pages')
diff --git a/src/browser/pages/User-Manual/eSim.html b/src/browser/pages/User-Manual/eSim.html
index d14da283..a2a970e4 100644
--- a/src/browser/pages/User-Manual/eSim.html
+++ b/src/browser/pages/User-Manual/eSim.html
@@ -6,314 +6,167 @@
-
-
-
+
+
+
-
+
+
+
eSim
+An open source EDA tool for circuit design,
+simulation, analysis and PCB design
+
+
+eSim User Manual
+version 1.0.0
+Prepared By:
+eSim Team
+FOSSEE at IIT,Bombay
+
+Indian Institute of Technology Bombay
+
+August 2015
Drawing Interchange Format or Drawing Exchange Format
-
EDA
Electronic Design Automation
-
ERC
Electric Rules Check
FOSS
Free and Open Source Software
-
FPGA
Field Programmable Gate Array
-
gEDA
Electronic Design Automation released under GPL
-
GUI
Graphical User Interface
-
HDL
Hardware Descrition Language
-
HPGL
Hewlett-Packard Graphics Language
-
IC
Integrated Circuit
-
ICT
Information and Communication Technology
-
IGBT
Insulated Gate Bipolar Transistor
-
JFET
Junction Field Effect Transistor
KCE
Kirchoff’s Current Law
-
KVE
Kirchoff’s Voltage Law
-
LXDE
Lightweight X11 Desktop Environment
-
MNA
Modified Nodal Analysis
-
MOSFET
Metal Oxide Semiconductor Field Effect Transistor
NMEICT
National Mission on Education through ICT
-
Op-amp
Operational Amplifier
-
PCB
Printed Circuit Board
RS
Ohmic Resistance
-
SELF
Spoken Tutorial based Education and Learning through Free
-FOSS study
-
SVF
Serial Vector Format
T10KT
Teach 10,000 Teachers
-
VCCS
Voltage Controlled Current Source
-
VCVS
Voltage Controlled Voltage source
-
-
-
-
-
-
+
Chapter 1 Introduction
Electronic systems are an integral part of human life. They have
+ id="x1-20001">Introduction Electronic systems are an integral part of human life. They have
simplified our lives to a great extent. Starting from small systems made of a few
discrete components to the present day integrated circuits (ICs) with millions of
logic gates, electronic systems have undergone a sea change. As a result, design of
@@ -323,9 +176,9 @@ and efficient designs. These are called Electronic Design Automation or EDAtools.
+ id="dx1-2001">tools.
Let us see the steps involved in EDA. In the first stage, the specifications of the system are
+ id="dx1-2002"> In the first stage, the specifications of the system are
laid out. These specifications are then converted to a design. The design could be in
the form of a circuit schematic, logical description using an HDL language, etc.
The design is then simulated and re-designed, if needed, to achieve the desired
@@ -337,14 +190,14 @@ href="#Xeda">9].
A person who builds an electronic system has to first design the circuit, produce a virtual
representation of it through a schematic for easy comprehension, simulate it and finally
convert it into a Printed Circuit Board (PCB). There are various tools available that help do
-this. Some of the popular EDA tools are those of There are various tools available that will help
+us do this. Some of the popular EDA tools are those of Cadence, Synopys, Mentor Graphics and
-Xilinx. Although these are fairly comprehensive and high end, their licenses are expensive,
-being proprietary.
+class="cmtt-10x-x-109">Mentor Graphics
+and Xilinx. Although these are fairly comprehensive and high end, their licenses are
+expensive, being proprietary.
There are some free and open source EDA tools like gEDA, KiCad and gEDA). To the best of our knowledge, there is no o
circuit design, simulation and layout design together. eSim is capable of doing all of the
above.
eSim is a free and open source EDA tool. It is an acronym for Open source computer
-aided design. eSim is created using open source software packages, such as KiCad, Ngspice,
-Scilab and Python. Using eSim, one can create circuit schematics, perform simulations and
-design PCB layouts. It can create or edit new device models, and create or edit subcircuits for
-simulation. This feature is unique to eSim. Because of these reasons, eSim is expected to
-be useful to students, teachers and other professionals who would want to study
-and/or design electronic systems. eSim is also useful for entrepreneurs and small scale
-enterprises who do not have the capability to invest in heavily priced proprietary
-tools.
+class="cmbx-10x-x-109">Electronics Simulation.
+eSim is created using open source software packages, such as KiCad, Ngspice and Python.
+Using eSim, one can create circuit schematics, perform simulations and design PCB
+layouts. It can create or edit new device models, and create or edit subcircuits for
+simulation.
+
Because of these reasons, eSim is expected to be useful for students, teachers and other
+professionals who would want to study and/or design electronic systems. eSim is also useful
+for entrepreneurs and small scale enterprises who do not have the capability to invest in
+heavily priced proprietary tools.
This book introduces eSim to the reader and illustrates all the features of eSim with
examples. Chapter 2 gives step by step instructions to install eSim on a typical computer
+href="#x1-30002">2 gives step by step instructions to install eSim on a typical computer
system and to validate the installation. The software architecture of eSim is presented in
Chapter 3. Chapter 4 gets the user started with eSim. It takes them through a tour of eSim
-
-with the help of a simple RC circuit example. Chapter 5 explains how to create circuit
-schematics using eSim, in detail using examples. Chapter 6 illustrates how to simulate
-circuits using eSim. Chapter 7 explains PCB design using eSim, in detail. The advanced
-features of eSim such as Model Builder covered in Chapter 8 and Sub circuiting
-is covered in Chapter 9. Appendix A presents examples, that have been worked
-out using eSim, from the book Microelectronic Circuits by Sedra and Smith
- [1].
-
The following convention has been adopted throughout this book. All the menu names,
-options under each menu item, tool names, certain points to be noted, etc., are given in
-italics. Some keywords, names of certain windows/dialog boxes, names of some
-files/projects/folders, messages displayed during an activity, names of websites, component
-references, etc., are given in typewriter font. Some key presses, e.g. 3. Chapter 4 gets the user started with eSim. It takes them through a tour
+
+of eSim with the help of a simple RC circuit example. Chapter 5 illustrates how
+to simulate circuits. Chapter 6 explains PCB design using eSim, in detail. The
+advanced features of eSim such as Model Builder covered in Chapter 7 and Sub
+circuiting is covered in Chapter 8. Chapter 9 illustrates how to use eSim for solving
+problems.
+
The following convention has been adopted throughout this manual.All the
+menu names, options under each menu item, tool names, certain points to be noted,
+etc., are given in italics. Some keywords, names of certain windows/dialog boxes,
+names of some files/projects/folders, messages displayed during an activity, names
+of websites, component references, etc., are given in typewriter font. Some key
+presses, e.g. Enter key, F1 key, y for
-yes, etc., are also mentioned in typewriter font.
+class="cmtt-10x-x-109">y
for yes, etc., are also mentioned in typewriter
+font.
Chapter 2 Installing and Setting up eSim
+ id="x1-30002">Installing eSim
1.
class="cmbx-10x-x-109">$ esim or you can double click on eSim icon created on desktop after installation.
-
-
Chapter 3 Architecture of eSim
+ id="x1-40003">Architecture of eSim
eSim is a CAD tool that helps electronic system designers to design, test and analyse their
+ id="dx1-4001">tool that helps electronic system designers to design, test and analyse their
circuits. But the important feature of this tool is that it is open source and hence the user can
modify the source as per his/her need. The software provides a generic, modular and
extensible platform for experiment with electronic circuits. This software runs on all
-Ubuntu Linux distributions. It uses Python, KiCad, Ngspice and Scilab (5.4.0 or
-above).
-
The objective behind the development of eSim is to provide an open source EDA solution
+class="cmtt-10x-x-109">KiCad and
+Ngspice.
+
The objective behind the development of eSim is to provide an open source EDA solution
for electronics and electrical engineers. The software should be capable of performing
schematic creation, PCB design and circuit simulation (analog, digital and mixed signal). It
-should provide facilities to create new models and components. In addition to this, it should
-have the capability to explain the circuit by giving symbolic equations and numerical
-values. The architecture of eSim has been designed by keeping these objectives in
-mind.
+should provide facilities to create new models and components. The architecture of eSim has
+been designed by keeping these objectives in mind.
3.1 Modules used in eSim
-
Various open-source tools have been used for the underlying build-up of eSim. In this section
+ id="x1-50003.1">Modules used in eSim
+
Various open-source tools have been used for the underlying build-up of eSim. In this section
we will give a brief idea about all the modules used in eSim.
-
+
3.1.1 EEschema
+ id="x1-60003.1.1">Eeschema
+ id="dx1-6001">
-
EEschema is an integrated software where all functions of circuit drawing, control, layout,
-library management and access to the PCB design software are carried out within itself. It is
-the schematic editor tool used in KiCad [11]. EEschema is intended to work with PCB
-layout software such as Pcbnew. It provides netlist that describes the electrical connections of
-the PCB. EEschema also integrates a component editor which allows the creation, editing and
+ id="dx1-6002">
+
Eeschema is an integrated software where all functions of circuit drawing, control, layout,
+library management and access to the PCB design software are carried out. It is the
+schematic editor tool used in KiCad [11]. Eeschema is intended to work with PCB layout
+software such as Pcbnew. It provides netlist that describes the electrical connections of the
+PCB. Eeschema also integrates a component editor which allows the creation, editing and
visualization of components. It also allows the user to effectively handle the symbol
-libraries i.e; import, export, addition and deletion of library components. EEschema
+libraries i.e; import, export, addition and deletion of library components. Eeschema
also integrates the following additional but essential functions needed for a modern
schematic capture software: 1. Design rules check (1. Design rules check (DRC) for the automatic control of
incorrect connections and inputs of components left unconnected. 2. Generation of
+ id="x1-6005r2">2. Generation of
layout files in POSTSCRIPTor or HPGLformat. 3. Generation of layout files printable via
+ id="dx1-6007">format. 3. Generation of layout files printable via
printer. 4. Bill of material generation. 5. Netlist generation for PCB layout or for
+ id="x1-6009r4">4. Bill of material generation. 5. Netlist generation for PCB layout or for
simulation.
This module is indicated by the label 1 in Fig. 3.1.
-
As Eeschema is originally intended for PCB Design, there are no fictitious
+href="#x1-130011">3.1.
+
As Eeschema is originally intended for PCB Design, there are no fictitious
components1
+href="esim2.html#fn1x3">1
such as voltage or current sources. Thus, we have added a new library for different types of
voltage and current sources such as sine, pulse and square wave. We have also built a library
which gives printing and plotting solutions. This extension, developed by us for eSim, is
indicated by the label 2 in Fig. 3.1.
+href="#x1-130011">3.1.
3.1.2 CvPcb
+ id="x1-70003.1.2">CvPcb
-
CvPcb is a tool that allows the user to associate components in the schematic to component
+ id="dx1-7001">
+
CvPcb is a tool that allows the user to associate components in the schematic to component
footprints when designing the printed circuit board. CvPcb is the footprint editor tool in
KiCad [11]. Typically the netlist file generated by EEschema does not specify which printed
+href="#Xeeschema">11]
. Typically the netlist file generated by Eeschema does not specify which printed
circuit board footprint is associated with each component in the schematic. However, this is
not always the case as component footprints can be associated during schematic capture by
setting the component’s footprint field. CvPcb provides a convenient method of associating
@@ -522,30 +359,30 @@ This is because CvPcb not only allows automatic association, but also allows to
see the list of available footprints and displays them on the screen to ensure the
correct footprint is being associated. This module is indicated by the label 3 in
Fig. 3.1.
-
+href="#x1-130011">3.1.
+
3.1.3 Pcbnew
+ id="x1-80003.1.3">Pcbnew
-
Pcbnew is a powerful printed circuit board software tool. It is the layout editor tool
+ id="dx1-8001">
+
Pcbnew is a powerful printed circuit board software tool. It is the layout editor tool
used in KiCad [11]. It is used in association with the schematic capture software
-EEschema, which provides the netlist. Netlist describes the electrical connections of
+Eeschema, which provides the netlist. Netlist describes the electrical connections of
the circuit. CvPcb is used to assign each component, in the netlist produced by
-EEschema, to a module that is used by Pcbnew. The features of Pcbnew are given
+Eeschema, to a module that is used by Pcbnew. The features of Pcbnew are given
below:
It manages libraries of modules. Each module is a drawing of the physical
component including its footprint - the layout of pads providing connections to the
+ id="dx1-8002"> - the layout of pads providing connections to the
component. The required modules are automatically loaded during the reading of
the netlist produced by CvPcb.
Pcbnew integrates automatically and immediately any circuit modification by
removal of any erroneous tracks, addition of new components, or by modifying
- any value (and under certain conditions any reference) of the old or new modules,
+ any value (and under certain conditions any reference) of old or new modules,
according to the electrical connections appearing in the schematic.
This tool provides a rats nest display, a hairline connecting the pads of modules
@@ -576,121 +413,68 @@ class="cmtt-10x-x-109">SPECCTRA dsn format allows to use more advanced
display the track/pad clearance.
-
This module is indicated by the label 4 in Fig. 3.1.
+
This module is indicated by the label 4 in Fig. 3.1.
3.1.4 KiCad to Ngspice converter
-
It converts KiCad generated netlists to Ngspice compatible format. Also it facilitates adding
-model library of components and subcircuits. Following are the different functionality lies
-under conversion.
-
Analysis Inserter
-
This feature helps the user to perform different types of analysis such as Operating
-point analysis, DC analysis, AC analysis, transient analysis, etc. It has the facility
-to
-
-
Insert type of analysis such as AC or DC or Transient
-
-
Insert values for analysis
-
-
Source Details
-
eSim sources are added from eSim-sources package. Sources auch as SINE, AC, DC, PULSE
-are in this library. Input to all the sources added in the circuit are given in source
-details.
-
Ngspice Model
-
eSim adds Ngspice model using this facility.
-
Device Modeling
-
Devices like Diode, JFET, MOSFET, IGBT, MOS etc added in the circuit can be modeled
-using device model libraries. eSim also provides editing and adding new model libraries. While
-converting Kicad to Ngspice these library files added to the corresponding devices used in the
-circuit.
-
-
Subcircuits
-
Subcircuits are the circuits within a circuits. Subcircuiting helps to reuse the part of the
-circuits. The sub circuit in the main circuits are added using this facility. Also, eSim provides
-us with editing the already existing subcircuits. Sub circuits are saved separately in different
-folders.
+ id="x1-90003.1.4">KiCad to Ngspice converter
+
We can provide analysis parameters, and the source details through this module. It also
+allows us to add and edit the device models and subcircuits, included in the circuit
+schematic. Finally, this module facilitates the conversion of KiCad netlist to Ngspice
+compatible ones. It is developed by us for eSim and it is indicated by the label 7 in
+Fig. 3.1.
+
3.1.5 Model Builder
+ id="x1-100003.1.5">Model Builder
-
This tool provides the facility to define a new model for devices such as, 1. Diode 2. Bipolar
+ id="dx1-10001">
+
This tool provides the facility to define a new model for devices such as, 1. Diode 2. Bipolar
Junction Transistor (BJT) 3. Metal Oxide Semiconductor Field Effect Transistor
+ id="x1-10004r3">3. Metal Oxide Semiconductor Field Effect Transistor
(MOSFET) 4. Junction Field Effect Transistor (JFET) 5. IGBT and 6. Magnetic
+ id="x1-10005r4">4. Junction Field Effect Transistor (JFET) 5. IGBT and 6. Magnetic
core.
This module also helps edit existing models. It is developed by us for eSim and it is indicated
by the label 5 in Fig. 3.1.
-
+href="#x1-130011">3.1.
+
3.1.6 Subcircuit Builder
+ id="x1-110003.1.6">Subcircuit Builder
-
This module allows the user to create a subcircuit for a component. Once the subcircuit for a
+ id="dx1-11001">
+
This module allows the user to create a subcircuit for a component. Once the subcircuit for a
component is created, the user can use it in other circuits. It has the facility to define new
components such as, Op-amps and IC-555. This component also helps edit existing
subcircuits. This module is developed by us for eSim and it is indicated by the label 6 in
Fig. 3.1.
-
+href="#x1-130011">3.1.
+
3.1.7 KiCad to Ngspice netlist converter
-
+ id="x1-120003.1.7">Ngspice
-
-
It converts KiCad generated netlists to Ngspice (see Sec. 3.1.8) compatible format. It has the
-capability to 1. Insert parameters for fictitious components 2. Convert IC into discrete
-blocks 3. Insert D-A and A-D converter at appropriate places 4. Insert plotting
-and printing statements in netlist and 5. Find current through all components.
-
This module is developed by us for eSim and it is indicated by the label 7 in
-Fig. 3.1.
-
-
-
3.1.8 Ngspice
-
-
Ngspice is a general purpose circuit simulation program for nonlinear dc, nonlinear transient,
-and linear ac analyses [
+
Ngspice is a general purpose circuit simulation program for nonlinear dc, nonlinear transient,
+and linear ac analysis [12]. Circuits may contain resistors, capacitors, inductors, mutual
inductors, independent voltage and current sources, four types of dependent sources, lossless
and lossy transmission lines (two separate implementations), switches, uniform
+
distributed RC lines, and the five most common semiconductor devices: diodes,
BJTs, JFETs, MESFETs, and MOSFET. This module is indicated by the label 9 in
+ id="dx1-12002">BJTs, JFETs, MESFETs, and MOSFET. This module is indicated by the label 9 in
Fig. 3.1.
-
+href="#x1-130011">3.1.
+
3.2 Work flow of eSim
-
Fig. 3.1 shows the work flow in eSim. The block diagram consists of mainly three
+ id="x1-130003.2">Work flow of eSim
+
Fig. 3.1 shows the work flow in eSim. The block diagram consists of mainly three
parts:
Schematic Editor
@@ -698,52 +482,52 @@ parts:
PCB Layout Editor
Circuit Simulators
-
+ id="x1-130011">
-
Figure 3.1: Work flow in eSim. Boxes with dotted lines denote the modules developed
-in this work.
+class="content">Work flow in eSim. (Boxes with dotted lines denote the modules developed
+in this work).
-
-
Here we explain the role of each block in designing electronic systems. Circuit design is the
+
+
Here we explain the role of each block in designing electronic systems. Circuit design is the
first step in the design of an electronic circuit. Generally a circuit diagram is drawn on a
-paper, and then entered into a computer using a schematic editor. EEschema is the schematic
-editor for eSim. Thus all the functionalities of EEschema are naturally available in eSim.
+paper, and then entered into a computer using a schematic editor. Eeschema is the schematic
+editor for eSim. Thus all the functionalities of Eeschema are naturally available in eSim.
-
Libraries for components, explicitly or implicitly supported by Ngspice, have been created
-using the features of EEschema. As EEschema is originally intended for PCB design, there are
+ id="dx1-13002">
+
Libraries for components, explicitly or implicitly supported by Ngspice, have been created
+using the features of Eeschema. As Eeschema is originally intended for PCB design, there are
no fictitious components such as voltage or current sources. Thus, a new library for different
types of voltage and current sources such as sine, pulse and square wave, has been added in
eSim. A library which gives the functionality of printing and plotting has also been
created.
-
The schematic editor provides a netlist file, which describes the electrical connections of
+
The schematic editor provides a netlist file, which describes the electrical connections of
the design. In order to create a PCB layout, physical components are required to be mapped
into their footprints. To perform component to footprint mapping, CvPcb is used. Footprints
have been created for the components in the newly created libraries. Pcbnew is used to draw
a PCB layout.
-
After designing a circuit, it is essential to check the integrity of the circuit design. In the
+
After designing a circuit, it is essential to check the integrity of the circuit design. In the
case of large electronic circuits, breadboard testing is impractical. In such cases, electronic
system designers rely heavily on simulation. The accuracy of the simulation results can be
increased by accurate modeling of the circuit elements. Model Builder provides the facility to
define a new model for devices and edit existing models. Complex circuit elements can be
created by hierarchical modeling. Subcircuit Builder provides an easy way to create a
subcircuit.
-
The netlist generated by Schematic Editor cannot be directly used for simulation
-due to compatibility issues. Netlist Converter converts it into Ngspice compatible
-format. The type of simulation to be performed and the corresponding options are
-provided through a graphical user interface (GUI). This is called Analysis Inserter in
+
The netlist generated by Schematic Editor cannot be directly used for simulation due to
+compatibility issues. Netlist Converter converts it into Ngspice compatible format. The
+type of simulation to be performed and the corresponding options are provided
+through a graphical user interface (GUI). This is called KiCad to Ngspice Converter in
eSim.
-
eSim uses Ngspice for analog, digital, mixed-level/mixed-signal circuit simulation. Ngspice
is based on three open source software packages [14]:
@@ -753,70 +537,70 @@ href="#Xspice">14]
:
Xspice (code modeling support and simulation of digital components through an
event driven algorithm)
-
It is a part of gEDA project. Ngspice is capable of simulating devices with BSIM, EKV, HICUM,
+
It is a part of gEDA project. Ngspice is capable of simulating devices with BSIM, EKV, HICUM,
HiSim, PSP, and PTM models. It is widely used due to its accuracy even for the latest
+ id="dx1-13007">PSP, and PTM models. It is widely used due to its accuracy even for the latest
technology devices.
Chapter 4 Getting Started
+ id="x1-140004">Getting Started
In this chapter we will get started with eSim. We will run through the various options
available with an example circuit. Referring to this chapter will make one familiar with
eSim and will help plan the project before actually designing a circuit. Lets get
started.
4.1 eSim Main Window
+ id="x1-150004.1">eSim Main Window
4.1.1 Workspace
-
After installation is completed, when the eSim is run the first window that appears is
-workspace dialog as shown in Fig. 4.1.
How to launch eSim in Ubuntu?
+
After installation is completed, to launch eSim 1. Go to terminal. 2. Type esim and hit enter. The first window that appears is workspace dialog as shown in Fig. 4.1.
+ id="x1-160011">
-
Figure 4.1: eSim-Workspace
-
-
-
The default eSim-Workspace can be chosen if the ok or cancel button is clicked. Else to
-create new workspace browse button is used.
+class="content">eSim-Workspace
+
+
+
The default workspace is eSim-Workspace under home directory. To create new workspace
+use browse option.
4.1.2 Main-GUI
-
The main GUI window of eSim is as shown in Fig. 4.2
Main-GUI
+
The main GUI window of eSim is as shown in Fig. 4.2
+ id="x1-170012">
-
Figure 4.2: eSim Main GUI
+class="content">eSim Main GUI
-
-
The eSim main GUI window consists the following symbols.
+
+
The eSim main window consists of the following symbols.
Open Schematic The first tool on the toolbar i.e. Schematic Editor. Doing so
- will open EEschema, the schematic editor used in eSim. If a new project is being
- created, one will get the schematic editor window with an info dialog box. This is
- illustrated in Fig. 4.3. This warning can be safely ignored by clicking on OK.
-
-
Figure 4.3: Schematic Editor Window
-
-
However, if an already existing project is opened, one would get the schematic
- editor window along with a Load error. This is illustrated in Fig. 4.4. This
- error occurs because the schematic that is opened has not been loaded with
- the libraries mentioned in the Load Error message. Close the Load Error
- message by clicking on the Close button. The RC circuit diagram opens up
- as shown in Fig. 4.5. Now the circuit schematic can be created/edited. To
- know how to use the schematic editor to create circuit schematics, refer to
- Chapter 5.
-
Toolbar
+
-
Figure 4.4: Schematic Editor Window of an existing Project
-
-
+
+
+
Figure 4.5: Schematic Editor Window of an existing Project
-
+>Figure 4.3: Toolbar
+
+
+
+
Open Schematic: The first tool on the toolbar i.e. Schematic Editor. Clicking on
+ this button will open Eeschema, the KiCad schematic editor.
-
Convert Kicad to Ngspice: The second tool on the toolbar is the Kicad to Ngspice
- Converter . Before one uses this tool, one should have already created the
- spice netlist file (.cir). This file is not compatible with Ngspice. The analysis
- window consists of total five tabs as namely Analysis, Device Model, Source
+
Convert KiCad to Ngspice: This converter converts KiCad spice netlist into
+ Ngspice compatible netlist. The KiCad to Ngspice window consists of total five
+ tabs as namely Analysis, Device Model, Source Details, Model Library, Subcircuits.
+ Once the values have been entered, press the Convert key. It will generate
Details, Model Library, Subcircuits, out of which only analysis tab is static and
- remaining tabs are dynamic. The widgets in the dynamic tab depends on the
- components included in the circuit. It consists of the parameters depending
- upon the type of sources used. Once the values have been entered, press the
+class="cmtt-10x-x-109">.cir.out file in the same project directory. Note that KiCad to Ngspice Converter can only be used if current project has
+ created the KiCad spice netlist file .cir.
+
The details of tabs under KiCad to Ngspice converter are as follows:
+
Analysis
+
This feature helps the user to perform different types of analysis such as Operating
+ point analysis, DC analysis, AC analysis, transient analysis. It has the facility
+ to
+
+
Insert type of analysis such as AC or DC or Transient
+
+
Insert values for analysis
+
+
Source Details
+
eSim sources are added from eSim_Sources library. Source such as SINE, AC, DC,Convert key. It will generate .cir.out and .cir.ckt files in the same project
- directory.
+class="cmti-10x-x-109">PULSE are in this library. The parameter values to all the sources added in the
+ shcematic can be given through ’Source Details’.
+
+
+
Ngspice Model
+
Ngspice has in built model such as flipflop(D,SR,JK,T),gain,summer etc. which can be
+ utilised while building a circuit. eSim allows to add and modify Ngspice model
+ parameter through Ngspice Model tab.
+
+
Device Modeling
+
Devices like Diode, JFET, MOSFET, IGBT, MOS etc used in the circuit can be
+ modeled using device model libraries. eSim also provides editing and adding new model
+ libraries. While converting KiCad to Ngspice, these library files are added to the
+ corresponding devices used in the circuit.
+
+
Subcircuits
+
Subcircuits are circuits within circuit. Subcircuiting helps to reuse the parts of the
+ circuits. The subcircuits in the main circuits are added using this facility. Also, eSim
+ provides us with the facility to edit already existing subcircuits.
-
Simulation: The suitable netlist generated using Kicad to Ngspice. This file is
- stimulated using Ngspice tool. Clicking on this tool Simulation, Ngspice and
- Python plotting window will open, as shown in Fig. 4.6. It shows the output
- waveform of project.
Simulation: The netlist generated using the KiCad to Ngspice converter is
+ simulated using simulation button. Clicking on the Simulation button will run
+ the Ngspice simulation for current project. Python plotting window will open, as
+ shown in Fig. 4.4. It shows the output waveform of current project. In the
+ Ngspice tab we can view the output plotted by Ngspice.
Figure 4.6: Simulation Output in Python Plotting Window
-
+>Figure 4.4: Simulation Output in Python Plotting Window
+
Foot Print Editor: Clicking on the Footprint Editor tool will open the CvPcbwindow.
- This window will ideally open the .net file for the current project. So, before using this
- tool, one should have the netlist for PCB design (a .net file). To know more about how
- to generate netlist for PCB, refer to Sec. 7.1.1.
-
Open the project RC_pcb available in the Examples folder downloaded from the eSim
- website. On clicking the Footprint Editor tool, we see the corresponding RC_pcb.net file
- for RC circuit. This window is shown in Fig. 4.7. The main purpose of this window is to
- let one choose the footprints for the various components in the circuit. Let us view the
- footprint C1 for capacitor C1. Click on C1 from the right hand side of CvPcb
- window. Click on View Selected Footprint tool from the tool bar of CvPcb
- window. This will show the footprint corresponding to C1. This is illustrated in
- Fig. 4.8. To know more about how to assign footprints to components, see
- Chapter 7.
-
-
Figure 4.7: CvPCB Window
-
-
-
-
Figure 4.8: Footprint for C1
-
+class="cmtt-10x-x-109">CvPcb
+ window. This window will ideally open the .net file for the current project. So,
+ before using this tool, one should have the netlist for PCB design (a .net
+ file).
-
PCB Layout: Open the RC_pcb project available in Examples. Clicking on the
- PCB Layout: Clicking on the Layout Editor tool will open Pcbnew, the layout editor used in eSim. This
- shows the PCB design for RC circuit. In this window, one will create the
- PCB. It involves laying tracks and vias, performing optimum routing of tracks,
- creating one or more copper layers for PCB, etc. The PCB design for RC
- circuit is shown in Fig. 4.9. This is how the PCB will look like when one
- actually prints it on a copper-clad board. It will be saved as a .brd file in the
- same directory. Chapter 7 explains how to use the Layout Editor to design a
- PCB.
-
-
Figure 4.9: PCB design for RC circuit
-
+ id="dx1-23003">, the layout editor
+
+ used in eSim. In this window, one will create the PCB. It involves laying
+ tracks and vias, performing optimum routing of tracks, creating one or more
+ copper layers for PCB, etc. It will be saved as a .brd file in the current project
+ directory.
-
Model Editor: eSim also gives an option to re-configure the model of a component. It
- facilitates the user to change models of components such as diode, transistor, MOSFET,
- etc. When one clicks on the Model Builder tool, the window as shown in Fig. 4.10 will
- appear.
-
-
Figure 4.10: Footprint for C1
-
-
To create a new model library New button is clicked which then opens the template
- library folder. We can choose from the template library that can be edited, to create the
- new library and the click on Save to save the edited model library. Also the existing
- library can be edited using Edit option. The user can also use their own library by
- uploading it using Upload button.
-
-
Figure 4.11: Model Editor with Diode Model
-
-
+
Model Editor: eSim also gives an option to re-configure the model library of a device. It
+ facilitates the user to change model library of devices such as diode, transistor,
+ MOSFET, etc.
Subcircuit: eSim has an option to build subcircuits. The subcircuits can again have
components having subcircuits and so on. This enables users to build commonly used
circuits as subcircuits and then use it across circuits. For example, one can build a 12
-
Volt power supply as a subcircuit and then use it as just a single component across
- circuits without having the need to recreate it. Clicking on Subcircuit Builder
- tool will allow one to edit or create a subcircuit. To know how to make a
- subcircuit, refer to Chapter 7. Fig. 4.12 shows the subcircuit of 555 timer IC.
-
-
-
Figure 4.12: Subcircuit o1f 555 timer IC
-
-
+ circuits without having to recreate it. Clicking on Subcircuit Builder tool will allow one
+ to edit or create a subcircuit.
+
+
Menubar
+
+
New Project: New projects are created in the eSim-workspace. When this
+ menu is selected, a new window opens up with Enter Project name field.
+ Type the name of the new project and click on OK. A project directory will
+ be created in eSim-Workspace. The name of this folder will be the same as
+ that of the project created. Make sure project name does not have any spaces.
+
+
Open Project: This opens the file dialog of defalut workspace where the
+ projects are stored. The project can be selected which is then added in the
+ project explorer.
+
+
Exit: This button closes the project window and exits.
+
+
Help: It opens user manual in the dockarea.
+
+
+
Project Explorer
+
Project explorer has tree of all the project previously added in it. On right clicking the
+ project we can simply remove or refresh the project in the explorer. Also on
+ double/right clicking, the project file can be opened in the text editor which can then be
+ edited.
+
+
Dockarea
+
This area is used to open the following windows.
+
+ 1.
KiCad to Ngspice converter
+
+ 2.
Ngspice plotting
+
+ 3.
Python plotting
+
+ 4.
Model builder
+
+ 5.
Subcircuit builder
+
+
Console Area
+
Console area provides information about the activity done in current project.
-
-
Menubar
-
-
New Project: New projects are created in the workspace. When selected this menu,
- a new window opens up with Enter Project name field. Type the name of the
- new project here. Click on OK. A folder will be created in the specified directory.
- The name of this folder will be the same as that of the project created.
-
-
Open Project: This opens the file dialog of defalut workspace where the projects
- are stored. The project can be selected which is then added in the project explorer.
-
-
Exit: This button closes the project window and exits.
-
-
Help:
-
-
Project Explorer
-
Project explorer has tree of all the project previously added in it. On right clicking
-the project we can simply remove or refresh the project in the explorer. Also on
-right clicking the project file can be opened in the text editor which can then be
-edited.
-
-
-
Dockarea
-
-
Console Area
-
Console area provides with the errors and active commands running.
-
-
Chapter 5 Schematic Creation
The first step in the design of an electronic system is the
+ id="x1-280005">Schematic Creation The first step in the design of an electronic system is the
design of its circuit. This circuit is usually created using a Schematic Editor and is called a
+ id="dx1-28001"> and is called a
Schematic. eSim uses EEschemaas its schematic editor. EEschema is the schematic editor of
+ id="dx1-28002">eSim uses Eeschemaas its schematic editor. Eeschema is the schematic editor of
KiCad. It is a powerful schematic editor software. It allows the creation and modification of
+ id="dx1-28004">It is a powerful schematic editor software. It allows the creation and modification of
components and symbol libraries and supports multiple hierarchical layers of printed circuit
design.
5.1 Familiarizing the Schematic Editor interface
+ id="x1-290005.1">Familiarizing the Schematic Editor interface
Fig. 5.1 shows the schematic editor and the various menu and toolbars. We will explain them
+href="#x1-290011">5.1 shows the schematic editor and the various menu and toolbars. We will explain them
briefly in this section.
+ id="x1-290011">
Figure 5.1: Schematic editor with the menu bar and toolbars marked
+class="content">Schematic editor with the menu bar and toolbars marked
5.1.1 Top menu bar
+ id="x1-300005.1.1">Top menu bar
The top menu bar will be available at the top left corner. Some of the important menu
options in the top menu bar are:
@@ -1155,7 +863,7 @@ class="compactenum">Save Current sheet as - Save current sheet with a new name.
(g)
Print - Access to print menu (See Fig. 5.2).
+href="#x1-300112">5.2).
(h)
Plot - Plot the schematic in Postscript, HPGL, SVF or DXF format
@@ -1164,7 +872,7 @@ class="compactenum">Plot - Plot the schematic in Postscript, HPGL, SVF or DXF fo
class="compactenum">Quit - Quit the schematic editor.
Place - The place menu has shortcuts for placing various items like components, wire
and junction, on to the schematic editor window. See Sec. 5.1.5 to know more about
+href="#x1-340005.1.5">5.1.5 to know more about
various shortcut keys (hotkeys).
3.
Language - Shows the current list of translations. Use defau
(e)
Hotkeys - Access to the hot keys menu. See Sec. 5.1.5 about hotkeys.
+href="#x1-340005.1.5">5.1.5 about hotkeys.
Some of the important tools in the top toolbar are discussed below. They are marked in
Fig. 5.3.
5.3.
+ id="x1-310033">
Figure 5.3: Toolbar on top with important tools marked
+class="content">Toolbar on top with important tools marked
@@ -1263,33 +971,33 @@ class="compactenum">Check ERC - Do Electric Rules Check for the schematic
9.
Create BOM - Create a Bill of Materials of the schematic
5.1.3 Toolbar on the right
+ id="x1-320005.1.3">Toolbar on the right
+ id="dx1-32001">
+ id="dx1-32002">
The toolbar on the right side of the schematic editor window has many important tools. Some
of them are marked in Fig. 5.4.
5.4.
+ id="x1-320034">
Figure 5.4: Toolbar on right with important tools marked
+class="content">Toolbar on right with important tools marked
Let us now look at each of these tools and their uses.
1.
Place a component - Load a component to the schematic. See Sec. 5.2.1 for more
+href="#x1-360005.2.1">5.2.1 for more
details.
2.
Place a global label - Place a global label (these are conne
diagrams in the hierarchy)
8.
Create a hierarchical sheet - Create a sub-sheet within the root sheet in the
- hierarchy. Hierarchical schematics are a good solution for big projects
-
- 9.
Place a text or comment - Place a text or comment in the schematic
5.1.4 Toolbar on the left
+ id="x1-330005.1.4">Toolbar on the left
+ id="dx1-33001">
+ id="dx1-33002">
Some of the important tools in the toolbar on the left are discussed below. They are marked
in Fig. 5.5.
5.5.
+ id="x1-330035">
Figure 5.5: Toolbar on left with important tools marked
+class="content">Toolbar on left with important tools marked
@@ -1349,14 +1053,14 @@ class="compactenum">Show/Hide grid - Show or Hide the grid in the schematic edit
class="compactenum">Show hidden pins - Show hidden pins of certain components, for example, power
pins of certain ICs.
5.1.5 Hotkeys
-
!Schematic Editor A set of keyboard keys are associated with various operations in the
-schematic editor. These keys save time and make it easy to switch from one operation to
-another. The list of hotkeys can be viewed by going to Preferences in the top menu bar.
-Choose Hotkeys and select List current keys. The hotkeys can also be edited by selecting the
-option Hotkeys
+
A set of keyboard keys are associated with various operations in the schematic editor. These
+keys save time and make it easy to switch from one operation to another. The list of hotkeys
+can be viewed by going to Preferences in the top menu bar. Choose Hotkeys and
+select List current keys. The hotkeys can also be edited by selecting the option
+Edit Hotkeys. Some frequently used hotkeys, along with their functions, are given
below:
@@ -1394,154 +1098,146 @@ below:
class="cmti-10x-x-109">Note: Both lower and upper-case keys will work as hotkeys
.
5.2 Schematic creation for simulation
+ id="x1-350005.2">Schematic creation for simulation
+ id="dx1-35001">
There are certain differences between the schematic created for simulation and that created
-for PCB design. We need certain components like plots and current sources. for simulation
-whereas these are not needed for PCB design. For PCB design, we would require
-connectors (e.g. DB15 and 2 pin connector) for taking signals in and out of the
-PCB whereas these have no meaning in simulation. This section covers schematic
-creation for simulation. Refer to Chapter 7 to know how to create schematic for PCB
-design.
+for PCB design. We need certain components like plots and current sources. For simulation
+whereas these are not needed for PCB design. For PCB design, we would require connectors
+(e.g. DB15 and 2 pin connector) for taking signals in and out of the PCB whereas
+these have no meaning in simulation. This section covers schematic creation for
+simulation.
The first step in the creation of circuit schematic is the selection and placement of
-required components. Let us see this using an example. Let us create the circuit schematic of
-an RC filter given in Fig. 5.6 and do a transient simulation.
5.6.
+
+ id="x1-350026">
-
Figure 5.6: RC circuit
+class="content">eSim-Components Libraries
-
+
5.2.1 Selection and placement of components
-
-
We would need a resistor, a capacitor, a voltage source, ground terminal and some
-plot components. To place a resistor on the schematic editor window, select the
-Placea component tool from the toolbar on the right side and click anywhere on
-the schematic editor. This opens up the component selection window. (The above
-action can also be performed by pressing the key A.) Type R in the field Name of
-the component selection window as shown in Fig. 5.7. Click on OK. A resistor
+ id="x1-360005.2.1">Selection and placement of components
+
+
We would need a resistor, a capacitor, a voltage source, ground terminal. To place a resistor
+on the schematic editor window, select the Place a component tool from the toolbar
+on the right side and click anywhere on the schematic editor. This opens up the
+component selection window. Resistor component can be found under eSim_Devices
+library. Fig. 5.7 shows the selection of resistor component. Click on OK. A resistor
will be tied to the cursor. Place the resistor on the schematic editor by a single
click.
-
+ id="x1-360027">
-
Figure 5.7: Placing a resistor using the Place a Component tool
-
-
-
To place the next component, i.e., capacitor, click again on the schematic editor. Type C
-in the Name field of component selection window. Click on OK. Place the capacitor
-on the schematic editor by a single click. Let us now place a sinusoidal voltage
-source. This is required for performing transient analysis. To place it, click again
-on the schematic editor. On the component selection window, click on List all.
-Choose the library sourcesSpice by double clicking on it. Select the component
-SINE and click on OK. Place the sine source on the schematic editor by a single
-click.
-
Place the component by clicking on the schematic editor. Similarly place a ground
-terminal gnd from the library power. It can also be placed using the Place a power port tool
-from the toolbar on the right. Click anywhere on the editor after selecting place a power port
-tool. Click List all and choose gnd. Once all the components are placed, the schematic editor
-would look like the Fig. 5.8.
+class="content">Placing a resistor using the Place a Component tool
-
-
-
-
+
To place the next component, i.e., capacitor, click again on the schematic editor.Similarly,
+Capacitor component is found under eSim_Devices library. Click on OK. Place the capacitor
+on the schematic editor by a single click. Let us now place a sinusoidal voltage source. This is
+required for performing transient analysis. To place it, click again on the schematic editor. On
+the component selection window, choose the library eSim_source by double clicking on it.
+Select the component SINE and click on OK. Place the sine source on the schematic editor by
+a single click.
+
Place the component by clicking on the schematic editor. Similarly place gnd, a ground
+terminal and power_flag under power library. Once all the components are placed, the
+schematic editor would look like the Fig. 5.8.
+
+
+
+
+
Figure 5.8: All RC circuit components placed
-
-
-
Let us rotate the resistor to complete the circuit as shown in Fig. 5.6. To rotate the
-resistor, place the cursor on the resistor and press the key R. Note that if the cursor is placed
-above the letter R (not R?) on the resistor, it asks to clarify selection. Choose the option
+class="content">All RC circuit components placed
+
+
+
Let us rotate the resistor to complete the circuit. To rotate the resistor, place the cursor
+on the resistor and press the key R. Note that if the cursor is placed above the letter R (not
Component R. This can be avoided by placing the cursor slightly away from the letter R as
-shown in Fig. 5.9. This applies to all components.
R?) on the resistor, it asks to clarify selection. Choose the option Component R. This can be
+avoided by placing the cursor slightly away from the letter R as shown in Fig. 5.9. This
+applies to all components.
+ id="x1-360059">
-
Figure 5.9: Placing the cursor (cross mark) slightly away from the letter R
+class="content">Placing the cursor (cross mark) slightly away from the letter R
-
-
If one wants to move a component, place the cursor on top of the component and press the
+
+
If one wants to move a component, place the cursor on top of the component and press the
key M. The component will be tied to the cursor and can be moved in any direction.
+ id="dx1-36006">
5.2.2 Wiring the circuit
+ id="x1-370005.2.2">Wiring the circuit
-
The next step is to wire the connections. Let us connect the resistor to the capacitor.
+ id="dx1-37001">
+
The next step is to wire the connections. Let us connect the resistor to the capacitor.
To do so, point the cursor to the terminal of resistor to be connected and press
the key W. It has now changed to the wiring mode. Move the cursor towards the
terminal of the capacitor and click on it. A wire is formed as shown in Fig. 5.10a.
+href="#x1-37002r1">5.10a.
Similarly connect the wires between all terminals and the final schematic would look like
+
+
Similarly connect the wires between all terminals and the final schematic would look like
Fig. 5.10b.
+href="#x1-37003r2">5.10b.
5.2.3 Assigning values to components
+ id="x1-380005.2.3">Assigning values to components
-
We need to assign values to the components in our circuit i.e., resistor and capacitor. Note
+ id="dx1-38001">
+
We need to assign values to the components in our circuit i.e., resistor and capacitor. Note
that the sine voltage source has been placed for simulation. The specifications of sine source
will be given during simulation. To assign value to the resistor, place the cursor above the
letter Field value. Type 1k in the Edit value field box
as shown in Fig. 5.11. 1k means 15.11. 1k means 1kΩ. Similarly give the value 1u for the capacitor. 1u means
1μF.
-
The next step is to annotate the schematic. Annotation gives unique references to the
+ id="dx1-39004">
+
The next step is to annotate the schematic. Annotation gives unique references to the
components. To annotate the schematic, click on Annotate schematic tool from the
-top toolbar. Click on annotation, then click on OK and finally click on close as
+top toolbar. Click on annotation, then click on OK and finally click on close as
shown in Fig. 5.13. The schematic is now annotated. The question marks next to
+href="#x1-3900813">5.13. The schematic is now annotated. The question marks next to
component references have been replaced by unique numbers. If there are more than
one instance of a component (say resistor), the annotation will be done as R1, R2,
etc.
-
Let us now do
Let us now do ERC or Electric Rules Check. To do so, click on Perform electric rulescheck tool from the top toolbar. Click on Test Erc button. The error as shown in Fig. 5.12
+href="#x1-3900712">5.12
may be displayed. Click on close in the test erc window.
window.
+ id="x1-3900712">
-
Figure 5.12: ERC error
+class="content">ERC error
-
-
+
+ id="x1-3900813">
-
Figure 5.13: Steps in annotating a schematic: 1. First click on Annotation then 2. Click
-on Ok then 3. Click on close
+on Ok then 3. Click on close
-
-
There will be a green arrow pointing to the source of error in the schematic. Here it points
+
+
There will be a green arrow pointing to the source of error in the schematic. Here it points
to the ground terminal. This is shown in Fig. 5.14.
5.14.
+ id="x1-3900914">
-
Figure 5.14: Green arrow pointing to Ground terminal indicating an ERC error
+class="content">Green arrow pointing to Ground terminal indicating an ERC error
-
-
To correct this error, place a
+
To correct this error, place a PWR_FLAG from the EEschema library _FLAG from the Eeschema library power. Connect the
+ id="dx1-39010">Connect the
power flag to the ground terminal as shown in Fig. 5.10c. More information about
-PWR_FLAG is given in Sec. ??. One needs to place 5.10c. One needs to place PWR_FLAG wherever the error shown in
-Fig. 5.12 is obtained. Repeat the ERC. Now there are no errors. With this we have created
-the schematic for simulation.
+class="cmtt-10x-x-109">_FLAG
+wherever the error shown in Fig. 5.12 is obtained. Repeat the ERC. Now there are no errors.
+With this we have created the schematic for simulation.
5.2.5 Netlist generation
+ id="x1-400005.2.5">Netlist generation
-
To simulate the circuit that has been created in the previous section, we need to generate its
+ id="dx1-40001">
+
To simulate the circuit that has been created in the previous section, we need to generate its
netlist. Netlist is a list of components in the schematic along with their connection
information. To do so, click on the To do so, click on the Generate netlist tool from the top toolbar. Click on spice
-from the window that opens up. Uncheck the option Default Format. Then click on Netlist.
+class="cmti-10x-x-109">Generate.
This is shown in Fig. 5.15. Save the netlist. This will be a 5.15. Save the netlist. This will be a .cir file. Do not change the
directory while saving.
+ id="x1-4000315">
-
Figure 5.15: Steps in generating a Netlist for simulation: 1. Click on Spice then 2.
Check the option Default Format then 3. Click on Netlist
+class="cmtt-10x-x-109">Default Format then 3. Click on Generate
-
-
Now the netlist is ready to be simulated. Chapter 6 explains how to perform simulations.
-Refer to [
Circuit simulation uses mathematical models to replicate the
-behaviour of an actual device or circuit. Simulation software allows to model circuit
-operations. Simulating a circuit’s behaviour before actually building it can greatly improve
-design efficiency. eSim uses Ngspice for analog, digital and mixed-level/mixed-signal circuit
-simulation. The various steps involved in simulating a circuit schematic in eSim are given
-below:
-
-
Kicad to Ngspice Conversion: The schematic file generated in Kicad i.e. .cir file is to
- be converted into a ngspice compatible file before simulation. The process of conversion
- involves following steps-
-
- 1.
Analysis insertion - This tool is used to insert the type of analysis to the
- netlist. It is done by the Analysis Inserter tool in the eSim toolbar.
-
- 2.
Source Details - The netlist created in the Schematic Editor is converted to
- Ngspice format and analysis commands is appended to it. It is done by the
- Netlist Converter tool in the eSim toolbar.
-
- 3.
Ngspice Modelling - Ngspice simulation of the netlist is performed. It is done
- by clicking on the Ngspice tool in the eSim toolbar.
-
- 4.
Model Library - Model library adds the component library of the components
- like Diode, JFET, MOS, IGBT. These library file contains the parameters
- and the values of the components.
-
- 5.
Sub-Circuit - A sub circuiting can be done using this tool. This involves
- adding the sub circuit used in the main circuit. This adds all the project files
- of the sub circuit.
-
-
Simulation: The output file produced is used for simulation to plot the output in the
- Ngspice.
-
In the following sections, we shall describe each of the above steps.
+ id="x1-410006">PCB Design Printed Circuit Board (PCB) design is an important step in
+electronic system design. Every component of the circuit needs to be placed and connections
+routed to minimise delay and area. Each component has an associated footprint. Footprint
+refers to the physical layout of a component that is required to mount it on the PCB.PCB
+design involves associating footprints to all components, placing them appropriately to
+minimise wire length and area, connecting the footprints using tracks/vias and finally
+extracting the required files needed for printing the PCB. Let us see the steps to design PCB
+using eSim.
6.1 Analysis Inserter
-
-
In order to simulate a circuit, the user must define the type of analysis to be done on the
-circuit. The types of analysis include Operating point analysis, DC analysis,
-AC analysis, transient analysis, etc. The user should also specify the options
-
-corresponding to each analysis. This is facilitated by the Analysis Inserter tool in
-eSim.
-
Analysis Inserter generates the commands for Ngspice. When one clicks on Kicad to
-Ngspice from the eSim toolbar, one gets the Analysis Inserter GUI as shown in Fig. 6.1. The
-various tabs in this GUI correspond to the various types of analysis. The user can enter
-the details, needed to perform simulation, in the corresponding fields under these
-tabs.
-
Schematic creation for PCB design
+
In Chapter 9, we will see the differences between schematic for simulation and schematic for
+PCB design. Let us design the PCB for a RC circuit. A resistor, capacitor, ground, power flag
+and a connector are required. Connectors are used to take signals in and out of the
+PCB.
+
Create the circuit schematic as shown in Fig. 6.1. The two pin connector (CONN_2) can
+be placed from the Eeschema library conn. Do the annotation and test for ERC. Refer to
+Chapter 9 to know more about basic steps in schematic creation.
+
+ id="x1-420011">
-
Figure 6.1: Analysis Inserter GUI
+class="content">Final circuit schematic for RC low pass circuit
-
+
6.1.1 Types of analysis
-
-
eSim supports three types of analyses: 1. DC Analysis (Operating Point and DC Sweep)
+ id="x1-430006.1.1">Netlist generation for PCB
2. AC Small-signal Analysis 3. Transient Analysis.
-Other analysis in the Analysis Inserter are currently under progress. The different types of
-analyses supported in eSim are explained below [17].
-
-
DC analysis
+ id="dx1-43001">
-
The DC analysis determines the dc operating point of the circuit with inductors shorted and
-capacitors opened. The DC analysis options are specified on the .dcand .op control
-lines.
-
There is assumed to be no time dependence on any of the sources within the system
-description. The simulator algorithm subdivides the circuit into those portions which require
+ id="dx1-43002">
+
The netlist for PCB is different from that for simulation. To generate netlist for PCB, click on
the analog simulator algorithm and those which require the event-driven algorithm.
-Each subsystem block is then iterated to solution, with the interfaces between analog nodes
-and event-driven nodes iterated for consistency across the entire system. Once stable values
-are obtained for all nodes in the system, the analysis halts and the results could be displayed
-or printed out.
-
A DC analysis is automatically performed prior to a transient analysis to determine
-the transient initial conditions, and prior to an ac small-signal analysis to determine the
-linearised, small-signal models for nonlinear devices. The DC analysis can also be used to
-generate dc transfer curves: a specified independent voltage or current source is stepped over a
-user-specified range and the dc output variables are stored for each sequential source
-value.
-
-
AC small-signal analysis
-
-
AC analysis is limited to analog nodes. It represents the small signal, sinusoidal
-solution of the analog system described at a particular frequency or set of frequencies.
-This analysis is similar to the DC analysis in that it represents the steady-state
-behaviour of the described system with a single input node at a given set of stimulus
-frequencies.
-
-
The program first computes the dc operating point of the circuit and determines
-linearised, small-signal models for all of the nonlinear devices in the circuit. The resultant
-linear circuit is then analyzed over a user-specified range of frequencies. The desired output
-of an ac small-signal analysis is usually a transfer function (voltage gain, trans
-impedance, etc.). If the circuit has only one ac input, it is convenient to set that input to
-unity and zero phase, so that output variables have the same value as the transfer
-function.
-
-
Transient analysis
-
-
Transient analysis is an extension of DC analysis to the time domain. A transient
-analysis begins by obtaining a DC solution to provide a point of departure for simulating
-time-varying behaviour. Once the DC solution is obtained, the time-dependent aspects of the
-system are reintroduced and the simulator algorithms incrementally solve for the time varying
-behaviour of the entire system. Inconsistencies in node values are resolved by the simulation
-algorithms such that the time-dependent waveforms created by the analysis are consistent
-across the entire simulated time interval.
-
Resulting time-varying descriptions of node behaviour for the specified time interval are
-accessible. All sources which are not time dependent (for example, power supplies) are
-set to their dc value. The transient time interval is specified on a .tran control
-line.
-
-
6.1.2 DC analysis inserter
-
By default DC analysis option appears when one clicks on Analysis Inserter. Here we need
-to give the details of input source name, start value of input, increment and stop value. Once
-this is done, click on Add Simulation Data.
-
Fig. 6.2 gives an example of DC analysis inserter. In this example, v1 is the input
-voltage source which starts at 0 Volt, increments by 1 Volt and stops at 10 Volt. On
-clicking Add Simulation Data, the analysis command is generated and is of the form:
- .dcsourcename vstart vstop vincr The .dc line defines the dc transfer curve source and sweep limits (with capacitors open and
-inductors shorted). srcnam is the name of an independent voltage or current source. vstart,
+class="cmti-10x-x-109">Generate netlist
tool from the top toolbar in Schematic editor. In the Netlist window,
+under the tab Pcbnew, click on the button Netlist. This is shown in Fig. 6.2. Click on
vstop, and vincr are the starting, final, and incrementing values respectively, of the
-source.
-
When we check the option Operating Point analysis on the DC analysis window, .op gets
-appended to the analysis statement.
Save in the Save netlist file dialog box that opens up. Do not change the directory
+or the name of the netlist file. Save the schematic and close the schematic editor.
+
+ id="x1-430042">
-
Figure 6.2: DC Analysis GUI
+class="content">Netlist generation for PCB
-
-
The inclusion of the line .op in the analysis file directs Ngspice to determine the dc
-operating point of the circuit with inductors shorted and capacitors opened.
+
+
Note that the netlist for PCB has an extension .net. The netlist created for simulation
+has an extension .cir.
+
6.1.2 Mapping of components using Footprint Editor
+
+
+
+
Once the netlist for PCB is created, one needs to map each component in the netlist to a
+footprint. The tool Footprint Editor is used for this. eSim uses CvPcb as its footprint editor.
+CvPcb is the footprint editor tool in KiCad.
+
6.1.3 AC analysis inserter
+ id="x1-450006.1.3">Familiarising the Footprint Editor tool
-
When one clicks on the option AC in the Analysis Inserter GUI, the window given in
-Fig. 6.3 appears.
+
If one opens the Footprint Editor after creating the .net netlist file, the Footprint editor as
+shown in Fig. 6.3 will be obtained. The menu bar and toolbars and the panes are marked in
+this figure. The menu bar will be available in the top left corner. The left pane has a list of
+components in the netlist file and the right pane has a list of available footprints for each
+component.
+ id="x1-450023">
-
Figure 6.3: AC Analysis GUI
-
-
-
Here one needs to enter the details of scale, start frequency, stop frequency and Number of
-points.
-
After entering these values, click on Add Simulation Data. The analysis statement is
-generated. This is in one of the three forms listed below, depending on the type of scale that
-one chooses. The types of scale available are dec, oct, and lin, the usage of which is explained
-below: .ac dec nd fstart fstop .ac oct no fstart fstop .ac lin np fstart fstop Here, dec stands for decade variation and nd is the number of points per decade. oct stands
-for octave variation and no is the number of points per octave. lin stands for linear variation
-and np is the number of points. fstart is the starting frequency and fstop is the final
-frequency.
-
If the .ac analysis is included in the analysis file, Ngspice performs an AC analysis of the
-circuit over the specified frequency range. Note that in order for this analysis to be
-meaningful, at least one independent source must have been specified with an ac value. While
-creating the schematic for performing ac analysis, add the component AC from the
-sourcesSpice library.
-
6.1.4 Transient analysis inserter
-
-
When one clicks on the option Transient in the Analysis Inserter GUI, the window given in
-Fig. 6.4 appears. Here one needs to enter the details of start time, step time, and stop time.
-After entering these values, click on Add Simulation Data. The analysis statement is
-generated. It is of the form:
-
.tran tstep tstop tstart
-
Here, tstep is the printing or plotting increment for line-printer output. For use
-with the post-processor, tstep is the suggested computing increment. tstop is the
-final time, and tstart is the initial time. If tstart is omitted, it is assumed to be
-zero.
-
The transient analysis always begins at time zero. In the interval <zero, tstart>, the
-circuit is analyzed (to reach a steady state), but no outputs are stored. In the interval
-<tstart, tstop>, the circuit is analyzed and outputs are stored.
-
-
-
-
-
-
Figure 6.4: Transient Analysis GUI
-
-
-
6.2 Adding Source Details
-
Source details is basically a dynamic tab, i.e. the fields are added as per the circuit. The
-number of sources schematic has like AC,DC is the number of fields that get added in the
-GUI. Consider a Half-Adder circuit as shown in Fig. 6.5
-
-
-
-
-
-
Figure 6.5: Half Adder Schematic
-
-
-
Here, total three DC input source are used and hence the source detail GUI would be
-having three input fields as shown is Fig. 6.6
-
-
-
-
-
-
Figure 6.6: Source Details of Half-Adder
-
-
-
6.3 Adding Ngspice Model
-
-
6.4 Adding Device Model Library
-
Spice based simulators include a feature which allows accurate modeling of semiconductor
-devices such as diodes, transistors etc. Model libraries holds these features to define
-models for devices such as diodes, MOSFET, BJT, JFET, IGBT, Magnetic core
-etc.
-
The fields in this tab are added for each such device in the circuit and the corresponding
-model library is added. In the example of bridgerectifier as shown in Fig. 6.7 for four diodes
-library files are added as in Fig. 6.8
-
-
-
-
-
-
Figure 6.7: Schematic of Bridge Rectifier
-
-
-
-
-
-
-
-
-
Figure 6.8: Device Model GUI Window
-
-
-
6.5 Adding Sub Circuit
-
Sub-circuiting is the way of hierarchical modeling. The sub circuit file in the main circuits
-needs to be added before converting it. Let us consider the simple example of Full-Adder
-circuit containing two half adder sub circuits.
-
-
6.6 Kicad to Ngspice Conversion
-
After Filling up the values in all the above mentioned fields the convert button is pressed for
-the conversion process to finish. If all the files are added the successful message box is
-popped on the screen as shown in Fig. 6.9. Then click ok, this will create the .cir.out,
-analysis and other files in the project folders.
-
-
-
-
-
-
-
Figure 6.9: Successful Conversion Pop-Up Window
-
-
-
6.7 Simulation
-
After the Kicad to Ngspice conversion is successfully completed simulation tab on the toolbar
-is clicked to check the output waveform of the project. The windows shown if Fig. 6.10 and
-Fig. 6.11 are opned in dockarea.
-
-
-
-
-
-
-
Figure 6.10: Pythonplot Window in a Dockarea
-
-
-
-
-
-
-
-
-
Figure 6.11: Ngspice Terminal in a Dockarea
-
-
-
Following are the commands to be given in Ngspice window.
-
-
plot allv - Plots all the voltage waveforms.
-
-
plot v(node-name) - Plot a waveform of the node-name voltage source.
-
The output in the ngspice window is shown in Fig. 6.12
-
-
-
-
-
-
Figure 6.12: Output in a Ngspice Window
-
-
-
Likewise, in the pythonplot window the checkbox of a particular source can be chosen
-and then PLOT button is clicked. This output in pythonplot window is shown in
-Fig. 6.13
-
-
-
-
-
-
-
Figure 6.13: output in a Pythonplot Window
-
-
-
-
Chapter 7 PCB Design
Printed Circuit Board (PCB) design is an important step in
-electronic system design. Every component of the circuit needs to be placed and connections
-routed to minimise delay and area. Each component has an associated footprint. Footprint
-refers to the physical layout of a component that is required to mount it on the PCB.PCB
-design involves associating footprints to all components, placing them appropriately to
-minimise wire length and area, connecting the footprints using tracks/vias and finally
-extracting the required files needed for printing the PCB. Let us see the steps to design PCB
-using eSim.
-
7.1 Schematic creation for PCB design
-
In Chapter 5, we have seen the differences between schematic for simulation and schematic
-for PCB design. Let us design the PCB for an RC circuit. A resistor, capacitor, ground, power
-flag and a connector are required. Connectors are used to take signals in and out of the
-PCB.
-
Create the circuit schematic as shown in Fig. 7.1. The two pin connector (CONN_2) can
-be placed from the EEschema library conn. See Sec. ?? to know more about EEschema
-library conn. Do the annotation and test for ERC. Refer to Chapter 5 to know more about
-basic steps in schematic creation.
-
-
-
-
-
-
-
Figure 7.1: Final circuit schematic for RC low pass circuit
-
-
-
7.1.1 Netlist generation for PCB
-
-
-
The netlist for PCB is different from that for simulation. To generate netlist for PCB, click on
-the Generate netlist tool from the top toolbar in Schematic editor. In the Netlist window,
-under the tab Pcbnew, click on the button Netlist. This is shown in Fig. 7.2. Click on
-Save in the Save netlist file dialog box that opens up. Do not change the directory
-or the name of the netlist file. Save the schematic and close the schematic editor.
-
-
-
-
-
-
-
Figure 7.2: Netlist generation for PCB
-
-
-
Note that the netlist for PCB has an extension .net. The netlist created for simulation
-has an extension .cir.
-
7.1.2 Mapping of components using Footprint Editor
-
-
-
-
Once the netlist for PCB is created, one needs to map each component in the netlist to a
-footprint. The tool Footprint Editor is used for this. eSim uses CvPcb as its footprint editor.
-CvPcb is the footprint editor tool in KiCad.
-
-
7.1.3 Familiarising the Footprint Editor tool
-
-
If one opens the Footprint Editor after creating the .net netlist file, the Footprint editor as
-shown in Fig. 7.3 will be obtained. The menu bar and toolbars and the panes are marked in
-this figure. The menu bar will be available in the top left corner. The left pane has a list of
-components in the netlist file and the right pane has a list of available footprints for each
-component.
-
-
-
-
-
-
Figure 7.3: Footprint editor with the menu bar, toolbar, left pane and right pane
-marked
-
-
-
Note that if the Footprint Editor is opened before creating a ‘.net’ file, then the left and
+class="content">Footprint editor with the menu bar, toolbar, left pane and right pane
+marked
+
+
+
Note that if the Footprint Editor is opened before creating a ‘.net’ file, then the left andright panes will be empty.
Toolbar
-
Some of the important tools in the toolbar are shown in Fig. 7.4. They are explained below:
+ id="x1-460006.1.3">Toolbar
+
Some of the important tools in the toolbar are shown in Fig. 6.4. They are explained below:
+ id="x1-460014">
-
Figure 7.4: Some important tools in the toolbar
+>Figure 6.4: Some important tools in the toolbar
-
+
1.
Save netlist and footprint files - Save the netlist and the footprints that are
@@ -2453,7 +1595,7 @@ class="compactenum">Save netlist and footprint files - Save the netlist
2.
View selected footprint - View the selected footprint in 2D. See Sec. 7.1.4 for more
+href="#x1-470006.1.4">6.1.4 for more
details.
3.
Display filtered footprint list - Display a filtered list of
6.
Display full footprint list - Display the list of all footprints available (without
filtering)
-
7.1.4 Viewing footprints in 2D and 3D
+
6.1.4 Viewing footprints in 2D and 3D
+ id="dx1-47001">
-
To view a footprint in 2D, select it from the right pane and click on
+
To view a footprint in 2D, select it from the right pane and click on View selected footprint
from the menu bar. Let us view the footprint for SM1210. Choose SM1210 from
the right pane as shown in Fig. 7.5. On clicking the 6.5. On clicking the View selected footprint tool,
the Footprint window with the view in 2D will be displayed. Click on the 3D
tool in the Footprint window, as shown in Fig. 7.6. A top view of the selected
+href="#x1-470046">6.6. A top view of the selected
footprint in 3D is obtained. Click on the footprint and rotate it using mouse to get 3D
views from various angles. One such side view of the footprint in 3D is shown in
Fig. 7.7.
-
6.7.
+
+ id="x1-470035">
-
Figure 7.5: Figure 6.5: Viewing footprint for SM1210: 1. Choose the footprint SM1210 from the
right pane, 2. Click on View selected footprint
+class="cmti-10x-x-109">View selected footprint
-
-
+
+ id="x1-470046">
-
Figure 7.6: Figure 6.6: Footprint view in 2D. Click on 3D to get 3D view
+class="cmti-10x-x-109">3D to get 3D view
-
-
+
+ id="x1-470057">
-
Figure 7.7: Side view of the footprint in 3D
+>Figure 6.7: Side view of the footprint in 3D
-
-
7.1.5 Mapping of components in the RC circuit
-
Click on
+
6.1.5 Mapping of components in the RC circuit
+
Click on C1 from the left pane. Choose the footprint C1 from the right pane by double
clicking on it. Click on connector R3 for the resistor R1. The
footprint mapping is shown in Fig. 7.8. Save the footprint association by clicking on the 6.8. Save the footprint association by clicking on the Savenetlist and footprint files tool from the Footprint Editor window closes automatically.
>
+ id="x1-480018">
-
Figure 7.8: Footprint mapping done
+>Figure 6.8: Footprint mapping done
-
-
+
Note that one needs to browse to the directory where the schematic file is saved and savethe ‘.net’ file in the same directory.
-
7.2 Creation of PCB layout
+
6.2 Creation of PCB layout
+ id="dx1-49001">
-
The next step is to place the footprints and lay tracks between them to get the layout. This is
+ id="dx1-49002">
+
The next step is to place the footprints and lay tracks between them to get the layout. This is
done using the Layout Editor tool. eSim uses Pcbnew, the layout creation tool in KiCad, as its
layout editor.
-
-
7.2.1 Familiarizing the Layout Editor tool
+
+
6.2.1 Familiarizing the Layout Editor tool
-
The layout editor with the various menu bar and toolbars is shown in Fig. 7.9.
+ id="dx1-50001">
+
The layout editor with the various menu bar and toolbars is shown in Fig. 6.9.
+ id="x1-500029">
-
Figure 7.9: Layout editor with menu bar, toolbars and layer options marked
+>Figure 6.9: Layout editor with menu bar, toolbars and layer options marked
-
-
+
+ id="x1-5000310">
-
Figure 7.10: Top toolbar with important tools marked
+>Figure 6.10: Top toolbar with important tools marked
-
+
Top toolbar
-
Some of the important menu options in the top menu bar are shown in Fig. 7.10. They are
+ id="x1-510006.2.1">Top toolbar
+
Some of the important menu options in the top menu bar are shown in Fig. 6.10. They are
explained below:
1.
Show active layer selections and select layer pair for route
7.
Mode footprint: Manual/automatic move and place - Move and place modules
-
-
7.2.2 Hotkeys
+
+
6.2.2 Hotkeys
-
A list of hotkeys are given below:
+ id="dx1-52001">
+
A list of hotkeys are given below:
1.
F1 - Zoom in
@@ -2699,18 +1841,18 @@ class="compactenum">Ctrl+Z - Undo
11.
E - Edit Item
-
The list can be viewed by selecting
The list can be viewed by selecting Preferences from the top menu bar and choosing List CurrentKeys from the option Hotkeys.
-
-
7.2.3 PCB design example using RC circuit
+
+
6.2.3 PCB design example using RC circuit
-
Click on
+
Click on Layout Editor from the eSim toolbar. Click on Read Netlist tool from the top
toolbar. Click on Read CurrentNetlist on the Netlist window. The message area in the Netlist window says that
the RC_pcb.net has been read. The sequence of operations is shown in Fig. 7.11.
+href="#x1-5300411">6.11.
+the RC_pcb.net file, 3. Read Netlist file, 4. Close
-
-
The footprint modules will now be imported to the top left hand corner of the layout
+
+
The footprint modules will now be imported to the top left hand corner of the layout
editor window. This is shown in Fig. 7.12.
6.12.
+ id="x1-5300512">
-
Figure 7.12: Footprint modules imported to top left corner of layout editor window
+>Figure 6.12: Footprint modules imported to top left corner of layout editor window
-
-
Zoom in to the top left corner by pressing the key
+
Zoom in to the top left corner by pressing the key F1 or using the scroll button of the
mouse. The zoomed in version of the imported netlist is shown in Fig. 7.13.
-
Let us now place this in the center of the layout editor window.
6.13.
+
Let us now place this in the center of the layout editor window.
+ id="x1-5300613">
-
Figure 7.13: Zoomed in version of the imported netlist
+>Figure 6.13: Zoomed in version of the imported netlist
-
-
Click on
+
Click on Mode footprint: Manual/automatic move and place tool from the top toolbar.
Place the cursor near the center of the layout editor window. Right click and choose Globmove and place. Choose move all modules. The sequence of operations is shown in Fig. 7.14.
+href="#x1-5300714">6.14.
Click on Yes on the confirmation window to move the modules. Zoom in using the F1 key.
The current placement of components after zooming in is shown in Fig. 7.15a.
+href="#x1-53008r1">6.15a.
+ id="x1-5300714">
-
Figure 7.14: Figure 6.14: Moving and placing modules to the center of layout editor. 1. Click on
Mode footprint: Manual/automatic move and place, 2. Place cursor at center of layout
@@ -2808,18 +1950,18 @@ editor and right click on it 3. Choose Glob Move and Place and then choose Move AllModules.
+class="cmti-10x-x-109">Modules.
-
-
+
+ id="x1-5301015">
-
+
of the
class="cmr-9">layout
editormovingP1
Figure 7.15: Different stages of placement of modules on PCB
+>Figure 6.15: Different stages of placement of modules on PCB
-
-
We need to arrange the modules properly to lay tracks. Rotate the connector P1 by
+
+
We need to arrange the modules properly to lay tracks. Rotate the connector P1 by
placing the cursor on top of P1 and pressing R. Move it by placing the cursor on top of it and
pressing M. The final placement is shown in Fig. 7.15b.
-
Let us now lay the tracks. Let us first change the track width. Click on 6.15b.
+
Let us now lay the tracks. Let us first change the track width. Click on Design rules from
the top menu bar. Click on Design rules. This is shown in Fig. 7.16. The 6.16. The Design Rules Editor
window opens up. Here one can edit the various design rules. Double click on the track width
field to edit it. Type 0.8 and press Enter. Click on OK. Fig. 7.17 shows the sequence of
+href="#x1-5301517">6.17 shows the sequence of
operations.
+ id="x1-5301416">
-
Figure 7.16: Figure 6.16: Choose Design Rules from the top menu bar and Design Rules again
+class="cmti-10x-x-109">Design Rules again
-
-
+
+ id="x1-5301517">
-
Figure 7.17: Figure 6.17: Changing the track width: 1. Double click on Track Width field and type
0.8, 2. Click on OK
+class="cmti-10x-x-109">OK
-
-
Click on
+
Click on Back from the Layer options as shown in Fig. 7.18.
6.18.
+ id="x1-5301718">
-
Figure 7.18: Figure 6.18: Choosing the copper layer Back
+class="cmti-10x-x-109">Back
-
-
Let us now start laying the tracks. Place the cursor above the left terminal of R1
+
+
Let us now start laying the tracks. Place the cursor above the left terminal of R1
in the layout editor window. Press the key x. Move the cursor down and double
click on the left terminal of C1. A track is formed. This is shown in Fig. 7.19a.
+href="#x1-53018r1">6.19a.
Figure 7.19: Different stages of laying tracks during PCB design
+>Figure 6.19: Different stages of laying tracks during PCB design
-
-
Similarly lay the track between capacitor C1 and connector P1 as shown in
+
+
Similarly lay the track between capacitor C1 and connector P1 as shown in
Fig. 7.19b. The last track needs to be laid at an angle. To do so, place the cursor
+href="#x1-53019r2">6.19b. The last track needs to be laid at an angle. To do so, place the cursor
above the second terminal of R1. Press the key x and move the cursor diagonally
down. Double click on the other terminal of the connector. The track will be laid
as shown in Fig. 7.19c. All tracks are now laid. The next step is to create PCB
+href="#x1-53020r3">6.19c. All tracks are now laid. The next step is to create PCB
edges.
-
Choose
Choose PCB_edges from the Layer options to add edges. Click on Add graphic line orpolygon from the toolbar on the left. Fig. 7.20 shows the sequence of operations. Let us now
+href="#x1-5302320">6.20 shows the sequence of operations. Let us now
start drawing edges for PCB.
+ id="x1-5302320">
-
Figure 7.20: Figure 6.20: Creating PCB edges: 1. Choose PCB_Edges from Layer options 2. Choose
Add graphic line or polygon from left toolbar
+class="cmti-10x-x-109">Add graphic line or polygon from left toolbar
-
-
Click to the left of the layout. Move cursor horizontally to the right. Click once to change
+
+
Click to the left of the layout. Move cursor horizontally to the right. Click once to change
orientation. Move cursor vertically down. Draw the edges as shown in Fig. 7.21. Double click
+href="#x1-5302421">6.21. Double click
to finish drawing the edges.
+ id="x1-5302421">
-
Figure 7.21: PCB edges drawn
+>Figure 6.21: PCB edges drawn
-
-
Click on
+
Click on Perform design rules check from the top toolbar to check for design rules. The
DRC Control window opens up. Click on Errormessages tab. Click on OK to close DRC control window. Fig. 7.22 shows the sequence of
+href="#x1-5302622">6.22 shows the sequence of
operations.
+ id="x1-5302622">
-
Figure 7.22: Figure 6.22: Performing design rules check: 1. Click on Start DRC, 2. Click on Ok
+class="cmti-10x-x-109">Ok
-
-
Click on
+
Click on Save board on the top toolbar.
-
To generate Gerber files, click on
To generate Gerber files, click on File from the top menu bar. Click on Plot. This is shown
in Fig. 7.23. The plot window opens up. One can choose which layers to plot by
+href="#x1-5302823">6.23. The plot window opens up. One can choose which layers to plot by
selecting/deselecting them from the Layers pane on the left side. One can also choose the
format used to plot them. Choose Plot. The message window shows the location
in which the Gerber files are created. Click on Close. This is shown in Fig. 7.24.
+href="#x1-5302924">6.24.
+ id="x1-5302823">
-
Figure 7.23: Figure 6.23: Choosing Plot from the File menu
+class="cmti-10x-x-109">File menu
-
-
+
+ id="x1-5302924">
-
Figure 7.24: Figure 6.24: Creating Gerber files: 1. Choose Gerber as the plot format, 2. Click on
Plot. Message window shows location in which Gerber files are created, 3. Click on Close
+class="cmti-10x-x-109">Close
-
-
The PCB design of RC circuit is now complete. To know more about Pcbnew, refer to
+
+
The PCB design of RC circuit is now complete. To know more about Pcbnew, refer to
[15] or [16].
-
Chapter 8 Model Editor
+
Chapter 7 Model Editor
Spice based simulators include a feature which allows accurate modeling of semiconductor
-devices such as diodes, transistors etc. eSim Model Builder provides a facility to define a new
-model for devices such as diodes, MOSFET, BJT, JFET, IGBT, Magnetic core etc. Model
-Builder in eSim lets the user enter the values of parameters depending on the type of device
-for which a model is required. The parameter values can be obtained from the data-sheet
-of the device. A newly created model can be exported to the model library and
-one can import it for different projects, whenever required. Model Builder also
+devices such as diodes, transistors etc. eSim Model Editor provides a facility to define a new
+model for devices such as diodes, MOSFET, BJT, JFET, IGBT, Magnetic core etc. Model
+Editor in eSim lets the user enter the values of parameters depending on the type of
+device for which a model is required. The parameter values can be obtained from the
+data-sheet of the device. A newly created model can be exported to the model library
+and one can import it for different projects, whenever required. Model Editor also
provides a facility to edit existing models. The GUI of the model editor is as shown in
Fig. 8.1
+href="#x1-540011">7.1
+ id="x1-540011">
Figure 8.1: Model Editor
+>Figure 7.1: Model Editor
-
8.1 Creating New Model Library
-
eSim lets used create new model libraries based on the template model libraries. on selecting
+
7.1 Creating New Model Library
+
eSim lets us create new model libraries based on the template model libraries. On selecting
New button the window is popped to name the new library file. The library file has to be
-unique otherwise the error message appears on the window.
+class="cmtt-10x-x-109">New
button the window is popped as shown in Fig. 7.2. The name has to be unique otherwise
+the error message appears on the window.
+ id="x1-550012">
Figure 8.2: Creating New Model Library
+>Figure 7.2: Creating New Model Library
-
After the OK button is pressed the type of model library to be created is chosen by
+
After the OK button is pressed the type of model library to be created is chosen by
selecting one of the types on the left hand side i.e. Diode, BJT, MOS, JFET, IGBT,Magnetic Core. The template model library is then opened in the tabular form. As shown in
-Fig. 8.3
-
Magnetic Core. The template model library opens up in a tabular form as shown in Fig. 7.3
+
+ id="x1-550023">
-
Figure 8.3: Choosing the Template Model Library
+>Figure 7.3: Choosing the Template Model Library
+
+
-
-
The new parameters can be added or a current parameters can be removed using ADD
+
New parameters can be added or current parameters can be removed using ADD
and REMOVE buttons. Also the values of parameters can be changed in the table. The
-adding and removing of the parameters in a library files is as shown in the Fig. 8.4 and
+class="cmtt-10x-x-109">REMOVE
buttons. Also the values of parameters can be changed in the table.
+Adding and removing the parameters in library files is shown in the Fig. 7.4 and
Fig. 8.5
+href="#x1-550045">7.5
+ id="x1-550034">
Figure 8.4: Adding the Parameter in a Library
+>Figure 7.4: Adding the Parameter in a Library
+ id="x1-550045">
Figure 8.5: Removing a Parameter from a Library
+>Figure 7.5: Removing a Parameter from a Library
-
After the editing of the model library is done the file can be saved selecting the SAVE
+
After the editing of the model library is done, the file can be saved by selecting the SAVE
button. These libraries are saved in the Use Libraries folder under DecviceModelLibrary folder
-in the project folder.
-
8.2 Editing Current Model Library
-
The current model library can be saved using EDIT option. On clicking the EDIT button the
-file dialog opens where all the library files are saved as shown in Fig. 8.6
-
User Libraries folder under deviceModelLibrary
+repository.
+
7.2 Editing Current Model Library
+
The existing model library can be modified using EDIT option. On clicking the EDIT button
+the file dialog opens where all the library files are saved as shown in Fig. 7.6. You can select
+the library you want to edit. Once you are done with the editing, click on SAVE
+button.
+
+ id="x1-560016">
-
Figure 8.6: Editing Existing Model Library
-
-
-
Further on clicking the SAVE button the edited model library is saved in the Use
+>Figure 7.6: Editing Existing Model Library
+
+
+
7.3 Uploading external .lib file to eSim repository
+
eSim directly cannot use the external .lib file. It has to be uploaded to eSim repository before
+using it in a circuit. eSim provides the facility to upload library files. They are then converted
+into xml format, which can be easily modified from the eSim interface. On clicking UPLOAD
+button the library can be uploaded from any location. The model library will be
+saved with the name you have provided, in the User Libraries folder of repository
Libraries folder under DecviceModelLibrary folder in the project folder.
-
8.3 Converting Library file to XML file
-
eSim can not read the model library file in the .lib form. The file needs to be converted into
-XML so as to make it readable and editable in model editor. Any new netlist that user wants
-to use in the eSim need to be convertedinto xml before using it in a project. hence eSim
-provides us to upload the new netlist which converts in into xml. on clicking UPLOAD button
-the netlist can be uploaded from any location and further on saving the file the model library
-can be saved in the Use Libraries folder under DecviceModelLibrary folder in the project
-folder with different name.
-
-
+class="cmti-10x-x-109">deviceModelLibrary
.
-
Chapter 9 Sub-Circuit Builder
Subcircuit is a way to implement hierarchical modeling.
+
Chapter 8 SubCircuit Builder
Subcircuit is a way to implement hierarchical modeling.
Once a subcircuit for a compo- nent is created, it can be used in other circuits.
-eSim provides an easy way to create a subcircuit. Thw Following Fig. 9.1 shows
-the window that is opened when the Sub-CIrcuit tool is chosen from the toolbar.
+eSim provides an easy way to create a subcircuit. The following Fig. 8.1 shows
+the window that is opened when the SubCircuit tool is chosen from the toolbar.
+ id="x1-580011">
Figure 9.1: Sub circuit Window
+>Figure 8.1: Subcircuit Window
-
9.1 Creating a Sub-Circuit
-
Let us take an example of Half-adder circuit. To create a new sub circuit select the New
-Subcircuit Schematic.Fig. 9.2 shows the half-adder circuit and Fig. 9.3 shows the block of the
-sub circuit included in the main circuit.
-
-
-
-
8.1 Creating a SubCircuit
+
The steps to create subcircuit are as follows.
+
+
After opening the Subcircuit tool, click on New Subcircuit Schematic button.
+ It will ask the name of the subcircuit. Enter the name of subcircuit (without any
+ spaces) and click OK as shown in Fig. 8.2.
+
Figure 9.2: Half-Adder Sub-circuit
-
-
-
NOTE: All the input and output of the sub circuits are connected to the port component.
-
-
-
-
-
-
Figure 8.2: New Sub circuit Window
+
+
+
After clicking OK button it will open KiCad schematic. Draw your circuit
+ which will be later used as a subcircuit. e.g the Fig. 8.3 shows the half adder
+ circuit.
+
Figure 9.3: Half-Adder Sub-circuit Block
-
-
-
After creating the schematic kicad netlist is generated as explained in section and convert
-kicad to Ngspice where cir.out and .sub files are generated. The number of input and
-output ports of the subcircuit is to matched with number of connections in the
-main circuit. eSim provides this validation of mapping of the sub circuit ports.
-Also the respective input and output ports can be checked by reading the .sub
-file.
-
-
-
Appendix A Solved Examples
-
A.1 Solved Examples
-
-
A.1.1 Basic RC Circuit
-
-
Problem Statement-
-
Plot the Input and Output Waveform of RC ckt where the input voltage (Vs) is
-50Hz, 3V peak to peak. Value for Resistor (R) and Capacitor(C) is 1k and 1uf
-respectively.
-
-
Solution-
-
Draw the schematic and label the nodes as shown in Fig. A.1a using the schematic editor.
-Annotate the schematic using the Annotate tool from the top toolbar in Schematic editor.
-Perform Electric Rules check using the Perform electric rules check tool from the top toolbar.
-Ensure that there are no errors in the circuit schematic. Now generate Spice netlist for
-simulation using the Generate Netlist tool from the top toolbar. This is shown
-Fig. A.1.
-
Next step is to convert kicad netlist to ngspice netlist by click on icon Convert Kicad to
-Ngspice. Then Fill the Analysis tab with Transisent option selected as given in Fig. A.2.
-Enter start time = 0ms, step time = 1ms, stop time = 100ms.
-
Now Click on Sources Details Tab to Enter Sine Source Values as shown in
-Fig. A.4.
-
Then Press Convert Button which will generate Ngspice Netlist (rc.cir.out)
-
Now Click on Simulation icon to open Ngspice Plot and Python Plot shown in Fig. A.5
-And Fig. A.6.
-
-
-
-
+>Figure 8.3: New Sub circuit Window
+
-
+
Once you complete the circuit, assign port to the node of your circuit which will be
+ used to connect with the main circuit. The circuit will look like Fig. 8.4 after
+ adding PORT to it. The PORT symbol can be found in Eeschema as shown in
+ Fig. 8.5.
+
Figure A.1: Schematic of RC circuit
-
-
-
-
-
-
-
-
Figure 8.4: Half-Adder Subcircuit
+
+
Figure A.2: RC circuit Netlist Generation
-
-
-
-
-
-
+>Figure 8.5: Selection of PORT component
+
-
+
Next step is to save the schematic and generate KiCad netlist as explained in Chapter
+ 5.
+
+
To use this as a subcircuit, create a block in KiCad Eeschema by following steps given
+ below:
+
+ 1.
Go to library browser of Eeschema.
+
+ 2.
Select the working library as eSim_Subckt as shown in Fig. 8.6
Figure A.3: RC Circuit Analysis Insertor
-
-
-
-
-
-
+>Figure 8.6: Selecting Working Library
+
-
+ 3.
Click on create a new component with reference X as shown in Fig. 8.7
+
Figure A.4: RC Source Details
-
-
-
-
-
-
-
-
Figure 8.7: Creating New Component
+
+
+ 4.
Start drawing the subcircuit block. Update and save it as shown in Fig. 8.8.
+
Figure A.5: Ngspice Plot of RC circuit
-
-
-
+>Figure 8.8: Half-Adder Subcircuit Block
+
+
-
-
-
-
-
Figure A.6: Python Plot of RC Circuit
+
+
Close the Eeschema window and click on Convert KiCad to Ngspice button in subcircuit
+ builder tool. This will convert the KiCad spice netlist to Ngspice netlist. And it will
+ save your subcircuit into eSim repository, which you can add in your main
+ circuit.
+
+
+
8.2 Edit a Subcircuit
+
The steps to edit a subcircuit are as follows.
+
+
After opening the Subcircuit tool, click on Edit Subcircuit Schematic button.
+ It will open a dialog box where you can select any subcircuit for editing.
+
+
After selecting the subcircuit it will open it in KiCad Eeschema, where you can
+ edit the subcircuit.
+
+
Next step is to save the schematic and generate KiCad netlist.
+
+
If you have edited the number of ports then you have to change the block in KiCad
+ Eeschema accordingly.
+
+
Close the Eeschema window and click on Convert KiCad to Ngspice button in
+ subcircuit builder tool to convert the edited subcircuit KiCad netlist into Ngspice
+ netlist.
+
-
-
A.1.2 Half Wave Rectifier
-
+
Chapter 9 Solved Examples
+
9.1 Solved Examples
+
+
9.1.1 Basic RC Circuit
+
Problem Statement-
-
Plot the Input and Output Waveform of Half Wave Rectifier ckt where the input voltage (Vs)
-is 50Hz, 2V peak to peak. Value for Resistor (R) is 1k respectively
-
-
+ id="x1-640009.1.1">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.
Solution-
-
Draw the schematic and label the nodes as shown in Fig. A.7 using the schematic editor.
-Annotate the schematic using the Annotate tool from the top toolbar in Schematic editor.
-Perform Electric Rules check using the Perform electric rules check tool from the top toolbar.
-Ensure that there are no errors in the circuit schematic. Now generate Spice netlist for
-simulation using the Generate Netlist tool from the top toolbar. This is shown in
-Fig. A.8.
-
Next step is to convert kicad netlist to ngspice netlist by click on icon Convert Kicad to
-Ngspice. Then Fill the Analysis tab with Transisent option selected as given in Fig. A.9.
-Enter start time = 0ms, step time = 1ms, stop time = 100ms. Now Click on Sources Details
-Tab to Enter Sine Source Values as shown in Fig. A.10. Now Click on Device Model Tab to
-ADD Diode model to the circuit shown in Fig. A.11. (Note Details about Device Model is
-expained in earlier chapter Model Builder.)
-
Then Press Convert Button which will generate Ngspice Netlist (Halfwave-Rectifier.cir.out)
-
Now Click on Simulation icon to open Ngspice Plot and Python Plot shown in Fig. A.12
-And Fig. A.13
-
-
-
-
-
-
-
Figure A.7: Schematic of Halfwave Rectifier circuit
-
-
-
-
-
-
-
-
Solution:
+
+
Creating a Project: The new project is created by clicking the New icon on the
+ menubar. The name of the project is given in the pop up window as shown in
+ Fig. 9.1.
Creating the Schematic: To create the schematic, click the very first icon of the left
+ toolbar as shown in the Fig. 9.2. This will open KiCad Eeschema.
+
To create a schematic in KiCad, we need to place the required components. Fig. 9.3
+ shows the icon on the right toolbar which opens the component library.
+
Figure A.10: Halfwave Rectifier Source Details
-
-
-
-
-
-
-
-
Figure 9.3: Place Component Icon
+
+
+
After all the required components of the simple RC circuit are placed, wiring is done
+ using the Place Wire option as shown in the Fig. 9.4
+
+
Figure 9.4: Place Wire Icon
+
+
Next step is ERC (Electric Rules Check). Fig. 9.5 shows the icon for ERC.
+
Figure A.11: Device Modeling of Halfwave Rectifier circuit
-
-
-
-
-
-
-
-
Figure 9.5: Electric Rules Check Icon
+
+
Fig. 9.6 shows the RC circuit after connecting the components by wire.
+
Figure A.12: Ngspice Plot of Halfwave Rectifier circuit
+>Figure 9.6: RC circuit
+
-
-
After clicking the ERC icon a window opens up. Click the Run button to run rules check.
+ The errors are listed in as shown in Fig. 9.7a. This error is handled by adding Power
+ Flag as shown in Fig. 9.7b.
+
-
-
-
-
-
(a)
+ ERC
+ Run
+ (b)
+ Power
+ Flag
+
Figure 9.7: ERC check and POWER FLAG
+
+
After adding the Power Flag the completed RC circuit is shown in Fig. 9.8a and the
+ netlist is generated as shown in Fig. 9.8b.
+
-
Figure A.13: Python Plot of Halfwave Rectifier Circuit
-
-
-
-
A.1.3 Inverting Amplifier
-
-
Problem Statement-
-
Plot the Input and Output Waveform of Inverting Amplifier ckt where the input voltage (Vs)
-is 50Hz, 2V peak to peak and gain is 2.
-
Solution-
-
Draw the schematic and label the nodes as shown in Fig. A.14. using the schematic editor.
-Annotate the schematic using the Annotate tool from the top toolbar in Schematic editor.
-Perform Electric Rules check using the Perform electric rules check tool from the top toolbar.
-Ensure that there are no errors in the circuit schematic. Now generate Spice netlist for
-simulation using the Generate Netlist tool from the top toolbar. This is shown in
-Fig. A.15.
-
Next step is to convert kicad netlist to ngspice netlist by click on icon Convert Kicad to
-Ngspice. Then Fill the Analysis tab with Transisent option selected as given in
-Fig. A.16. Enter start time = 0ms, step time = 1ms, stop time = 100ms. Now
-Click on Sources Details Tab to Enter Sine Source Values as shown in Fig. A.17.
-Now Click on Subciruits Tab to ADD UA741 Subcircut to the circuit shown in
-Fig. A.18 (Note Details about Subcircuit is expained in earlier chapter Subcircuit
-Builder.)
-
Then Press Convert Button which will generate Ngspice Netlist (Inverting-Amplifier.cir.out)
-
Now Click on Simulation icon to open Ngspice Plot and Python Plot shown in Fig. A.20
-and Fig. A.19.
-
Convert KiCad to Ngspice: To convert KiCad netlist of RC circuit to NgSpice
+ compatible netlist click on KiCad to Ngspice icon as shown in Fig. 9.9.
+
Figure A.14: Schematic of Inverting Amplifier circuit
-
-
-
-
-
-
-
-
Figure 9.9: Convert KiCad to Ngspice Icon
+
+
Now you can enter the type of analysis and source details as shown in Fig. 9.10a and
+ Fig. 9.10b respectively.
+
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.
-
-
-
-
+
Simulation: To run Ngspice simulation click the simulation icon in the tool bar
+ as shown in the Fig. 9.11.
+
Figure 9.11: Simulation Icon
+
+
In eSim, there are two types of plot. First is normal Ngspice plot and second is
+ interactive python plot as shown in Fig. 9.12a and Fig. 9.12b respectively.
+
(a)
+ Ngspice
+ Plot
+ of RC
+ (b)
+ Python
+ Plot
+ of RC
+
Figure 9.12: Ngspice and Interactive Python Plotting
+
+
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.
+
-
-
-
-
+
9.1.2 Half Wave Rectifier
+
+
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.
+
+
Solution:
+
The new project is created by clicking the New icon on the menubar. The name of the project
+is given in the window shown in Fig. 9.1.
+
+
Creating Schematic: To create the schematic, click the very first icon of the left
+ toolbar as shown in the Fig. 9.2. This will open KiCad Eeschema.
+
After the KiCad window is opened, to create a schematic we need to place the
+ required components. Fig. 9.3 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 Place Wire option as shown in the Fig. 9.4
+
Next step is ERC (Electric Rules Check). Fig. 9.5 shows the icon for ERC. After
+ completing all the above steps the final Half Wave Rectifier schematic will look
+ like Fig. 9.13.
+
Figure A.17: Inverting Amplifier Source Details
-
-
-
+>Figure 9.13: Schematic of Half Wave Rectifier circuit
+
-
-
-
-
KiCad netlist is generated as shown in the Fig. 9.14
+
Figure A.18: Sub Circuit Tab of Inverting Amplifier
Convert KiCad to Ngspice: After creating KiCad netlist, click on the KiCad-Ngspice
+ converter button. This will open converter window where you can enter details of
+ Analysis, Source values and Device library.
+
-
-
-
-
-
(a)
+ Half
+ Wave
+ Rectifier
+ Analysis
-
Figure A.19: Ngspice Plot of Inverting Amplifier circuit
Plot the Input and Output Waveform of Precision Reectifier ckt where the input voltage (Vs)
-is 50Hz, 3V peak to peak.
-
+ id="x1-700009.1.3">Problem Statement:
+
Plot the input and output waveform of the Precision Rectifier circuit where input voltage
+(Vs) is 50Hz , 3V peak to peak.
+
Solution -
-
Draw the schematic and label the nodes as shown in Fig. D.1a using the schematic editor.
-Annotate the schematic using the Annotate tool from the top toolbar in Schematic editor.
-Perform Electric Rules check using the Perform electric rules check tool from the top toolbar.
-Ensure that there are no errors in the circuit schematic. Now generate Spice netlist for
-simulation using the Generate Netlist tool from the top toolbar. This is shown in
-Fig. A.22.
-
Next step is to convert kicad netlist to ngspice netlist by click on icon Convert Kicad to
-Ngspice. Then Fill the Analysis tab with Transisent option selected as given in
-Fig. A.23. Enter start time = 0ms, step time = 1 ms, stop time = 100 ms. Now Click
-on Sources Details Tab to Enter Sine Source Values as shown in Fig. A.24. Now
-Click on Device Model Tab to ADD Diode model to the circuit shown in Fig. A.25.
-(Note Details about Device Model is expained in earlier chapter Model Builder.)
-Then Click on Subciruits Tab to ADD UA741 Subcircut to the circuit shown in
-Fig. A.26. (Note Details about Subcircuit is expained in earlier chapter Subcircuit
-Builder.)
-
Then Press Convert Button which will generate Ngspice Netlist (Precision-Rectifier.cir.out)
-
Now Click on Simulation icon to open Ngspice Plot and Python Plot shown in Fig. A.27
-and Fig. A.28.
-
-
-
-
-
-
Solution:
+
The new project is created by clicking the New icon on the menubar. The name of the project
+is given as shown in the Fig. 9.1.
+
+
Creating Schematic: To create the schematic, click the very first icon of the left
+ toolbar as shown in the Fig. 9.2. This will open KiCad Eeschema. After the KiCad window is opened, to create a schematic we need to place the
+ required components. Fig. 9.3 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 Place Wire option as shown in the Fig. 9.4. Next step is ERC (Electric Rules Check). Fig. 9.5 shows the icon for ERC. The
+ Fig. 9.17 shows the complete Precision Rectifier schematic after removing the
+ errors.
+
Figure A.21: Schematic of Precision Rectifier circuit
-
-
-
-
-
-
-
-
Figure 9.17: Schematic of Precision Rectifier circuit
+
+
The KiCad netlist is generated as shown in Fig. 9.18.
+
+>Figure 9.19: Analysis, Source, Device library and Subcircuit tab
+
+
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.
-
-
+
Simulation: Once the KiCad-Ngspice converter runs successfully, you can run the
+ simulation by clicking the simulation button in the toolbar.
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.
+
Solution:
+
+
Creating Schematic: To create the schematic, click the very first icon of the left
+ toolbar as shown in the Fig. 9.2. This will open KiCad Eeschema. After the KiCad window is opened, to create a schematic we need to place the
+ required components. Fig. 9.3 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 Place Wire option as shown in the Fig. 9.4. Next step is ERC (Electric Rules Check). Fig. 9.5 shows the icon for ERC.
+
The Fig. 9.21 shows the complete Precision Rectifier schematic after removing
+ the errors.
+
Figure A.27: Ngspice Plot of Precision Rectifier circuit
-
-
-
Figure 9.21: Schematic of Inverting Amplifier circuit
+
+
The KiCad netlist is generated as shown in Fig. 9.22.
Plot the Input and Output Waveform of Half Adder ckt.
-
+ id="x1-760009.1.5">Problem Statement:
+
Plot the Input and Output Waveform of Half Adder circuit.
+
Solution -
-
Draw the schematic and label the nodes as shown in Fig. A.29 using the schematic editor.
-[Note : To create any Digital Circuits ADCs and DACs must be connected to input and
-output of the circuit.] Annotate the schematic using the Annotate tool from the top toolbar in
-Schematic editor. Perform Electric Rules check using the Perform electric rules check tool
-from the top toolbar. Ensure that there are no errors in the circuit schematic. Now generate
-Spice netlist for simulation using the Generate Netlist tool from the top toolbar. This is
-shown in Fig. A.30.
-
Next step is to convert kicad netlist to ngspice netlist by click on icon Convert Kicad to
-Ngspice. Then Fill the Analysis tab with Transisent option selected as given in Fig. A.31.
-Enter start time = 0ms, step time = 1ms, stop time = 100ms. Now Click on Sources Details
-Tab to Enter Sine Source Values as shown in Fig. A.32. Click on Ngspice Model Tab and
-Enter the Details of Ngspice Models else keep it empty where it will select default values as
-shown in Fig. A.33 Then Click on Subciruits Tab to ADD half-adder Subcircut to the circuit
-shown in Fig. A.34. (Note Details about Subcircuit is expained in earlier chapter Subcircuit
-Builder.)
-
Then Press Convert Button which will generate Ngspice Netlist (Half-Adder.cir.out)
-
Now Click on Simulation icon to open Ngspice Plot and Python Plot shown in Fig. A.35
-and Fig. A.36.
-
-
-
-
-
-
Solution:
+
+
Creating Schematic: To create the schematic, click the very first icon of the left
+ toolbar as shown in the Fig. 9.2. This will open KiCad Eeschema. After the KiCad window is opened, to create a schematic we need to place the
+ required components. Fig. 9.3 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 Place Wire option as shown in the Fig. 9.4. Next step is ERC (Electric Rules Check). Fig. 9.5 shows the icon for ERC.
+
The Fig. 9.25 shows the complete Half Adder schematic after removing the
+ errors.
Figure A.29: Schematic of Half Adder circuit
-
-
-
-
-
-
-
-
Figure 9.25: Schematic of Half Adder circuit
+
+
The KiCad netlist is generated as shown in Fig. 9.26.