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

From Script | Spoken-Tutorial
Jump to: navigation, search
 
(4 intermediate revisions by 2 users not shown)
Line 12: Line 12:
 
|-
 
|-
 
||  '''Show Slide:'''
 
||  '''Show Slide:'''
 
 
Opening Slide
 
Opening Slide
 
||  Welcome to the spoken tutorial on '''Creating a Device Model '''in '''eSim'''.
 
||  Welcome to the spoken tutorial on '''Creating a Device Model '''in '''eSim'''.
 
|-
 
|-
 +
 
||  '''Show Slide:'''
 
||  '''Show Slide:'''
 
 
Learning Objectives
 
Learning Objectives
||  In this tutorial, using '''eSim'' we will learn -
 
  
 +
||  In this tutorial, using '''eSim''' we will learn -
 
* To create a '''Germanium Diode''' from an existing '''Device Model'''  and
 
* To create a '''Germanium Diode''' from an existing '''Device Model'''  and
 
* To edit a current '''Device Model'''.
 
* To edit a current '''Device Model'''.
 
 
|-
 
|-
 +
 
||  '''Show Slide:'''
 
||  '''Show Slide:'''
 
 
Systems Requirements
 
Systems Requirements
 +
 
||  To record this tutorial, we will use-
 
||  To record this tutorial, we will use-
* '''Ubuntu Linux OS '''16.04  
+
* '''Ubuntu Linux OS ''' version 16.04  
 
* '''eSim '''version 2.0
 
* '''eSim '''version 2.0
 
 
|-
 
|-
||  '''Show Slide:'''
 
  
 +
||'''Show Slide:'''
 
Prerequisites
 
Prerequisites
||  To practice this tutorial,
 
*To create a circuit schematic and simulate the netlist file in '''eSim'''.
 
  
 +
||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.
 
If not, watch the prerequisite '''eSim''' tutorials on this website.
  
 
|-
 
|-
 
||  '''Show Slide:'''
 
||  '''Show Slide:'''
 
 
Device Models
 
Device Models
||  The device model file begins with a dot model statement.
 
*'''mname''' indicates the model name like '''diode''' model '''1N4007''', '''1N4148'''.
 
*'''Component type''' indicates the type of model used.
 
  
For example: '''D''' is used for '''Diode''', '''M''' for '''MOSFET''', and  '''NPN''' or '''PNP''' for '''BJT'''.
+
||The '''device model''' file begins with a  '''dot model''' statement.
 +
*'''mname''' indicates the model name like '''diode model N4007, 1N4148'''.
 +
*'''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
+
*'''pname''' is the '''parameter''' name and
*'''pval''' is the parameter value.
+
*'''pval''' is the '''parameter''' value.
  
 
|-
 
|-
||   '''Show Slide:'''
+
|| '''Show Slide:'''
 +
Device Models in '''eSim'''
  
Device Models in eSim
+
||  The '''model''' components are already added in '''eSim'''.  
||  The model components are already added in '''eSim'''. They are referred to as '''templates'''.
+
 
 +
They are referred to as '''templates'''.
  
 
The '''templates''' are in a tabular form with '''parameter''' names and values.
 
The '''templates''' are in a tabular form with '''parameter''' names and values.
  
The '''Device Model''' libraries are used for the components present in '''eSim''' underscore '''Devices'''.
+
The '''Device Model libraries''' are used for the components present in '''eSim underscore Devices'''.
  
 
|-
 
|-
 
||  '''System Computer:'''
 
||  '''System Computer:'''
 
Desktop icon
 
Desktop icon
 +
 
||  To launch '''eSim''', you need to double-click on the '''eSim''' icon on your '''Desktop'''.
 
||  To launch '''eSim''', you need to double-click on the '''eSim''' icon on your '''Desktop'''.
  
Line 72: Line 76:
 
||  '''System Computer:'''
 
||  '''System Computer:'''
 
eSim startup window
 
eSim startup window
 +
 
||  I have already opened '''eSim'''.
 
||  I have already opened '''eSim'''.
  
Line 77: Line 82:
 
||  '''eSim Main Window:'''
 
||  '''eSim Main Window:'''
 
Click on  '''Model Editor'''  
 
Click on  '''Model Editor'''  
||  Let us now create a '''Device Model''' of a '''Germanium diode''' '''1N34A'''.
 
  
 +
||  Let us now create a '''Device model''' of a '''Germanium diode 1N34A'''.
  
 
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.
  
The '''Model Editor''' tab opens.
+
|-
 
