CAD and Simulation Objectives Experiment Topic: CAD and Simulation PSpice 9.1 Student Version To obtain your free copy of the software and user s guide, go to Electronics Lab website ( http://www.electronics-lab.com/downloads/schematic/013/ ). To investigate the use of the standard circuit simulation tool, PSPice, in the analysis of both time and frequency responses of the circuits. Background Theory and Simulation Practice SPICE (Simulation Program with Integrated Circuit Emphasis) is a general-purpose electronic circuit simulator based on nodal analysis approach. It was developed in the early 1970's at the University of California at Berkeley. Spice software was originally written in FORTRAN language and it was designed to run on a large mainframe computer. In 1984, PSPice (PC-based Spice) developed by MicroSim Corporation was the first commercial Spice program running on personal computer to gain wide acceptance in both industry and academic. In late 1997 and early 1998, OrCAD Systems Corporation and MicroSim Corporation merged a business to be a supplier of analog and mixed-signal simulation software for designing printed circuit board systems. PSpice is the most popular circuit simulator on the market today. The software package is used by students or educators in classroom, and also engineers or technicians on the advanced job in professional level. In-charge Faculty Staff: <none> 8-1
Introduction to PSPICE 1. Open OrCAD Capture window by click on Capture Student icon (Start \ All Programs \ PSpice Student \ Capture Student). Figure 1 OrCAD Capture window 2. Create a new project by click on File \ New \ Project button. Fill in as follows. Enter project Name, e.g. circuit 0. Select Analog or Mixed A/D. Enter folder Location, e.g. C:\Program Files\OrCAD_Demo\550711, then click OK. Figure 2 New Project dialog box In-charge Faculty Staff: <none> 8-2
3. Select Create a blank project, then click OK. Figure 3 Create PSpice Project dialog box 4. This is OrCAD Capture window. Figure 4 OrCAD Capture window In-charge Faculty Staff: <none> 8-3
Example Theory Figure 5 RL circuit Inductance is the opposition to changing current. The relationship is expressed by where is the average voltage across the inductor, is an inductance constant, and is the current. For sinusoidal response, sin where angular frequency 2, cos sin (1) (2) where. Therefore the voltage is another sine wave and it leads the current by 90. In-charge Faculty Staff: <none> 8-4
Simulation I 1. Draw the circuit. 1.1) Place voltage source - Click Place Part button on the right Tool Palette. - Click Add Library and add library SOURCE (C:\Program Files\OrCAD_Demo\Capture\Library\Pspice\source.olb). - Select VPWL (Voltage Piecewise Linear) part and click OK. - Place VPWL part on the schematic window Note : To end the part placement, click right and select End Mode. To rotate the part, press Ctrl+R. Figure 6 Add Library and Place Part 1.2) By following the previous steps, - Place R (Resistor) part from library ANALOG. - Place L (Inductor) part from library ANALOG. 1.3) Place ground - Click Place Ground button on the right Tool Palette. - Select 0 part and click OK. - Place 0 part on the schematic window. In-charge Faculty Staff: <none> 8-5
Figure 7 Place Ground Figure 8 Components on the schematic 2. Wire the components - Click Place Wire button on the right Tool Palette. - Drag the wire to complete wiring. Note : To end the wire placement, click right and select End Wire. Figure 9 Wired components on the schematic 3. Set the component values - Double click on the attributes of R part and L part to open Display Properties window. - Change Value (R = 0.001 and L = 100 mh) and click OK. In-charge Faculty Staff: <none> 8-6
Figure 10 Display Properties windows for R part and L part - Double click on VPWL part to open Property Editor window and set the values as follows. T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 0ms 1ms 1.001ms 2ms 2.001ms 3ms 3.001ms 4ms 4.001ms 5ms V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 0V 0V 1V 1V 0V 0V -1V -1V 0V 0V Figure 11 Property Editor Figure 12 Complete circuit on the schematic 4. Place measurement probe - Click Voltage/Level Marker button and Current Marker button on Toolbar. - Place the markers. In-charge Faculty Staff: <none> 8-7
5. Set simulation parameters Figure 13 Place probes - Click New Simulation Profile button on Toolbar to open New Simulation dialog box. - Enter simulation Name, e.g. circuit 0, and click Create to open Simulation Setting window. - Select Analysis type: Time Domain (Transient). - Set Run to time: 5ms. - Set Maximum step size: 0.001ms. - To edit the setting, click Edit Simulation Settings button on Toolbar. Figure 14 New Simulation dialog box and Simulation Settings window 6. Run the simulation - Click Run PSpice button on Toolbar. - You can add Y axis by Plot \ Add Y Axis. - You can set axis range by Plot \ Axis Setting. In-charge Faculty Staff: <none> 8-8
Figure 15 Axis Setting windows Figure 16 Simulated circuit on the schematic Figure 17 Simulation result In-charge Faculty Staff: <none> 8-9
Simulation II 1. Draw the same circuit but change VPWL part to VSIN part. Set offset voltage VOFF = 0, amplitude VAMPL = 5V, and frequency FREQ = 1k. 2. Simulate the circuit Figure 18 Simulated circuit (VSIN source) on the schematic Figure 17 Simulation result (VSIN source) In-charge Faculty Staff: <none> 8-10
Procedure 1. Comparator circuit Theory Op-amp comparator has a well balanced difference input and a very high gain. When the non-inverting input (V Input ) is at a higher voltage than the inverting input (V Reference ), the high gain of the op-amp causes the output to saturate at the highest positive voltage it can output. When the non-inverting input drops below the inverting input, the output saturates at the most negative voltage it can output. The op-amp's output voltage is limited by the supply voltage. +15 V V Input V Reference + 15 V R Load V Output Voltage Figure 18 Non-inverting comparator circuit V Reference V Input V Output Time Figure 19 Comparator circuit result 1.1) Design square wave generator using comparator circuit. - Input signal is 2sin 2000. - Output signal is 0-10 V. - Duty circle of output signal is 50%. 1.2) Simulate the circuit and show the comparison of input signal and output signal. - For op-amp part, select LM324 part from library EVAL. 1.3) Discuss on the theoretical result and the simulation result. In-charge Faculty Staff: <none> 8-11
2. Passive filter Theory Passive filters are based on combinations of resistors (R), inductors (L) and capacitors (C). They are passive because they do not depend on an external power supply and they do not contain active components such as op-amp. The cut-off frequency is the frequency that the output voltage is decreased to 70.7% of the input voltage ( or 20 log(v Output / V Input ) = 3 db ). RL-Lowpass-Filter RL-Highpass-Filter 1 2 RC-Lowpass-Filter 1 2 RC-Highpass-Filter 1 2 1 2 Figure 20 Passive filters V Output V Output 1 1 0.707 0.707 Low-Pass High-Pass f Cut-Off Frequency Frequency Figure 21 Frequency response of low-pass filter and high-pass filter 2.1) Design passive high-pass filter. - Cut-off frequency of the filter is 100 khz. - Input signal is 1-V Peak-to-Peak sinusoidal wave. f Cut-Off In-charge Faculty Staff: <none> 8-12
2.2) Simulate the circuit and show the frequency response. - For voltage source, select VAC part from library SOURCE. - For simulation setting, select Analysis type: AC Sweep/Noise. - Set Start Frequency and End Frequency up to your design 2.3) Discuss on the theoretical result and the simulation result 3. Active filter Theory The main disadvantage of passive filters is that the output voltage is less than that of the input and the load impedance affects the filters characteristics. To control this loss of signal, active Filters containing active components such as operational amplifiers are used. They draw their power from an external power source and use it to boost or amplify the output voltage. 1 st Order-Lowpass-Filter 1 st Order-Highpass-Filter + + 1 2 1 2 2 nd Order-Lowpass-Filter 2 nd Order-Highpass-Filter + + 1 2 1 2 Figure 21 Active filters 3.1) Design active low-pass filter. - Cut-off frequency of the filter is 100 khz. - Input signal is 1-V Peak-to-Peak sinusoidal wave. In-charge Faculty Staff: <none> 8-13
3.2) Simulate the circuit and show the frequency response. 2.3) Discuss on the theoretical result and the simulation result 4. Choose your own circuit 4.1) Design your own circuit and write its theory. 4.2) Simulate the circuit and show the simulation result. 4.3) Discuss on the theoretical result and the simulation result In-charge Faculty Staff: <none> 8-14