ECE210 - Lab 3 - LTSpice and Nodal analysis

pdf

School

University of Massachusetts, Amherst *

*We aren’t endorsed by this school

Course

210

Subject

Electrical Engineering

Date

Jan 9, 2024

Type

pdf

Pages

15

Uploaded by DoctorPorpoiseMaster992

Report
UMass ECE 210 – Fall 2023 Lab 3: LTSpice and Nodal Analysis GOALS: Solve a simple DC circuit by hand using nodal analysis (Part 1) Verify calculations by simulating the circuit’s DC operating point in LTspice (Part 2+3) Investigate circuit behavior via DC sweep analysis (Part 4) Meet design specification via DC sweep analysis (Part 5) Lab report (Due in 1 week): 1. Introduce justification for experiment. a. Validate theoretical calculations via simulation b. Investigate circuit behavior via simulation 2. Properly label and document theoretical calculations, simulation schematics, and simulation results a. Label all voltages, currents (with direction). b. Label components, interesting nodes 3. Present measurements with figures that are clearly labeled 4. Analysis for each figure 5. Conclusion – Summary of concepts (See template for more details) You will need to RECORD all of your data independently. The simulation data required for your lab report are listed in a black box like this at throughout the following parts. FOLLOW ALL STEPS AND INCLUDE ALL REQUIRED DATA IN YOUR REPORT!
Introduction: Theoretical Calculations and Simulations Simulation programs (like LTspice) are powerful tools that let us quickly and efficiently analyze a circuit’s behavior without needing to build the physical circuit or repeat tedious calculations by hand (e.g., solve the circuit again for every new resistor value we want to test). However, it is still valuable to first solve the circuit by hand to develop some intuition or understanding of its behavior, and then verify these results and perform further testing via simulation. To illustrate this process, you will first solve a circuit using nodal analysis by hand to find two specific node voltages (note that there are more than two node voltages in the circuit!). You will then simulate this circuit to verify your calculations of the voltages, as well as other quantites (e.g., current, power). Finally, you will use the simulation to investigate the circuit behavior, develop some intuition related to nodal analysis, and implement a design.
Part 1: Nodal Analysis Pictured aboved is a relatively complex circuit. Note the 8 nodes in this circuit, each with it’s own voltage: 7 nodes are labeled with black speech bubbles, and the 8 th node is labeled with the “ground” symbol. Although we know the values of every source and resistor, we do not immediately know the voltages at any of these nodes (other than ground, which is 0V). It turns out we can use nodal analysis to efficiently calculate two of these node voltages, V 1 and V 2 , and then use other techniques to easily calculate the remaining node voltages and branch currents. For this lab, we will just calculate V 1 , V 2 , and the branch currents by hand. Use nodal analysis to find the voltages V 1 and V 2 in the circuit above. After finding V 1 and V 2 , calculate the 4 branch currents leaving/entering the V 1 node and verify that KCL is satisfied. Do the same for the 3 branch currents leaving/entering the V 2 node.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
In your lab report : 1. Re-draw the circuit schematic, including… a. Draw arrows indicating the directions you assigned for each branch current. b. Draw the polarities you assigned across each current source and resistor. 2. Show your work for nodal analysis, including… a. Your symbolic nodal equations before solving them (one for node V 1 , one for node V 2 ) b. The values of V 1 and V 2 c. KCL check for node V 1 d. KCL check for node V 2 Some hints : When deriving each nodal equation, it helps to imagine all the currents leaving (or all entering) the node, so that the sum of all these currents is equal to 0. In other words, you do not need to try to predict the direction of every current, or use the polarity of a voltage source to determine the direction of the current through it. You should end up with a system of equations with only two unknowns (V 1 and V 2 ). In each nodal equation, when there are multiple terms proportional to V 1 or V 2 , you should find that EVERY term has the same sign (if you have chosen all currents leaving (or all entering). It might be positive or negative, depending on exactly how you apply nodal analysis, but they must all be the same. Work symbolically! Form your nodal equations and do as much of the algebra as possible with symbols before plugging in numbers.
Part 2: LTspice Next, you will use LTspice to simulate the circuit and verify your calculations. Visit https://www.analog.com/en/design-center/design-tools-and-calculators/ltspice-simulator.html and download the appropriate version of LTspice for your machine. Follow the on-screen prompts of the installer to install LTspice, and then open the program. You should see a window similar to the left image (Windows) or right image (MacOS). In this window, select File à New Schematic (Windows) or Start a new, blank schematic (MacOS). This will open a blank workspace, which is where you will build your circuit model and simulate its behavior. Be sure to save your schematic file (.asc) now, and as you work. Building the circuit model First, we must build the circuit model by placing each resistor and source and connecting them via wires. Let’s start with the leftmost 2 branches in the circuit above. Helpful hotkeys are listed throughout; see the Appendix for a complete list. 1. Place an independent current source 1.1. Select Edit à Component (Windows) or right click à Draft à Component (MacOS). 1.1.1. Use F2 as a hotkey for the component menu 1.2. In the search bar, type “current,” and click the corresponding result to select the source. 1.3. You will be returned to the schematic window and your cursor will be replaced with the current source. 1.4. press Ctrl + R (CMD + R) to rotate the source 90deg clockwise. Rotate it until it matches the direction of the 1A source in the given circuit, then left click to place it. 1.5. Your cursor will still be a source in case you want to place another instance. Press escape, or right click, to return to a normal cursor. 1.5.1. If you want to delete or move the component you just placed, go to the edit menu (right click the schematic window on MacOS), and select the delete or move tools to change your cursor to the corresponding tool (or press hotkeys F5 for delete, F7 for move). With the delete tool, click on the component to delete it. With the move tool, click on the component to select it, then move the component and click again to place it. Press escape or right click to stop using either tool. 1.5.2. You can use your mouse wheel or the zoom options on the toolbar or under the view dropdown to change your view of the schematic. A helpful option is "Zoom to fit," which resets your view to your circuit (hotkey = spacebar ).
2. Change the source parameters 2.1. This source has two labels: a name, I1, and a value, I. 2.2. Right click the name (I1) and change it to Ia, to match the given circuit diagram. 2.3. Right click the source or the I to edit it’s properties. Since this is an independent DC current source, we can only change the current. Change the current to 1A (the unit is listed within the pop-up). 2.4. The two blue blocks on the top and bottom of the source are its terminals. We will use these later to wire up the circuit. 3. Place some resistors 3.1. Select Edit à Component (Windows), or right click à Draft à Component (MacOS), search “resistor,” and select the component. 3.1.1. You could also press R in the schematic window, or select the resistor element from the toolbar. 3.2. Place a resistor above the current source, Ia, and then 3 more resistors as in the 2nd leftmost branch. Match the circuit diagram but leave enough room so you can clearly see the component parameters. 3.3. Change their values and labels to match the circuit. 3.4. Make sure the resistor above the 1A source is named R1 – we will use this later. 4. Wire up the components 4.1. Select Edit -> Draw Wire (Windows), or right click à Draft à Wire (MacOS). Your cursor will change to 2 perpendicular dotted lines. 4.1.1. You could also use the F3 hotkey. 4.2. Click on the blue box above Ia, and then move your cursor away. You will see a line following your cursor, which is the wire. 4.3. Click the blue box at the bottom of resistor R1 (above the current source) to connect them via the wire. 4.3.1. If you mess up, you can use the delete tool ( F5 ). 4.4. Wire up the other components, matching the circuit diagram. 4.4.1. If you want to place a path of wiring (e.g. a 90deg turn), you can click in open space to place one segment of wire, then move your cursor again to continue the wire path in a different direction. 4.4.2. You may notice a solid blue square forming when more than 2 wires are connected. This indicates a junction where multiple branches meet.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
5. Label the nodes 5.1. Now that we have some nodes, let's label them to match the circuit diagram. LTspice also refers to the nodes as "nets." 5.2. Select Edit -> Net Name (Windows), or right click à Draft à Net Name (MacOS). In the pop-up, type V1 in the text box and click ok. Your cursor will change to a V1 label. Click anywhere on the top wire to label the node/net as V1. 5.2.1. You can also right click on any wire and select "Label Net," or use hotkey F4 . 5.3. If you hover your cursor anywhere over this wire, a message on the bottom left (Windows) or top (MacOS) of the window will display "This is node V1." 5.3.1. This status message will change depending on what your cursor is on. See image below. 5.3.2. If you hover your cursor over any other wire, the status message will say something like "This is node N001," for example. Labeling your important nodes will make it much easier to keep track of them later when simulating circuit behavior. 5.4. Label Vx and V3 as well. 6. Assign ground 6.1. We must explicitly tell LTspice what node we want to treat as ground (0V). 6.2. Select Edit à Place Ground (Windows), or right click à Draft à Net Name and select the GND bubble (MacOS). You can also select the ground option within the Net Name window. 6.3. Your cursor will change to the ground symbol. Place this beneath your circuit, then connect the ground symbol to the bottommost wire. 6.4. If you hover your cursor over this wire, you will see the message display "This is ground" or “This is node 0.” 7. Finish building the circuit 7.1. Place the remaining components and wire them up. 7.1.1. For the independent voltage source, you can type "voltage" in the component window and select the Voltage component. You can leave the “series resistance” parameters blank. 7.2. Make sure the source polarities match the given circuit diagram! 7.3. Make sure the source/resistor labels/values match the given circuit diagram! 7.4. Make sure the node labels match the given circuit diagram! Below are some helpful shortcuts, clipped from the table in the Appendix…
Part 3: DC Operating Point Now we can simulate the circuit behavior to find the DC voltages and currents in the circuit (i.e., its DC operating point). This is done by writing SPICE directives, which are like single lines of code that define the type of simulation we want LTspice to perform. In the Appendix, you can see a list of common commands used in SPICE directives. We are interested in the DC operating point, so we will use the .op directive. 1. Select Edit à SPICE directive (Windows) or right-click à Draft à SPICE directive (MacOS) 1.1. Hotkey S 2. Enter .op in the text field. Make sure the bullet for “SPICE directive” is selected, and press ok. 3. Your cursor will change to .op, similar to a net label. Place it any open space in your schematic (not on the circuit). This is your SPICE directive, which acts like a text box in the schematic but is required to run a simulation. 4. Select Simulate à Run (Windows), right-click à Run (MacOS), or click the running man symbol in the toolbar. 5. A .log file will pop-up (press Ctrl + L (CMD + L) if not) listing the DC operating point of the circuit, i.e., the voltage at each node, and the current through each element. Note how proper node and component labeling make this list easier to parse. 5.1. A blank .raw window may also pop up, but close this for now. 6. The currents through each resistor are treated as going down each branch, towards ground. The polarity across each resistor would be + on top, so passive sign convention is obeyed. Using KCL and the listed currents, you should be able to verify the direction of the current through the R6. 7. Check that V1, V2, and the currents match your hand calculations. In your lab report : 1. Submit a screenshot of your schematic, including the .op SPICE directive. a. Make sure your component and node labels are correct. 2. Submit a screenshot of the DC operating point list, including the directory path at the top.
Power Dissipation The simulation will also tell us the power absorbed by each component (listed as the power dissipation). On Windows, we can easily read the power for each component, but a bit of extra work is required on MacOS. 1) For Windows… a) Hover your cursor over any source or resistor in the schematic. The status message will display the DC operating point, including the power dissipated into the component. b) Record this value into a table in your lab report for each component. i) Note that this is the power absorbed by this component. ii) Equivalently, you could flip the sign and say this is the power delivered by this component. 2) For MacOS a) Rerun the simulation to open the blank .raw window again. Hover your cursor over any source or resistor in the schematic while holding CMD . Your cursor should change to a thermometer. Click to plot the power dissipated into the component in the .raw window. b) Record this value into a table in your lab report for each component. It may be useful to delete each power value before adding the next ( Delete key while the .raw window is active, then click the legend to remove the current value). i) Note that this is the power absorbed by this component. ii) Equivalently, you could flip the sign and say this is the power delivered by this component. In your lab report: 1. Fill out a table listing the power absorbed by each component, and the total power absorbed (sum all the power values). Answer the following: a. What is the total power absorbed by the circuit? b. Why is this the case? Think about energy conservation and the fact that some of the elements are absorbing negative power (i.e., delivering positive power).
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Part 4: DC Sweep When analyzing a circuit, we may be interested in what happens when we change the value of a component (e.g., source, resistor). We may also want to try a range of values. Rather than re- solving the entire circuit for each value by hand, we can have the simulation “sweep” these values and solve the circuit for each variation (i.e., a DC sweep). Let’s sweep the value of resistor R1 (the 100ohm resistor above the 1A source) and see how the circuit is affected. 1) First, change the value of R1 from 100 to {R} . The brackets around a letter tell LTspice that we will be using this value as a variable. 2) Next, write a SPICE directive for a DC sweep. Enter .step param R 10 100 10 , and place this directive in your schematic. a) The .step command tells LTspice we want to do a sweep. b) We will sweep the parameter R, which we just set as the value of R1. c) After R, the first number is the starting value of the sweep (10 ohms). d) The second number is the ending value of the sweep (100 ohms). e) The third number is the step, or how much we will increment by from start to end. f) In total, this statement says we will sweep R from 10ohms to 100ohms with a 10ohm step. 3) Select Simulate -> Run , and a window with an empty plot will appear. 4) We now need to select some voltages/currents to plot as waveforms. In your schematic, hover your cursor over the V 1 node. The cursor will change to a little probe, and the status message will display "Click to plot voltage V(V1)." Click the node to plot a waveform of the voltage V1 vs the resistance R. The y axis is the voltage, the x axis is the resistance value we are sweeping, and the top of the plot displays a color coded legend. 5) Click directly on R1 to plot the current through it. Note that the right side of the plot now displays an axis for the current. Be sure you know which waveform corresponds to which axis based on the legend. 6) Click the node Vx (between R1and Ia) to plot the voltage at that node. 7) Right click the voltage y-axis and make sure Top = 120V, Tick = 10V, Bottom = 0V In your report: 1. Submit a screenshot of your schematic, including the .op and .step SPICE directives. a. Make sure your component and node labels are correct. 2. Submit a screenshot of your waveform plot including: a. V1 voltage curve b. Vx voltage curve c. R1 current curve 3. Answer the following:
a. How do V1 and the current through R1 change with respect to R1’s value? Based on your nodal equation and how independent current sources work, does this make sense? b. How does Vx change with respect to R1’s value? Is it linear? c. Now, think about the power delivered by Ia (P = V*I, where V is the voltage across the source, and I is 1A). Explain how changing R1’s value ultimately changes the power delivered by the source. i. For example, “changing the resistor value changes …, which changes…” (think in terms of node voltages). ii. You could also symbolically expand P = V*I in terms of the circuit variables (V1, Vx, R, …) to show the dependence on the resistor.
Part 5: DC Sweep for Design Part 4 showed that the DC sweep is a simple but powerful tool that lets us determine exactly how any quantity in the circuit can depend (or not) on a given component. We can make practical use of this tool to implement design specifications. Let’s implement the following design spec: current source Ib must deliver 1x00W (or, equivalently, absorb -1x00W), where x is the last digit of your student ID. For example, if your ID ends in 3, you want to make sure the source absorbs -1300W. Based on part 4, we can intuit that changing the value of Ry (200ohm resistor below Ib) will ultimately change the power delivered by the source. What resistor value will satisfy your power specification? To find this, we will combine the .step statement with a .meas statement, which can identify specific values from our output waveforms (among many other functions). 1) First, change the value of R1 back to 100 ohms. 2) Change the value of Ry to {R}. 3) Change the .step statement to .step param R 200 500 10 a) We are now sweeping R from 200ohms to 500ohms with a 10ohm step 4) Write the following SPICE directive: .meas find Ry when V(V2,Vy)*I(Ib) = -1x00W a) The .meas command tells LTspice we want to it to evaluate some operation/function. b) We want to find the value of Ry when the power absorbed by Ib equals -1x00W. c) Note that the power is written as a math operation here in the form of V*I. This is how LTspice will interpret the power absorbed by the source. d) The voltage across the source is written as the difference between two voltages, V2 and Vy. The current is written as the current through source Ib. e) X is the last digit of your ID. 5) Clear the traces from part 4 (you can delete each trace or close the simulation window and rerun the simulation). 6) Hover your cursor over source Ib and hold Ctrl (Windows) or CMD (MacOS). The cursor should change to a thermometer and the status message will say “Plot Ib dissipation: V(V2,Vy)*I(Ib)“ 7) Click to plot the power dissipated in the source (absorbed) vs Ry. Notice that the waveform legend shows the math operation performed to calculate the power using the corresponding voltage and current labels in the circuit. 8) Open the log (select the schematic window, then Alt+L or CMD+L ) to view the results. a) Under the DC operating point values, there should be a line labeled “find: v(v2,vy)*i(ib)=- 1x00W at __” b) The __ is the value of Ry that satisfies your power specification.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
In your report: 1. Submit a screenshot of your schematic, including the .op, .step, and .meas SPICE directives. a. Make sure your component and node labels are correct. 2. Submit a screenshot of the power dissipation vs Ry waveform. 3. Submit a screenshot of your .log file, including the DC operating point values, the result of the .meas statement, and the directory path at the top. 4. What Ry value will make Ib absorb -1x00W (deliver 1x00W)? LAB REPORT DUE NEXT WEEK SEE LAB REPORT 2 RUBRIC ON NEXT PAGE
LAB REPORT 2 – RUBRIC To practice your technical writing skills, you will write a concise (short) lab report which is a self-contained document, introducing important concepts with citations to a few sources, motivating your experiment, presenting your experimental setup and your experimental results (PLOTS, TABLES etc.) and analyzing your results to verify the concepts you introduced were confirmed within the precision of your measurements. Lab reports should focus on proving to the reader that you made the measurements accurately and precisely. Meaning you will need to take pictures of your circuit and setup and present data in well labeled figures that are easy to interpret towards your conclusions. 2,000-word limit 1 report/group Submission contents are list briefly below, but double check the black box for each section! Part Submission Material Points Introduce and define concept (nodal analysis) 2.5 Motivation for experiment 2.5 1 Circuit diagram (polarities / current directions labeled) 5 V 1 and V 2 solution + work 5 V 1 and V 2 KCL checks 5 2/3 Schematic (labeled) and DC operating point screenshots 2.5 Power absorbed table 2.5 Total power question 2.5 4 Schematic (labeled) screenshot 2.5 Waveform plot 5 Plot analysis and power questions 5 Schematic (labeled) screenshot 2.5 Power dissipation plot 5 DC operating point screenshot 2.5 Ry resistor value 5
Appendix Helpful list of LTspice syntax and shortcuts
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help