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

From Script | Spoken-Tutorial
Jump to: navigation, search
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,
 +
*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.
||   The device model file begins with a dot model statement.
+
*'''mname''' indicates the model name like ''diode'' model ''1N4007'', ''1N4148''.
*'''mname''' indicates the model name like '''diode''' model '''1N4007''', '''1N4148'''.
+
 
*'''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  '''NPN''' or '''PNP''' for '''BJT'''.
+
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
Line 55: Line 55:
  
 
|-
 
|-
||   '''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'''.
+
  
The '''templates''' are in a tabular form with '''parameter''' names and values.
+
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'''.
 
The '''Device Model''' libraries are used for the components present in '''eSim''' underscore '''Devices'''.
Line 67: Line 69:
 
||  '''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 75:
 
||  '''System Computer:'''
 
||  '''System Computer:'''
 
eSim startup window
 
eSim startup window
 +
 
||  I have already opened '''eSim'''.
 
||  I have already opened '''eSim'''.
  
Line 77: Line 81:
 
||  '''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.
 
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.
+
  
Type the '''Model Name''' as '''Germanium''' underscore '''Diode'''.  
+
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.
 
Click on the '''OK''' button.
Line 98: Line 105:
 
||'''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.
 
||A list of model components appears on the left corner of the '''Model Editor''' tab.
  
Line 106: Line 114:
  
 
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 126:
 
||Show Slide:
 
||Show Slide:
 
'''Code File'''
 
'''Code File'''
||Let us now add the spice parameters of '''Germanium diode''''.
+
 
 +
||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.
 
The parameters of '''Germanium Diode''' model '''1N34A''' can also be downloaded from the '''Code File''' section.
Line 129: Line 141:
 
||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.5e-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  '''144e-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.0e-7'''.
 +
 
Enter '''Bv''' as '''75'''.
 
Enter '''Bv''' as '''75'''.
  
Line 144: Line 165:
 
||'''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 156: Line 178:
  
 
||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.  
 
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.
 
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'''.
Line 177: Line 212:
  
 
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 221:
 
|-
 
|-
 
||'''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 197: Line 240:
  
 
|-
 
|-
||eSim Main Window:
+
||'''eSim Main Window:'''
  
Select '''Diode_characteristics'''>> click on '''Convert Kicad to Ngspice'''
+
Select '''Diode_characteristics'''>>  
 +
 
 +
click on '''Convert Kicad to Ngspice'''
  
 
||Let us go back to the '''eSim''' window.
 
||Let us go back to the '''eSim''' window.
Line 206: Line 251:
  
 
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 263:
  
 
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 231: Line 282:
 
||'''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 253: Line 317:
 
||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.
  
 
|-
 
|-
 
||'''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.  
+
   
You can see the '''forward characteristics''' of the '''Germanium diode'''.
+
And click on the '''Plot''' button.  
Close the '''Python''' plot window.
+
 
 +
You can see the ''forward characteristics'' of the ''Germanium diode''.
 +
 
 +
Close the '''Python''' ''plot'' window.
  
 
|-
 
|-
Line 285: Line 359:
 
'''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
+
  
Click on N value>> enter 4.0>> click Save>>click OK
+
''saturation current''  '''Is''' and
  
Now let us learn how to edit a  model library.
+
''ohmic resistance'' '''Rs'''.
  
On the eSim window, click on the Model editor button from the left toolbar.  
+
For an ideal diode, '''N''' is equal to ''1'' .
  
We will edit the Germanium diode parameters.
+
This factor mainly accounts for ''carrier recombination''.  
  
On the Model editor tab,click on the Edit button.
+
|-
Double click on the Diode folder.
+
||'''eSim Main Window:'''
  
Select Germanium underscore diode dot lib file.
+
Click on  ''''Model Editor'''>>
  
Click on the Open button.
+
Click on '''EDIT''' >>
  
A tabular form of Germanium Diode parameters and its corresponding values will appear.
+
Double click on '''Diode''' folder
  
Let us now change the value of the parameter N .
+
>>click on '''Germanium_Diode'''
  
Click on the parameter N  Value field and enter  4.
+
>> click '''Open'''
  
Click on the SAVE button in the Model editor tab.
+
Click on '''N value'''>> enter '''4.0'''>>
  
In the Information dialog box, click on the OK button.
+
click ''''Save'''>>
  
eSim Main Window:
+
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.
  
Select Diode_characteristics>> click on Convert Kicad to Ngspice>> Click on Device  Modeling Tab
+
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 ADD>> Double click on Diode folder>>click on Germanium_ Diode.lib file>> click Open.
+
Click on the '''parameter N''' '''Value''' ''field'' and enter  '''4'''.
  
Let us now simulate the characteristics.
+
Click on the '''SAVE''' button in the '''Model editor''' tab.
  
On the eSim window, select Diode underscore Characteristics.
+
In the '''Information''' dialog box, click on the '''OK''' button.
  
Click on Convert Kicad to Ngspice button from the left toolbar.
+
|-
 +
||'''eSim Main Window:'''
  
Let us keep the default values for the  Analysis tab and the Source Details tab.
+
Select '''Diode_characteristics'''>>
  
Skip the Ngspice Model tab.
+
click on '''Convert Kicad to Ngspice'''>>
Click on Device  Modeling Tab.
+
Click on the ADD button.
+
  
Double-click on the Diode folder.
+
Click on '''Device Modeling''' Tab
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 '''ADD'''>>  
eSim Main Window:
+
Click on Convert>>click OK
+
Click on Simulation.
+
  
 +
Double click on '''Diode''' folder>>
  
On the Kicad to Ngspice tab, click on the Convert button.
+
click on '''Germanium_ Diode.lib''' file
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.
+
>> click '''Open'''.
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.
+
||Let us now simulate the characteristics.
  
The knee voltage is around 0.5 volts, which is similar to a Silicon diode.
+
On the '''eSim''' window, select '''Diode''' underscore '''Characteristics'''.
  
The forward current is 1.1 milliampere.
+
Click on '''Convert Kicad to Ngspice''' button from the left toolbar.
  
Close the ngspice terminal and plots.  
+
Let us keep the default values for the '''Analysis''' tab and the '''Source Details''' tab.
Python Plot:
+
  
Check In and Out node>> click Plot
+
Skip the '''Ngspice Model''' tab.
  
 +
Click on '''Device  Modeling''' tab.
  
In the Python plot window, check the In and Out nodes.
+
Click on the '''ADD''' button.
Then click on the Plot button.
+
 
You can see the input and output plot.
+
Double-click on the '''Diode''' folder.
Now close the Python plot window.
+
 
Show Slide:
+
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
 
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.
 +
 
 +
We give '''Certificates''' and '''Honorarium''' to the contributors.
 +
 
 
For more details, please visit this site:
 
For more details, please visit this site:
Show Slide:
+
 
 +
|-
 +
||'''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

Revision as of 01:09, 4 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,
  • 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, 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.

The Model Editor tab opens.

Model Editor tab:

Click New >>

Enter New Model Name as Germanium_Diode >>

Click OK

A New Model pop up window appears.

Type theModel 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.5e-12.

Enter N as 1.3.

Enter Ibv as 0.018.

Enter tt as 144e-9.

Enter M as 0.27.

Enter Vj as 0.1.

Enter Is as 2.0e-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