Oscad/C2/Schematic-Creation-and-Simulation/English
Title of the Script: Schematic Creation and Simulation using Oscad
Author: Rakhi
Keywords: video tutorial, Oscad, schematic, simulation, EDA, Ngspice, analysis, transient
|
|
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
|
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:
|
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 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.
| |
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.
|
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.
|
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
| |
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
|
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
|
In this tutorial, we learnt to
|
Show Slide: Assignment
|
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
|
Show Slide | The Spoken Tutorial Project Team
|
Show Slide | Spoken Tutorial Project is a part of the Talk to a Teacher project
|
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. |