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

From Script | Spoken-Tutorial
Jump to: navigation, search
Line 35: Line 35:
 
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 43: Line 44:
 
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 N4007, 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
+
*'''pname''' is the '''parameter''' name and
 
+
*'''pval''' is the '''parameter''' value.
''NPN'' or ''PNP'' for ''BJT''.
+
 
+
*'''pname''' is the parameter name and
+
*'''pval''' is the parameter value.
+
  
 
|-
 
|-
Line 58: Line 59:
 
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'''.
  
 
|-
 
|-
Line 82: Line 83:
 
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''' >>
+
Click '''New'''  
 +
||Click the '''New''' button in the '''Model Editor''' tab.
  
Enter '''New Model''' Name'''  as '''Germanium_Diode''' >>
+
|-
 +
||Enter '''New Model''' Name'''  as '''Germanium_Diode''' >>
  
 
Click '''OK'''
 
Click '''OK'''
  
||A '''New Model''' pop up window appears.
+
||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 106: Line 111:
 
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.
  
These are the models you can choose from.
+
These are the '''models''' you can choose from.
  
 
|-
 
|-
Line 117: Line 122:
 
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'''.  
+
||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'''.
+
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 127: Line 132:
 
'''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.
  
Download and open the file in a text editor.
+
Download and open the file in a '''text editor'''.
  
Copy-paste the parameter values in the respective text box in the '''Model Editor''' window.
+
Copy-paste the '''parameter''' values in the respective text-box in the '''Model Editor''' window.
  
 
|-
 
|-
Line 144: Line 149:
 
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'''.
Line 150: Line 155:
 
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'''.
Line 156: Line 162:
 
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.
  
 
|-
 
|-
Line 168: Line 175:
 
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 181: Line 188:
 
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'''.
  
 
|-
 
|-
Line 207: Line 214:
 
||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 227: Line 234:
 
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.
Line 237: Line 244:
 
Press '''F1''' key.
 
Press '''F1''' key.
  
||Press '''F1''' key to zoom in the schematic.
+
||Press '''F1''' key to zoom in the '''schematic'''.
  
 
|-
 
|-
Line 248: Line 255:
 
||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.
Line 277: Line 284:
 
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'''.
  
 
|-
 
|-
Line 296: Line 303:
 
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.
  
 
|-
 
|-
Line 315: Line 322:
 
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 330: Line 337:
 
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.
  
 
|-
 
|-
Line 347: Line 354:
 
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 359: Line 366:
 
'''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''',
+
*'''emission coefficient n''',
 +
*'''saturation current Is''' and
 +
*'''ohmic resistance Rs'''.
  
''saturation current'' '''Is''' and
+
For an ideal '''diode, N''' is equal to '''1'''.
  
''ohmic resistance'' '''Rs'''.
+
This factor mainly accounts for '''carrier recombination'''.  
 
+
For an ideal diode, '''N''' is equal to ''1'' .
+
 
+
This factor mainly accounts for ''carrier recombination''.  
+
  
 
|-
 
|-
Line 391: Line 396:
 
click '''OK'''
 
click '''OK'''
  
||Now let us learn how to edit a model library.
+
||Now let us learn how to edit a '''model library'''.
  
 
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.  
  
We will edit the ''Germanium diode'' parameters.
+
We will edit the '''Germanium diode parameters'''.
  
 
On the '''Model editor''' tab, click on the '''Edit''' button.
 
On the '''Model editor''' tab, click on the '''Edit''' 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.
  
A tabular form of ''Germanium Diode'' ''parameters'' and its corresponding ''values'' will appear.
+
A tabular form of '''Germanium Diode parameters''' and its corresponding values will appear.
  
Let us now change the value of the ''parameter'' '''N''' .
+
Let us now change the value of the '''parameter N''' .
  
Click on the '''parameter N'''  '''Value''' ''field'' and enter  '''4'''.
+
Click on the '''parameter N Value field''' and enter  '''4'''.
  
 
Click on the '''SAVE''' button in the '''Model editor''' tab.
 
Click on the '''SAVE''' button in the '''Model editor''' tab.
Line 433: Line 438:
  
  
||Let us now simulate the characteristics.
+
||Let us now simulate the '''characteristics'''.
  
On the '''eSim''' window, select '''Diode''' underscore '''Characteristics'''.
+
On the '''eSim''' window, select '''Diode underscore Characteristics'''.
  
 
Click on '''Convert Kicad to Ngspice''' button from the left toolbar.
 
Click on '''Convert Kicad to Ngspice''' button from the left toolbar.
Line 449: Line 454:
 
Double-click on the '''Diode''' folder.
 
Double-click on the '''Diode''' folder.
  
Select '''Germanium''' underscore '''Diode''' dot '''lib''' file and click on the '''Open''' button.
+
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.  
+
This step was done because we have edited the '''Germanium diode library''' file.  
  
 
|-
 
|-
Line 464: Line 469:
 
||On the '''Kicad to Ngspice''' tab, click on the '''Convert''' button.
 
||On the '''Kicad to Ngspice''' tab, click on the '''Convert''' button.
  
Click on the '''OK''' button in the '''information''' dialog box.
+
Click on the '''OK''' button in the '''Information''' dialog box.
  
Let us now generate the ''plots''.
+
Let us now 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 479: Line 484:
 
Point the cursor on the ''Y-axis'' for the '''current'''.
 
Point the cursor on the ''Y-axis'' for the '''current'''.
  
||The '''Ngspice''' ''terminal'' and ''plots'' opens along with the '''Python''' ''plot''.
+
||The '''Ngspice terminal''' and '''plots''' opens along with the '''Python plot'''.
  
Notice a decrease in the ''forward characteristics''.
+
Notice a decrease in the '''forward characteristics'''.
  
The ''knee voltage'' is around '''0.5 volts''', which is similar to a ''Silicon diode''.
+
The '''knee voltage''' is around '''0.5 volts''', which is similar to a '''Silicon diode'''.
  
The ''forward current'' is '''1.1 milliampere'''.
+
The '''forward current''' is '''1.1 milliampere'''.
  
Close the '''Ngspice''' ''terminal'' and ''plots''.
+
Close the '''Ngspice terminal''' and '''plots'''.
 
   
 
   
 
|-
 
|-
Line 497: Line 502:
  
  
||In the '''Python''' ''plot'' window, check the '''In''' 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'''.
  
Now close the '''Python''' ''plot'' window.
+
Now close the '''Python plot''' window.
  
 
|-
 
|-
Line 567: Line 572:
 
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.

Revision as of 17:25, 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