.
English Letter
Greek Symbol
w
ω
W
Ω
t
τ
a
α
m
µ
q
θ
For Greek symbols that are different from the above, use the Greek Symbol Palette.
ASSIGNMENT 2 1. Look at all the buttons on the Math Palette. Which palette does the function absolute value appear? Which palette does the function complex appear? What is the help definition of both functions? 2. Integrate and differentiate the following functions: e , 2cos (3t), 2cos (2 πt), e sin(2ωt) and xsin(x). Discuss any difficulties you had with any of these three functions. Try to do these functions theoretically first. -2t
-3t
3. Integrate sin(t) from 0 to 2 π. (Hint- there is a definite integral in one of the palettes). -t
4. Do the second derivative of sin(t) and e . (Hint- there is a way of doing higher order derivatives in one of the palettes).
Page 20
EET 300
Computer Applications Manual
GRAPHING IN MATHCAD You can graph the results of your calculations very easy using Mathcad. When you graph a function, you first need to set up a range for the independent variable. There are three parts to this range – the initial value, the increment, and the final value. An increment can be left off, but the default will be 1, and it might be produce a graph that looks unusual. Try to use increments that make sense. This range can also be used to produce a non-graphical result of the function vs. the independent variable. When you are graphing functions that would involve sine or cosine, you might want to have as the final value (or increments) some function of pi.. If you are not sure of the range, then you can initially graph without defining the range for the independent variable. Usually you will get a graph that is centered around the origin. Once you observe the graph, you can insert the range for the independent variable in a location that is below where you define the function, but above where the graph is placed.
Setting up a Range for an Independent Variable 1- Below the variable expression which used the independent variable, type the variable, such as t, followed by the assignment expression (colon). 2- Type in a number, which which will be be the initial initial point for the graph. 3- Type a comma followed by a number or expression that represents the increment. 4- Type a semicolon, which will produce two dots, followed by a number or expression that -t represents the final value. For example, if you wanted to plot e from 0 to 4, with an increment of .01, then the variable t would look like
t
0 , .0 .01.. 4
5- Press
Graphing 1- Below the range range and the definition of of the function, type the function, function, such as f(t), followed by the @ sign (
Page 21
EET 300
Computer Applications Manual
3- If you want to resize the graph, click once on the graph, point to the lower right hand side of the graph (on top of the small black box) and the mouse pointer will change to a double arrow. Drag it to the right and down, and and the graph will will enlarge. 4- If you want want to graph two functions, functions, click next next to the first function function in the graph, graph, make sure the underline is under the entire expression, and type in a comma, followed by the new function. Note – If you want to just graph the function, you do not have to initially define the range for the independent variable, such as t. You will get a graph, and then based on that graph, insert just above the graph the range, as described in the previous page.
From the worksheet Graphing.mcd
Graphing Examples f( t ) g( t )
sin ( t ) cos ( t )
0 , .0 .01.π
t
..
2 .π
1
0.5
f( t ) g( t )
0
0.5
1 0
2
Page 22
4 t
6
8
EET 300
Computer Applications Manual
ASSIGNMENT 3 1.
Do problem 2-36 in the text theoretically. Then plot the addition of the two functions using MathCAD, as well as the result of solving problem 2-36 (on a separate graph). They should be the same graph. (a) Are they the same graph? (b) What are some of the difficulties you encountered in the MathCAD assignment? (Hintyou might want to plot each of the two functions separately first). (c) How would you determine the phase angle from the resulting graph in this example?
2.
For extra credit, plot the product of these two functions, describe what you observe, and could you mathematically have determined the plot? If so, how?
Page 23
EET 300
Computer Applications Manual
LESSON 2 – INTRODUCTION TO PSPICE You will Learn:
How start PSpice.
How to add parts to a schematic.
How to search for a part.
How to move and rotate parts.
How to connect parts.
How to change the attributes of a part.
How to save a schematic file.
How to copy and paste a part.
How to use the Undo/Redo feature
How to use Redraw and the Zooming feature
How to incorporate schematics in Word 97
How to perform simple DC analysis measurements
Page 24
EET 300
Computer Applications Manual
OVERVIEW The three main programs that will be used in the evaluation software are Schematics, PSpice and Probe. Schematics is the program that builds circuits by having you “draw” them on a monitor, and save them to a file with an .sch extension. PSpice is the software that is used to analyze the circuit created by Schematics , and to generate solutions. To graph these solutions a third application, called Probe, will be used.
Getting Started 1- Click on the Start button. The pop up menu appears. 2- Point to the word Programs. Programs . A pop up menu appears. 3- Point to the word DesignLab Eval 8. You will see the pop up menu with all of the evaluation evaluation programs. 4- Point to the word Schematics and click. The Schematics window Schematics window will open.
You will see a Windows based program, MicroSim Schematics (will change with OrCad version), with a menu bar and icons both below the menu bar and on the left side of the page. You will also see a blank area with blue letters on the top and left side of the page. To start drawing a schematic, part need to be placed on the page. In version 8.0, you will see on the Taskbar two additional programs, which are minimized. These programs are MicroSim Message Viewer and DesignLab Design Manager . Additional descriptions of these programs will be provided later on. You will also see a status bar on the bottom of the window. This will be used for prompts and cursor coordinates.
Page 25
EET 300
Computer Applications Manual
Tool Bars
Status Bar
Schematics window
Page 26
EET 300
Computer Applications Manual
USING SCHEMATICS Schematics is a schematic capture front-end program that provides a convenient system for:
· creating and managing circuit drawings · setting up and running simulations using PSpice · evaluating simulation results using Probe An important prerequisite to building a schematic is the availability of the necessary parts (in the form of symbols) for assembly. Schematics has an extensive symbol libraries and a fully integrated symbol editor for creating your own symbols or modifying modifying existing symbols. For the labs you will be using the existing symbols. A schematic consists of symbols, attributes, wires, buses and text items. Parts are electrical devices that make up a circuit, such as resistors, operational amplifiers, diodes, voltage sources and digital gates. gates. The graphical representation of a part is a symbol. symbol. You can add additional text to the schematic.
Adding Parts To A Schematic 1- Choose Draw…Get New Part from the menu bar, or click on the Get New Part button located in the toolbar. The Part Browser Basic dialog box appears. The description for the button is in the Tooltips, which are the yellow background words just under the mouse pointer. A more detailed description appears in the status bar, located at the bottom of the window. 2- Either type the the first letter of the part in the Part Name field or scroll scroll down the list list until you see the part part name or number. number. If you type in the first letter the scroll scroll list below will will automatically go to a part with that letter. 3- Select the part by clicking clickin g on the appropriate name in the list box. The part will appear in the Part Name field. 4- To place a part on the drawing drawing page, first click on the Place and Close button. Then move the part to approximately where you want it, and click on the left mouse button. The part will appear to be attached to the mouse icon. Once you click on the left mouse button the part will appear on the page, and still attached to the mouse icon. You can place multiple instances of this part by clicking on the left mouse button each time. When you are placing a part, you will see a package reference (which will designate that part) and a value attribute (which shows the value of that part). 5- When you are are finished, finished, click on the the right mouse mouse button. The part will will no longer longer appear appear to be attached to the mouse icon.
Page 27
EET 300
Computer Applications Manual
6- If you want another part, then repeat items items 2-5. Otherwise, click on the Close button. If you only want one part from this dialog box, after choosing it you can click on the Place and Close button. The Part Browser Basic dialog box closes.
You can click on the Place button in the Part Browser dialog box, rather than the
Place and you to choose another part without opening the dialog box. Close button. This will enable you However, you might find this as difficult, since you will have to move each part after placing it.
The dialog box above will be different for Versions 6.0 and 6.1.
Starting with Version 6.2, it
will be the same.
If you click on the Advanced button, you will see a picture of the part, before placing it (see dialog box on right). To get back to the original shape of the dialog box, click on the Basic button.
Page 28
EET 300
Computer Applications Manual
Adding Parts To A Schematic Using The Get Recent Part List 1- Click on the drop drop down list, list, located on the right side of of the first line of tools.
2- Click on the item you want want to place. 3- Move the mouse onto the drawing page. If you want the part rotated before you you place it, then press
The recent part list shows the most recent parts that you use (the last 10 parts), and would probably be a good source for many of your schematics.
EXERCISE 1-
Open Schematics .
2-
From the Get Recent Parts Dialog box, obtain a resistor and place it on the page, by moving the mouse pointer onto the page and clicking on the left mouse button. Note that R1 is the package reference, and 1k is the value attribute (the default value).
3-
Move the mouse pointer to the right of the first resistor and place a second resistor. Note that this second resistor has a package reference R2.
4-
Click on the right mouse button to stop placing resistors.
5-
Click on the Get New Part icon, and find a part called VDC. Place it to the left of R1. It will be easiest to click on the Place and Close button in Part Browser dialog box.
Page 29
EET 300
Computer Applications Manual
SEARCHING FOR PARTS There might be times where you do not know the abbreviation of the part, and are having a problem finding the part. You can use a description search to find a part (or group of parts) that has that characteristic.
Using The Description Search Feature Of The Part Browser Dialog Box 1- Open the part browser dialog box, by clicking on the Get New Part button located in the toolbar.
.
2- In the description description search field, enter a general general description description of the part (i.e. ground, ground, power power supply). 3- Click on the Search button. A list of those parts, which contain the phrase you entered, will appear.
EXERCISE 1-
In the current drawing page, page, open the Part Browser dialog box. Make sure the Advanced button has been clicked.
2-
In the description search field, type in the word ground, and click on the search field.
3-
Click on each of the ground parts, and observe the description and picture.
Page 30
EET 300
Computer Applications Manual
ARRANGING PARTS Once you have all the parts on the drawing page, page, they need to be arranged. This includes moving them relative to one another and rotating the parts to get the correct orientation. By default, voltage and current sources are placed vertically and passive components (RCL) are placed horizontally. You can also delete parts that were accidentally placed on the drawing page.
Moving Parts 1- Double click on the Visio icon. 2- Select the part by by clicking clicking it. The part part will will turn red. Caution: Caution: Only single-click, do not double-click the part. 3- Move the mouse icon over the part. You will see the mouse icon change, and a double/double white arrow will appear on the lower right of the mouse icon. With the mouse icon on the part, click and hold the part, and move it to the position you want. The part will not move smoothly, but rather snap into position based on the grids (grids are used to make the parts line up). If the grid is not visible, and you want it visible, then select Options…Display Options…Display Options and click in the checkbox next to Grid On. When you paste these circuits to another application application (to be discussed later) it is recommended to turn the grid off 4- If you want to move more than one part at a time, select the first part, and hold down
You can also move a label (either a value or the part number) by repeating items 1 and 2 above.
Page 31
EET 300
Computer Applications Manual
Rotating Parts 1- Select the part part by clicking it. The part part will turn red. red. o
2- Press
Deleting Parts 1- Select the part part by clicking it. The part part will turn red. red. 2- Press
EXERCISE 1-
In the schematic you just created, select both resistors and move them down about 1inch.
2-
Move R1 so that it to the right of the voltage source, and horizontal.
3-
Move and rotate R2 so that it is to the right of R1 and vertical.
4-
Add one additional resistor, and then delete it.
Page 32
EET 300
Computer Applications Manual
CONNECTING PARTS Parts and ports contain one or more pins to which connections are made. Electrical connections are formed by wire and bus segments joining pins and other wire and bus segments. Attaching pins directly to pins also forms connections. Schematics represent each such electrical connection by a junction. Junctions are made visible when three or more connected items converge at the junction. Junctions are created and removed automatically.
Connecting Parts 1- Either click on the Draw Wire button in the toolbar icon changes to a pencil.
, or press
2- Place the tip of the pencil on one of the parts you want to connect, and click the left mouse button. This will anchor the drawing wire at that point. 3- Move the mouse until it is on the next part you want to connect to. The parts will look like they are connected. 4- Click at that that point. The wire will now now anchor anchor at the the next next point. Note: Note: If you need to make a bend in the wire, simply move the mouse in that direction. The wire will continue to be drawn until you click it. 5- You can now move the pencil to a new point, and connect two new parts. 6- When you are finished finished connecting, connecting, click on the the right mouse button button to deselect deselect the Draw Wire tool.
In most circuits, you will need to add a ground. This can be found in the parts dialog box as AGND or EGND.
Once the parts are connected, you can still move them.
They will remain connected. However, make certain that in the Display Options dialog box (choose Options, Display Options in the menu bar) the Rubberband checkbox is checked.
Page 33
EET 300
Computer Applications Manual
CHANGING PARTS ATTRIBUTES Each part has a single or multiple set of values. Parts such as resistors, capacitors, inductors and VDC have just a single value that needs to be changed. The default value is shown in a box next to the part. For example, resistors will have a default value of 1 k Ω, voltage sources will have a default value of 0V. Certain complex sources, such as VSIN, VPULSE, VSRC, etc. must have several values defined before you can begin the analysis.
Changing Single Values 1- Double click on the value of the part. The Set Attribute Attribut e Value dialog box opens. 2- With the value highlighted, highlight ed, type over with a number. You do not have to put in the appropriate units (unless you want to put in mV as opposed to V). 3- Click OK. OK.
Set Attribute Value dialog box
Be careful with abbreviations after parts.
PSpice will not recognize 5M as 5 M Ω − use 5000k instead. The same thing is true about .01F – write it as 10000 µF.
Page 34
EET 300
Computer Applications Manual
Changing Complex Values 1- Double-click on on the p part, art, or select select the part and click on on the Edit Attributes button in the toolbar
. A dialog box will open with the part name.
2- Click on the appropriate line you wish to change. The name and value will appear above in the designated boxes. 3- Double-click in the Value Box field, and type over the appropriate number. 4- Press
PartName dialog box
Page 35
EET 300
Computer Applications Manual
EXERCISE 1-
In the schematic you just created, connect all the parts together, and add an AGND part.
2-
Change the value of R2 to 2k.
3-
Change the VDC value, using the PartName dialog box, to 5 V, and change the Package reference Designator attribute (PKGREF) from V1 to Vin.
Page 36
EET 300
Computer Applications Manual
SAVING A SCHEMATIC FILE Prior to any simulation, you you must save the schematic. You can save a file by using the current name, drive and folder ( File, Save), or change the name, drive or folder to create a file that is separate from the original ( File, Save As). When you first create a schematic file Schematics automatically opens the Save As dialog box.
Saving A Schematic File 1- Choose File, Save to save an existing file as itself, or click on the Save button in the toolbar. If you haven’t saved the file before, the Save As dialog box will open. If you have already saved the file, the changes will be saved with the same file name. 2- If you want to save this file with a different differ ent name, drive or folder, choose File, Save As. As . 3- If the Save As As dialog box appears, fill in the the name of the schematic in the the File name field field in the Save As dialog box, and choose both the drive and folder. 4- Click on the Save button.
Save As Dialog Box
Page 37
EET 300
Computer Applications Manual
COPY/PASTING PARTS To add multiple copies of a part, you can repeatedly click on the left mouse button after selecting that part from the Parts Browser dialog box. If you you have placed a specific part on the schematic, and you want to add additional copies, you can also copy that part. Since this copy will be the same value as the original, it can be very useful when you are have a several values you need to set, such as a voltage source. You can also copy from one file, and paste that same part to a new file.
Copying A Part 1- Select the part. The color of the part becomes becomes red. 2- Copy and paste the part (using shortcut keys, menu bar, or the toolbar). You will see that part on the end of the mouse pointer. 3- Position the mouse pointer where you want the part, and click on the left mouse button. If you want another instance of this part, click again. 4- When you are completed completed with with pasting, click on on the right mouse mouse button.
Page 38
EET 300
Computer Applications Manual
EXERCISE 1- Start a new schematic, and draw the circuit as shown below.
2- Add two more 2k resistors by copying and pasting.
3- Save this file as THEV1.
Page 39
EET 300
Computer Applications Manual
UNDO/REDO Schematics keeps a record of each edit you apply to your schematic. Because of this, you can undo (or reverse) each edit, up to the last time you saved the schematic. If you you used undo too much, you can redo (or reapply) the edits. Both Undo and Redo apply only to design changes that alter the contents of a schematic page.
Undo/Redo 1- Choose Edit, Undo, Undo, or press
.
2- To reverse any undo action, choose Edit, Redo, Redo, or press
EXERCISE 1-
Save the file you just created as RESISTOR (note that the program will automatically put in the extension).
2-
Once saved, add a resistor to the drawing page, delete it, undo that deletion, and redo that deletion. When you are finished with these tasks, you should have the original drawing.
3-
Keep this file open.
Page 40
EET 300
Computer Applications Manual
REDRAW AND ZOOMING If there are additional lines in the schematic that shouldn’t be there, or lines that are missing, the drawing might need to be refreshed. The redraw feature accomplishes this. When working on a design, you can zoom in or zoom out to view a larger or smaller portion of the schematic window.
Using Redraw 1- To refresh refresh your drawing, choose View, Redraw, Redraw , or click on the Redraw button in the toolbar. 2- Click on the appropriate line you wish to change. The name and value will appear above in the designated boxes. 3- Double-click in the value box field, and type over the appropriate number.
Zoom Out
Zoom To Fit Page
Zoom Area
Zoom In
Zoom Button in the Toolbar
Page 41
EET 300
Computer Applications Manual
Button
Function
Menu Bar Method
Zoom In
Click on this button to zoom in on the circuit.
Choose View, In and click on the portion of the circuit you want to zoom in on.
Zoom Out
Click on this button to zoom out.
Choose View, Out and click on the portion of the circuit where you want to zoom out.
Zoom Area
Click on this button, and then click and hold the left mouse button down to draw a box around the area you want to zoom in on. When you release the mouse button, that area will fill the entire drawing page.
Choose View, Area and then click and hold the left mouse button down to draw a box around the area you want to zoom in on. When you you release the mouse button, that area will fill the entire drawing page.
Zoom to Fit Page
Click on this button and the circuit will fill the entire drawing page. This is useful if you zoomed in on an area too far and you want to see the entire circuit.
Choose View, Fit and the circuit will fill the entire drawing page. This is useful if you zoomed in on an area too far and you want to see the entire circuit.
You can also choose View, Entire Page from the menu bar. entire drawing page, including border and title block.
Page 42
This will enable you you to see the
EET 300
Computer Applications Manual
WORKING WITH WORD 97 If you want to incorporate a schematic into your report, the best way would be to copy/paste the schematic into your Word document.
Copying Schematics Into Word 97 1- Choose Options, Display Options, Options, and click off Grid On. 2- In the Schematics window, Schematics window, point the mouse above and to the left of the schematic. 3- Click and hold the mouse button, and drag to the right and below the schematic. You will see a rectangular box surrounding your schematic. Make sure this box surrounds the entire schematic, and there is about ½ inch border between the box and the parts. 4- Choose Edit, Copy to Clipboard. Clipboard. The schematic can now be pasted into another Window application, application, such as Word W ord 97. 5- In Word 97, choose Edit, Paste Special. Special . The Paste Special dialog box appears. 6- In the right side of this dialog box, you will see a checkbox with the description descripti on Float over text . Make sure the checkbox is not checked, then click the OK button. You need to do this this to prevent the schematic schematic from having a frame around it. Without a frame, you can position position the schematic using using the formatting toolbar – left, center, center, or right. If you didn’t uncheck this box, you could move the schematic anywhere in the page. However, this can cause problems. 7- If you click once in the schematic, you will see 9 small boxes around the picture, as well well as a Picture toolbar. You can move the mouse to the lower right box, click and hold the mouse button down, and then you can resize the schematic by dragging diagonally. 8- You will will see a line around around the schematic. schematic. If you want want to get rid of the line, click on on the cropping button in the Picture toolbar, , and then move the mouse pointer over the four middle boxes boxes in the picture, click and drag then then inwards. When you click outside the picture, you should not see the lines.
It might be easier to first crop the picture and then resize it.
Page 43
EET 300
Computer Applications Manual
EXERCISE 1-
Open both PSpice and Word 97. If you you have another word processing application, you can still perform this exercise. However, you will need to understand how to crop a picture.
2-
In PSpice, place a VDC part and two resistors. Drag a box around those three parts, paste them into your word processing program, and center the drawing in the page.
3-
Using the cropping tool, get rid of the outside border lines
Page 44
EET 300
Computer Applications Manual
MEASUREMENTS - DC ANALYSIS If you want to measure DC levels (i.e. for experiments involving Ohm’s law or Kirchoff’s law) you can use two parts to view these levels. These parts are placed on the schematic drawing the same way any other part is placed. VIEWPOINT is a voltage viewing point, which will show the value after the circuit is simulated. You place VIEWPOINT on a node. IPROBE is a current probe, which will show the value after the circuit is simulated. You need to put this part between two parts, so that current flowing in that branch can be measured. If you have measurements that are time-varying (i.e. a sinusoid) then you need to run Probe. This section will deal with simple DC analysis.
DC Analysis 1- Place VIEWPOINT VIEWPOI NT and/or IPULSE in the appropriate points. You place the VIEWPOINT VIEWPO INT part at a node. To place the IPULSE part, you will have to break the circuit. 2- Save the drawing. 3- Choose Analysis…Simulate from the menu bar, or click on the Simulate button in the toolbar. 4- If there are no errors, you will see the PSpice dialog box and hear a click. Move the mouse anywhere in the schematic page and click the left mouse button. You will see the values on the VIEWPOINT or IPULSE parts. If there is an error, you will see an Error dialog dialog box. If you click on the OK button, you will bring up the MicroSim MicroSim Message Viewer dialog box. Anything with a red Error message needs to be corrected.
Page 45
EET 300
Computer Applications Manual
PSpiceAD dialog box
MicroSim Message Viewer
Page 46
EET 300
Computer Applications Manual
EXERCISE 1-
In the RESISTOR file, add a VIEWPOINT and IPROBE part.
2-
If there were no errors, you should see the PSpiceAD dialog box
3-
Close the PSpiceAD dialog box. The schematic should now show numbers for both the voltage and current through R2.
4-
Change the value of R2 to 5K, run the simulation again, and observe the new values.
5-
Delete the AGND part, and run the simulation again. You should see an error, which needs to be fixed by adding the AGND part.
6-
Save this file.
Page 47
EET 300
Computer Applications Manual
EXPLANATION OF PROBLEMS At the end of each chapter there will be several problems based on what was covered in the chapter. Besides doing the required steps, you are encouraged to experiment by
• • • •
Changing values of components Adding/deleting components Changing the measuring points Changing the amplitude or type of input
You will be required to hand in a report based on these problems. This report should include the following: 1. A title page page with your name 2. An introductory section detailing what you you think you will be accomplishing in this exercise, what new concepts you will be learning, and what if any additional items you tried. 3. Detailed calculations (similar to a pre-lab) which will demonstrate what you expect to see. This may involve mathematical proof of responses. 4. Printouts of the schematic(s) and of the responses. These printouts should be pasted into the Word document, as opposed to being printed out. If there is a problem doing this, see me during office hours. 5. A brief conclusion as to the observations, how close they came to the “pre-lab” calculations, and how do you think this exercise could have been changed.
Page 48
EET 300
Computer Applications Manual
PROBLEM 1 1-
Place the following components on a new drawing page: 4 Resistors, VDC and AGND.
2-
Move and rotate the components so they appear as in the figure below.
3-
Wire the components together.
4-
Change the values to the components as follows: V 1=100, R1=7.5k, R2=5k, R3=3k and R4=2k. (Note that you do not have to put in Ω for the resistors). You might have to move the value box away or nearer the part.
5-
Add two VIEWPOINT objects to the drawing- one attached to the right of R 1, the other on top of R 4. You should have the figure below.
6-
First calculate the voltage at the two VIEWPOINT VIEWPOINT objects. Show the calculations.
7-
Save the drawing first, as CHAP3-1.
8-
Run a simulation, and compare the values to those from item 6.
9-
Change R2 to 2k, and R4 to 4k. Calculate first, and then run the simulation again.
10-
Save this again and close out of this file.
Page 49
EET 300
Computer Applications Manual
LESSON 3 - TRANSIENT ANALYSIS WITH RC AND RL CIRCUITS You will Learn:
How to use the pulse voltage source.
How to set up and perform a transient analysis.
How to use special markers for the schematic.
How to modify the graph appearance.
How to print graphs.
How to copy and paste the schematic or graph to another program.
How to sweep a component value.
How to use the VPWL source.
How to use the Differentiator and Integrator parts.
How to work with custom axis.
Page 50
EET 300
Computer Applications Manual
PULSE VOLTAGE SOURCE In analyzing a circuit that has a voltage source switched at t=0, you can simulate this by using a pulse voltage source (VPULSE). Various parameters must be set for this source.
Setting A Pulse Voltage Source 1- Select from the Part Browser Browser dialog dialog box box VPULSE. VPULSE. 2- Place it on the drawing page. 3- Double-click Double-cli ck on the part. The VPULSE dialog box opens. 4- Type in zero for V1 (unless you want a positive and negative pulse). Type in the desired amplitude (don’t need the unit V) for V2. 5- Type in values for TR and and TF, at at least 1/100
th
of the pulse width.
Unless you are going to choose an extremely narrow pulse, a choice of 1ns for each of the two values would be appropriate. Do not have a space between the value and the units . 6- Type in a value for PW. 7- Type in a value for the PER. This value will depend on whether you want to see multiple cycles (then type in a value 2 or 3 times the pulse width) or only one cycle (then type in a value at least 10 times the pulse width). 8- Click OK.
Page 51
EET 300
Computer Applications Manual
UNIT STEP In many instances, you will be required to set up a circuit with a unit step function. This function would also be used to solve initial and steady state conditions in circuits, where you have a DC source and a switch that closes at DC. The VPULSE part can be used to set up a Unit Step.
Setting up a Unit Step Input 1- Follow the procedure on the preceding page for setting up a VPULSE part. 2- When you are setting setting up the value value of PW, this value value must be at least least 5 times the time constant of the system. If you do not know the time constant of the system, you can set the value of the PW to several seconds. The circuit will view this “wide” pulse as a switched DC, or a unit step function.
Page 52
EET 300
Computer Applications Manual
SETTING UP THE TRANSIENT ANALYSIS To run a transient analysis on the pulse waveform, the Transient dialog box must be filled in.
Transient Dialog Box 1- Choose Analysis…Setup from the menu bar, or click on the Setup Analysis Analysis button in the toolbar
. The Analysis Setup dialog box opens.
2- Click on the Transient button in the Analysis Setup dialog box. The Transient dialog box opens. 3- Type in the appropriate appropriate values values for the Final Time. If you want to see multiple waveforms, then the Final Time should be at least twice the value of PER. If you want to see an expanded view of the rise time, then the Final Time value should be approximately approximatel y 1.2 times the PW. You do not have to change the Print Step value unless you only have a resistive circuit (do not set it to zero). If you need to change the Print Step value (because the analysis is incrementing too slowly), th make sure Print Step is at least 1/100 of the Final Time. 4- Click OK, OK, and then Close. Close.
Page 53
EET 300
Computer Applications Manual
Analysis Setup Dialog Box
Transient dialog box
Page 54
EET 300
Computer Applications Manual
PERFORMING THE TRANSIENT ANALYSIS Once the VPULSE part, the Transient Dialog box, and the rest of the circuit are set up, transient analysis can be performed. Since usually both the input and output need to be observed, this can be set before running the simulation.
Performing The Transient Analysis Analysis 1- Save the schematic. Place markers on the schematic to indicate the points for which you want to see simulation waveforms displayed in Probe . Placement can occur occur before or after after simulation takes place. place. Use Mark Voltage/Level markers for this part. 2- Choose Analysis…Simulate from the menu bar, or click on the Simulate icon in the toolbar. If there are no errors, you will see the PSpice dialog box, and on the bottom of this dialog box you will see numbers changing. When the iterations are completed, you will hear a click, followed by a display of the Probe window. Probe window. 3- If there are errors, you need to choose File…View Messages from the menu bar. Read the error messages and take appropriate action. 4- If you want to modify the schematic, click on the Schematic button in the Taskbar (Windows (Wi ndows 95). Then repeat step 2. You do not have to repeat step 2 if you are only adding additional markers .
When the graph appears, you will see a window with PROBE in the title bar, and in Windows 95/98 the Taskbar will contain the Probe button. You will also see at the bottom of the graph a color indicating which point on the circuit you are looking at, i.e. for a resistor R1, V(R1:1) represents the left side of the resistor (if you are looking at a horizontal resistor) while V(R1:2) is the right side of the resistor.
Page 55
EET 300
Computer Applications Manual
CHANGING BACKGROUND COLORS IN PROBE The default colors in Probe are a black background with a white axis. Although this might be acceptable when viewing on a monitor, it is very difficult to see when you copy to a Word document (to be shown later). You can change the default colors so that you have a white background.
Color Change In Probe 1- Locate the file called msim_evl.ini in the C:/windows C:/windows directory. directory. It is not the file called msim_ev.ini. (must have have evl after the underline). underline). You can use either either Windows Explorer Explorer or use the Find feature of Windows 95. 2- If you double double click on the icon icon to the left of the file name, this file should should open open in Notepad. Notepad. If it doesn't, then open it in Notepad (although you can also open it in Word). Make sure that PSpice is closed. 3- In Notepad, choose Search…Find, Search…Find , type in the words PROBE DISPLAY COLORS, COLORS, and then click the FIND NEXT button. You should go to the section you need to modify. 4- In the next several lines, you are going to change the Background, Foreground and Trace_1 and Trace_3 values. The original Trace_1 value is BRIGHTGREEN, BRIGHTGR EEN, which is very hard to see on top of a white background. The first 5 lines of the PROBE DISPLAY COLORS COLORS section should look like the following: [PROBE DISPLAY COLORS] NUMTRACECOLORS=6 BACKGROUND=BRIGHTWHITE FOREGROUND=BLACK TRACE_1=BRIGHTBLUE TRACE_2=BRIGHTRED TRACE_3=BRIGHTGREEN 5- Save these changes, and then reopen PSpice.
Page 56
EET 300
Computer Applications Manual
EXERCISE 1-
Place VPULSE, AGND, R and C parts on the drawing page, move and connect them so you get the schematic as seen below. Make sure you change the C1 value to 1 uF.
2-
Setup VPULSE for a pulse width (PW) of 1ms, a period (PER) of 5ms, V1= 0 and V2 = 5. Make sure you put in appropriate values for TR and TF.
3-
Go to Setup Analysis, and in the Transient analysis set Final Time to 10ms.
4-
Place a voltage marker at the input (at the top of V1) and the output (at the top of the capacitor).
5-
Save this file as RC.
6-
Click on the Simulate button in the toolbar. If there are no errors, you should see the PSpiceAD window come up, various numbers change on the bottom, and then the Probe graph window appear, with graphs showing both the input and the output (see next diagram). If you you have a black background, change the setting in the msim_evl.ini file, as detailed in the previous page.
Page 57
EET 300
Computer Applications Manual
7-
Go back to the Schematics window, change the value of the capacitor to 0.2uF, and run the simulation again.
8-
Keep this file open.
Page 58
EET 300
Computer Applications Manual
SPECIAL MARKERS Instead of using markers, which will name the trace based on the part it is attached to, you can use a special part called a BUBBLE. You can give this part any name, and it can be used to mark the traces as Vin, Vout, etc.
Using Bubbles 1- Click on the Get a new part button in the toolbar, and choose Bubble from the drop down list. 2- Place the bubble bubble part at the point(s) point(s) of interest (delete the Voltage/Level Voltage/Level markers). 3- Double-click on each bubble. The Set Attribute Value dialog appears. Type in the name for the bubble. 4- Click on Analysis…Simulate to run PSpice . If the setup was done properly, Probe should Probe should run and you will see a blank graph. 5- In the Probe menu Probe menu bar, choose Trace…Add. Trace…Add. The Add Traces dialog box appears. 6- From the left-hand column of this box click on the appropriate name. You can hold down
You can delete any trace by clicking on the legend for the trace (located in the lower left portion of the graph) and pressing
The Add Traces dialog box can also be used to display complex functions of voltages and currents, i.e. power.
If you you use the bubble part, label it with names such as input or output. next to the name.
Page 59
Probe will add the V
EET 300
Computer Applications Manual
EXERCISE 1-
Delete, in the previous schematic, the Voltage/Level markers, and place a Bubble part on top of the VPULSE and the capacitor.
2-
Double-click on each of the Bubble parts, and put in the label Vin and Vout.
3-
Run the simulation. You should get a blank graph in the Probe window.
4-
In the menu bar of the Probe window, choose Trace, Add, select Vin and click OK.
5-
Repeat item 4 for Vout. You should now have a graph that is labeled with Vin and Vout.
6-
Keep this file open.
Page 60
EET 300
Computer Applications Manual
MODIFYING GRAPHS There are many ways to modify the graphs. Changes include axis setting, adding labels to a curve, or adding a cursor to the plot.
Changing Axis 1- Choose Plot and either X Axis Settings or Y Axis Settings. Settings. A dialog box will appear. 2- To change the scale, click in the radio box next to the words User Defined, Defined, and enter the new scale below. To go back to the original setting, select Auto Range in the Data Range field. 3- You can add an Axis Title as well, by typing in that field. 4- Click OK. OK.
Page 61
EET 300
Computer Applications Manual
Adding Labels To Curve 1- Choose Tools, Label. Label. You will see a drop down list. 2- If you want a text label then choose Text, Text, and type in the desired text in the dialog box. To choose just text you can also click on the Text Label button in the toolbar. When you click OK, OK, the mouse pointer will change to a pencil. You can move the mouse around and place the text anywhere you want, and then click the left mouse button to fix the position. 3- You can also use other Label items, such as lines, arrows and boxes. To use an arrow, choose Arrow from the drop down list, move the mouse away from the point of the graph you want the arrow to point to. Click, and then move the mouse towards the point you want the arrow to show. Note that an arrow is always at the line end. 4- If you typed text, and want to modify or delete it, double click on the text. The dialog box will appear, and either edit what is in the dialog box or delete it, and then click OK. OK.
Adding A Cursor To The Plot 1- Choose Tools, Cursor, Display, Display, or click on the Toggle Cursor button in the toolbar. A display box appears in the lower right hand corner of the graph, entitled Probe Cursor. Probe Cursor. This will show values for both axes. 2- Click with the left mouse button anywhere in the graph. A dotted vertical white white line appears (this is the cursor). If the graph is anything but a pulse, pulse, you may see a horizontal horizontal and vertical dotted line. You can click and drag the cursor over the curve, and observe the changes in the values in the Probe Cursor Probe Cursor display box. 3- To select which which trace the cursor cursor is measuring, click click on the icon next to the axis axis label (located in the lower left part of the graph).
Page 62
EET 300
Computer Applications Manual
EXERCISE 1-
In the Probe graph you have opened, change the X-axis to 5 ms.
2-
Add an arrow, pointing to the peak of the output.
3-
Add a label entitled Maximum.
4-
Add a cursor to Vout.
Page 63
EET 300
Computer Applications Manual
PRINTING AND COPYING GRAPHS There are two ways to get hardcopy of your graphs: printing them or copy them to another application (such as Word).
Printing Graphs 1- In the Probe window, Probe window, choose File…Print from the menu bar. If a graph does not appear, make sure that the appropriate printer is chosen (one that can print graphs as well as text). You can see what printer is chosen by choosing File, Printer, Select from the menu bar..
Copying Graphs 1- In the Probe window, Probe window, choose Tools, Copy to Clipboard. Clipboard. The graph can now be pasted into another Window application application,, such as Word. If you are using Word 97, then you should should use Edit, Paste Special, Special , and uncheck the “Float over text” checkbox. 2- Select a new new folder in the Choose a Drawing Template dialog box and click on the Open button. The folder represents represents a group of templates. templates.
EXERCISE 1-
Print the graph directly from Probe.
2-
Open a new Word document, and type the word Schematic and then press
3-
Copy and paste the schematic to this new document.
4-
Press
5-
Copy and paste the graph in the Probe window to this document.
Page 64
EET 300
Computer Applications Manual
SWEEPING A COMPONENT VALUE There are tests that might require you you to sweep a component through a range of values. To do this, a three-step process is needed.
Changing the Component Value to A Variable 1- Double click click on the Value Attribute Attribute (the components components magnitude). magnitude). The Set Attribute Value Value dialog box opens. 2- Type in an expression, such as RLOAD or ROUT, ROUT, make sure you encase this expression in curly braces braces {}, and then click OK. OK. You might want to move this label, by pointing to the label and clicking and hold and drag this label to a new position.
Defining the Value as A Variable 1- Click on the Get New Part butto button n on on the the too toolba lbar. r.
. The Part Part Brows Browser er dialo dialog g box box ope opens ns..
2- Select from the list the PARAM part. 3- Click on the Place and Close button, move the mouse pointer to an empty area (i.e. above and to the right of the schematic) and click on the left mouse button. 4- Click on the right mouse mouse button. 5- Point to the word PARAMETERS, PARAMETERS, and double click on it. The PartName dialog box opens. 6- Enter the name you chose for this component in the NAME1 field, and enter the original value of this component in the VALUE1 field. 7- Click OK. OK.
Page 65
EET 300
Computer Applications Manual
Global Sweep 1- Click on the Setup Analysis button in the toolbar. opens.
The Analysis Setup dialog box
2- Click on the DC Sweep button. The DC Sweep dialog box opens. 3- Select Global Parameter in the Swept Var. Type field. 4- Enter the name of the component and the range of the sweep (the start value, end value, and the increment). 5- Click OK, OK, and then click Close. Close.
DC Sweep dialog box
Page 66
EET 300
Computer Applications Manual
EXERCISE 1-
Draw the circuit below, defining the last resistor as a variable RLOAD.
2-
Setup the sweep with Start Value of 100, End Value of 100k, and Increment of 100.
3-
Add a voltage level marker at the top of R4.
4-
Run the simulation.
5-
Add a cursor to the graph, and measure the voltage amplitude. See how it approaches a certain value.
6-
Try doing the same thing using a Current/Level marker.
Page 67
EET 300
Computer Applications Manual
USING THE VPWL SOURCE When you want to create a custom voltage source, you can use the VPWL part. This will allow you to define different voltage levels for up to 10 different time points. This source can be very useful in creating a linear voltage waveform to analyze RMS, average, integration and differentiation of piecewise linear voltage waveforms.
Setting Up the VPWL Source 1- Set up up a circuit with with a VPWL source. source. 2- Double click on the VPWL VPWL source. The PartName PartName dialog dialog box box opens. opens. 3- Enter the values values for the voltage, voltage, and the the time that voltage voltage occurs. 4- To view the waveform, place a resistor across the source (use the default value) and an AGND part. Place a Voltage marker marker at the top of the resistor, and run a transient transient analysis. Make sure that the Final Time is set so you can see the entire waveform.
To create most waveforms, you might want to start at 0, which means that V1 and T1 should be 0.
If you want to create a square wave, then T1=T2.
Page 68
EET 300
Computer Applications Manual
EXERCISE 1-
Set up a VPWL source with the following parameters: T1=0, V1=0, T2=2, V2=2, T3=4, V3=0.
2-
Add a resistor and AGND part.
3-
Set the transient analysis analysis to the following: Print Step = 1 ms, Final Time=5s. Add a voltage marker to the top of R1.
4-
Save this file with a name WAVEFORM, and run the analysis. You should see an triangular waveform, with an amplitude of 2V and a pulse width of 4s.
5-
Keep this file open.
Page 69
EET 300
Computer Applications Manual
USING THE DIFFERENTIATOR AND INTEGRATOR In working with mathematical expressions such as differentiation and integration, you can add a part to the schematic that will accomplish these expressions. These are single input, single output parts.
Using Mathematical Parts 1- Click on the Get New Part button. 2- Select either either the part DIFFER (for differentiation) differentiation) or INTEG (for integration). integration). 3- If you are just viewing the effects of differentiation or integration on a waveform, place this type of part immediately after the source, and place a resistor (use the default value) as an output. Make sure you use an AGND part.
EXERCISE 1-
Using the VPWL source you just created, insert a DIFFER part between the source and the resistor.
2-
Add another voltage probe, so you have one before and after the DIFFER part.
3-
Run a simulation. Compare the output to what you you would expect the differentiated waveform to look like.
Page 70
EET 300
4-
Computer Applications Manual
Repeat steps 1-3 with the INTEG INTEG part. Note: You can also replace parts by clicking on that part, choosing Edit, Replace and then typing in the part name.
Page 71
EET 300
Computer Applications Manual
WORKING WITH CUSTOM AXIS Besides being able to plot standard values such as input or output voltages or currents, Probe allows you to plot calculated plots (i.e. voltage times current) or functions (i.e. derivative of the output voltage waveform). You also have functions which will be useful for plotting Bode plots (log) and also for finding average and rms values.
Generating A Custom Axis 1- In the Probe window, Probe window, choose Trace, Add. Add. The Add Traces dialog box appears. 2- To create a simple simple expression expression (i.e. Vout/Vin), Vout/Vin), click on the first Variable Variable in the expression expression.. You will see it appear in the Trace Expression field (located at the bottom of the dialog box). 3- Click on a Function (located on on the right right half of the dialog box). box). This function will appear appear after the first variable. 4- Continue to add the appropriate appropriat e Variables and Functions. If you are using a function with a parenthesis ( ), make sure that the cursor is in the middle of the parenthesis before clicking on a Variable (i.e. LOG10 (Vout)).
Page 72
EET 300
Computer Applications Manual
Some of the expressions you may need for the labs in this course are as follows:
Function
Meaning
AVG(x)
Running average of x over the range of the x-axis variable.
AVGX(a,b)
Running average of x for a range – from the point a on the x-axis to the point b on the x-axis.
D(x)
Derivative of x with respect to the x-axis variable.
DB(x)
Magnitude in decibels of x.
LOG10(x)
log (x)
LOG(x)
ln(x)
P(x)
Phase of x (in degrees)
PWR (x,y)
x
RMS(x)
Running RMS average of x over the range of the x-axis variable.
S(x)
Integral of x over the range of the x-axis variable.
y
Note that you could do differentiation and integration using functions as well as the parts.
Page 73
EET 300
Computer Applications Manual
EXERCISE 1-
From the previous exercise, delete the integrated waveform (leave the original triangular waveform alone).
2-
Add the average waveform to this plot, using the function (the voltage should be V(R1:2). Note that this waveform is the average at each instant of time.
3-
Try adding the RMS value as well. See if you can explain the differences.
Page 74
EET 300
Computer Applications Manual
PROBLEMS 2-5 PROBLEM 2 1-
Create a waveform with the following characteristics, using the VPWL source: T1=0, V1=0, T2=1, V2=1, T3=2, V3=1, T4=4, V4=0.
2-
Integrate and differentiate the waveform, both theoretically and using PSpice.
3-
Create the figure shown in Fig. P2-60 (only the first two waveforms) using the VPWL source. Differentiate and integrate this waveform theortically and with PSpice.
PROBLEM 3 1-
Create a voltage waveform, using the VPWL source, with the following parameters: T1=0, V1=0; T2=3, V2=5; T3=6, V3=0. Place a 1k resistor across this source. Note that V and s are assumed units if they are not specified.
2-
Place a BUBBLE part at the output (across the resistor), call that part Vout,.
3-
Use the Set Up button to run a Transient Analysis. Set the Print Step to 2ms and the Final Time to 10s. Run the simulation.
4-
Add the trace Vout to the graph and observe the waveform.
5-
Add another plot to this graph, and add a trace to that new plot with the function AVG(Vout).
6-
Place a cursor on the upper graph, and move the cursor until it is at 6s. Read the value of the upper graph, and compare it to the calculated average for this triangular waveform.
Page 75
EET 300
Computer Applications Manual
PROBLEM 4 1-
Place the following components on a new drawing page: 1 Resistor, VSIN, 1 Capacitor and AGND.
2-
Move and rotate the components, and wire them together. Also add two voltage markersone at the input, and one at the output.
3-
Change the capacitor value to 1u.
4-
Set the values of VSIN as follows: VOFF=0, VAMPL=10V, FREQ=1000.
5-
Set the Transient values to 1us for the Print Step, and 2 ms for the Final time.
6-
Run the simulation and observe the two curves. Which voltage (input or output) leads, and approximately by how much. How do you you calculate phase?
7-
Replace the position of the resistors and capacitors. What happens to the phase relationship between the input and output voltage.
PROBLEM 5 1-
Solve problem 4-17 for the voltage and current waveforms, using PSpice. Estimate theoretically what the initial and steady state condition should be. Does it conform to the Probe waveform?
Page 76
EET 300
Computer Applications Manual
LESSON 4 – LAPLACE TRANSFORMS USING MATHCAD You will Learn:
How to perform the Laplace transform and inverse transform in Mathcad.
How to solve for the roots of an equation.
Page 77
EET 300
Computer Applications Manual
LAPLACE TRANSFORMS
MathCAD can enable you to perform both Laplace transforms and inverse Laplace transforms. The best way to accomplish this is to use the Symbolic Keyword Palette.
Laplace Transforms 1- Set up a variable, such as v(t), and assign it to an expression, such as sin(t). 2- Type the variable variable below, and click on the laplace button located in the Symbolic Keyword Palette. You will see the word laplace, followed by a comma, a placeholder and an arrow. 3- The placeholde placeholderr is for the variable. Type in t, and press press
Inverse Transform 1- Set up a variable, such as V(s), and assign it to an expression that is a function of s. Remember that the order of the denominator must be greater than the order of the numerator. 2- Type the variable variable below, and click on the invlaplace button located in the Symbolic Keyword Palette. You will see the word invlaplace, followed by a comma, a placeholder and an arrow. 3- The placeholder is for the variable. Type in s, and press
Page 78
EET 300
Computer Applications Manual
From the worksheet Laplace Transform.mcd
Laplace Transforms v( t )
sin ( t ) 1
v ( t ) laplace , t s
2
1
Now, look at the inverse transform. If we type the same expression as above, we should get the original function sin(t)
1
V( s ) s
2
1
V( s ) invlaplace , s
sin ( t )
ASSIGNMENT 4 1.
Solve equation 5-48 theoretically, and show the solution with MathCAD. Are they different, and if so why?
2.
Practice with other examples in the textbook.
Page 79
EET 300
Computer Applications Manual
ROOTS OF AN EQUATION
When you need to solve the inverse Laplace transform, you will need to factor the roots of an equation. MathCAD enables you to type type in an equation, and solve for the roots, whether they are real or imaginary. The equation you will be solving in EET300 will generally be of the order 2
a .x
b .x
c
Solving for the roots of an Equation 1- Define the coefficients of each each order, order, for example a, b, and and c. 2- Type in the equation. 3- From the Symbolic Keyword Palette, click on the solve button. You will see the word solve, followed by a comma, a placeholder and an arrow. 5- Type in the independent variable, such as x in the example above, and press
From the worksheet Quadratic Equation.mcd
Consider the General form of a second order polynomial 2
a .x
b .x
c
To solve this equation, first define a, b and c a
1
b
2
c
3
Then to solve the equation 2
a .x
b .x
c solve
,
x
1
i
.
2
1
i
.
2
For any other second order polynomial, change a, b or c
Page 80
EET 300
Computer Applications Manual
PROBLEMS 6-7 PROBLEM 6 1-
Draw the circuit in Figure 6-49 in PSpice.
2-
Derive the output v(t) theoretically, using Laplace transforms. Do not use Mathcad for the transforms (do it by hand).
3-
From the output v(t) you derived theoretically, use Mathcad to plot this voltage, and paste this plot in Word.
4-
Use a VPULSE generator in place of the 10V source and switch with the following parameters: V1=0 and V2=10 TR and TF = .01us PW=10 and PER=20
5-
Run the simulation with the Setup dialog box as Transient, Print Step= 20ms, and Final Time=7000ms. Copy this plot to word
6-
Observe what happens and compare it to the theoretical analysis from step 3.
PROBLEM 7 1-
Analyze, both theoretically and with PSpice, problem 6-25.
2-
Try to do problem 6-26. See if you can determine how to do it with PSpice (you (you should be able to do it theoretically, and use Mathcad to plot the final output voltage).
Page 81
EET 300
Computer Applications Manual
LESSON 5 – LAPLACE TRANSFORM IN PSPICE
You will Learn:
How to use the Laplace component in a circuit
Page 82
EET 300
Computer Applications Manual
USING THE LAPLACE COMPONENT You can analyze the effect of a system with a specific Laplace transform by utilizing the Laplace component. This component allows you to specify both a numerator and denominator. To analyze the effect of the transform, you need to have an input (either a pulse or sine wave), the setup (either an AC sweep or transient), a resistive load on the output, and a ground. The resistive load will not be part of the circuit in analyzing the response. Therefore, the response you will observe will be strictly due to the Laplace component, and not as a result of voltage division between the resistor and the Laplace component.
Using the Laplace Component 1- Set up a circuit with a VPULSE source, a LAPLACE component in series, a resistor in series with the LAPLACE component, and a ground (AGND). 2- Double click on the VPULSE component and set up the parameters (see Lesson 2). Note: Note: You want to set up the pulse width parameters based on the time constants of the 1 transform. For example, example, if the the transform is , then you want to specify the PW (pulse s +1 width) of the VPULSE component as 1s (1 second), if you want to see the entire response. 3- Double click on the LAPLACE component and specify the numerator and denominator. If 2 3 you want higher order, type in s*s to represent s , and s*s*s to represent s . 4- Place a voltage marker on the input, and another one on the output. 5- Type in the appropriate appropriate values values for the Print Print Step and Final Time in the Transient setup. setup. Make sure that the Final Time is no more than 1000-2000 times the Print Step (otherwise the simulation will take a long time). 6- Run the Simulation. You should see the output in the Probe window that represents the Laplace transform.
Do not include the resistor in the analysis of the circuit (i.e. use the resistor as a voltage divider). Only consider the Laplace transform block.
Page 83
EET 300
Computer Applications Manual
PROBLEMS 8-9 PROBLEM 8 1- Setup up the circuit as shown below, with the LAPLACE component set to the default of 1 , and the resistor set to 1, and the VPULSE component set to 1us for the rise and fall s +1 time, 1s for the PW, and 10s for the PER. Make sure that you use the AGND component. Also, set V1 to 0, V2 to 5.
2- Place two voltage markers (one on the input, and one on the output). 3- In the Transient setup, set the PRINT STEP to 10ms, and the FINAL TIME to 5s. 4- Run the simulation. The graph should appear as shown below. Verify theoretically that this is the correct answer, by plotting your theoretical answer with Mathcad, and comparing to PSpice.
Page 84
EET 300
Computer Applications Manual
PROBLEM 9 1. Set the LAPLACE component to
1
, and run the simulation. Observe the graph, graph, and s+2 describe the differences between Exercise 1.
2. Develop the theoretical solution to transform
5 , and compare to the graph in step 1. s + 2 s 1
3. Put another LAPLACE component in series, and set it to the same value as in step 1 of Exercise 2. Run the simulation, observe the graph, graph, develop the theoretical solution to the transform, and compare. Make sure you have voltage markers at the input and at each output of the LAPLACE component. 4. Change the second LAPLACE component to
1 s +1
, run the simulation, observe the graph,
and develop the theoretical solution. 5. Change the denominator in the first LAPLACE component to s, run the simulation, observe the graph, and develop the solution. Comment on why you are seeing the specific graph. 6. Repeat items 2-4 with a VSIN component. Set the frequency to 1 Hz (see page 92 for additional information on the VSIN component). You should do the theoretical work as well as the PSpice examples, and plot the theoretical results with Mathcad. You must do the theoretical results by hand (not use Mathcad to perform the transforms).
Page 85
EET 300
Computer Applications Manual
LESSON 6 – SINUSOIDAL STEADY STATE IN PSPICE You will Learn:
How to measure differences with cursors
How to delete a trace
How to mark specific values on the graph
How to generate multiple plots on a graph
How to use the VSIN source
How to simulate a Bode plot
Page 86
EET 300
Computer Applications Manual
MEASURING DIFFERENCES WITH CURSORS There are actually two cursors that you can activate; one with the left mouse button and one with the right mouse button. By moving moving these cursors around, you can measure both time and amplitude differences.
Setting Up Multiple Cursors in Probe 1- With the Probe window Probe window open, click on the Toggle Cursor button in the toolbar.
.
2- If you have two waveforms, you can associate a cursor with each waveform. Point to the legend symbol , located in the lower left portion of the graph, and click on one of the legend symbols with the left mouse button. You will see a closely spaced dotted line around that legend. This is cursor A1, as seen in the Probe Cursor display box. 3- Point to the other legend symbol, and click with the right mouse button. You will see a loosely spaced dotted line around that symbol. This is cursor A2, as seen in the Probe Cursor display box.
You can have two cursors even if there is only one waveform (i.e. output voltage).
If you you click on the left mouse, you will bring up cursor A1. If you click on the right mouse, you you will bring up cursor A2.
If you click and hold on the title bar of the Probe Cursor display box, you can reposition it.
Page 87
EET 300
Computer Applications Manual
Moving Cursors 1- Position the mouse pointer to the place on the waveform where you want the cursor. Click on either the left or right mouse button (depending on whether you want A1 or A2 cursor).. 2- To move the cursor position, click and hold on either button, and drag the mouse to the desired direction. 3- For finer cursor movement, movement, press the the right or left arrow key for the A1 cursor, cursor, and
The difference calculation is A2 (the right mouse button cursor) minus A1 (the left mouse button cursor). You might want to position the appropriate cursors to get a positive difference.
Deleting A Trace 1- Click on the legend name (not the symbol) of the trace you want to remove. It will change to a red color. 2- Press
EXERCISE 1-
Open up the RC.sch file you created in the exercise on page 57. If you do not have this file, recreate it.
2-
Perform a simulation, and add traces for Vin and Vout.
3-
Assign A1 cursor to Vin, and A2 cursor to Vout.
4-
Move either cursor and observe the changes in the Probe Cursor display box.
5-
Delete the Vin trace, and change the X-axis to 2 ms.
6-
Measure the time difference between t=0 and the point where the voltage is 63% of maximum. You will need both cursors. Compare that value to the rise time.
7-
Move the Probe Cursor display box to the middle right portion of the graph. Keep this file open
Page 88
EET 300
Computer Applications Manual
MARKING SPECIFIC VALUES ON THE GRAPH If there are specific points on a graph you wish to mark, you you can do so using the cursor. You can also reposition these marked points.
Marking Coordinate Values 1- Activate the cursor by clicking on the Toggle Cursor button in the toolbar.
.
2- Move the cursor to a specific point. 3- Choose Tools, Cursor, Freeze from the menu bar. 4- Click on the Mark Label button in the toolbar. The x and y coordinates will be displayed near that point, along with a line pointing to the specific point.
Moving the Marked Coordinate Values 1- Choose Tools, Cursor, Freeze. Freeze . 2- Click and hold on the marked coordinate values that you want to move, and drag them to the new location. 3- Double-click Double-clic k in the value box field, and type over the appropriate number.
Removing the Marked Coordinate Values 1- Choose Tools, Cursor, Freeze. Freeze . 2- Click on the marked coordinate values you want to remove, and press
Page 89
EET 300
Computer Applications Manual
EXERCISE 1-
From the previous example, move the right cursor (A2) to the Y-axis.
2-
Position the A1 cursor somewhere on the graph, and mark the coordinate values.
3-
Do that two additional times.
4- Keep this plot opened.
Page 90
EET 300
Computer Applications Manual
GENERATING MULTIPLE PLOTS If you start to add too many plots to a single graph, it can become confusing. One way to overcome this would be to generate multiple plots within a single Probe window. These plots can either share the same X-axis or have individual X-axes (allows you to zoom in on one plot at a time). You can have up to four individual plots in a Probe window.
Generating Multiple Plots in A Probe Window 1- Choose Plot, Add Plot. Plot. 2- Choose Trace, Add and select the trace you want to add to this plot. 3- Click anywhere anywhere in the the desired plot to select select it. You will see SEL>> SEL>> is to the left of the selected plot.. 4- To delete a plot, select it and choose choose Plot, Delete Plot. Plot . 5- To create a separate X-axis for a new plot, select that plot and choose Plot, Unsync Plot. Plot. The new plot will now have a separate X-axis, and there will be a cursor separating the plots. You can scroll horizontally on the new plot.
EXERCISE 1-
In the open Probe window, add an additional plot.
2-
Select Vin as the trace to add to this new plot.
3-
Select the original plot (Vout).
Page 91
EET 300
Computer Applications Manual
USING THE VSIN SOURCE You can analyze the frequency response of a circuit to a sinusoid by utilizing the VSIN part. By placing the markers at appropriate points in the circuit, and running a transient response, you can observe the amplitude and phase changes for a particular frequency.
Analyzing Analyzing the Response of A Circuit to A Specific Sinusoidal Frequency Frequ ency 1- Set up a circuit with a VSIN source. 2- Double click on the VSIN source. The PartName dialog box opens. 3- Enter the following values for these values in the dialog box: VOFF – 0 VAMPL – Peak amplitude for the sine wave (5V is a good value to use) FREQ – Choose the value you which to observe (don’t need to include the units) 4- Place Voltage/Level markers at the appropriate places in the circuit. Place at least one at the input and one at the output. You may want to use the bubble part so that you can mark these parts Vin and Vout. 5- Choose Analysis…Setup. Analysis…Setup . The Analysis Setup dialog box opens. 6- Click on the Transient button, and fill in the appropriate values for the Print Step and Final Time in the dialog box. For amplitude and phase analysis, you want to observe at least 2-3 complete waveforms. 1 Therefore, select a value for Final Time that is 2-4 times the period of the input ( ). frequency 7- Choose Analysis…Simulate, Analysis…Simulate , or click on the Simulate button in the toolbar and observe the graph in the Probe window. Probe window. You should be able to use the cursor to measure the amplitude change and phase change of the output. If you use the BUBBLE part, you will need to add those traces to the graph. 8- To select a different frequency, go back to the Schematic window Schematic window and double click on the VSIN source. Change the value of the frequency and run the simulation again.
Page 92
EET 300
Computer Applications Manual
SIMULATING A BODE PLOT You can perform a Bode plot (amplitude and phase) vs. frequency in PSpice. You will need to create two plots.
Viewing Amplitude Amplitude Vs. Swept Frequency 1- Set up a circuit with a VSIN part. 2- Double click on the VSIN part. The PartName dialog box opens. 3- Enter the following values for these values in the dialog box: VOFF – 0 VAC – same value as VAMPL VAMPL – Peak amplitude for the sine wave (5V is a good value to use) FREQ – Choose the value you which to observe (don’t need to include the units) 4- Choose Analysis…Setup. Analysis…Setup . If Transient is selected, you might want to deselect it by clicking in the check box, and then select AC Sweep. Sweep. Specify the Start Freq., End Freq., Freq., and Total Pts. (you many initially want want to leave this value alone). You may have to experiment with these values, if you have not tried to calculate the Bode plot theoretically from the circuit. 5- Choose Analysis…Simulate. Analysis…Simulate . If you didn’t deselect Transient (as in step 4), you will get a small dialog box, entitled Analysis Type. Click on the AC button. If you deselected Transient, this box will not appear. You will get a plot with frequency as the X-axis. If you choose Plot, X Axis Settings, you will see that the scale is log. 6- In the Probe window Probe window choose Trace, Add. Add. The Add Traces dialog box opens. 7- Select DB() DB() in the Function Function or Macro field. field. The cursor will will be in the middle of the parenthesis. 8- Select Vout from the Variables Variables field, and then move move the cursor one position position to the left (using the arrow keys on the keyboard or the mouse). You want to have the cursor inside the right most parentheses. parentheses. 9- Select the “ / ” operator operator from the Function Function or Macro Macro field, and then then select Vin from the Variable field. 10- Click on OK. OK. You will see a plot of dB vs. frequency.
Page 93
EET 300
Computer Applications Manual
AC Sweep and Noise Analysis Dialog Box
Viewing Phase Vs. Swept Frequency 1- Choose Plot, Add Plot. Plot. A second plot in the Probe window Probe window is selected. 2- In the Probe window Probe window choose Trace, Add. Add. The Add Traces dialog box opens. 3- Select P() in the Function Function or Macro Macro field. The cursor will will be in the middle of the parenthesis. parenthesis. 4- Select Vout from the Variables field. 5- Type in a – sign, and then then select P() P() again. 6- Select Vin from the Variables field. 7- Click on OK. OK. You will see a plot of angle (d) vs. frequency.
Page 94
EET 300
Computer Applications Manual
PROBLEMS 10-11 PROBLEM 10 1-
Setup an RC circuit, as shown below. Set the frequency to 10Hz, the VAMPL to 5 V, the Final time to 40 ms, and run the simulation (make sure to save this file first). Measure the ratio of the peak output waveform to the peak input waveform, and record it. Measure the phase difference between the input and output.
o
Note that to measure phase differences, 360 represents the time interval between two consecutive peaks for the input waveform (period of the input). Therefore, to measure the phase differences between output and input, measure the time differences between the two peaks, and o divide 360 by that number, and then multiply multiply that result by the period. That will be the phase shift at that frequency. It might also be easier to change the value of the X-axis setting to 20 ms.
2-
Change the frequency to 100Hz, and repeat step 1. Do the same thing for 250Hz, 500Hz, 1000Hz, and 5000Hz.
Page 95
EET 300
Computer Applications Manual
3-
Take the values of the amplitude ratio (output/input), convert those values to decibels, and plot the result vs. frequency on semi-log paper.
4-
Plot the phase measurements vs. frequency on semi-log paper.
5-
Try repeating the same thing with the circuit as shown below (save this file with a different name)
6- Go back to the original file in item 1, and leave that open.
PROBLEM 2 1-
Develop a theoretical Bode plot (amplitude and phase) for the RC circuit that is open from the previous exercise. Use breakpoint analysis. What type of filter is this?
Page 96
EET 300
Computer Applications Manual
2-
Determine the break frequency from this plot. How would you do it, and how does it compare to the calculated break frequency?
3-
Replace the VSIN in the schematic with a VPULSE (set PW equal to 1 ms, PER to 5 ms). What happens to the output waveform, and how does it compare to the frequency response of this circuit? Determine the output theoretically using Laplace transforms
4-
Reverse the capacitor and resistor, and develop a new Bode plot for this circuit. What type of filter is this? Repeat items 3 & 4 for this new circuit. In all cases, do a theoretical Bode plot as well.
Page 97
EET 300
Computer Applications Manual
LESSON 7 – FOURIER ANALYSIS You will Learn:
How to understand Fourier analysis using Mathcad
How to do a Fourier analysis with PSpice
Page 98
EET 300
Computer Applications Manual
FOURIER ANALYSIS - MATHCAD One of the basic concepts in Fourier analysis is an understanding of how combining harmonics of a sinusoidal waveform can produce other periodic waveforms. A Mathcad worksheet, Recursive Fourier Analysis.mcd, was created to demonstrate this principal (see next page). Note the use of functions such as odd and even. Look them up in Mathcad help, to understand why they were used.
Page 99
EET 300
Computer Applications Manual
Demonstration of Fourier series First, create variables for odd harmonics, harmonics, even harmonics, and all harmonics. Odd harmonic variable would be 1 for an odd number, and 0 for an even number. The even harmonic variable would be 1 for an even number, and 0 for an odd number. The all variable would be 1 for odd or even.
odd ( i)
mod( i , 2 )
even( i)
mod( i
1 , 2)
all( i)
1
For a specific time function, determine whether there are only odd, even, or all harmonics
odde oddeve ven n( i)
odd ( i)
Select how many harmonics you want to view
n
5
Create a function that that is based on the Fourier Fourier series from calculations or from Table 9-2
g( i , t)
2 . sin( i. π .t ) i. π
Determine the resulting time time function, placing the appropriate odd/even function function in the summation sign
n g( i , t) . od odd ( i)
f( t ) i= 0
Determine the time axis (based on the fundamental frequency)
t
0 , .01 .. 4
1
0.5 f( t )
0
0.5
1 0
1
2 t
Page 100
3
4
EET 300
Computer Applications Manual
FOURIER ANALYSIS - PSPICE You can perform Fourier analysis on any waveform, whether you have generated it using a simple source or the waveform is the output from a circuit.
Fourier Analysis of A Simple Waveform 1- Set up the circuit circuit with a source, source, a resistive resistive load, a ground ground and a voltage voltage marker. 2- Set up the transient analysis. If you set up the combination of pulse width, period and Final Time in the analysis so that you only see one waveform, you will see a Fourier Transform. If you change the parameters (most likely lik ely the Final Time) so that there are repetitive waveforms in the plot, you will be approaching a Fourier series. 3- Simulate the circuit, and ge generate nerate a plot.
4- Choose Trace, Fourier or click on the Fourier button in the toolbar. 5- To view the lower harmonics, change the X-axis settings.
You can also look at the Fourier analysis of any circuit using the same procedure.
If you set up the voltage markers to show the input and outputs, you can then observe how the circuit is affecting the frequency content of the input signal.
EXERCISE 1-
Set up a circuit with a VPULSE part, a resistor (use the default value) and an AGND part.
2-
Set the VPULSE part to the following parameters: V1=0, V2=5, PW=1, PER=5.
3-
Run a transient analysis with a Final Time of 5 s.
4-
Change the plot to a Fourier analysis, and change the X-axis setting to user defined, 0 to 40Hz.
Page 101
EET 300
Computer Applications Manual
5-
Change the X axis settings to a maximum of 10 Hz, and observe the difference in the graph.
6-
Derive theoretically and compare.
7-
Change the PER to 2, and change the Final Time in the transient analysis to 20.
8-
Generate the waveform, and then generate the Fourier Fourier plot. Because you see many waveforms on the plot, the Fourier plot will appear more like a line plot, or more like the Fourier series.
9-
Add a 100 uF capacitor in series with the resistor, and place a voltage probe at the input and output. Change the PER back to 5, change the Final Time back to 5, and run the transient analysis. Change the plot to a Fourier analysis, and compare the input and output spectra.
Page 102
EET 300
Computer Applications Manual
PROBLEMS 12-13 PROBLEM 12 1-
Generate a square wave, PW=1s and PER=10s.
2-
Set the Final Time to 2s, and generate a Fourier plot. How much less is the 5 harmonic from the fundamental.
3-
Decrease both PW and Final Time by 1/10, and generate a new Fourier plot. Compare the two (you might want to look at only the first 10 harmonics).
4-
Repeat item 3 once more.
5-
Repeat items 1-4 with a triangular waveform and a sawtooth pulse (see pg. 414). Compare the three waveforms, both theoretical and from the PSpice experiment.
6-
Change the PER to 2s, and the Final Time to 10s for the square wave. Generate a Fourier plot. How is it different from the one in item 2?
7-
Change the Final Time to 40s for the square wave, and repeat item 6. What is happening?
th
PROBLEM 13 1-
Generate plots for both the input and output for the circuits in Examples 6-49 and 6-50 (page 257). Make sure that you set the Final Time so that you have only one waveform appear on the plot.
2-
Generate a Fourier plot, with the input and output superimposed. Compare the input and output plots for both circuits. What does the Fourier transform show, and is it correct?
Page 103
EET 300
Computer Applications Manual
APPENDIX - PROBLEMS IN THE TEXTBOOK
The textbook, in the back of each chapter, has examples in either PSpice or Matlab. However, the examples in Matlab can be accomplished in MathCAD. Three examples are shown in the next several pages. Try to set them up on your your own, and then modify them.
blem - Matlab example 4-1, p. 153, using Mathcad t
)
10
75 8 .e
z 0 , 1 .. 400
2 8 ..63 z = 7.04
Capacitor Voltage of Example 4-7
50
100
150
200
250
t time seconds seconds
Page 104
300
350
400
EET 300
Computer Applications Manual
Problem - Matlab example 5-1, p. 201, using Mathcad (s
F( s ) s
f( t )
t
2
4) 3 s
2
F ( s ) invlaplace
0 .01 ,
..
,
s
2 ex exp ( 2 t ) .
.
3 ex exp ( .
t)
5
1.5
1 f( t ) 0.5
0 0
1
2
Page 105
3
4
5
EET 300
Computer Applications Manual
Plotting Impulse response of a transfer function Problem 7-1, p. 305, using MathCad First define the transfer function, G(s) 1
G( s ) s
2
. 1.4142s
1
Then, create a variable f(t), which is defined by using the invlaplace keyword When you click on that keyword, you will have two placeholders. placeholders. In the one to the left of invlaplace, type in G(s). In the placeholder to the right of G(s), type the variable s. Then press return - you will get the time function
f( t )
G( s ) invlaplace , s
.exp( .7071.t ) .sin( .7071135 .t2) 1.4142000002601225741 .70711356230 62308063 80637816 78162
Define the appropriate time period - note: you might have to experiement. However, if you see an exponent, such as the number .7071, take the inverse of that number, and multiple by 5. That is 5 time constants. Set the initial value of t to 0, the increment to at least 0.01 of the final value, and set the final value to about 10 time constants (if you know them). t
0 , .0 .01.. 10
Then type below this f(t)@, and then press return. You will get the graph. graph. If you change anything above, such as the G(s) term or the time period, the graph will change. Impulse Response of Filter for ex. 7-3
0.6
0.4 e s n o p s e r
f( t ) 0.2
0
0.2 0
2
4
6 t time (s)
Page 106
8
10
EET 300
Computer Applications Manual
INDEX Laplace Transforms - Mathcad, 79 Adding cursor to plot, 63 Adding labels to curve, 63 Adding parts to schematics, 27 Analysis Setup Dialog Box, 55 Automatic mode, 11
Marking coordinate values, 90 Math palette, 15 Message Viewer, 47 Moving parts in PSpice, 32 Multiple cursors, 88 Multiple plots in PSpice, 92
Bode Plot, 94 Bubbles, 60
Overview, 25 Calculations in Mathcad, 9 Changing axis, 62 Changing colors in Probe, 57 Changing parts attributes, 35 Complex numbers, 11 Connecting parts, 34 Copying graphs, 65 Copying Mathcad to Word, 16 Copying schematics into Word, 44 Copying/pasting Copying/pasting parts, 39 Custom axis, 73
Part Browser Dialog Box, 28 Parts browser dialog box, 30 Printing graphs, 65 Pulse voltage source, 52 Redraw, 42 Roots of an equation, 81 Rotating parts, 33 Saving a schematic file, 38 Schematics window, 26 Setting up functions in Mathcad, 17 Sweeping a component value, 66
DC Analysis, 46 Defining a variable, 10 Deleting parts, 33
Text in Mathcad, 8 Transient analysis, 54
Fourier analysis - Mathcad, 100 Fourier analysis - PSpice, 102 Functions, 74
Undo/Redo, 41 Unit conversion, 14 Unit step, 53 Using math parts in PSpice, 71
Graphing in Mathcad, 21 Greek symbols, 20
Viewpoint, 46 VPWL, 69 VSin source, 93
Inserting a function, 13 Integration and Differentiation, 18 Introduction, 5 Ipulse, 46
Zoom, 43 Laplace Component - PSpice, 84
Page 107