+
|| Model Editor tab
 
+
||The '''Model Editor''' tab opens.
  
 
|-
 
|-
 
|| '''Model Editor tab:'''
 
|| '''Model Editor tab:'''
Click '''New''' >> Enter '''New Model''' Name'''  as '''Germanium_Diode''' >> Click '''OK'''
+
Click '''New'''  
||A '''New Model''' pop up window appears.
+
||Click the '''New''' button in the '''Model Editor''' tab.
 +
 
 +
|-
 +
||Enter '''New Model''' Name'''  as '''Germanium_Diode''' >>
 +
 
 +
Click '''OK'''
 +
 
 +
||A '''New Model''' pop-up window appears.
  
Type the '''Model Name''' as '''Germanium''' underscore '''Diode'''.  
+
Type the '''Model Name''' as '''Germanium underscore Diode'''.  
  
 
Click on the '''OK''' button.
 
Click on the '''OK''' button.
Line 98: Line 110:
 
||'''Model Editor tab:'''
 
||'''Model Editor tab:'''
 
Hover the mouse on the '''Diode''', '''BJT''','''MOS''' options below.
 
Hover the mouse on the '''Diode''', '''BJT''','''MOS''' options below.
||A list of model components appears on the left corner of the '''Model Editor''' tab.
 
  
These are the models you can choose from.
+
||A list of '''model''' components appears on the left corner of the '''Model Editor''' tab.
 +
 
 +
These are the '''models''' you can choose from.
  
 
|-
 
|-
Line 106: Line 119:
  
 
Click on '''Diode'''.
 
Click on '''Diode'''.
 +
 
Hover the cursor on the '''Parameter''' and '''Value''' column.
 
Hover the cursor on the '''Parameter''' and '''Value''' column.
||Since we are creating a new model of a '''Diode''', Click on '''Diode'''.
 
  
The '''diode''' model opens up in a tabular form with the '''Parameter name''' and  '''Value'''.
+
||Since we are creating a new model of a ''Diode'', click on '''Diode'''.
 +
 
 +
The '''diode model''' opens up in a tabular form with the '''Parameter''' name and  value.
 +
 
 
You can see the default values.
 
You can see the default values.
  
Line 115: Line 131:
 
||Show Slide:
 
||Show Slide:
 
'''Code File'''
 
'''Code File'''
||Let us now add the spice parameters of '''Germanium diode''''.
 
  
The parameters of '''Germanium Diode''' model '''1N34A''' can also be downloaded from the '''Code File''' section.
+
||Let us now add the '''spice parameters''' of '''Germanium diode'''.
  
Download and open the file in a text editor.
+
The '''parameters''' of '''Germanium Diode model 1N34A''' can also be downloaded from the '''Code File''' section.
  
Copy-paste the parameter values in the respective text box in the '''Model Editor''' window.
+
Download and open the file in a '''text editor'''.
 +
 
 +
Copy-paste the '''parameter''' values in the respective text-box in the '''Model Editor''' window.
  
 
|-
 
|-
Line 129: Line 146:
 
||Here I am entering the values.
 
||Here I am entering the values.
 
To enter a value,  click on the '''value''' field.
 
To enter a value,  click on the '''value''' field.
 +
 
Enter '''Rs''' as  '''7'''.
 
Enter '''Rs''' as  '''7'''.
Enter  '''Cjo''' as  '''0.5e-12'''.
+
 
 +
Enter  '''Cjo''' as  '''0.5 exponential minus 12'''.
 +
 
 
Enter '''N''' as '''1.3'''.
 
Enter '''N''' as '''1.3'''.
 +
 
Enter '''Ibv''' as  '''0.018'''.
 
Enter '''Ibv''' as  '''0.018'''.
Enter '''tt''' as  '''144e-9'''.
+
 
 +
Enter '''tt''' as  '''144 exponential minus 9'''.
 +
 
 
Enter '''M''' as  '''0.27'''.
 
Enter '''M''' as  '''0.27'''.
 +
 
Enter '''Vj'''  as '''0.1'''.
 
Enter '''Vj'''  as '''0.1'''.
Enter '''Is''' as '''2.0e-7'''.
+
 
 +
Enter '''Is''' as '''2.0 exponential minus 7'''.
 +
 
 
Enter '''Bv''' as '''75'''.
 
Enter '''Bv''' as '''75'''.
  
The sequence of parameters may vary.
+
The sequence of '''parameters''' may vary.
  
 
|-
 
|-
 
||'''Model Editor tab:'''
 
