Difference between revisions of "ESim/C2/Uploading-a-Spice-Device-Model/English"

From Script | Spoken-Tutorial
Jump to: navigation, search
 
(3 intermediate revisions by one other user not shown)
Line 34: Line 34:
 
Prerequisites
 
Prerequisites
  
||To practice this tutorial,
+
||To practice this tutorial, you should know to
*To create a circuit schematic and simulate the netlist file in '''eSim'''.
+
*create a '''circuit schematic''' and  
 +
*'''simulate''' the '''netlist''' file in '''eSim'''.
 
If not, watch the prerequisite '''eSim''' tutorials on this website.
 
If not, watch the prerequisite '''eSim''' tutorials on this website.
  
Line 42: Line 43:
 
Device Models
 
Device Models
  
||The device model file begins with a dot model statement.
+
||The '''device model''' file begins with a '''dot model''' statement.
*'''mname''' indicates the model name like ''diode'' model ''1N4007'', ''1N534A''.
+
*'''mname''' indicates the '''model''' name like '''diode model 1N4007, 1N534A'''.
*'''Component type''' indicates the type of model used.  
+
*'''Component type''' indicates the '''type''' of '''model''' used.  
  
For example: ''D'' is used for ''Diode'',''M'' for ''MOSFET'',and   
+
For example:  
 +
*'''D''' is used for '''Diode''',
 +
*'''M''' for '''MOSFET''',and   
 +
*'''NPN''' or '''PNP''' for '''BJT'''.
  
''NPN'' or ''PNP'' for ''BJT''.
+
*'''pname''' is the '''parameter''' name and
 
+
*'''pval''' is the '''parameter''' value.
*'''pname''' is the parameter name and
+
*'''pval''' is the parameter value.
+
  
 
|-
 
|-
Line 57: Line 59:
 
Introduction
 
Introduction
  
||  The model components are already added in '''eSim'''.  
+
||  The '''model components''' are already added in '''eSim'''.  
  
The model library files added using the '''Upload''' option will be saved in the '''User Libraries''' folder under '''deviceModelLibrary'''.
+
The '''model library''' files added using the '''Upload''' option will be saved in the '''User Libraries''' folder under '''deviceModelLibrary''' directory.
  
The model library files are used with the components present in '''eSim''' underscore '''Devices'''.
+
The '''model library''' files are used with the '''components''' present in '''eSim underscore Devices'''.
  
You can also refer to the spice models available in the '''Ngspice''' manual.
+
You can also refer to the '''spice models''' available in the '''Ngspice''' manual.
  
 
|-
 
|-
Line 83: Line 85:
 
||Pause the video here.
 
||Pause the video here.
  
Download the '''Schottky diode 1N5711''' library file from the '''Code file''' section available on this page.
+
Download the '''Schottky diode 1N5711 library''' file from the '''Code file''' section available on this page.
  
Save it on your '''Desktop''' with dot '''lib''' extension.
+
Save it on your '''Desktop''' with '''dot lib''' extension.
  
 
|-
 
|-
Line 93: Line 95:
 
|| On the '''eSim''' window, click on the '''Model Editor''' button from the left toolbar.
 
|| On the '''eSim''' window, click on the '''Model Editor''' button from the left toolbar.
  
In the previous tutorial, we have seen how to add a ''Device model'' using the '''New''' option.
+
In the previous tutorial, we have seen how to add a '''Device model''' using the '''New''' option.
 
+
Now, we will add a ''Device model'' library using the '''Upload''' option.
+
  
 +
Now, we will add a '''Device model library''' using the '''Upload''' option.
  
 
|-
 
|-
Line 110: Line 111:
 
||On the ''' Model Editor''' tab, click on the '''Upload''' button.
 
||On the ''' Model Editor''' tab, click on the '''Upload''' button.
  
I have already downloaded the ''Schottky diode IN5711'' model and saved it on my ''Desktop''.
+
I have already downloaded the '''Schottky diode IN5711 model''' and saved it on my '''Desktop'''.
  
 
Click on the  '''Desktop'''.
 
Click on the  '''Desktop'''.
  
Click on the '''Schottky''' dot '''lib''' file.
+
Click on the '''Schottky dot lib''' file.
  
 
Click on the '''Open''' button.
 
Click on the '''Open''' button.
Line 127: Line 128:
 
||A pop-up window '''Model Name''' will appear.  
 
||A pop-up window '''Model Name''' will appear.  
  
