ESim/C2/Schematic-Creation-and-Simulation/English-timed

From Script | Spoken-Tutorial
Revision as of 17:37, 17 June 2021 by Pratik kamble (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Schematic Creation and Simulation using eSim

Author: Gaurav Supal

Keywords: Video tutorial, eSim, Schematic, Simulation, EDA, Ngspice, analysis, transient, subcircuit, spice

Time Narration
00:01 Welcome to the spoken tutorial on “Schematic Creation and Simulation using eSim
00:08 In this tutorial, using eSim, we will learn to-

Create circuit schematic

Generate spice netlist

Convert spice netlist to ngspice format

Simulate the netlist

00:26 To record this tutorial, we will use-

Ubuntu Linux OS 16.04

eSim version 1.1.2.

00:38 To practice this tutorial, basic knowledge of analog and digital electronics is required.
00:47 To launch eSim, double-click on the eSim icon on your desktop.
00:55 Alternately, you can also open eSim from the terminal.
01:01 To do so, press Ctrl, Alt and T keys together. Now, type esim and press Enter.
01:11 eSim window opens up.
01:14 Note that the project files created will be saved in the eSim-Workspace directory, by default. Press “Ok” in the dialog box.
01:27 Let us now create an RC circuit schematic and simulate it.
01:33 Click on the New Project button, to create a new project. In the “Enter Project name” field, type RC and click on OK.
01:47 Please note that spaces are not allowed in the Project name.
01:53 Our new project RC will now appear under Projects.
01:59 Double-click on RC to select the project.
02:04 To create the circuit schematic, click Open Schematic button on the left toolbar.
02:12 Click on Yes in the confirmation dialog box.
02:17 Ignore the eeschema error by clicking OK.
02:22 The Schematic editor window opens up.
02:26 Let us now add components to the schematic.
02:31 Click on Place component tool from the right toolbar. Now click anywhere on the editor.
02:40 Type eSim_Devices in the Filter field.
02:49 Then select R and click on OK. Now click anywhere on the editor.
03:00 Place the resistor R on the editor, by clicking on the editor once.
03:07 Zoom in by pressing F1.
03:11 You can also do so, by scrolling the scroll button of your mouse.
03:18 Click on the editor once again.
03:22 Type again eSim_Devices in the Filter field. Then select C and click on OK.
03:33 Place the capacitor C on the editor as done before.
03:39 Click again on the editor.
03:43 Type eSim_Sources in the Filter field,
03:50 select sine and click on OK.
03:56 Place the sine on the editor as done before.
04:02 Similarly, type gnd and place a ground terminal on editor.
04:12 Similarly, type eSim_Plot, select the plot_v1 and place it on the editor.
04:26 We need one more plot for output.
04:30 Place the cursor on plot_v1, right click and select copy component. Now place it on the editor.
04:45 This is the plot component used to plot voltages at the required nodes.
04:52 Let us now add labels to the schematic.
04:56 The labels are used to name the required nodes in the circuit.
05:02 This will help us understand the netlist and connection of our circuit.
05:09 Click on Place global label tool from the right toolbar. Now click anywhere on the editor.
05:19 Type IN in text field and click on OK.
05:27 Similarly, place one more label OUT in editor.
05:36 Let us move and arrange the components to create the RC circuit.
05:42 To move the resistor, place the cursor on it and press the key 'm'.
05:50 Place it at the preferred location, by clicking on editor again.
05:57 To rotate the resistor, place the cursor on it and press the key 'r'.
06:05 Similarly, move the plot components and labels, as shown.
06:11 Now, let us connect the various components using wires.
06:16 Click on Place wire button from the right toolbar
06:22 Click on one end of the sine source.
06:26 Move the cursor point to one end of the resistor and click on it.
06:33 Similarly, connect all the components as demonstrated here.
06:40 The plot components are placed at the output and input nodes.
06:45 This helps us to view the corresponding voltage waveforms on simulation.
06:53 To annotate the schematic components, Click on Annotate button from the top toolbar.
07:01 Click on Annotate and then click on OK. The schematic is now annotated.
07:11 To assign a value to the resistor, right-click on it and choose Edit Component.
07:18 Click on Value. Type 1k and click on OK.
07:26 Similarly, assign value 1u for capacitor.
07:33 Now let us do electrical rules check for this schematic.
07:38 Click on Perform electrical rules check button on the top toolbar . Click on Run.
07:47 We can see the errors -

global label not connected and a pin is not driven to components

07:58 Ignore the global label not connected error, since we have used the labels for naming the nodes only.
08:06 Close the ERC window.
08:09 Note that the ground terminal pin is highlighted by a green arrow in the schematic.
08:17 It means that this pin is not driven by any power source.
08:22 To prevent this, let us place a power flag.
08:26 Click on Place component tool. Click on the Schematic editor.
08:33 Type PWR underscore FLAG and Click OK. Place it on the schematic editor.
08:47 Connect this power flag to the ground terminal using a wire.
08:53 This indicates that a power source will be connected here.
08:59 Now repeat the electrical rules check.
09:04 There will be only global label not connected errors, which can be ignored.
09:12 Click on Delete Markers and then click on Close.
09:18 Now let us generate the netlist of this circuit.
09:23 Click on Generate netlist button from the top toolbar.
09:29 Click on the Spice tab. Check the option Default format and then click on Generate. Click on Save.
09:41 A Kicad netlist of the RC circuit has been generated. Now minimise the schematic editor.
09:51 Now, let us add simulation parameters to this netlist.
09:57 Click on Convert Kicad to Ngspice from eSim toolbar.
10:04 Let us add transient parameters in Analysis tab.
10:09 By default, Transient is selected.
10:13 Scroll down to enter values in the Transient analysis fields.
10:20 Make Start Time equal to 0 by doing the following:
10:27 Type 0 in the start textbox.
10:32 Similarly, make the Step time 5 milliseconds and Stop time 30 milliseconds.
10:43 Let us add the source details
10:45 To do so, click on Source details tab.
10:51 Enter the offset value as 0 and press Tab.
10:57 Type 5 for amplitude, 50 for frequency and 0 for both delay time and damping factor.
11:10 We will talk about the Ngspice Model, Device Modelling and subcircuits tab in later tutorials.
11:20 Press the Convert button to convert the kicad netlist to ngspice netlist
11:28 A confirmation dialog box appears. Here let's click Ok.
11:35 Close the kicad to ngspice tool by clicking close at the top right corner of the window.
11:43 Click on simulation from the eSim toolbar to simulate the example.
11:50 An ngspice terminal and plot windows open along with a python plot window.
11:58 The plot waveforms show transient analysis of the RC circuit.
12:04 Close the Ngspice terminal and plot window.
12:09 Select the python plot window by clicking on Plotting tab in the dock area.
12:16 Maximize the Python plot window.
12:20 To plot the output: Check the IN and OUT nodes and click on the plot button.
12:28 The output plot is shown in blue and input plot in red.
12:35 To view the rms values of node voltages, click on the multimeter button.
12:42 The Multimeter window opens up, which will be on top of all other windows.
12:49 Maximise the schematic and drag the multimeter windows on the corresponding nodes of schematic.
12:59 Let us see how to simulate a circuit involving semiconductor devices and subcircuits.
13:06 Let us simulate 7805VoltageRegulator circuit, which has diodes and a LM7805 regulator IC.
13:16 Click on Open Project button from the left toolbar.
13:21 Click on Desktop. Click on 7805VoltageRegulator.
13:27 And click on the Open button at the bottom right corner.
13:32 In the Projects window of eSim, double-click on 7805VoltageRegulator.
13:39 Click on Open Schematic button from the left toolbar.
13:44 I have annotated, performed ERC, and generated the spice netlist for this circuit.
13:51 I will now switch back to the eSim Main Window
13:55 Now, let us add simulation parameters to this netlist.
14:00 Click on Convert Kicad to Ngspice from eSim toolbar.
14:06 I have already added the parameter values in the Analysis and source details tab.
14:14 Let us assign device models to the semiconductor components inside the schematic.
14:21 To do so, click on Device Modelling tab.
14:26 We will add a device model for Diode 1: esim_diode
14:33 Click on Add and then double-click on Diode.
14:38 Click on D.lib Then click on the Open button.
14:44 We will perform the same steps for the remaining diodes as well.
14:50 Now let’s add the subcircuit file for LM_7805 subcircuit. To do so, click on Subcircuits tab.
15:01 Click on Add Double-click on lm7805 folder and then click on the Open button.
15:10 Press the Convert button to convert the kicad netlist to ngspice netlist.
15:16 A confirmation dialog box appears. Here let's click Ok.
15:22 Click on simulation from the left toolbar.
15:27 An ngspice terminal and ngspice plot windows opens along with a python plot window.
15:37 Click on in1, in2 and out checkboxes in the python plot window.
15:46 Scroll down and click on plot button.
15:51 Now let us summarize.
15:54 In this tutorial, we learnt how to-

Create circuit schematic

Generate spice netlist

Convert spice netlist to ngspice format

Simulate the netlist

16:10 Please post your timed queries in this forum.
16:14 Please post your general queries on eSim in this forum.
16:20 FOSSEE team coordinates the TBC project.
16:30 Spoken Tutorial Project is funded by NMEICT, MHRD, Govt. of India. For more details, visit this website.
16: This is Usha from IIT Bombay, signing off. Thank you.

Contributors and Content Editors

Pratik kamble