http://www.emagtech.com/wiki/index.php?title=Basic_Tutorial_Lesson_2:_Time_and_Frequency_Domain_Analysis_of_an_RLC_Filter&feed=atom&action=historyBasic Tutorial Lesson 2: Time and Frequency Domain Analysis of an RLC Filter - Revision history2024-03-29T14:26:58ZRevision history for this page on the wikiMediaWiki 1.23.17http://www.emagtech.com/wiki/index.php?title=Basic_Tutorial_Lesson_2:_Time_and_Frequency_Domain_Analysis_of_an_RLC_Filter&diff=32913&oldid=prevKazem Sabet at 17:54, 8 November 20162016-11-08T17:54:15Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 17:54, 8 November 2016</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 11:</td>
<td colspan="2" class="diff-lineno">Line 11:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>|All versions|{{download|http://www.emagtech.com/downloads/ProjectRepo/AnalogLesson2.zip Analog Lesson 2}} }}</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>|All versions|{{download|http://www.emagtech.com/downloads/ProjectRepo/AnalogLesson2.zip Analog Lesson 2}} }}</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline">=</del>== What You Will Learn <del class="diffchange diffchange-inline">=</del>==</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>== What You Will Learn ==</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>In this tutorial, you will investigate a linear, time-varying, RLC circuit shown in the figure below. Using this circuit, you'll learn how to analyze transient and frequency domain responses. You will also learn how to set up and use a virtual instrument like the Oscilloscope during a live simulation.   </div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>In this tutorial, you will investigate a linear, time-varying, RLC circuit shown in the figure below. Using this circuit, you'll learn how to analyze transient and frequency domain responses. You will also learn how to set up and use a virtual instrument like the Oscilloscope during a live simulation.   </div></td></tr>
</table>Kazem Sabethttp://www.emagtech.com/wiki/index.php?title=Basic_Tutorial_Lesson_2:_Time_and_Frequency_Domain_Analysis_of_an_RLC_Filter&diff=32855&oldid=prevKazem Sabet: Created page with "{{projectinfo|Tutorial| Time and Frequency Domain Analysis of an RLC Filter |b2TUT2_1.png|In this project, you will investigate a linear, time-varying, RLC circuit in both tim..."2016-11-07T23:04:30Z<p>Created page with "{{projectinfo|Tutorial| Time and Frequency Domain Analysis of an RLC Filter |b2TUT2_1.png|In this project, you will investigate a linear, time-varying, RLC circuit in both tim..."</p>
<p><b>New page</b></p><div>{{projectinfo|Tutorial| Time and Frequency Domain Analysis of an RLC Filter |b2TUT2_1.png|In this project, you will investigate a linear, time-varying, RLC circuit in both time and frequency domains.|<br />
<br />
*Capacitor<br />
*Inductor<br />
*Virtual Instrument<br />
*Oscilloscope <br />
*Transient Test<br />
*AC Sweep Test<br />
*Preset Graph Plots<br />
*Editing Graph Axes<br />
|All versions|{{download|http://www.emagtech.com/downloads/ProjectRepo/AnalogLesson2.zip Analog Lesson 2}} }}<br />
<br />
=== What You Will Learn ===<br />
<br />
In this tutorial, you will investigate a linear, time-varying, RLC circuit shown in the figure below. Using this circuit, you'll learn how to analyze transient and frequency domain responses. You will also learn how to set up and use a virtual instrument like the Oscilloscope during a live simulation. <br />
<br />
<table><br />
<tr><br />
<td> [[Image:b2TUT2_1.png|thumb|400px|A simple RLC filter.]] </td><br />
</tr><br />
</table><br />
<br />
== Drawing the Circuit ==<br />
<br />
We assume that at this point you have already completed Tutorial Lesson 1 and have acquired the basic circuit editing skills. If you haven’t, you may want to look over Tutorial Lesson 1 now. The following is a list of parts needed for this lesson:<br />
<br />
{| border="0"<br />
|-<br />
| valign="top"|<br />
|-<br />
{| class="wikitable"<br />
|-<br />
! scope="col"| Part Name<br />
! scope="col"| Part Type<br />
! scope="col"| Part Value<br />
|-<br />
! scope="row"| V1<br />
| Voltage Source<br />
| 1<br />
|-<br />
! scope="row"| L1<br />
| Inductor<br />
| 1u<br />
|-<br />
! scope="row"| C1<br />
| Capacitor<br />
| 1n<br />
|-<br />
! scope="row"| R1<br />
| Resistor<br />
| 50 <br />
|}<br />
<br />
Note that you can use the keyboard shortcuts {{key|L}} and {{key|C}} for placing inductors and capacitors in your circuit. 1n represents 1 nano-unit. It can also be entered as 1E-9, or 1NF. 1u is 1 micro-unit, which can also be entered as 1E-6. [[RF.Spice A/D]] is case-insensitive, so you could enter 1 micro-unit as 1e-6, or 1E-6. Also, the type of the unit is ignored, so 1NF and 1ns are both equivalent to 1n. 1 n, however, will be interpreted as 1, since spaces are illegal in values. Place all the four parts listed above and connect them as shown in the figure using wires. For the time being, leave the voltage source as a default DC source with 1V voltage. Do not forget to define a ground for your circuit.<br />
<br />
== Setting Up and Running a Live Simulation ==<br />
<br />
[[File:b2TUT2_2.png|thumb|500px]] <br />
Recall that a "Live Simulation" is a continuous time domain simulation that runs indefinitely until it is paused or stopped and reset. Since simulations do not produce a graph, you will need to use virtual instruments to measure the circuit. Specifically, you will use a "'''Virtual Oscilloscope'''" in this lesson.<br />
<br />
First, you are going to change the type of your voltage source V1 to a square wave generator. You may alternatively use the "'''Virtual Function Generator'''" for this purpose. Double-click the voltage source to open its property dialog. From the '''Transient Properties''', select the "'''Pulse'''" option. The table on the right list the various properties of the '''Pulse Waveform'''. The default amplitude is 1V. Keep all the default values except for "Pulse Width" and "Pulse Period". Change their values to 0.5m and 1m, respectively. Note that these values represent milliseconds. A period of 1ms with a pulse width of 0.5ms corresponds to a pulse repetition rate (or frequency) of 1KHz, with a duty cycle of 50%. This is shown in the opposite figure. <br />
<br />
Make sure circuit nodes are displayed. Your schematic should now look like the following figure:<br />
<br />
<table><br />
<tr><br />
<td> [[File:b2TUT2_3.png|thumb|350px|The RLC filter schematic showing the node numbers.]] </td><br />
</tr><br />
</table><br />
<br />
Next, you will define the virtual oscilloscope. Go to the "Virtual Instrument Panel" on the right side of the screen and click on the button labeled "'''Add Meter'''". From the drop-down list, select "Oscilloscope". An empty oscilloscope window appears in the right side panel. Click the '''Setup''' button to expend the window and bring its settings dialog on. You should see a dialog like the figure below. Under the '''Traces''' tab, click the '''Input Trace 1''' button to set up the first signal to measure on the oscilloscope. Set the input node to 1 and the reference node to 0. This will measure the voltage at node 1, which is where the voltage source is injected. Click on '''Input Trace 2''' to set up the second signal. Set that input node to 2 and the reference to 0 and check the "Show" check box to display the signal. Workshop will try to automatically set the X and Y axis ranges to fit the signal into the graph window so you can leave all the other settings in the other tabs as they are. <br />
<br />
<table><br />
<tr><br />
<td> [[File:b2TUT2_4.png|thumb|230px|The virtual oscilloscope instrument.]] </td><br />
<td> [[File:b2TUT2_5.png|thumb|230px|Vertical Tab of Oscilloscope Setup dialog.]] </td><br />
<td> [[File:b2TUT2_6.png|thumb|230px|Timebase Tab of Oscilloscope Setup dialog.]] </td><br />
</tr><br />
</table><br />
<br />
Now click the "Run/Go" [[File:b2Run_Tool.png]] button of the '''Main Toolbar''', or use the keyboard shortcut "'''Ctrl+G'''" to start the live simulation. Keep in mind that sometime [[RF.Spice A/D]] may ask you to allow it to adjust certain simulation parameters like time step automatically. Click OK in such situations and let the program do its job. However, once the simulation starts, you may not see anything in the scope's display. Or there might be flashes of a signal, but no solid signals. When this happens, it is likely that Workshop is having trouble automatically setting one or both of the axis settings. <br />
<br />
Let's look at the axes settings to see what's happening. Switch on the '''Vertical''' tab. The Vertical V/Div is automatically set at 1. We know that the reading at node 1 should be the source signal set to 1V. Therefore, the 1V/div setting for the Vertical V/div should at least display the input signal correctly. Next, switch to the '''Timebase''' tab. The Timebase s/div setting is where the X axis range is set. It is set to "Auto" by default, but if you look closely, the setting might be continuously changing, probably due to the fact that one or both of the signals is throwing off the period calculations made by Workshop. In these cases, you can change the Timebase settings manually. To override this, click the "'''Manual'''" button. Let's set the signal to at least show the injected 1KHz signal. The period for our 1KHz pulse is 1ms. Since your graph has 10 divisions, the setting for time/div must be 1ms/10 = 0.1ms, or 100us. So enter 100u into the Timebase box and either press the '''Enter Key''' or click on the small "Return Arrow" button to accept the change. Otherwise, the dialog may show 100u, but Workshop will still be using the old value. Now you should see the signals in the scope's display screen.<br />
<br />
If you look at the output waveform more closely, you will discern very small fluctuating signal overshoots at the rise or fall of the pulse. In the next part of this lesson, you will run a transient test to zoom in that portion of the temporal waveform.<br />
<br />
== Running a Transient Test ==<br />
<br />
[[File:b2TUT2_7.png|thumb|400px|Transient Test Setup Dialog]]<br />
In the Toolbox on the left side panel, click on the "'''Tests'''" tab. Select the "'''Transient'''" option by checking the leftmost check box in the "basic" column. Then, click the "'''Setup'''" button in the Transient test row to open the Test Settings Dialog as shown in the figure below. Set the transient test parameters according to the table below. Make sure that the '''Single Test''' tab is selected and the check box labeled "'''Graph'''" is checked in the "Output Results Options" section of the dialog. <br />
<br />
{| border="0"<br />
|-<br />
| valign="top"|<br />
|-<br />
{| class="wikitable"<br />
|-<br />
! scope="row"| Start Time<br />
| 0<br />
|-<br />
! scope="row"| Stop Time<br />
| 5m<br />
|-<br />
! scope="row"| Linearize Step<br />
| 10u<br />
|-<br />
! scope="row"| Step Ceiling<br />
| 1u<br />
|-<br />
! scope="row"| Preset Graph Plots<br />
| v(1), v(2)<br />
|}<br />
<br />
<table><br />
<tr><br />
<td>[[File:b2TUT2_8.png|thumb|500px|Edit Plot List dialog.]]</td><br />
</tr><br />
</table><br />
<br />
Before running the test, you have to instruct [[RF.Spice A/D]] what you want to plot at the end of the test. Click the button labeled "'''Preset Graph Plots...'''". A new dialog opens up, which looks like the figure shown above. Select the signals v(1) and v(2) and click the button labeled {{key|Add->}} to move them to the graph table. Click the "Run Test" [[File:b2RunTest_Tool.png]] button of this dialog, or use the keyboard shortcut {{key|Ctrl+B}} to run the transient test. The following figure shows up at the bottom of the Workshop.<br />
<br />
<table><br />
<tr><br />
<td>[[File:b2TUT2_9.png|thumb|720px|Graph of input and output voltages over the 5ms interval.]]</td><br />
</tr><br />
</table><br />
<br />
Since the period of the input pulse waveform is 1ms, your specified time interval contains 5 periods. Both the source signal and output voltage signal are plotted on the same graph. The signal overshoot at the rise and fall of the pulse train are better visible here. In order to examine this transient behavior in more detail, change the transient test parameters as follows:<br />
<br />
{| border="0"<br />
|-<br />
| valign="top"|<br />
|-<br />
{| class="wikitable"<br />
|-<br />
! scope="row"| Start Time<br />
| 0<br />
|-<br />
! scope="row"| Stop Time<br />
| 10u<br />
|-<br />
! scope="row"| Linearize Step<br />
| 1n<br />
|-<br />
! scope="row"| Step Ceiling<br />
| 1n<br />
|-<br />
! scope="row"| Preset Graph Plots<br />
| v(1), v(2)<br />
|}<br />
<br />
[[File:b2TUT2_11.png|thumb|250px|Edit Axes dialog.]]<br />
Run the transient test once again and examine the new graph that replaces the previous one. The transient behavior of the circuit in the first 10 microseconds is clearly visible now. You can further zoom in on that part of the graph. Make the graph view active and open the "'''Edit Axes'''" tab of the '''Toolbox'''. <br />
<br />
<table><br />
<tr><br />
<td>[[File:b2TUT2_10.png|thumb|720px|Graph of input and output voltages over the 10&mu;s interval.]]</td><br />
</tr><br />
</table><br />
<br />
<table><br />
<tr><br />
<td>[[File:b2TUT2_12.png|thumb|720px|Details of the graph after editing the minimum and maximum values of the left axis.]] </td><br />
</tr><br />
</table><br />
<br />
== Changing the Source Period ==<br />
<br />
The square wave input signal you used in the previous part had a period of 1ms corresponding to a repetition frequency of 1kHz. In this part, you will change this frequency to 10MHz. Open the property dialog of your voltage source and in its Transient tab set the following parameters: <br />
<br />
{| border="0"<br />
|-<br />
| valign="top"|<br />
|-<br />
{| class="wikitable"<br />
|-<br />
! scope="row"| V1<br />
| Initial Voltage<br />
| 0<br />
|-<br />
! scope="row"| V2<br />
| Peak Voltage<br />
| 1<br />
|-<br />
! scope="row"| Td<br />
| Initial Delay Time<br />
| 0<br />
|-<br />
! scope="row"| Tr<br />
| Rise Time<br />
| 1n<br />
|-<br />
! scope="row"| Tf<br />
| Fall Time<br />
| 1n<br />
|-<br />
! scope="row"| Pw<br />
| Pulse Width<br />
| 50n<br />
|-<br />
! scope="row"| Period<br />
| Period<br />
| 100n<br />
|}<br />
<br />
Open the setting dialog of the transient pest panel and change the test parameters as shown in the table below:<br />
<br />
{| border="0"<br />
|-<br />
| valign="top"|<br />
|-<br />
{| class="wikitable"<br />
|-<br />
! scope="row"| Start Time<br />
| 0<br />
|-<br />
! scope="row"| Stop Time<br />
| 1u<br />
|-<br />
! scope="row"| Linearize Step<br />
| 1n<br />
|-<br />
! scope="row"| Step Ceiling<br />
| 1n<br />
|-<br />
! scope="row"| Preset Graph Plots<br />
| v(1), v(2)<br />
|}<br />
<br />
Run the transient test and examine the new graph that replaces the previous one. As you can see from the graph, your lowpass filter has now filtered out the high frequency spectral contents of the input pulse train. The output voltage is sinusoidal with a frequency of 10MHz. <br />
<br />
<table><br />
<tr><br />
<td>[[File:b2TUT2_12A.png|thumb|720px|Graph of input and output voltages over the 10&mu;s interval.]]</td><br />
</tr><br />
</table><br />
<br />
== Setting Up and Running an AC Sweep Test ==<br />
<br />
[[File:b2TUT2_18.png|thumb|500px|Voltage source.]]<br />
<br />
The AC Sweep Test generates the frequency response of a circuit. When you run an AC sweep test, the voltage sources always act as sinusoidal signal sources regardless of the type you have specified in the transient tab of the property dialog of the individual sources. Furthermore, the frequency of that source signals will be stepped through a range of frequencies while the response of the circuit is recorded at each step.<br />
<br />
Before you run an AC sweep test, you need to instruct [[RF.Spice A/D]] which signal sources you want to treat as AC sources. To do so, double-click on your voltage source to open its property dialog. This dialog has two tabs. The first tab, which you saw earlier, is labeled as "'''DC & Transient'''". The second tab, which you should open now, is labeled as "'''Small-Signal AC & Distortion'''". At the top of the tab is a box labeled '''Small-Signal Offset''' with units of V/A. When your circuit has active devices, it is important to set a DC bias point. This box will set the DC offset of your source. For this lesson, leave this box blank. Next, you will see a section titled "AC Properties for Small Signal AC Analysis Only". This section consists of boxes for Magnitude and Phase of the AC source plus the '''Use''' check box. You have to check the last box to include the signal source in your AC analysis. Set the magnitude to 1V and phase to 0 degrees. <br />
<br />
{{Note|You cannot run an AC sweep test if none of your signal sources has an AC designation. [[RF.Spice A/D]] will generate an error message.}} <br />
<br />
Next, open the '''Tests''' tab of the '''Toolbox''', select the "'''AC Frequency Sweep'''" and click the Setup button to open the AC Sweep Settings Dialog. Set the frequency sweep parameters according to the table shown. These specifications tell the simulator to step 20 points per each decade, and a decade is a factor of 10.<br />
<br />
{| border="0"<br />
|-<br />
| valign="top"|<br />
|-<br />
{| class="wikitable"<br />
|-<br />
! scope="row"| Start Frequency<br />
| 1Meg<br />
|-<br />
! scope="row"| Stop Frequency<br />
| 100Meg<br />
|-<br />
! scope="row"| Steps/Interval<br />
| 20<br />
|-<br />
! scope="row"| Interval Type<br />
| Decade<br />
|-<br />
! scope="row"| Preset Graph Plots<br />
| vdb(2), vp_deg(2)<br />
|}<br />
<br />
<table><br />
<tr><br />
<td>[[File:b2TUT2_21.png|thumb|400px|AC Test Settings dialog.]]</td><br />
</tr><br />
</table><br />
<br />
[[File:b2TUT2_19.png|thumb|480px|Edit Plots List Dialog]]<br />
Before running the test, also specify the observables of your AC circuit simulation. Make sure that the '''Single Test''' tab is selected and the check box labeled "'''Graph'''" is checked in the "Output Results Options" section of the dialog. Click the button labeled "'''Preset Graph Plots...'''". <br />
<br />
{{Note|An AC analysis involve complex-valued voltages and currents. You have to specify the format of the complex-valued signals.}} <br />
<br />
Select the signals vdb(2) and vp_deg(2) and click the button labeled {{key|Add->}} to move them to the graph table. This will produce plots of the magnitude and phase of the voltage at node 2 expressed in the dB scale and degrees, respectively. Click the "Run Test" [[File:b2RunTest_Tool.png]] button the test dialog, or use the keyboard shortcut "'''Ctrl+B'''" to run the AC sweep test. The following figure shows up at the bottom of the Workshop in a new Graph window:<br />
<br />
<table><br />
<tr><br />
<td>[[File:b2TUT2_20.png|thumb|720px|Graph of amplitude and phase of the output AC voltage vs. frequency on a logarithmic scale.]]</td><br />
</tr><br />
</table><br />
<br />
You will notice that the amplitude and phase plots are initially plot on the same graph. First click on the surface of the plot to enable the "Graph View Mode". Note that the contents menu bar at the top of the screen changes. From the Edit Menu, select '''Separate Plots with Vertical Tiling'''. This splits the original graph to two separate graphs for the amplitude and phase. The amplitude graph is in the form of a Bode plot. That is, the magnitude is plotted in decibels, 20*log(Y value), and the frequency is plotted on a log scale. Keep in mind that since the amplitude of the input AC signal is fixed at 1V over the entire frequency range, its plot would be a horizontal line at 0dB. You can see from the graph that the output voltage drops to -3dB at about 7.5MHz.<br />
<br />
<p>&nbsp;</p><br />
[[Image:Back_icon.png|40px]] '''[[RF.Spice_A/D#RF.Spice_A.2FD_Tutorials | Back to RF.Spice A/D Tutorial Gateway]]'''</div>Kazem Sabet