||'''Model Editor tab:'''
 
Hover the mouse on '''ADD''' and ''''Delete''' buttons.
 
Hover the mouse on '''ADD''' and ''''Delete''' buttons.
 +
 
Click '''Save'''.
 
Click '''Save'''.
  
||You can also '''Add''' or '''Delete''' the parameter.
+
||You can also add or delete the '''parameter'''.
  
 
After the '''parameters''' are entered, click on the '''Save''' button in the '''Model editor''' tab.
 
After the '''parameters''' are entered, click on the '''Save''' button in the '''Model editor''' tab.
Line 155: Line 182:
 
Click '''OK'''.
 
Click '''OK'''.
  
||An information pop-up window, ''''Model saved successfully''' is displayed.
+
||An information pop-up window, ''''Model saved successfully'''' is displayed.
 +
 
 
Click on the '''OK''' button.  
 
Click on the '''OK''' button.  
These libraries will be saved in the '''Diode''' folder of '''deviceModelLibrary''' directory.  
+
 
If the component model was chosen as '''BJT''', then the library would be saved in the '''Transistor''' folder.
+
These '''libraries''' will be saved in the '''Diode''' folder of '''deviceModelLibrary''' directory.  
 +
 
 +
If the '''component model''' was chosen as '''BJT''', then the '''library''' would be saved in the '''Transistor''' folder.
 +
 
 
Each '''template''' chosen will be saved in their respective folders of '''deviceModelLibrary''' directory.
 
Each '''template''' chosen will be saved in their respective folders of '''deviceModelLibrary''' directory.
  
 
|-
 
|-
 
||'''eSim Main Window:'''
 
||'''eSim Main Window:'''
||Now let us simulate the characteristics of Germanium Diode.
+
 
 +
||Now let us simulate the characteristics of '''Germanium Diode'''.
  
 
|-
 
|-
 
||'''eSim Main Window:'''
 
||'''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'''.
+
Click on '''Open Project''' from the top toolbar >>
 +
 
 +
Double click on  '''eSim-2.0''' >>  
 +
 
 +
Click on '''Examples'''>>  
 +
 
 +
select '''Diode_characteristics''' >>  
 +
 
 +
click '''Open'''.
  
 
||We will open the '''Diode characteristic''' example from the '''Examples''' folder of '''eSim'''.
 
||We will open the '''Diode characteristic''' example from the '''Examples''' folder of '''eSim'''.
  
On the '''eSim'''' window, click on the '''Open Project''' button 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.
  
Double 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 184: Line 226:
 
|-
 
|-
 
||'''eSim Main Window:'''
 
||'''eSim Main Window:'''
Select '''Diode_Characteristics''' under '''Projects'''>>Click on the '''Open Schematic'''>>Click '''Yes'''
+
Select '''Diode_Characteristics''' under '''Projects'''>>
 +
 
 +
Click on the '''Open Schematic'''>>
 +
 
 +
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 194: Line 242:
 
Press '''F1''' key.
 
Press '''F1''' key.
  
||Press '''F1''' key to zoom in the schematic.
+
||Press '''F1''' key to zoom in the '''schematic'''.
  
 
|-
 
|-
||eSim Main Window:
+
||'''eSim Main Window:'''
 +
 
 +
Select '''Diode_characteristics'''>>
  
Select '''Diode_characteristics'''>> click on '''Convert Kicad to Ngspice'''
+
click on '''Convert Kicad to Ngspice'''
  
 
||Let us go back to the '''eSim''' window.
 
||Let us go back to the '''eSim''' window.
  
Select the '''Diode''' underscore '''characteristics'''.
+
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.
 
  
 
|-
 
|-
||'''Kicad to Ngspice Converter:''
+
||'''Kicad to Ngspice Converter:'''
'''Analysis''' Tab >> Select '''DC'''
+
'''Analysis''' Tab >>  
 +
 
 +
Select '''DC'''
 +
 
 
Enter the values.
 
Enter the values.
  
Line 216: Line 268:
  
 
Scroll down to enter values.
 
Scroll down to enter values.
 +
 
Enter '''Source''' as '''V1'''.
 
Enter '''Source''' as '''V1'''.
 +
 
Enter '''Start''' as '''0'''.
 
Enter '''Start''' as '''0'''.
 +
 
Enter '''Increment''' as '''0.1'''.
 
Enter '''Increment''' as '''0.1'''.
 +
 
Enter '''Stop''' as '''2'''.
 
Enter '''Stop''' as '''2'''.
  
