Difference between revisions of "Oscad/C2/Schematic-Creation-and-Simulation/English"

From Script | Spoken-Tutorial
Jump to: navigation, search
 
Line 60: Line 60:
 
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.18cm;"| '''Oscad''' window opens up.
 
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.18cm;"| '''Oscad''' window opens up.
  
Let us now create an RC circuit schematic and simulate it.
+
Let us now create an '''RC circuit schematic''' and simulate it.
  
 
The first step is to create a new '''Oscad''' Project.
 
The first step is to create a new '''Oscad''' Project.
Line 214: Line 214:
 
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.18cm;"| Move '''plot''' components
 
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.18cm;"| Move '''plot''' components
 
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.18cm;"| Similarly, move the '''plot components,''' as shown.
 
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.18cm;"| Similarly, move the '''plot components,''' as shown.
 
|-
 
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.18cm;"|
 
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.18cm;"|
 
  
 
|-
 
|-
Line 307: Line 303:
 
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.18cm;"| To do so, click on '''Place a component '''tool.  
 
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.18cm;"| To do so, click on '''Place a component '''tool.  
  
Click on the Schematic editor.
+
Click on the '''Schematic editor'''.
  
 
Type '''P W R underscore FLAG '''and place it on the '''editor.'''
 
Type '''P W R underscore FLAG '''and place it on the '''editor.'''
Line 402: Line 398:
 
|-
 
|-
 
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.18cm;"|  
 
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.18cm;"|  
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.18cm;"| Let us now convert the '''netlist''' to '''ngspice''' format and append the analysis information to it.
+
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.18cm;"| Let us now  
 +
*convert the '''netlist''' to '''ngspice''' format and  
 +
*append the analysis information to it.
  
 
|-
 
|-
Line 410: Line 408:
 
|-
 
|-
 
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.18cm;"| Highlight “parameters for sine source v1” in the terminal window
 
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.18cm;"| Highlight “parameters for sine source v1” in the terminal window
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.18cm;"| This opens up a new terminal window.
+
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.18cm;"| This opens up a new '''terminal''' window.
  
 
This window prompts the user to input the parameters for the sine source.  
 
This window prompts the user to input the parameters for the sine source.  
Line 449: Line 447:
 
|-
 
|-
 
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.18cm;"| Press '''Enter'''
 
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding:0.18cm;"| Press '''Enter'''
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.18cm;"| Press '''Enter''' to quit this terminal.
+
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.18cm;"| Press '''Enter''' to quit this '''terminal'''.
  
 
|-
 
|-
Line 483: Line 481:
 
* generate '''spice netlist''',  
 
* generate '''spice netlist''',  
 
* convert spice '''netlist''' to '''Ngspice''' format and simulate the '''netlist'''
 
* convert spice '''netlist''' to '''Ngspice''' format and simulate the '''netlist'''
 
  
 
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.18cm;"| In this tutorial, we learnt to  
 
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.18cm;"| In this tutorial, we learnt to  
Line 490: Line 487:
 
* generate '''spice netlist''',  
 
* generate '''spice netlist''',  
 
* convert spice '''netlist''' to '''Ngspice''' format and simulate the '''netlist'''
 
* convert spice '''netlist''' to '''Ngspice''' format and simulate the '''netlist'''
 
 
  
 
|-
 
|-
Line 521: Line 516:
 
* It summarises the Spoken Tutorial project  
 
* It summarises the Spoken Tutorial project  
 
* If you do not have good bandwidth, you can download and watch it
 
* If you do not have good bandwidth, you can download and watch it
 
 
  
 
|-
 
|-
Line 531: Line 524:
 
* Givescertificates for those who pass an online test  
 
* Givescertificates for those who pass an online test  
 
* For more details, please write to contact at spoken hyphen tutorial dot org  
 
* For more details, please write to contact at spoken hyphen tutorial dot org  
 
 
  
 
|-
 
|-
Line 540: Line 531:
 
* It is supported by the National Mission on Education through ICT, MHRD, Government of India  
 
* It is supported by the National Mission on Education through ICT, MHRD, Government of India  
 
* More information on this Mission is available at spoken hyphen tutorial dot org slash NMEICT hyphen Intro  
 
* More information on this Mission is available at spoken hyphen tutorial dot org slash NMEICT hyphen Intro  
 
 
  
 
|-
 
|-
Line 550: Line 539:
  
 
Thank you.
 
Thank you.
 
 
|}
 
|}

Latest revision as of 07:16, 8 February 2014

Title of the Script: Schematic Creation and Simulation using Oscad

Author: Rakhi

Keywords: video tutorial, Oscad, schematic, simulation, EDA, Ngspice, analysis, transient


Visual cue
Narration
Opening Slide Welcome to the spoken tutorial on “Schematic Creation and Simulation using Oscad
Show Slide:

Learning Objectives

In this tutorial we will learn to
  • create circuit schematic
  • generate spice netlist,
  • convert spice netlist to Ngspice format and
  • simulate the netlist
