1 / 52

CIRCUIT ANALYSIS USING NGSPICE

TECHNICAL WORKSHOP MARATHON 2012. CIRCUIT ANALYSIS USING NGSPICE. VISHNU V 2 nd Year M.Tech VLSI and Embedded Systems Govt. Model Engineering College, Thrikkakara. CONTENTS. SIMULATING A CIRCUIT IN NGSPICE EXAMPLE CIRCUIT NETLIST CREATION USING gEDA SCHEMATIC EDITOR

morela
Télécharger la présentation

CIRCUIT ANALYSIS USING NGSPICE

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 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 • 0 • 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 n1 0 1k

  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 n1 0 1k .CONTROL TRAN 0 0.01ms 10ms PLOT V( n0) V(n1) .ENDC .END

  10. SIMULATION STEPS Terminal Save the above file asrc_filter.cir STEP 1 : Open Terminal and typengspice Open Terminal and Type ngspice Ngspice command terminal opens

  11. SIMULATION STEPS STEP 2 : Give the file name of the netlist we have written ierc_filter.cir Give the file name of the netlist and press enter

  12. SIMULATION STEPS TRANSIENT ANALYSIS OUTPUT BASH TERMINAL WAVE FORM WINDOW

  13. ANALYSIS OF WAVEFORM Analyse the waveform I N P U T OUTPUT

  14. 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. 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 >= 48.22 kHz

  28. MODIFIED NETLIST A Simple RC High pass filter V1 n0 0 SIN(0 10 500kHz) C1 n0 n1 3.3nF R n1 0 1k .CONTROL TRAN 0.0001ms 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  16 60 600KHz .AC DEC  20 1  10kHz

  31. NETLIST FOR AC ANALYSIS OF HIGH PASS FILTER A Simple RC High pass filter V1 n0 0 SIN(0 10 500kHz) C1 n0 n1 3.3nF R n1 0 1k .CONTROL AC LIN 1000 0.1Hz 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(0 10 500kHz) C1 n0 n1 3.3nF R n1 0 1k .CONTROL AC DEC 10 100Hz 10000kHz 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 << 0.0016T ; 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 +5V

  46. CLIPPER CIRCUITS DOUBLE CLIPPER CLIPPING LEVELS : +5V and -5V WRITE NETLIST AND OBTAIN THE OUTPUT WAVEFORM

  47. r DOUBLE CLIPPER OUTPUT WAVEFORM +5V -5V

  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

More Related