In the '''Enter Model Library Name''', type New Model Name as '''Schottky'''.
+
In the '''Enter Model Library Name''', type new model name as '''Schottky'''.
  
 
Click on the '''OK''' button.
 
Click on the '''OK''' button.
  
The ''device model'' '''Schottky''' and its '''xml''' file will be saved under the '''User libraries''' folder.
+
The '''device model Schottky''' and its '''xml''' file will be saved under the '''User libraries''' folder.
  
 
|-
 
|-
 
||'''eSim Main Window:'''
 
||'''eSim Main Window:'''
  
||Let us simulate the characteristics of ''Schottky diode''.
+
||Let us '''simulate''' the '''characteristics''' of '''Schottky diode'''.
  
We will open the example ''Diode Characteristics'' from the '''eSim''' ''Examples'' folder.
+
We will open the example '''Diode Characteristics''' from the '''eSim Examples''' folder.
  
 
|-
 
|-
Line 153: Line 154:
 
click '''Open'''.
 
click '''Open'''.
  
||We will open the '''Diode characteristic''' example from the '''Examples''' folder of '''eSim'''.
+
||On the '''eSim''' window, click on the '''Open Project''' option from the top menu.
  
On the '''eSim'''' window, click on the '''Open Project''' button from the top menu.
+
Locate the '''directory''' where the '''eSim''' is installed.
  
Locate the directory where the '''eSim''' is installed.
+
Click on the '''Examples''' folder.
  
Double click on the '''Examples''' folder.
+
Scroll down and select the '''Diode underscore characteristics'''.
 
+
Scroll down and select the '''Diode''' underscore '''characteristics'''.
+
  
 
Click on the '''Open''' button.
 
Click on the '''Open''' button.
Line 175: Line 174:
 
Click '''Yes'''
 
Click '''Yes'''
  
||To see the schematic, select '''Diode characteristics'''.
+
||To see the '''schematic''', select '''Diode characteristics'''.
  
 
Click on the '''Open Schematic''' button from the left toolbar.
 
Click on the '''Open Schematic''' button from the left toolbar.
  
It directs us to the ''schematic editor''.
+
It directs us to the '''schematic editor'''.
  
 
|-
 
|-
Line 185: Line 184:
 
Press '''F1''' key.
 
Press '''F1''' key.
  
||Press '''F1''' key to zoom in the schematic.
+
||Press '''F1''' key to zoom in the '''schematic'''.
  
 
|-
 
|-
Line 196: Line 195:
 
||Let us go back to the '''eSim''' window.
 
||Let us go back to the '''eSim''' window.
  
on the '''eSim''' window,select the '''Diode''' underscore '''characteristics'''.
+
On the '''eSim''' window,select the '''Diode underscore characteristics'''.
  
 
Click on the '''Convert Kicad to Ngspice''' button from the left toolbar.
 
Click on the '''Convert Kicad to Ngspice''' button from the left toolbar.
Line 208: Line 207:
 
Enter the values.
 
Enter the values.
  
||In the '''Analysis''' tab, Select '''DC'''.
+
||In the '''Analysis''' tab, select '''DC'''.
  
 
Scroll down to enter values.
 
Scroll down to enter values.
Line 225: Line 224:
 
Enter '''1''' for '''DC''' source '''V1'''.
 
Enter '''1''' for '''DC''' source '''V1'''.
  
||In the '''Source Details''' tab, enter ''' the value''' as '''1'''.
+
||In the '''Source Details''' tab, enter the value as '''1'''.
  
 
|-
 
|-
Line 240: Line 239:
 
||Skip the '''Ngspice Model''' tab.
 
||Skip the '''Ngspice Model''' tab.
  
Click on the ''''Device Modeling''' tab.
+
Click on the '''Device Modeling''' tab.
  
 
Click on the '''ADD''' button.
 
Click on the '''ADD''' button.
Line 246: Line 245:
 
Double-click on the '''User Libraries ''' folder.
 
Double-click on the '''User Libraries ''' folder.
  
Select '''Schottky ''' dot '''lib''' file and
+
Select '''Schottky dot lib''' file and click on the '''Open''' button.
 
+
Click on the '''Open''' button.
+
  
 
|-
 
|-
Line 263: Line 260:
 
Click on '''Simulation'''.
 
Click on '''Simulation'''.
  
||Now, let us generate the ''plots''.  
+
||Now, let us generate the '''plots'''.  
 