Show Slide:

Systems Requirements

Here we will use Ubuntu Linux 12.04 and Oscad version 1.0.
Slide

Prerequisites

To practise this tutorial, basic knowledge of analog and digital electronics is required.
Double-click on Oscad icon on Desktop To launch Oscad, double-click on the Oscad icon on your desktop.
Also show launching of Oscad through terminal:

Press Ctrl, alt, t keys together

Type Oscad on terminal

Press Enter

Show Oscad window

Alternately, you can launch Oscad by doing the following:
  • Open the terminal window by pressing the ctrl, alt and t keys together
  • Type oscad on the terminal and press Enter.
Oscad window opens up.

Let us now create an RC circuit schematic and simulate it.

The first step is to create a new Oscad Project.

Click on the Project tab >> New Click on the Project tab and then on New, to create a new project.
Choose desired folder >> click on OK Choose the desired folder and click on OK.
Type RC in Enter Project name field >> click OK. In the “Enter Project name” field, type RC and click on OK.
Show Oscad tool bar The Oscad tool bar appears on screen.
Click on the first tool >> schematic editor To create the circuit schematic, click on the first tool, that is schematic editor.
Minimize Oscad window schematic editor window opens up.

Let me minimize the Oscad window.

Click OK Click on OK to close the Info dialog box.
Click anywhere on the schematic editor window >> click on Preferences from the top menu bar >> click on Library. Add the Oscad component libraries to your project by doing the following-


  • Click anywhere on the schematic editor to select it.
  • Click on Preferences from the top menu bar.
  • Click on Library.
Click on Add Click on the first button, that is, Add.
Browse to the Oscad installation directory >> select the folder 'library'. To select Oscad libraries, browse to the directory where Oscad is installed.

Select the folder 'library'.

Note that all the Oscad library names end with the word spice.

The extension of the file is dot lib

Press CRTL and A keys Select all, by pressing the keys CRTL and A together.
Click on Open >> Ok Click on Open. Now click on OK.
Click on Save Save the project by clicking on Save.
Many of the components used in Oscad belong to these libraries.


For each schematic you create or edit, you should add these libraries to your project.

Let us now add components to the schematic.
click on Place a component tool from the toolbar on the right Click on Place a component tool from the toolbar on the right, as shown.
Click anywhere on the editor. Now click anywhere on the editor.
Type R in Name field >> click on OK. Type R in the Name field and click on OK.
Place the resistor R on the editor by clicking on the editor once. Place the resistor R on the editor, by clicking on the editor once.
Press F1 to zoom in or use middle button of mouse to zoom in. Zoom in by pressing F1.


You can also do so, by scrolling the middle button of your mouse.

Click again on the editor. Click again on the editor.
Type C in the Name field >> click on OK Type C in the Name field and click on OK
Place the capacitor C on the editor Place the capacitor C on the editor as done before.
Place sinusoidal voltage source by typing sine and placing it on editor Place a sinusoidal voltage source by typing sine and placing it on the editor.
Similarly type gnd and place a ground terminal on editor. Similarly, type gnd and place a ground terminal on editor.
Type vplot8_1 and place it on editor Type vplot8_1 and place it on the editor.

This is the plot component used to plot voltages at the required nodes.

Place one more vplot8_1 component Place one more vplot8_1 component on the editor.
Let us move and arrange the components to create an RC low pass circuit.
Place cursor on resistor >> press key 'M'. Move the resistor by placing the cursor on it and pressing the key 'M'.
Click again. Place it by clicking again.
Place cursor on resistor >> press key 'R' Rotate the resistor by placing the cursor on it and pressing the key 'R'.
Move plot components Similarly, move the plot components, as shown.
Now, let us connect the various components using wires.
Click on Place a wire from the right toolbar. Click on Place a wire from the right toolbar, as shown.
Click on one end of the sine source. Click on one end of the sine source.
Move the cursor point to one end of resistor >> click on it. Move the cursor point to one end of the resistor and click on it.
Connect wires Similarly, connect all the components as shown.
Show plot components at output and input nodes The plot components are placed at the output and input nodes.

This helps to view the corresponding voltage waveforms on simulation.

Click on annotate schematic button from the menu bar. To annotate the schematic, click on annotate schematic button from the menu bar.
Click on annotation >> OK >> Close Click on annotation, click on OK and click on Close.
Show annotated schematic. The schematic is now annotated.
Right click on resistor >> Choose Edit Component. >> Click on Value To assign value to the resistor, right click on it and choose Edit Component.

Click on Value.

type 1k >> click on OK. Type 1 k and click on OK.
Similarly type 1u for capacitor. Similarly, for capacitor, type 1 u.
Now let us do electric rules check for this schematic.
Click on Perform electric rules check button from the menu bar. For this, click on Perform electric rules check button from the menu bar as shown.
Click on Test Erc button. Click on Test Erc button.
Point to the error. We can see that there is an error that says a pin is not driven.
Close the Erc window. Close the Erc window.
Point to the green arrow near ground terminal. Note that the ground terminal pin is highlighted by a green arrow in the schematic.
It means that this pin is not driven by any power source.
To prevent this, let us place a power flag.
Click on Place a component >> type PWR_FLAG >> place it on the editor. To do so, click on Place a component tool.

