Download presentation
1
CIRCUIT ANALYSIS USING NGSPICE
TECHNICAL WORKSHOP MARATHON 2012 CIRCUIT ANALYSIS USING NGSPICE VISHNU V 2nd Year M.Tech VLSI and Embedded Systems Govt. Model Engineering College, Thrikkakara
2
CONTENTS SIMULATING A CIRCUIT IN NGSPICE EXAMPLE CIRCUIT
NETLIST CREATION USING gEDA SCHEMATIC EDITOR ANALYSIS OF BASIC CIRCUITS HIGH PASS CIRCUIT AND DIFFERENTIATOR LOW PASS CIRCUIT AND INTEGRATOR RECTIFIER CIRCUITS CLIPPER CIRCUITS CLAMPER CIRCUITS
3
Simulating a Circuit using NGSPICE
Steps Mark the nodes present in the circuit using numbers or symbols (Try to mark Ground node by '0') Write the netlist (use texteditors such as gedit or vi editor etc)for the circuit satisfying all the rules and regulations. Save the netlist using .cir or .net extension. 3
4
Simulating a Circuit using NGSPICE
Open ngspice command window by typing ngspice in terminal(bash,sash etc) Give the name of the saved netlist in ngspice command window.
5
EXAMPLE CIRCUIT Simulation of a simple RC filter using NGSPICE
6
EXAMPLE CIRCUIT Here there are three nodes n0 n1
Also the components present are A sinusoidal voltage source A 3.3nF capacitor A 1k resistor
7
Writing NETLIST Title Line (First Line ) A simple RC High pass filter
Component connections V1 n0 0 SIN(0 10 1kHz) C1 n0 n1 3.3nF R n k
8
Writing NETLIST Control Lines .CONTROL TRAN 0.01ms 10ms
PLOT V(n0) V(n1) END Lines .ENDC .END
9
Total NETLIST A Simple RC High pass filter V1 n0 0 SIN(0 10 1kHz)
C1 n0 n1 3.3nF R n k .CONTROL TRAN ms 10ms PLOT V( n0) V(n1) .ENDC .END
10
SIMULATION STEPS Save the above file as rc_filter.cir
Terminal Save the above file as rc_filter.cir STEP 1 : Open Terminal and type ngspice Open Terminal and Type ngspice Ngspice command terminal opens
11
SIMULATION STEPS STEP 2 : Give the file name of the netlist we have written ie rc_filter.cir Give the file name of the netlist and press enter
12
SIMULATION STEPS BASH TERMINAL WAVE FORM WINDOW
TRANSIENT ANALYSIS OUTPUT BASH TERMINAL WAVE FORM WINDOW
13
ANALYSIS OF WAVEFORM Analyse the waveform I N P U T OUTPUT
14
NETLIST CREATION USING
PART II NETLIST CREATION USING gEDA SCHEMATIC EDITOR
15
STEPS Draw the schematic of the circuit using gEDA schematic editor Save the file with extension .sch Convert .sch file to .net file using gnetlister. Command : gnetlist -g spice -o rc_filter.net rc_filter.sch
16
DRAWING CIRCUIT IN gEDA SCHEMATIC EDITOR
SAVE THE ABOVE SCHEMATIC AS rc_filter.sch
17
CONVERING SCHEMATIC TO NETLIST
Output File name Schematic Name gnetlist -g spice -o rc_filter.net rc_filter.sch
18
NETLIST OBTAINED FROM SCHEMATIC
rc_filter.net
19
SIMULATING THE NETLIST
20
SIMULATING THE NETLIST
Name of the NETLIST created using gnetlister
21
SIMULATING THE NETLIST
22
SIMULATING THE NETLIST : TRANSIENT ANALYSIS
Final Value Indicates Transient Analysis Increment value
23
SIMULATING THE NETLIST : TRANSIENT ANALYSIS
24
SIMULATING THE NETLIST : TRANSIENT ANALYSIS
PLOT V(2) V(1)
25
ANALYSIS OF THE WAVEFORM
GREEN COLOUR : INPUT WAVE RED COLOUR : OUTPUT WAVEFORM
26
WHY THE AMPLITUDE OF THE OUTPUT WAVEFORM IS VERY LESS ??
27
Cut off frequency of the high pass filter is given by,
REASONS The Circuit is a High pass filter, so it passes only high frequency signals. We have given an input sinusoidal waveform of Amplitude = 10V and Frequency = 1kHz Cut off frequency of the high pass filter is given by, cutoff frequency= 1/(2*pi*R*C) Here in this case Cutoff frequency (3 dB frequency ) = 48.22kHZ So, Give input sine wave frequency >= kHz
28
A Simple RC High pass filter V1 n0 0 SIN(0 10 500kHz) C1 n0 n1 3.3nF
MODIFIED NETLIST A Simple RC High pass filter V1 n0 0 SIN( kHz) C1 n0 n1 3.3nF R n k .CONTROL TRAN ms 0.1ms PLOT n0 n1 .ENDC .END NEW INPUT FREQUENCY
29
OUTPUT WAVEFORM
30
AC ANALYSIS OF HIGH PASS FILTER
FOR AC ANALYSIS THE CONTROL SIGNAL IS .AC <sweep type> <points value> <start frequency> <end frequency> (sweep type is either LIN,OCT or DEC) Examples .AC LIN KHz .AC DEC 20 1 10kHz
31
NETLIST FOR AC ANALYSIS OF HIGH PASS FILTER
A Simple RC High pass filter V1 n0 0 SIN( kHz) C1 n0 n1 3.3nF R n k .CONTROL AC LIN Hz 1000kHz PLOT V(n1) .ENDC .END AC ANALYSIS
32
AC ANALYSIS PLOT I
33
NETLIST FOR AC ANALYSIS OF HIGH PASS FILTER
A Simple RC High pass filter V1 n0 0 SIN( kHz) C1 n0 n1 3.3nF R n k .CONTROL AC DEC Hz kHz PLOT DB(V(n1)/V(n0)) .ENDC .END AC ANALYSIS
34
AC ANALYSIS PLOT II
35
HOW A HIGH PASS FILTER CAN BE CONVERTED TO A DIFFERENTIATOR CIRCUIT
36
HIGH PASS FILTER AS DIFFERENTIATOR
The Condition in which a high pass filter acts as a differentiator circuit is given by RC << T ; Where T = Time period of the input signal Question ? Design a Differentiator Circuit which takes a pulse waveform of frequency 1 kHz and perform its transient analysis using NGSPICE.... Take the capacitor value as C = 3.3nF
37
DIFFERENTIATOR TRANSIENT RESPONSE
With RESISTOR VALUE, R = 47k
38
DIFFERENTIATOR TRANSIENT RESPONSE
With RESISTOR VALUE, R = 10k
39
RC LOW PASS FILTER
40
RC LOWPASS FILTER AC ANALYSIS PLOT
41
RC LOWPASS FILTER AS INTEGRATOR
42
RECTIFIER CIRCUIT WRITE THE NETLIST AND PLOT THE WAVEFORMS
43
RECTIFIER CIRCUIT OUTPUT
44
CLIPPER CIRCUITS POSITIVE CLIPPER CLIPPING LEVEL : +5V
WRITE NETLIST AND OBTAIN THE OUTPUT WAVEFORM
45
POSITIVE CLIPPER OUTPUT WAVEFORM
46
CLIPPER CIRCUITS DOUBLE CLIPPER CLIPPING LEVELS : +5V and -5V
WRITE NETLIST AND OBTAIN THE OUTPUT WAVEFORM
47
DOUBLE CLIPPER OUTPUT WAVEFORM
48
CLAMPER CIRCUITS SIMPLE POSITIVE CLAMPER CIRCUIT
49
OUTPUT WAVEFORM
50
LAB SESSION EXPERIMENTS RC HIGH PASS CIRCUIT AND DIFFERENTIATOR
RC LOW PASS CIRCUIT AND INTEGRATOR RECTIFIER CIRCUITS CLIPPER CIRCUITS CLAMPER CIRCUITS
51
PLOT THE FOLLOWING WAVEFORM USING NGSPICE
ASSIGNMENT I PLOT THE FOLLOWING WAVEFORM USING NGSPICE
52
52
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.