Line 226: Line 282:
 
Enter '''1''' for '''DC''' source '''V1'''.
 
Enter '''1''' for '''DC''' source '''V1'''.
  
||In the '''Source Details''' tab, enter  '''value''' as '''1'''.
+
||In the '''Source Details''' tab, enter  value as '''1'''.
  
 
|-
 
|-
 
||'''Kicad to Ngspice Converter:'''
 
||'''Kicad to Ngspice Converter:'''
 
'''Device Modeling''' Tab
 
'''Device Modeling''' Tab
Click on '''ADD'''>> Double click on '''Diode''' folder>>click on ''''Germanium_ Diode.lib''' file>> click '''Open'''.
+
Click on '''ADD'''>>  
 +
 
 +
Double click on '''Diode''' folder>>
 +
 
 +
click on ''''Germanium_ Diode.lib''' file>>  
 +
 
 +
click '''Open'''.
 +
 
 +
||Skip the '''Ngspice Model''' tab.
  
||Skip the ''''Ngspice Model''' tab.
 
 
Click on the ''''Device Modeling''' tab, click on the '''ADD''' button.
 
Click on the ''''Device Modeling''' tab, click on the '''ADD''' button.
 +
 
Double-click on the '''Diode''' folder.
 
Double-click on the '''Diode''' folder.
Select '''Germanium''' underscore '''Diode''' dot '''lib''' file.
+
 
 +
Select '''Germanium underscore Diode dot lib''' file.
 +
 
 
Click on the '''Open''' button.
 
Click on the '''Open''' button.
This adds the '''Germanium Diode''' library file from the '''Diode''' folder.
+
 
 +
This adds the '''Germanium Diode library''' file from the '''Diode''' folder.
  
 
|-
 
|-
 
||'''Kicad to Ngspice Converter:'''
 
||'''Kicad to Ngspice Converter:'''
Click on  '''Convert'''>>Click '''OK'''
+
Click on  '''Convert'''>>
 +
 
 +
Click '''OK'''
  
 
||On the '''Kicad to Ngspice''' tab, click on the '''Convert''' button.
 
||On the '''Kicad to Ngspice''' tab, click on the '''Convert''' button.
Line 251: Line 320:
 
Click on '''Simulation'''.
 
Click on '''Simulation'''.
  
||Now, let us simulate the '''Ngspice''' netlist.
+
||Now, let us simulate the '''Ngspice netlist'''.
 
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.
 +
 
An '''Ngspice terminal''' and '''plot''' window opens along with a '''Python plot''' window.
 
An '''Ngspice terminal''' and '''plot''' window opens along with a '''Python plot''' window.
  
Line 258: Line 328:
 
||'''Ngspice Window:'''
 
||'''Ngspice Window:'''
 
Maximize the '''i(v_u1)''' ngspice plot.
 
Maximize the '''i(v_u1)''' ngspice plot.
 +
 
Hover the mouse on '''X-axis''' to point '''voltage'''.
 
Hover the mouse on '''X-axis''' to point '''voltage'''.
 +
 
Hover the mouse on '''Y-axis''' to point '''current'''.
 
Hover the mouse on '''Y-axis''' to point '''current'''.
 +
 
On '''Ngspice''' terminal, hover the mouse on '''.model Germanium_Diode'''.
 
On '''Ngspice''' terminal, hover the mouse on '''.model Germanium_Diode'''.
  
||The plot waveforms show '''DC''' analysis of the '''Germanium Diode''' model '''1N34A'''.
+
||The '''plot waveforms''' show '''DC analysis''' of the '''Germanium Diode model 1N34A'''.
  
 
This '''diode''' has a '''knee voltage''' or '''turn-on voltage''' around '''0.3'''.
 
This '''diode''' has a '''knee voltage''' or '''turn-on voltage''' around '''0.3'''.
 +
 
The '''forward current''' is around '''1.7 milliampere'''.
 
The '''forward current''' is around '''1.7 milliampere'''.
  
Close the '''Ngspice''' plot and '''Ngspice''' terminal windows.
+
Close the '''Ngspice plot''' and '''Ngspice terminal''' windows.
  
 
|-
 
|-
 
||'''Python Plot Window:'''
 
||'''Python Plot Window:'''
  
Check '''In''' and '''Out''' node>> click '''Plot'''
+
Check '''In''' and '''Out''' node>>  
 +
 
 +
click '''Plot'''
  
 
Hover the mouse on python plots after plot.
 
Hover the mouse on python plots after plot.
  