On the '''eSim''' window, click on the '''Simulation''' button from the left toolbar.
 
On the '''eSim''' window, click on the '''Simulation''' button from the left toolbar.
  
Line 274: Line 271:
 
Hover the mouse on '''Y-axis''' to point '''current'''.
 
Hover the mouse on '''Y-axis''' to point '''current'''.
  
||This ''diode'' has a ''knee voltage'' or ''turn-on voltage'' of around '''0.2'''.
+
||The '''diode''' has a '''knee voltage''' or '''turn-on voltage''' of around '''0.2'''.
  
The ''forward current'' is '''95 microampere'''.
+
The '''forward current''' is '''95 microampere'''.
  
These ''diodes'' are used in ''power rectification'' applications.
+
These '''diodes''' are used in '''power rectification''' applications.
  
Close the '''Ngspice''' ''terminal'' and ''plots''.  
+
Close the '''Ngspice terminals''' and '''plots'''.  
  
 
|-
 
|-
Line 289: Line 286:
 
click '''Plot'''
 
click '''Plot'''
  
||In the '''Python''' ''plot'' window, check the '''In''' node and '''Out''' nodes.
+
||In the '''Python plot''' window, check the '''In''' and '''Out''' nodes.
 
   
 
   
 
Then click on the '''Plot''' button.  
 
Then click on the '''Plot''' button.  
  
You can see the ''input'' and ''output'' plot.
+
You can see the '''input''' and '''output plot'''.
  
Close the '''Python''' ''plot''.
+
Close the '''Python plot'''.
  
 
|-
 
|-
Line 303: Line 300:
 
||Let us now summarise.
 
||Let us now summarise.
  
In this tutorial, we learnt  to create,
+
In this tutorial, we learnt  to create '''Schottky Diode''' using '''Upload''' option.
*'''Schottky Diode''' using '''Upload''' option.
+
  
 
|-
 
|-
Line 340: Line 336:
 
We give '''Certificates''' and '''Honorarium''' to the contributors.
 
We give '''Certificates''' and '''Honorarium''' to the contributors.
  
For more details, please visit this site:
+
For more details, please visit this site.
  
 
|-
 
|-

Latest revision as of 17:52, 6 August 2020

Uploading a Spice Device Model in eSim

Author: Gloria N

Keywords: eSim, Device model, KiCad, eeschema, Simulation, Analysis, Knee voltage, Forward characteristics, Forward current,Spice,xml, Schematic


Visual cue Narration
Show Slide:

Opening Slide

Welcome to the spoken tutorial on Uploading a Spice Device Model in eSim.
Show Slide:

Learning Objectives

In this tutorial, using eSim we will learn -
  • To create a Schottky Diode using the Upload option.
Show Slide:

Systems Requirements

To record this tutorial, we will use-
  • Ubuntu Linux OS version 16.04
  • eSim version 2.0
Show Slide:

Prerequisites

To practice this tutorial, you should know to
  • create a circuit schematic and
  • simulate the netlist file in eSim.

If not, watch the prerequisite eSim tutorials on this website.

Show Slide:

Device Models

The device model file begins with a dot model statement.
  • mname indicates the model name like diode model 1N4007, 1N534A.
  • Component type indicates the type of model used.

For example:

  • D is used for Diode,
  • M for MOSFET,and
  • NPN or PNP for BJT.
  • pname is the parameter name and
  • pval is the parameter value.
Show Slide:

Introduction

The model components are already added in eSim.

The model library files added using the Upload option will be saved in the User Libraries folder under deviceModelLibrary directory.

The model library files are used with the components present in eSim underscore Devices.

You can also refer to the spice models available in the Ngspice manual.

System Computer:

Desktop icon

To launch eSim, you need to double-click on the eSim icon on your Desktop.
System Computer:

eSim startup window

I have already opened eSim.
Show Slide:

Code File

Pause the video here.

Download the Schottky diode 1N5711 library file from the Code file section available on this page.

Save it on your Desktop with dot lib extension.

eSim Main Window:

Click on Model Editor

On the eSim window, click on the Model Editor button from the left toolbar.

In the previous tutorial, we have seen how to add a Device model using the New option.

Now, we will add a Device model library using the Upload option.

Model Editor tab:

Click Upload >>

Click on Desktop>>

click on Schottky_diode.lib >>

click Open

On the Model Editor tab, click on the Upload button.

