1 / 257

Introduction to Simulation language

Introduction to Simulation language. What is Simulation?. A Simulation of a system is the operation of a model, which is a representation of that system.

keelia
Download Presentation

Introduction to Simulation language

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. Introduction to Simulation language

  2. What is Simulation? • A Simulation of a system is the operation of a model, which is a representation of that system. • The model is amenable to manipulation which would be impossible, too expensive, or too impractical to perform on the system which it portrays. • The operation of the model can be studied, and, from this, properties concerning the behavior of the actual system can be inferred. Introduction to PSpice

  3. GEN. PURPOSE LANGUAGES USED FOR SIMULATION • FORTRAN • Probably more models than any other language. • PASCAL • Not as universal as FORTRAN • MODULA • Many improvements over PASCAL • ADA • Department of Defense attempt at standardization • C, C++ • Object-oriented programming language Introduction to PSpice

  4. Simulation tools (For EE-2240) • PSPICE • MATLAB • SIMULINK Introduction to PSpice

  5. Introduction to PSpice • Simulation Software Introduction to PSpice

  6. The Origins of SPICE • SPICE developed in the 1970’s • Simulation Program with Integrated Circuit Emphasis • Developed to save money • Simulation of circuits, not physically building • Can perform DC level, AC frequency response and transient time domain simulations. Introduction to PSpice

  7. Steps in simulating circuit using PSpice 1 Convert your circuit into a netlist. Save your netlist using text editor with extension .cir 2 Run PSpice and simulate your .cir file 3 Obtain the results from your output file Introduction to PSpice

  8. Examples – DC analysis This is how you write a PSpice netlist for the circuit: Test 1 i1 0 1 dc 1.5 r1 1 0 100 r2 1 2 150 r3 2 0 250 .dc i1 1.5 1.5 1 .print dc v(1) v(2) i(r1) i(r2) .end Title statement 1 Data statement Control statement Introduction to PSpice  Output statement  End statement

  9. 2 Run PSpice and simulate your .cir file Introduction to PSpice

  10. 3 Display the output  This depends on what you write in the output statement Introduction to PSpice

  11. Examples Introduction to PSpice

  12. Steps in simulating circuit using PSpice Circuits Output file **** 07/21/10 10:19:34 *********** Evaluation PSpice (Nov 1999) ************** Test 1 **** CIRCUIT DESCRIPTION ****************************************************************************** i1 0 1 dc 1.5 r1 1 0 100 r2 1 2 150 r3 2 0 250 .dc i1 1.5 1.5 1 .print dc v(1) v(2) i(r1) i(r2) .end **** 07/21/10 10:19:34 *********** Evaluation PSpice (Nov 1999) ************** Test 1 **** DC TRANSFER CURVES TEMPERATURE = 27.000 DEG C ****************************************************************************** i1 V(1) V(2) I(r1) I(r2) 1.500E+00 1.200E+02 7.500E+01 1.200E+00 3.000E-01 JOB CONCLUDED TOTAL JOB TIME .02 Input file (*.cir) containing Netlist PSPICE

  13. Use of Schematic Create Schematic circuit using drawing (Using “Schematic” or “Capture”) Simulate the circuit (PSPICE) Plot and analyze the results Introduction to PSpice

  14. Use of Schematic (Contd.) • UseSchematic capture • toenter schematic and set up simulation parameters before running • PSpice (simulation engine) • and then look at results in • ProbeAlso available at CERN: • Parts (modelling program) • Stimulus Editor (to produce “custom” voltage/current/digital sources) • Optimizer (can automatically vary circuit component values to satisfy design criteria) Introduction to PSpice

  15. PSPICE Graphical Tutorial

  16. Go to: Start: All Programs: Electrical Apps: Orcad Family… : PSpice Design Manager

  17. It will look like this:

  18. Click on: File : New Workspace

  19. Give your New Workspace a Names and Location

  20. It will then look like this: Then click here

  21. An area to draw your circuit will open up

  22. Click on Draw: Get New Part

  23. This window will then open up

  24. Enter a part name: R, C, L, etc… All related parts will list here: select the one you want It’s symbol will then appear here

  25. Click Place and put the part(s) where you want it or them

  26. Click on the part value to change its value:

  27. Then select a DC voltage supply and place it

  28. Draw the wires to connect all the parts

  29. Your circuit will look something like this:

  30. Click on the wires to label the circuit nodes: call the ground wire “0”

  31. Now mark the circuit nodes of interest with Voltage Level Markers

  32. Your circuit will look something like this:

  33. Click on Analysis: Setup

  34. For DC circuit analysis, enable: “Bias Point Detail”

  35. Select Analysis: Create Netlist (correct circuit layout if any errors found)

  36. Select Analysis: Simulate to analyze the circuit

  37. This window tells you how the simulation went

  38. Go to your workspace directory and click on the Output File

  39. Scroll down to you find the voltages for the nodes you marked in the circuit. The voltages are referenced to node “0.”

  40. This time, replace the DC voltage source with a time varying voltage source, such as VPULSE

  41. Put it in the circuit and click on it to select it’s parameters

  42. Here I selected the constant DC and AC values to be zero, the initial voltage level (V1) to be zero, the final voltage level (V2) to be 10V, the time delay (TD) to be 1us and the rise time (TR) to be 10us. I left the other options blank

  43. Under Analysis Setup, enable “Transient…” and click on it Keep the “Bias Point Detail” enabled too

  44. Set the Transient Analysis Final Time to 100us

  45. Run the Simulation and these result will appear: A plot of the voltages at all the marked nodes over the transient analysis time (0s to 100us) Play with this window to adjust display time and what signals are displayed

  46. PSPICE Reference Manuals • Look in C:\Program Files\Orcad\Document • pspug.pdf • pspqrc.pdf • PSpcRef.pdf • psp_sug.pdf

  47. Set-up VAC source • Set-up VAC* • DC=0 • used to find initial DC solution • ACMAG=1 • source p-to-p value during AC analysis • ACPHASE=0 • reference for phase measurements *VSIN can also be used for AC analysis - see Appendix 1 for set-up explanation Introduction to PSpice

  48. Set-up AC analysis and Probe • From Menu • Analysis/Setup… • or Toolbar - • Click “AC Sweep” • Enter as shown • Click “OK” Introduction to PSpice

  49. Set-up Probe and Run Analysis • Set-up Probe • From Menu • Analysis/Probe Setup… • Under Data Collection tab, select “All” N.B. other options allow to limit size of .dat file • Run Analysis • From Menu • Analysis/Simulate • From keyboard • F11 • From Toolbar - Introduction to PSpice

  50. Some Probe commands • Add Trace • Trace/Add • Insert reduce traces shown, use voltage markers • Add Y-axis • Plot/Add Y-axis • Ctrl-Y N.B “>>” indicates the active axis • Display manipulation functions • or • from the menu • View/Fit,In,Out,Area or • from the keyboard • Ctrl N,I,O,A • To re-scale axes • double-click on any axisor • Plot X(Y)-Axis Settings... Introduction to PSpice

More Related