||In the '''Python''' plot window, check the '''In''' node and '''Out''' node.
+
||In the '''Python plot''' window, check the '''In''' node and '''Out''' node.
  And click on the '''Plot''' button.  
+
   
 +
And click on the '''Plot''' button.  
 +
 
 
You can see the '''forward characteristics''' of the '''Germanium diode'''.
 
You can see the '''forward characteristics''' of the '''Germanium diode'''.
Close the '''Python''' plot window.
+
 
 +
Close the '''Python plot''' window.
  
 
|-
 
|-
Line 285: Line 364:
 
'''Shockley Diode Equation'''
 
'''Shockley Diode Equation'''
  
||The '''Shockley diode''' equation relates the '''diode''' current '''I''' with the '''diode''' voltage '''Vd'''.
+
||The '''Shockley diode''' equation relates the '''diode current I''' with the '''diode voltage Vd'''.
The main '''spice''' parameters that determine the '''DC''' analysis are  
+
The main '''spice parameters''' that determine the '''DC analysis''' are  
emission coefficient  ‘N’,
+
saturation current  ‘Is’ and
+
ohmic resistance ‘Rs’.
+
For an ideal diode, N is equal to 1 .
+
This factor mainly accounts for carrier recombination.
+
eSim Main Window:
+
  
Click on  Model Editor
+
*'''emission coefficient n''',
Click on  EDIT >> double click on Diode folder>>click on  Germanium_Diode>> click Open
+
*'''saturation current Is''' and
 +
*'''ohmic resistance Rs'''.
  
Click on N value>> enter 4.0>> click Save>>click OK
+
For an ideal '''diode, N''' is equal to '''1'''.
  
Now let us learn how to edit a  model library.
+
This factor mainly accounts for '''carrier recombination'''.  
  
On the eSim window, click on the Model editor button from the left toolbar.
+
|-
 +
||'''eSim Main Window:'''
  
We will edit the Germanium diode parameters.
+
Click on  ''''Model Editor'''>>
  
On the Model editor tab,click on the Edit button.
+
Click on '''EDIT''' >>
Double click on the Diode folder.
+
  
Select Germanium underscore diode dot lib file.
+
Double click on '''Diode''' folder
  
Click on the Open button.
+
>>click on '''Germanium_Diode'''
  
A tabular form of Germanium Diode parameters and its corresponding values will appear.
+
>> click '''Open'''
  
Let us now change the value of the parameter N .
+
Click on '''N value'''>> enter '''4.0'''>>
  
Click on the parameter N  Value field and enter  4.
+
click ''''Save'''>>
  
Click on the SAVE button in the Model editor tab.
+
click '''OK'''
  
In the Information dialog box, click on the OK button.
+
||Now let us learn how to edit a '''model library'''.
  
eSim Main Window:
+
On the ''eSim'' window, click on the ''''Model editor''' button from the left toolbar.
  
 +
We will edit the '''Germanium diode parameters'''.
  
 +
On the '''Model editor''' tab, click on the '''Edit''' button.
  
 +
Double-click on the '''Diode''' folder.
  
 +
Select '''Germanium underscore diode dot lib''' file.
  
Select Diode_characteristics>> click on Convert Kicad to Ngspice>> Click on Device  Modeling Tab
+
Click on the '''Open''' button.
  
 +
A tabular form of '''Germanium Diode parameters''' and its corresponding values will appear.
  
 +
Let us now change the value of the '''parameter N''' .
  
 +
Click on the '''parameter N Value field''' and enter  '''4'''.
  
 +
Click on the '''SAVE''' button in the '''Model editor''' tab.
  
Click  on ADD>> Double click on Diode folder>>click on Germanium_ Diode.lib file>> click Open.
+
In the '''Information''' dialog box, click on the '''OK''' button.
  
Let us now simulate the characteristics.
+
|-
 +
||'''eSim Main Window:'''
  
On the eSim window, select Diode underscore Characteristics.
+
Select '''Diode_characteristics'''>>
  
Click on Convert Kicad to Ngspice button from the left toolbar.
+
click on '''Convert Kicad to Ngspice'''>>
  
Let us keep the default values for the  Analysis tab and the Source Details tab.
+
Click on '''Device Modeling''' Tab
  
Skip the Ngspice Model tab.
+
Click  on '''ADD'''>>
Click on Device Modeling Tab.
+
Click on the ADD button.
+
  
Double-click on the Diode folder.
+
Double click on '''Diode''' folder>>
Select Germanium underscore Diode dot lib file and click on the Open button.
+
  