Click on the Schematic editor.

Type P W R underscore FLAG and place it on the editor.

Connect power flag to the ground terminal using wire. Connect this power flag to the ground terminal using wire.

It indicates that a power source will be connected here.

Repeat the electric rules check. Now repeat the electric rules check.
Click on Close. There are no errors this time.

Click on Close.

Click on Generate netlist button from menu bar. Now let us generate the spice netlist of this circuit.

Click on Generate netlist button from the menu bar.

Click on the tab Spice. Click on the tab Spice.
Uncheck the option Prefix references 'u' and 'ic' with 'x' and click on netlist.


Click on Save

Uncheck the option Prefix references 'u' and 'ic' with 'x' and click on netlist.

This is required for generating a proper netlist for simulation.

And click on Save

A spice netlist of the RC circuit has been generated.
Close the schematic editor. Close the schematic editor.
Click on Yes. Click on Yes to save the changes.
Now, let us add transient simulation parameters to this netlist.
Click on analysis inserter from Oscad tool bar. Click on analysis inserter from Oscad tool bar.
Click on transient. Click on transient.
Leave the field 'Start time' as it is.
Type 5 and choose the option ms from the drop down menu. Make Step Time equal to 5 milli seconds by doing the following:

Type 5 in the text box as shown.

Choose the option ms from the drop down menu.

Make Stop time 30 milli seconds. Similarly, make the Stop time 30 milli seconds.
Click on Add simulation data Click on Add simulation data.
Click on File >> choose Save. Go to the top left corner, click on File and choose Save.
Click on Save and close the analysis inserter window. Click on Save and close the analysis inserter window.
Let us now
  • convert the netlist to ngspice format and
  • append the analysis information to it.
Click on netlist converter from the Oscad tool bar. To do so, click on netlist converter from the Oscad tool bar.
Highlight “parameters for sine source v1” in the terminal window This opens up a new terminal window.

This window prompts the user to input the parameters for the sine source.

Enter the offset value as 0 >> press Enter Enter the offset value as 0 and press Enter.
Type

5 for amplitude,

50 for frequency,

zero for both delay time and damping factor.

Type

5 for amplitude,

50 for frequency,

zero for both delay time and damping factor.

Highlight the message


Highlight RC.cir.out

We can see that the Ngspice netlist for the RC circuit has been created.

The name of this netlist is RC.cir.out

We will talk about scilab netlist in later tutorials.
Press Enter Press Enter to quit this terminal.
Click on ngspice from the Oscad tool bar Click on ngspice from the Oscad tool bar to simulate the netlist.
Show the new windows This opens up a new terminal window and a plot window.
Highlight ngspice ->1 The terminal window is in the Ngspice simulation mode.
The plot shows transient analysis of the circuit.
Point to blue and red plots in graph The output plot is shown in blue and input plot in red.
<<PAUSE>>

Now let us summarize.

Slide: Summary
  • create circuit schematic
  • generate spice netlist,
  • convert spice netlist to Ngspice format and simulate the netlist
In this tutorial, we learnt to
  • create circuit schematic
  • generate spice netlist,
  • convert spice netlist to Ngspice format and simulate the netlist
Show Slide: Assignment
  • Watch KiCad tutorial on schematic creation on this link
    http://spoken-tutorial.org
    - Reproduce the astable multivibrator circuit schematic using Oscad
  • Oscad uses KiCad for schematic creation
  • schematic editor in Oscad = Eeschema in Kicad


Here's an assignment for you.

Please watch the Kicad tutorial on schematic creation on the spoken tutorial website.

Reproduce the astable multivibrator circuit schematic shown in it, using Oscad.

Oscad uses KiCad for schematic creation.

Schematic editor in Oscad looks the same as in Kicad.

It corresponds to Eeschema in Kicad.

<<PAUSE>>

Show Slide Watch the video available at the following link
  • It summarises the Spoken Tutorial project
  • If you do not have good bandwidth, you can download and watch it
Show Slide The Spoken Tutorial Project Team
  • Conducts workshops using spoken tutorials
  • Givescertificates for those who pass an online test
  • For more details, please write to contact at spoken hyphen tutorial dot org
Show Slide Spoken Tutorial Project is a part of the Talk to a Teacher project
  • It is supported by the National Mission on Education through ICT, MHRD, Government of India
  • More information on this Mission is available at spoken hyphen tutorial dot org slash NMEICT hyphen Intro
Remain on the previous slide Hope you found this tutorial useful.

This is Rupak and Rakhi from the Spoken Tutorial Project, IIT Bombay signing off.

Thank you.

Contributors and Content Editors

Nancyvarkey, Rakhiwarriar