3.08k likes | 3.89k Views
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.
E N D
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
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
Simulation tools (For EE-2240) • PSPICE • MATLAB • SIMULINK Introduction to PSpice
Introduction to PSpice • Simulation Software Introduction to PSpice
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
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
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
2 Run PSpice and simulate your .cir file Introduction to PSpice
3 Display the output This depends on what you write in the output statement Introduction to PSpice
Examples Introduction to PSpice
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
Use of Schematic Create Schematic circuit using drawing (Using “Schematic” or “Capture”) Simulate the circuit (PSPICE) Plot and analyze the results Introduction to PSpice
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
Go to: Start: All Programs: Electrical Apps: Orcad Family… : PSpice Design Manager
It will then look like this: Then click here
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
Click on the wires to label the circuit nodes: call the ground wire “0”
Now mark the circuit nodes of interest with Voltage Level Markers
Select Analysis: Create Netlist (correct circuit layout if any errors found)
Scroll down to you find the voltages for the nodes you marked in the circuit. The voltages are referenced to node “0.”
This time, replace the DC voltage source with a time varying voltage source, such as VPULSE
Put it in the circuit and click on it to select it’s parameters
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
Under Analysis Setup, enable “Transient…” and click on it Keep the “Bias Point Detail” enabled too
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
PSPICE Reference Manuals • Look in C:\Program Files\Orcad\Document • pspug.pdf • pspqrc.pdf • PSpcRef.pdf • psp_sug.pdf
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
Set-up AC analysis and Probe • From Menu • Analysis/Setup… • or Toolbar - • Click “AC Sweep” • Enter as shown • Click “OK” Introduction to PSpice
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
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