This step was done because we have edited the Germanium diode library file.
+
click on '''Germanium_ Diode.lib''' file
eSim Main Window:
+
Click on Convert>>click OK
+
Click on Simulation.
+
  
 +
>> click '''Open'''.
  
On the Kicad to Ngspice tab, click on the Convert button.
 
Click on the OK button in the information dialog box.
 
Let us now  generate the plots.
 
  
On the eSim window, click on the Simulation button from the left toolbar.
+
||Let us now simulate the '''characteristics'''.
Ngspice terminal and plots
+
  
Maximize the i(u,v1) ngspice plot.
+
On the '''eSim''' window, select '''Diode  underscore Characteristics'''.
Point the cursor on the X-axis for voltage.
+
Point the cursor on the Y-axis for the current.
+
The Ngspice terminal and plots opens along with the Python plot .
+
  
Notice a decrease in the forward characteristics.
+
Click on '''Convert Kicad to Ngspice''' button from the left toolbar.
  
The knee voltage is around 0.5 volts, which is similar to a Silicon diode.
+
Let us keep the default values for the '''Analysis''' tab and the '''Source Details''' tab.
  
The forward current is 1.1 milliampere.
+
Skip the '''Ngspice Model''' tab.  
  
Close the ngspice terminal and plots.  
+
Click on '''Device  Modeling''' tab.
Python Plot:
+
  
Check In and Out node>> click Plot
+
Click on the '''ADD''' button.
  
 +
Double-click on the '''Diode''' folder.
  
In the Python plot window, check the In and Out nodes.
+
Select '''Germanium underscore Diode dot lib''' file and click on the '''Open''' button.
Then click on the Plot button.
+
 
You can see the input and output plot.
+
This step was done because we have edited the '''Germanium diode library''' file.
Now close the Python plot window.
+
 
Show Slide:
+
|-
 +
||'''eSim Main Window:'''
 +
Click on '''Convert'''>>
 +
 
 +
click '''OK'''
 +
 
 +
Click on '''Simulation'''.
 +
 
 +
 
 +
||On the '''Kicad to Ngspice''' tab, click on the '''Convert''' button.
 +
 
 +
Click on the '''OK''' button in the '''Information''' dialog box.
 +
 
 +
Let us now generate the '''plots'''.
 +
 
 +
On the '''eSim''' window, click on the '''Simulation''' button from the left toolbar.
 +
 
 +
|-
 +
||'''Ngspice terminal and plots'''
 +
 
 +
Maximize the '''i(u,v1)''' ngspice plot.
 +
 
 +
Point the cursor on the ''X-axis'' for '''voltage'''.
 +
 
 +
Point the cursor on the ''Y-axis'' for the '''current'''.
 +
 
 +
||The '''Ngspice terminal''' and '''plots''' opens along with the '''Python plot'''.
 +
 
 +
Notice a decrease in the '''forward characteristics'''.
 +
 
 +
The '''knee voltage''' is around '''0.5 volts''', which is similar to a '''Silicon diode'''.
 +
 
 +
The '''forward current''' is '''1.1 milliampere'''.
 +
 
 +
Close the '''Ngspice terminal''' and '''plots'''.
 +
 +
|-
 +
