SIMULATIONS USING PSPICE & OSCILLOSCOPE TRAINING DRILL In this experiment the student will explre circuit simulatins using MicrSim s Pspice fllwed by an scillscpe training drill using Virtual Bench. Pspice Tutrial: 1. Launching the schematic editr: The schematic editr interface t PSpice may be either be launched frm the desktp r frm Windw s start menu. It can be fund in Start => Prgrams => MicrSim Pr 8 => Schematics. Belw is a figure f the Schematic editr interface. 2. Placing Parts: Figure 5.1. MicrSim Schematics editr MicrSim s schematic editr describes several ways f selecting and placing parts. Tw f these ptins are available frm the tlbar. If the user knws the name f the part in questin, it may be directly accessed frm empty text field in the tlbar. This is knwn as the Get Recent Part list bx. This field nt nly allws the user t select new parts, but it als keeps track f recently used parts fr quick access. Belw is a figure f the parts and wire tlbar where this ptin may be fund. Figure 5.2. Parts and wire tlbar. In additin t this, PSpice keeps an extensive parts library frm which the user can brwse thrugh. Again, this ptin may be directly accessed frm the tlbar. T enable this ptin press the buttn t the immediate left f the Get Recent Part list bx. Pressing this buttn shuld enable the dialg bx presented belw.
Figure5. 3. Part Brwser dialg bx. Figure 5.3 abve presents ne f the tw dialg bxes that may appear. These may be the Part Brwser Advanced and Part Brwser Basic dialg bxes. Althugh bth mdes can be used t select parts, Part Brwser Advanced prvides extended ptins fr part placement. These include descriptive searches as well as a symblic representatin f the selected part. Yu can switch- Between mdes by selecting the Basic r Advanced buttns. In additin t the abve methd the part brwser dialg bx may als be accessed at Draw => Get New Part r by using the <Ctrl-G>shrtcut. 3. Placing Wires: PSpice defines several methds fr wire placement. Again, this ptin may be accessed frm the tlbar in Figure 5.2. T place wires simply select the leftmst available icn n the tlbar. In additin t this methd wires may be placed frm bth Draw => Wire r by selecting the <Ctrl-W>shrtcut. 4. Placing Markers: Markers allw users t specify where vltage and current wavefrms are t be analyzed and simulated n the circuit frm the schematic. Markers may be accessed by selecting Markers frm the drp dwn menu. Belw is a descriptin f several f the available ptins. Mark Vltage Level - Measures vltage level with respect t grund. Mark Vltage Differential - Measures the differential vltage between tw user defined pints. Mark Current int Pin - Measures the current entering a nde. Mark Advanced - Prvides several advanced measuring ptins including decibel readings f vltage and current. 4. Setting up a Simulatin:
PSpice requires that all schematics be saved befre any simulatins may be cnducted. Once a schematic has been saved, the user shuld access Analysis => Setup frm the drp dwn menu. This shuld bring up the fllwing dialg bx. Figure 5.4. Setup dialg bx Figure 5.4 presents the numerus available simulatin ptins. In this case, we will nly be cncerned with selecting Bias Pint Detail as well as Transient ptins. These ptins will allw the user t plt time varying signals. Enable these ptins by placing a checkmark next t each. In additin t selecting Transient frm the dialg bx, click n the Transient buttn. Yu shuld see the fllwing dialg bx appear. Figure 5.5 Transient dialg bx The Transient dialg bx allws users t set final simulatin times as well integer step values fr simulatin. Smaller step values allw fr increased reslutin in resulting plts, hwever, this cmes at the expense f increased simulatin time. Care must be taken at bth extremes. Large step values can results in carse utput plts r even wrse the resulting signal may becme aliased. T prevent aliasing make sure yur print step is smaller than half the perid f the highest frequency signal in yur circuit. Once a step size and a final time have been selected yu are nw able t prceed with the simulatin. Exit the Transient dialg bx by clicking n the OK buttn. Then prceed t exit the Analysis Setup by clicking n the Clse buttn. T initiate a simulatin g t Analysis => Simulate. Ding s shuld begin the simulatin as lng as there are n errrs in yur circuit. At this pint yu shuld see a dialg bx that resembles Figure 5.6 n yur screen.
Figure 5.6 Simulatin dialg bx Once this prtin f the simulatin has finished, results are usually displayed graphically thrugh the use f the Prbe interface in Pspice. Figure 5.7 presents an example Prbe display. In the case where yur simulatin has finished running and yu d nt see the Prbe display g t Analysis => Run Prbe. This shuld wrk prvided yur circuit is errr free. Nte: Remember t place markers befre yu run yur simulatins. Figure 5.7 Sample Prbe display 5. Useful Shrtcuts:
Belw is a list f frequently used shrtcuts. These ptins can be additinally accessed frm the available tlbars in the schematic editr. <Ctrl-F> Prvides a mirrr image f the part by flipping it cmpletely ver <Ctrl-G> Displays the Get New Part dialg bx <Ctrl-P> Selects Get Recent Part list bx <Ctrl-R> Rtates selected part in increments f 90. <Ctrl-T> Creates a text bx <Ctrl-W> Places wire 6. Basic Parts List: Pspice prvides an extensive parts list. Its libraries may cntain thusands f cmpnents. In rder t simplify yur search-belw is a list f basic parts that yu may need fr the curse f the semester. R C L egnd Vdc Vsin Vpulse ua741 Resistr Capacitr Inductr Earth Grund DC Vltage Surce Sinusidal Vltage Surce Square Wave Vltage Surce 741 Op-amp Exercise: At this pint yu are nw ready t begin simulating sme simple circuits. We will begin by simulating sme f the same circuits yu have built in the previus labs. 1. Simulate the circuits in Figures 5.8 (a), (b), and (c). Make sure t measure all branch vltages and currents. Plt results. Cmpare these with the results btained in the previus labs. Are there any significant differences in results? If s, explain. Nte: Prvide separate plts fr vltage and current. Make sure t label yur plts. 5.8 (a) 5.8 (b)
5.8(c) 2. Simulate the circuit in Figure 5.9. Ntice that the input surce is n lnger DC. Instead we will use an alternating surce (AC) vltage. Display bth input and utput vltages plts n the same graph. D this fr bth a sinusidal input (Vsin) surce as well as fr a square wave (Vpulse) surce. Belw are the parameters yu need t set the surces t. Yu may change a surce's r any parts par parameters by duble clicking n the part. Vsin: Vpulse: DC = 0 DC = 0 AC = 5 AC = 5 Vff = 0 V1 = 5 Vamp = 5 V2 = -5 Freq = 1000 TD = 0 TD = 0 TR = 0.00001m DF = 0 TF = 0.00001m Phase = 0 PW = 0.5m PER = 1m Nte: D nt skip spaces. 3. Dependent Surces in PSpice Figure 5.9
There are fur different types f dependent surces all which can be fund and utilized in PSpice. Table 1-1 shws the different types f dependent surces as well as the part name that PSpice uses t identify them and Figure 5.10 illustrates each surces symbl. Surces Vltage cntrlled vltage surce (VCVS) Vltage cntrlled current surce (VCVS) Current cntrlled vltage surce (CCVS) Current cntrlled current surce (CCCS) Table 1-1 Part Name E G H F Figure 5.10 As is shwn in Figure 5.10, each dependent surce has tw surces assciated with the part. The surce (either vltage r current) n the left hand side f the part is the surce that requires the dependence. The surce n the right hand side f the part (the surce with the circle) is the surce that is ding the cntrlling based n a vltage r a current frm sme ther element in the circuit. A clearer explanatin can be seen with an example. Example: Simulate the circuit in Figure 5.11
Figure 5.11 T simulate this circuit, the dependent surce must be inserted int the circuit prperly as shwn in Figure 5.12. Figure 5.12 Fr a vltage cntrlled (VCVS r VCCS) dependent surce the dependent surce f the part must be placed in parallel with the dependent element and the plarities must be crrect fr prper simulatin! T make the cntrlling surce the necessary 4 times Vx yu must duble click n the part and enter 4 in fr the gain parameter. If we were cncerned with a current cntrlled vltage surce that was cntrlled with the current Ix then we wuld need t use the part G and then the dependent surce f the part wuld be cnnected in series with the dependent element as seen in Figure 5.13.
Figure 5.13 Again, if we were wanted the value f the current cntrlled surce t be 4Ix then simply duble click n the part and enter 4 fr the gain. Exercises Simulate and determine the vltage V1. Simulate and determine v2. Figure 5.14 Figure 5.15
Tutrial B Oscillscpe Training Drill I. Intrductin t the NI ELVIS Oscillscpe: 1. Start the ELVIS cmmand cnsle by ging t the Windws Start menu and selecting Prgrams -> Natinal Instruments -> NI ELVIS 2.0 -> NI ELVIS 2. Start the ELVIS scillscpe by selecting Oscillscpe frm the NI ELVIS cmmand cnsle. The fllwing interface shuld be displayed n the desktp: Figure 5.16 ELVIS Oscillscpe Channel A Cntrls Display Turns the display f input signal measurements fr channel A ON r OFF. The default value fr this buttn is ON. Nte: Acquisitin n CH-A cntinues even if the trace is nt displayed MEAS Turns the display f measurements fr channel A n r ff. The MEAS buttn is green when active. Measurements are displayed belw the graph, in the Measurements and Cursrs Display prtin f the Display Windw. The standard measurements are rt mean square (RMS), frequency, and V p-p. The MEAS buttn fr CH-A is dimmed if the Display buttn fr CH-A is OFF. Clicking this buttn when the MEAS buttn fr Channel B is n sets the CH-B MEAS buttn t OFF. The default value fr this buttn is OFF.
Surce Selects the signal surce fr the measurement n CH-A. Yu can select ACH<0..2>, ACH5, the BNC/Bard CH-A, the functin generatr FUNC_OUT signal, the functin generatr SYNC_OUT signal, and the DMM VOLTAGE channel (ruted t ACH7). The default value fr this cntrl is BNC/Bard CH-A. Vertical Psitin Knb Adjusts the vertical psitin f the CH-A trace by applying a psitive r negative vertical ffset. The default is zer ffset. The ffset is referenced frm the zer pint f the graph. This ffset value is nt applied t the actual acquired data. Zer Centers CH-A n the vertical zer pint f the graph. This actin des nt affect the actual acquired data. The default is n actin. Scale/Div Selects the vertical sensitivity fr the channel A trace. Sensitivity is defined as the amunt f vltage represented by each hrizntal line n the graph. The units are in vlts/divisin. The Scale/Div ptins are 10mV, 20mV, 50mV, 100mV, 200mV, 500mV, 1V, 2V, and 5V. The default value fr this cntrl is 2V. Cupling Specifies the cupling fr the channel. This peratin is dne in the sftware. Yu can select AC (remves the DC ffset frm the signal) r DC (allw NI ELVIS t measure all f the signal). The default fr value fr this cntrl is DC. Autscale Adjusts the vltage display scale f the graph based n the peak-t-peak vltage f the AC signal (greater than 5 Hz), fr an autmatic best-fit display f the signal. Channel B Cntrls Display Turns the display f the CH-B trace n r ff. The default value fr this buttn is ON. Nte Acquisitin n CH-B cntinues even if the trace is nt displayed MEAS Turns the display f measurements fr channel B n r ff. The MEAS buttn is green when active. Measurements are displayed belw the graph, in the Measurements and Cntrl Display prtin f the Display Windw. The standard measurements are RMS, frequency, and V p-p. The MEAS buttn fr CH-B is dimmed if the Display buttn fr CH-B is OFF. Turning this feature n when the CH-A MEAS buttn is n, sets the CH-A MEAS buttn t ff. The default value fr this buttn is OFF. Surce Selects the signal surce fr the measurement n CH-B. Yu can select ACH<0..2>, ACH5, the BNC/Bard CH-B, the functin generatr FUNC_OUT signal, the functin generatr SYNC_OUT signal, and the DMM VOLTAGE channel (ruted t ACH7). The default value fr this cntrl is BNC/Bard CH-B. Vertical Psitin Knb Adjusts the vertical psitin f the channel B trace by applying a psitive r negative vertical ffset. The ffset is referenced frm the zer pint f the graph. This ffset value is nt applied the actual acquired data. The default is zer ffset. Zer Centers the CH-B trace n the vertical zer pint f the graph. The default is n actin. This actin des nt affect the actual acquired data. Scale/Div Selects the vertical sensitivity fr the channel B trace. The units are in vlts/divisin. Sensitivity is defined as the amunt f vltage represented by each hrizntal line n the graph. The Scale/Div ptins are 10 mv, 20 mv, 50 mv, 100 mv, 200 mv, 500 mv, 1 V, 2 V, and 5 V. The default value fr this cntrl is 2 V.
Cupling Specifies the cupling fr the channel. This peratin is dne in the sftware. Yu can select AC (remves the DC ffset frm the signal) r DC (allw NI ELVIS t measure all f the signal). The default fr value fr this cntrl is DC. Autscale Adjusts the vltage display scale f the graph based n the peak-t-peak vltage f the AC signal (greater than 5 Hz), fr an autmatic best-fit display f the signal. Display Windw Displays the wavefrms specified in channel A (CH-A Surce) and channel B (CH-B Surce) as well as cursrs. Cursrs are mved hrizntally by clicking them and dragging them alng the time axis. The signals are pltted amplitude versus time. The Display Windw includes the fllwing cntrls and indicatrs: Measurements and Cursrs Display The Measurements and Cursrs Display includes the fllwing indicatrs: RMS Displays the measured RMS vltage f the selected input signal. The units fr this measurement are vlts. This indicatr is visible nly when measurements are turned n. Frequency Displays the reciprcal f time between adjacent mid reference level crssings in the same directin (perid) f the selected input signal. The units fr this measurement are Hertz. This indicatr is visible nly when measurements are in prgress. V p-p Displays the difference between the highest and lwest measured vltage level f the selected input signal. The units fr this measurement are vlts. This indicatr is visible nly when measurements are turned n. C1 Vltage Displays the crrespnding vltage level f the selected channel trace at the current cursr psitin. The units fr the measurement are vlts. This value is visible nly when cursrs are turned n. C2 Vltage Displays the crrespnding vltage level f the selected channel trace at the current cursr psitin. The units fr this measurement are vlts. This value is visible nly when cursrs are turned n. dt Displays the difference in time between cursrs C1 and C2. The units fr this measurement are secnds. This value is visible nly when cursrs are enabled.
II. Intrductin t the ELVIS Functin Generatr 1. Start the ELVIS functin generatr by selecting Functin Generatr frm the NI ELVIS cmmand cnsle. The fllwing interface shuld be displayed n the desktp: Figure 5.17 ELVIS Functin Generatr The NI ELVIS - FGEN SFP is a tp-level, stand-alne instrument that cntrls the functin generatr in the NI ELVIS Benchtp Wrkstatin. It allws setting f the fllwing features: Wavefrm (sine, triangle, square) Tuning mde (basic lw reslutin - fast 8-bit fine frequency, ultrafine - slwer 12-bit fine frequency) Mdulatin (disabled, sftware AM r FM using DAC0 r DAC1) Frequency adjust Amplitude (8-bit) DC ffset (8-bit) Measure frequency f generated signal
Yu can cntrl the functin generatr either thrugh the NI ELVIS - FGEN SFP (Sftware mde) r the hardware cntrls n the benchtp wrkstatin (Manual mde). This sectin describes the sftware cntrls. Refer t the NI ELVIS Benchtp Wrkstatin sectin f Chapter 3, Hardware Overview, f the NI ELVIS User Manual fr mre infrmatin n the hardware cntrls fr the functin generatr. The tab labeled Large Amplitude Wavefrm is capable f prviding signals with amplitudes larger than 2.5V peak. The utput frm this panel is available n DAC0 NOT FUNC_OUT. The tw signals CAN NOT be active simultaneusly, yu must chse ne utput r the ther. Als, please nte that sme f the builtin functins WILL NOT WORK if DAC0 is used as the input. III. Exercise 1: 1. Set the Oscillscpe Cntrls t the fllwing: DC Cupling 0V Offset Trigger Immediate 2. Cmplete the fllwing steps t measure a signal with the NI ELVIS - Scpe SFP: i. Cnnect the signal(s) yu want t measure and the trigger signal, if desired, t the BNC cnnectr(s) n the frnt f the NI ELVIS Benchtp Wrkstatin r t the crrespnding inputs n the NI ELVIS Prttyping Bard. ii. iii. iv. Launch the NI ELVIS - Scpe SFP frm the NI ELVIS Instrument Launcher. Refer t Launching the SFP Instruments fr mre infrmatin. The NI ELVIS - Scpe SFP starts running when launched. Yu shuld see the signal in the Display Windw. If needed, adjust the Trigger Surce cntrl t stabilize the signal in the Display Windw. If yu have an external signal cnnected as the trigger signal, select SCOPE Trigger. If yu want t use ne f the input channels as the trigger, select CHANNEL A r CHANNEL B frm the Surce cntrl. v. Adjust the Timebase, Vertical Psitin, Scale, and ther cntrls as desired. Yu shuld nw be able t read data n bth channels CHA and CHB f the wrkbench. 3. Nw cnfigure the ELVIS Functin Generatr t the fllwing settings: i. Cnnect the Functin Generatr FUNC_OUT pin t the lcatin where the signal is needed. ii. iii. iv. Launch the NI ELVIS - FGEN SFP frm the NI ELVIS Instrument Launcher. Chse the desired value frm the Wavefrm, Peak Amplitude, DC Offset, Fine Frequency, and Carse Frequency cntrls. Click the On buttn n the NI ELVIS - FGEN SFP t begin generatin. 4. Set the functin generatr t: Frequency: 500 Hz Duty Cycle: 50 % Offset: 0 % Amplitude: 5 Vpk Input Signal Sine wave 5. Set bth the functin generatr as well as the scillscpe fr cntinus signal generatin and acquisitin by pressing the Run r On buttns n either device.
Yu shuld nw see a sine wave at a frequency f 500 Hz, 0 V ffset, and 5Vpk. If yu d nt, try pressing Autscale n the frnt panel f the scpe. Additinally, ntice the parameters that appear belw the display. Yu shuld find helpful infrmatin n frequency, perid, vltage levels, ffset, etc. Mre ptins may be cnfigured in the General Settings tab. 6. On the frnt panel f the VB Scpe try turning the knbs labeled Time Base, Vlts/div, and V. Psitin. Answer the fllwing questins Can yu bserve any differences in the displayed signal? If s, what d yu bserve? D these settings have any effect n the parameters displayed belw the plt? Nw, press the buttn labeled Slpe. What effect des this have n the display? 7. Select the ptin labeled Cursr n the frnt panel f the VB Scpe display and set t the fllwing: CH-A CH-B Yu shuld nw be able t drag cursrs n the wavefrm bserved n channel A f the display. Nte that yu must enable channel B befre selecting the cursr fr channel B. Belw the plt yu shuld bserve infrmatin n the psitins f the tw cursrs. This infrmatin shuld include bth vltage levels as well as differential times between the tw cursrs. 8. De-select the Cursr ptin n the scpe. Nw return t the FG display and switch thrugh the varius different wavefrms available n the display. Yu shuld be able t select between sine, square, and triangular. Additinal wavefrms may als be user defined. 9. Set the utput wavefrm f the FG t a square and then triangular wave. On the frnt panel f the FG try turning the knb labeled Offset. Observe and answer the fllwing questins. Can yu bserve any differences in the displayed signal? If s, what d yu bserve? D these settings have any effect n the parameters displayed belw the plt? Explain. 10. Set the displayed wavefrm t the same settings described in step (4), but nw cnfigure the channel settings t AC cupling. D yu bserve any changes in the displayed wavefrm? Nw, increase r decrease the DC ffset f the signal. Is there any difference in the displayed wavefrm? Shuld there be? Explain. 11. Set the scillscpe t tw different wavefrms prvided fr by the instructr. These wavefrms shuld be at different ffsets, amplitudes, frequencies, as well as duty cycles. Nte: Adding a DC ffset t yur wavefrm is NOT the same as mving the reference pint n the display. This shuld be apparent fr the ptins displayed belw the plts.
IV. Exercise 1 This part f the experiment will allw the student t practice making AC measurements using the VB scpe. a. Set up the fllwing circuit. Figure 5.18 b. Set the input signal t a sine wave at 2 khz, 0 V DC ffset, and 8 Vp-p. Additinally, restre the settings n the VB Scpe t thse described in step 1 f exercise 1. c. Cnfigure channels A and B f the VB scpe t lk at V1 and V2 respectively. Be sure t set input cupling t DC, aut triggering, and a trigger nise rejectin rati f 1mV. Yu shuld see tw sinusids f the same frequency with a phase difference Φ displayed n yur screen. d. Use the cursrs t determine the delay (dt) between bth sinusids. What is the phase difference Φ between the tw sinusids? ( Nte: Φ = dt * frequency * 360)