I have already downloaded the Schottky diode IN5711 model and saved it on my Desktop.

Click on the Desktop.

Click on the Schottky dot lib file.

Click on the Open button.


Model Editor tab:

Type New Model Name as Schottky >>

click OK

A pop-up window Model Name will appear.

In the Enter Model Library Name, type new model name as Schottky.

Click on the OK button.

The device model Schottky and its xml file will be saved under the User libraries folder.

eSim Main Window: Let us simulate the characteristics of Schottky diode.

We will open the example Diode Characteristics from the eSim Examples folder.

eSim Main Window:

Click on Open Project from the top toolbar >>

Double click on eSim-2.0 >>

Click on Examples>>

select Diode_characteristics >>

click Open.

On the eSim window, click on the Open Project option from the top menu.

Locate the directory where the eSim is installed.

Click on the Examples folder.

Scroll down and select the Diode underscore characteristics.

Click on the Open button.

The Diode characteristics example is added to the eSim window under Projects.

eSim Main Window:

Select Diode_Characteristics under Projects>>

Click on the Open Schematic>>

Click Yes

To see the schematic, select Diode characteristics.

Click on the Open Schematic button from the left toolbar.

It directs us to the schematic editor.

eSim Schematic editor:

Press F1 key.

Press F1 key to zoom in the schematic.
eSim Main Window:

Select Diode_characteristics>>

click on Convert Kicad to Ngspice

Let us go back to the eSim window.

On the eSim window,select the Diode underscore characteristics.

Click on the Convert Kicad to Ngspice button from the left toolbar.

Kicad to Ngspice Converter:

Analysis Tab >>

Select DC

Enter the values.

In the Analysis tab, select DC.

Scroll down to enter values.

Enter Source 1 as V1.

Enter Start as 0.

Enter Increment as 0.1.

Enter Stop as 0.4.

Kicad to Ngspice Converter:

Source Details Tab: Enter 1 for DC source V1.

In the Source Details tab, enter the value as 1.
Kicad to Ngspice Converter:

Device Modeling Tab Click on ADD>>

Double click on User Libraries folder>>

click on 'Schottky.lib file>>

click Open.

Skip the Ngspice Model tab.

Click on the Device Modeling tab.

Click on the ADD button.

Double-click on the User Libraries folder.

Select Schottky dot lib file and click on the Open button.

Kicad to Ngspice Converter:

Click on Convert>>

Click OK

On the Kicad to Ngspice tab, click on the Convert button.

Click on the OK button in the Information dialog box.

eSim Main Window:

Click on Simulation.

Now, let us generate the plots.

On the eSim window, click on the Simulation button from the left toolbar.

Ngspice Window:

Maximize the i(v_u1) ngspice plot.

Hover the mouse on X-axis to point voltage.

Hover the mouse on Y-axis to point current.

The diode has a knee voltage or turn-on voltage of around 0.2.

The forward current is 95 microampere.

These diodes are used in power rectification applications.

Close the Ngspice terminals and plots.

Python Plot Window:

Check In and Out node>>

click Plot

In the Python plot window, check the In and Out nodes.

Then click on the Plot button.

You can see the input and output plot.

Close the Python plot.

Show Slide:

Summary

Let us now summarise.

In this tutorial, we learnt to create Schottky Diode using Upload option.

Show Slide:

Forum to answer questions

https://forums.spoken-tutorial.org/

Do you have questions in this Spoken Tutorial?

Choose the minute and second where you have the question.

Explain your question briefly.

Someone from the FOSSEE team will answer them.

Please visit this site.

Show Slide:

FOSSEE Forum

https://forums.fossee.in/

For any general or technical questions on eSim, visit the FOSSEE forum and post your question.
Show Slide:

Circuit Simulation

https://esim.fossee.in/circuit-simulation-project

The FOSSEE team coordinates the Circuit Simulation project.

We give Certificates and Honorarium to the contributors.

For more details, please visit this site.

Show Slide:

Lab Migration

https://esim.fossee.in/lab-migration-project

The FOSSEE team coordinates the Lab Migration project.

For more details, please visit this site.

Show Slide:

Acknowledgment

http://spoken-tutorial.org

Spoken Tutorial Project is funded by NMEICT, MHRD, Govt. of India.

For more details, visit this site.

Thank you slide This is Gloria N from IIT Bombay signing off.

Thank you

Contributors and Content Editors

Glorianandihal, Nancyvarkey