||'''Python Plot:'''
 +
 
 +
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'''.
 +
 
 +
Now close the '''Python plot''' window.
 +
 
 +
|-
 +
||'''Show Slide:'''
 
Summary
 
Summary
  
Let us summarise.
+
||Let us summarise.
 +
 
 
In this tutorial, we learnt:
 
In this tutorial, we learnt:
To create a Germanium Diode from an existing Device Model and
+
*To create a '''Germanium Diode''' from an existing '''Device Model''' and
To edit a current Device Model.
+
*To edit a current '''Device Model'''.
Show Slide:
+
 
 +
|-
 +
||'''Show Slide:'''
 
Forum to answer questions
 
Forum to answer questions
 +
 
https://forums.spoken-tutorial.org/
 
https://forums.spoken-tutorial.org/
Do you have questions in this Spoken Tutorial?
+
 
 +
||Do you have questions in this '''Spoken Tutorial'''?
 +
 
 
Choose the minute and second where you have the question.
 
Choose the minute and second where you have the question.
 +
 
Explain your question briefly.
 
Explain your question briefly.
Someone from the FOSSEE team will answer them.
+
 
 +
Someone from the '''FOSSEE''' team will answer them.
 +
 
 
Please visit this site.
 
Please visit this site.
Show Slide:
+
 
 +
|-
 +
||'''Show Slide:'''
 
FOSSEE Forum
 
FOSSEE Forum
 +
 
https://forums.fossee.in/
 
https://forums.fossee.in/
For any general or  technical questions on eSim, visit the FOSSEE forum and post your question.
+
 
Show Slide:
+
||For any general or  technical questions on '''eSim''', visit the '''FOSSEE''' forum and post your question.
 +
 
 +
|-
 +
||'''Show Slide:'''
 
Circuit Simulation
 
Circuit Simulation
 +
 
https://esim.fossee.in/circuit-simulation-project
 
https://esim.fossee.in/circuit-simulation-project
The FOSSEE team coordinates the Circuit Simulation project.
+
 
We give Certificates and Honorarium to the contributors.
+
||The '''FOSSEE''' team coordinates the '''Circuit Simulation''' project.
For more details, please visit this site:
+
 
Show Slide:
+
We give '''Certificates''' and '''Honorarium''' to the contributors.
 +
 
 +
For more details, please visit this site.
 +
 
 +
|-
 +
||'''Show Slide:'''
 
Lab Migration
 
Lab Migration
  
 
https://esim.fossee.in/lab-migration-project
 
https://esim.fossee.in/lab-migration-project
The FOSSEE team coordinates the Lab Migration project.
+
 
 +
||The '''FOSSEE''' team coordinates the '''Lab Migration''' project.
  
 
For more details, please visit this site.
 
For more details, please visit this site.
  
Show Slide:
+
|-
 +
||'''Show Slide:'''
 
Acknowledgment
 
Acknowledgment
  
 
http://spoken-tutorial.org
 
http://spoken-tutorial.org
Spoken Tutorial Project is funded by NMEICT, MHRD, Govt. of India.
+
 
 +
||'''Spoken Tutorial''' Project is funded by '''NMEICT, MHRD, Govt. of India'''.
  
 
For more details, visit this site.
 
For more details, visit this site.
 
Thank you slide
 
 
 
This is Gloria N  from IIT Bombay signing off.
+
|-
 +
||'''Thank you slide'''
 +
 +
||This is Gloria N  from IIT Bombay signing off.
 +
 
 
Thank you
 
Thank you

Latest revision as of 17:28, 6 August 2020

Creating a Device Model

Author: Gloria N

Keywords: eSim, Device model, KiCad, Eeschema, Simulation, Analysis, Knee voltage, Forward characteristics, Forward current, schematic, Ngspice netlist


Visual cue Narration
Show Slide:

Opening Slide

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

Learning Objectives

In this tutorial, using eSim we will learn -
  • To create a Germanium Diode from an existing Device Model and
  • To edit a current Device Model.
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 N4007, 1N4148.
  • 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:

Device Models in eSim

The model components are already added in eSim.

They are referred to as templates.

The templates are in a tabular form with parameter names and values.

The Device Model libraries are used for the components present in eSim underscore Devices.

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.
eSim Main Window:

Click on Model Editor

Let us now create a Device model of a Germanium diode 1N34A.

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

Model Editor tab The Model Editor tab opens.
Model Editor tab:

Click New

Click the New button in the Model Editor tab.
Enter New Model Name as Germanium_Diode >>

Click OK

A New Model pop-up window appears.

Type the Model Name as Germanium underscore Diode.

Click on the OK button.

Model Editor tab:

Hover the mouse on the Diode, BJT,MOS options below.

A list of model components appears on the left corner of the Model Editor tab.

These are the models you can choose from.

Model Editor tab:

Click on Diode.

Hover the cursor on the Parameter and Value column.

Since we are creating a new model of a Diode, click on Diode.

The diode model opens up in a tabular form with the Parameter name and value.

You can see the default values.

Show Slide:

Code File

Let us now add the spice parameters of Germanium diode.

The parameters of Germanium Diode model 1N34A can also be downloaded from the Code File section.

Download and open the file in a text editor.

Copy-paste the parameter values in the respective text-box in the Model Editor window.

Model Editor tab:

Enter the values in the tabular column.

Here I am entering the values.

To enter a value, click on the value field.

Enter Rs as 7.

Enter Cjo as 0.5 exponential minus 12.

Enter N as 1.3.

Enter Ibv as 0.018.

Enter tt as 144 exponential minus 9.

Enter M as 0.27.

Enter Vj as 0.1.

Enter Is as 2.0 exponential minus 7.

Enter Bv as 75.

The sequence of parameters may vary.

Model Editor tab:

Hover the mouse on ADD and 'Delete buttons.

Click Save.

You can also add or delete the parameter.

After the parameters are entered, click on the Save button in the Model editor tab.

eSim Main Window:

Click OK.

An information pop-up window, 'Model saved successfully' is displayed.

Click on the OK button.

These libraries will be saved in the Diode folder of deviceModelLibrary directory.

If the component model was chosen as BJT, then the library would be saved in the Transistor folder.

Each template chosen will be saved in their respective folders of deviceModelLibrary directory.

eSim Main Window: Now let us simulate the characteristics of Germanium Diode.
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.

We will open the Diode characteristic example from the Examples folder of eSim.

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

Locate the directory where the eSim is installed.

Double-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.

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.

Select DC in the Analysis tab.

Scroll down to enter values.

Enter Source as V1.

Enter Start as 0.

Enter Increment as 0.1.

Enter Stop as 2.

Kicad to Ngspice Converter:

Source Details Tab: Enter 1 for DC source V1.

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

Device Modeling Tab Click on ADD>>

Double click on Diode folder>>

click on 'Germanium_ Diode.lib file>>

click Open.

Skip the Ngspice Model tab.

Click on the 'Device Modeling tab, click on the ADD button.

Double-click on the Diode folder.

Select Germanium underscore Diode dot lib file.

Click on the Open button.

This adds the Germanium Diode library file from the Diode folder.

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 simulate the Ngspice netlist.

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

An Ngspice terminal and plot window opens along with a Python plot window.

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.

On Ngspice terminal, hover the mouse on .model Germanium_Diode.

The plot waveforms show DC analysis of the Germanium Diode model 1N34A.

This diode has a knee voltage or turn-on voltage around 0.3.

The forward current is around 1.7 milliampere.

Close the Ngspice plot and Ngspice terminal windows.

Python Plot Window:

Check In and Out node>>

click Plot

Hover the mouse on python plots after plot.

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

And click on the Plot button.

You can see the forward characteristics of the Germanium diode.

Close the Python plot window.

Show Slide:

Shockley Diode Equation

The Shockley diode equation relates the diode current I with the diode voltage Vd.

The main spice parameters that determine the DC analysis are

  • emission coefficient n,
  • saturation current Is and
  • ohmic resistance Rs.

For an ideal diode, N is equal to 1.

This factor mainly accounts for carrier recombination.

eSim Main Window:

Click on 'Model Editor>>

Click on EDIT >>

Double click on Diode folder

>>click on Germanium_Diode

>> click Open

Click on N value>> enter 4.0>>

click 'Save>>

click OK

Now let us learn how to edit a model library.

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

We will edit the Germanium diode parameters.

On the Model editor tab, click on the Edit button.

Double-click on the Diode folder.

Select Germanium underscore diode dot lib file.

Click on the Open button.

A tabular form of Germanium Diode parameters and its corresponding values will appear.

Let us now change the value of the parameter N .

Click on the parameter N Value field and enter 4.

Click on the SAVE button in the Model editor tab.

In the Information dialog box, click on the OK button.

eSim Main Window:

Select Diode_characteristics>>

click on Convert Kicad to Ngspice>>

Click on Device Modeling Tab

Click on ADD>>

Double click on Diode folder>>

click on Germanium_ Diode.lib file

>> click Open.


Let us now simulate the characteristics.

On the eSim window, select Diode underscore Characteristics.

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

Let us keep the default values for the Analysis tab and the Source Details tab.

Skip the Ngspice Model tab.

Click on Device Modeling tab.

Click on the ADD button.

Double-click on the Diode folder.

Select Germanium underscore Diode dot lib file and click on the Open button.

This step was done because we have edited the Germanium diode library file.

eSim Main Window:

Click on Convert>>

click OK

Click on Simulation.


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

Click on the OK button in the Information dialog box.

Let us now generate the plots.

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

Ngspice terminal and plots

Maximize the i(u,v1) ngspice plot.

Point the cursor on the X-axis for voltage.

Point the cursor on the Y-axis for the current.

The Ngspice terminal and plots opens along with the Python plot.

Notice a decrease in the forward characteristics.

The knee voltage is around 0.5 volts, which is similar to a Silicon diode.

The forward current is 1.1 milliampere.

Close the Ngspice terminal and plots.

Python Plot:

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.

Now close the Python plot window.

Show Slide:

Summary

Let us summarise.

In this tutorial, we learnt:

  • To create a Germanium Diode from an existing Device Model and
  • To edit a current Device Model.
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