Difference between revisions of "Analog Tutorial Lesson 5: Creating a New Part from Your Analog Circuit"

From Emagtech Wiki
Jump to: navigation, search
(What You Will Learn)
 
(19 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{projectinfo|Tutorial| Creating a New Part from Your Circuit |b2TUT5_1.png|In this project, the basic concepts of RF.Spice A/D are demonstrated, and a simple voltage divider is modeled and examined.|
+
{{projectinfo|Tutorial| Creating a New Part from Your Analog Circuit |b2TUT5_1.png|In this project, you will first build and test a voltage doubler circuit and you will then turn it into a reusable database part.|
  
*[[CubeCAD]]
+
*Diode
*Visualization
+
*Markers
*[[EM.Tempo#Lumped Sources | Lumped Sources]]
+
*Subcircuit Port Marker
*[[EM.Tempo#Scattering Parameters and Port Characteristics | S-Parameters]] 
+
*Transient Test
*[[EM.Tempo#Far Field Calculations in FDTD | Far Fields]]
+
*Parametric Sweep
*[[Advanced Meshing in EM.Tempo]]
+
*Sweep Parameter
|All versions|{{download|http://www.emagtech.com/content/project-file-download-repository|EM.Tempo Lesson 1|[[EM.Cube]] 14.8}} }}
+
|All versions|{{download|http://www.emagtech.com/downloads/ProjectRepo/AnalogLesson5.zip Analog Lesson 5}} }}
  
 
=== What You Will Learn ===
 
=== What You Will Learn ===
  
[[RF.Spice A/D]] allows you to take a circuit and turn it into a user defined part. Almost any circuit can be turned into a part with just a few steps. The new device is stored in [[RF.Spice]]'s '''Parts Database'''. You can create multiple instances of your new device in any circuit. In this tutorial lesson, you will learn how to use B2.Spice's Device Editor. You will create a voltage multiplier circuit as shown below and then will turn it into a new database device. in this lesson, you will also learn how to set up a parametric sweep in [[RF.Spice A/D]].  
+
[[RF.Spice A/D]] allows you to take a circuit and turn it into a user defined part. Almost any circuit can be turned into a part with just a few steps. The new device is stored in RF.Spice's '''Parts Database'''. You can create multiple instances of your new device in any circuit. In this tutorial lesson, you will learn how to use RF2.Spice's Device Manager. You will create a voltage multiplier circuit as shown below and then will turn it into a new database device. in this lesson, you will also learn how to set up a parametric sweep in [[RF.Spice A/D]].
  
 
== Building the Voltage Doubler Circuit ==
 
== Building the Voltage Doubler Circuit ==
Line 46: Line 46:
 
| Diode
 
| Diode
 
| Defaults
 
| Defaults
 +
|-
 +
! scope="row"| IN
 +
| Subcircuit Port Marker
 +
| N/A
 +
|-
 +
! scope="row"| OUT
 +
| Subcircuit Port Marker
 +
| N/A
 +
|-
 +
! scope="row"| GND
 +
| Subcircuit Port Marker
 +
| N/A
 
|}
 
|}
  
 +
[[File:b2TUT5_2.png|thumb|400px|The Marker's property dialog.]]
 
Connect the part as shown in the figure below and place a ground.
 
Connect the part as shown in the figure below and place a ground.
  
Line 58: Line 71:
 
</table>
 
</table>
  
=== Assigning Markers ===
+
Markers have many uses in [[RF.Spice A/D]]. First and foremost, they are used to identify and label the nodes of a circuit. When creating a new part out of your circuit, you need to use markers to designate the input/output nodes or pins of your new device. In other words, you need subcircuit port markers. To place a '''Subcircuit Port Marker''', you can use the keyboard shortcut {{key|Alt+R}}, or alternatively, you can go to the '''Markers Submenu''' of the '''Parts Menu''' and pick up the right marker type.
 
+
[[File:b2TUT5_2.png|thumb|300px]]
+
 
+
Markers have many uses in [[RF.Spice A/D]]. First and foremost, they are used to identify and label the nodes of a circuit.
+
  
 
{{Note|If two nodes in a circuit have markers with the same name, then those two nodes are considered to be identical or connected to each other.}}
 
{{Note|If two nodes in a circuit have markers with the same name, then those two nodes are considered to be identical or connected to each other.}}
 
    
 
    
When creating a new part out of your circuit, you need to use markers to designate the input/output nodes or pins of your new device. Markers have several properties. For example, they can be used for designating net names or aliases, or as voltage probes, or as subcircuit ports. To place a marker, you can use the keyboard shortcut "'''Alt+N'''" for a '''Net Marker''', "'''Alt+L'''" for '''Voltage Probe Marker''', or  "'''Alt+R'''" for '''Subcircuit Port Marker''', respectively. Or alternatively, you can go to the '''Markers Submenu''' of the '''Parts Menu''' and pick up one of the several marker types offered. For this lesson, create three Subcircuit Port Markers and label them IN (input port), OUT (output port) and GND (ground). Place your markers as shown in the above figure. Double-click on the markers to open their property dialog as shown in the figure below and change their names.   
+
{{Note|For analog and mixed-mode circuits, you use '''Subcircuit Port Markers''' to designate the ports and device pins.}}
 
+
{{Note|For analog and mixed-mode circuits, you use "'''Subcircuit Port Markers'''" to designate the ports and device pins. For digital circuits, you simply use the "'''Digital Inputs'''" and "'''Digital Outputs'''" in place of Markers. Double-click on the digital Input/Output port, name it, and check the box labeled "'''Use as Subcircuit Port'''".}}
+
  
 
== Running a Transient Test of the Voltage Doubler Circuit ==
 
== Running a Transient Test of the Voltage Doubler Circuit ==
  
To make sure that your voltage doubler circuit works properly, run a quick transient test with the following [[parameters]]:
+
To make sure that your voltage doubler circuit works properly, run a quick transient test with the following parameters:
  
 
{| border="0"
 
{| border="0"
Line 93: Line 100:
 
|-
 
|-
 
! scope="row"| Preset Graph Plots
 
! scope="row"| Preset Graph Plots
| v(in_1), v(out_1)
+
| v(in), v(out)
 
|}
 
|}
  
Line 112: Line 119:
 
At this point, you are ready to create your new part. Go to the Workshop's '''File Menu''' and select "'''Create Part from Circuit...'''", or simply use the keyboard shortcut "'''Ctrl+M'''".  The program will then prompt you for a name. Enter the name you wish for the new part, say, "'''MyVDoubler'''",  and click OK. Then the program will ask if you would like it to create a symbol for your part. If you already have a symbol ready, click NO and Workshop will then ask you to select a symbol from the Parts Database. Otherwise, click YES and Workshop will create a generic box symbol to be used with your new part. The new device "'''MyVDoubler'''" is now in the database and you're ready to use it or further customize it.
 
At this point, you are ready to create your new part. Go to the Workshop's '''File Menu''' and select "'''Create Part from Circuit...'''", or simply use the keyboard shortcut "'''Ctrl+M'''".  The program will then prompt you for a name. Enter the name you wish for the new part, say, "'''MyVDoubler'''",  and click OK. Then the program will ask if you would like it to create a symbol for your part. If you already have a symbol ready, click NO and Workshop will then ask you to select a symbol from the Parts Database. Otherwise, click YES and Workshop will create a generic box symbol to be used with your new part. The new device "'''MyVDoubler'''" is now in the database and you're ready to use it or further customize it.
  
{{Note|After you create a new part either from the Workshop or using Device Editor, you need to close the [[B2.Spice A/D]] application and re-open it to update the '''Parts Bin'''.}}
+
{{Note|After you create a new part either from the Workshop or using Device Editor, you need to close the [[RF.Spice A/D]] application and re-open it to update the '''Parts Bin'''.}}
  
 
== Using Your New Part in a New Circuit ==
 
== Using Your New Part in a New Circuit ==
  
Your new device "MyVDoubler" must by in your '''Parts Bin''' and ready to use. Start a new B2.Spice project in the '''Workshop'''. Open the Parts Bin in the "'''Add Part'''" tab of the '''Toolbox'''. Open the "'''Name'''" tab and click the letter "'''M'''" to display all the part names starting with M. Scroll all the way down to find your new part. Double-click on it and place its ghost on the schematic. You should see a rectangular box like in the figure below.   
+
Your new device "MyVDoubler" must by in your '''Parts Bin''' and ready to use. Start a new [[RF.Spice A/D]] project in the '''Workshop'''. Open the Parts Bin in the "'''Add Part'''" tab of the '''Toolbox'''. Open the "'''Name'''" tab and click the letter "'''M'''" to display all the part names starting with M. Scroll all the way down to find your new part. Double-click on it and place its ghost on the schematic. You should see a rectangular box like in the figure below.   
  
 
[[File:b2TUT5_12.png]]
 
[[File:b2TUT5_12.png]]
Line 122: Line 129:
 
Keep in mind that since you asked the program to create a symbol for your new device automatically, the new symbol might be far from good-looking (as you can see from the above figure). But don't worry - you can change the symbol and improve its appearance as you will do later. For the time being, you would like to see if your new device functions correctly as you would expect. Double-click the device to open its property dialog as shown in the figure below.
 
Keep in mind that since you asked the program to create a symbol for your new device automatically, the new symbol might be far from good-looking (as you can see from the above figure). But don't worry - you can change the symbol and improve its appearance as you will do later. For the time being, you would like to see if your new device functions correctly as you would expect. Double-click the device to open its property dialog as shown in the figure below.
  
{| border="0"
+
<table>
|-
+
<tr>
| valign="bottom"|
+
<td>
[[File:b2TUT5_6.png|thumb|left|350px|Part's Property Dialog]]
+
[[File:b2TUT5_6.png|thumb|340px|The new part's property dialog.]]
| valign="bottom"|
+
</td>
[[File:b2TUT5_7.png|thumb|left|400px|Part's Subcircuit Model Text]]
+
<td>
|-
+
[[File:b2TUT5_7.png|thumb|480px|The new part's subcircuit model text.]]
|}
+
</td>
 +
</tr>
 +
</table>
  
Notice the new symbol appearing in the property dialog of the part. Click the button labeled "Edit Model..." on the right side of the dialog. A new dialog open ups with the title: "'''Edit Subcircuit Text'''" as shown in the above figure. Here you see the Netlist code for your model, which is in fact the Netlist representation of your original voltage doubler circuit minus the voltage source. You can edit this Netlist model at any time if you like. Close both dialogs and return to the [[Schematic Editor]].         
+
Notice the new symbol appearing in the property dialog of the part. Click the button labeled "Edit Model..." on the right side of the dialog. A new dialog open ups with the title: "'''Edit Subcircuit Text'''" as shown in the above figure. Here you see the Netlist code for your model, which is in fact the Netlist representation of your original voltage doubler circuit minus the voltage source. You can edit this Netlist model at any time if you like. Close both dialogs and return to the Schematic Editor.         
  
 
Now, insert a new sinusoidal voltage source with an amplitude of 5V and a frequency of 1MHz identical to the previous section of the lesson. Connect it to the "IN" port of your device. Connect the "GND" pin of your device to the new circuit's ground. At the "OUT" pin of the device, place a large 1M resistor as a sort of "Open" load. Your new circuit should like the figure below:
 
Now, insert a new sinusoidal voltage source with an amplitude of 5V and a frequency of 1MHz identical to the previous section of the lesson. Connect it to the "IN" port of your device. Connect the "GND" pin of your device to the new circuit's ground. At the "OUT" pin of the device, place a large 1M resistor as a sort of "Open" load. Your new circuit should like the figure below:
 
    
 
    
{| border="0"
+
<table>
|-
+
<tr>
| valign="bottom"|
+
<td>
[[File:b2TUT5_13.png|left]]
+
[[File:b2TUT5_13.png|thumb|720px|The results of parametric sweep transient test of the voltage doubler circuit.]]
| valign="bottom"|
+
</td>
[[File:b2TUT5_5.png|thumb|left|600px]]
+
</tr>
|-
+
</table>
|}
+
  
 
Run the same transient test as before from 0 to 10 microseconds. This time look for the voltages at nodes 1 and 2. The resulting graph is shown in the opposite figure. It is almost identical to the previous graph that you got when testing your original voltage doubler circuit. Congratulations! Your new device works!!!
 
Run the same transient test as before from 0 to 10 microseconds. This time look for the voltages at nodes 1 and 2. The resulting graph is shown in the opposite figure. It is almost identical to the previous graph that you got when testing your original voltage doubler circuit. Congratulations! Your new device works!!!
 +
 +
<table>
 +
<tr>
 +
<td>
 +
[[File:b2TUT5_5.png|thumb|720px|The results of the transient test of your new circuit with the new MyVoltageDoubler part.]]
 +
</td>
 +
</tr>
 +
</table>
  
 
== Running a Parametric Sweep ==
 
== Running a Parametric Sweep ==
  
The reason you placed a large 1M resistor at the output of your device was to reproduce the same conditions as in your original circuit just for the purpose of verification. Next, you will explore the effect of resistive loading on your device. You will use B2.Spice's '''"Parametric Sweep"''' capability for this task. The goal is to vary the resistance of R1 and observe the effect on the output voltage, hoping that your new device still continues to provide a clean DC voltage twice as large as the input amplitude. The test type you will perform is still "'''Transient'''" as before.
+
The reason you placed a large 1M resistor at the output of your device was to reproduce the same conditions as in your original circuit just for the purpose of verification. Next, you will explore the effect of resistive loading on your device. You will use RF.Spice's '''"Parametric Sweep"''' capability for this task. The goal is to vary the resistance of R1 and observe the effect on the output voltage, hoping that your new device still continues to provide a clean DC voltage twice as large as the input amplitude. The test type you will perform is still "'''Transient'''" as before.
  
Bring up the '''Transient Test''' from the '''[[Tests]] Toolbox''', and set the [[parameters]] for the test as follows:
+
Bring up the '''Transient Test''' from the '''Tests Toolbox''', and set the parameters for the test as follows:
  
Start Time: 0
+
{| border="0"
 
+
|-
Stop Time: 10u
+
| valign="top"|
 
+
|-
Linearize Step: 10n
+
{| class="wikitable"
 
+
|-
Step Ceiling: 10n
+
! scope="row"| Start Time
 +
| 0
 +
|-
 +
! scope="row"| Stop Time
 +
| 10u
 +
|-
 +
! scope="row"| Linearize Step
 +
| 10n
 +
|-
 +
! scope="row"| Step Ceiling
 +
| 10n
 +
|-
 +
! scope="row"| Preset Graph Plots
 +
| v(in), v(out)
 +
|}
  
 
Don't forget to uncheck the "'''Basic'''" check box of '''Transient Test''' from the previous step of this tutorial lesson. Instead, check the middle check box in the "'''Sweep'''" column as shown in the figure below. Click on the '''Setup''' button to open the Transient Test Setup Dialog, also shown below. Note that this time the "Sweep" tab is active at the lower portion of the dialog.     
 
Don't forget to uncheck the "'''Basic'''" check box of '''Transient Test''' from the previous step of this tutorial lesson. Instead, check the middle check box in the "'''Sweep'''" column as shown in the figure below. Click on the '''Setup''' button to open the Transient Test Setup Dialog, also shown below. Note that this time the "Sweep" tab is active at the lower portion of the dialog.     
Line 171: Line 201:
 
|}
 
|}
  
Click the "'''Sweep Setup...'''" button of the dialog to open up the '''Sweep Settings Dialog''' as shown in the above figure. This is where you set up all your sweep [[parameters]] and their ranges and other properties. In this case, you will sweep the resistance of R1. Note that the top table of the dialog list's all the parts in your circuit along with their individual [[parameters]]. For example, you can see the "resistance" of the resistor "r1" and all the specific properties of the sinusoidal voltage source "v1" including its peak amplitude "Va" and frequency "Freq". Click on the first row of the table to highlight the resistance of "r1". In the middle section of the dialog titled "'''Parameter Setup'''", you will see the name "r1.resistance". Select the radio button "'''Sweep Parameter'''". You will sweep the resistance with the values 1K, 10K, 100K and 1M. So select the "'''Decade'''" option for "'''Interval Type'''". Set the start and end values at 1k and 1M, respectively, with the number of steps per interval equal to 1. Click the "'''Accept Changes'''" button. The sweep [[parameters]] with its values now appears in the bottom table. It shows 4 iterations based on the range you just defined.  
+
Click the "'''Sweep Setup...'''" button of the dialog to open up the '''Sweep Settings Dialog''' as shown in the above figure. This is where you set up all your sweep parameters and their ranges and other properties. In this case, you will sweep the resistance of R1. Note that the top table of the dialog list's all the parts in your circuit along with their individual parameters. For example, you can see the "resistance" of the resistor "r1" and all the specific properties of the sinusoidal voltage source "v1" including its peak amplitude "Va" and frequency "Freq". Click on the first row of the table to highlight the resistance of "r1". In the middle section of the dialog titled "'''Parameter Setup'''", you will see the name "r1.resistance". Select the radio button "'''Sweep Parameter'''". You will sweep the resistance with the values 1K, 10K, 100K and 1M. So select the "'''Decade'''" option for "'''Interval Type'''". Set the start and end values at 1k and 1M, respectively, with the number of steps per interval equal to 1. Click the "'''Accept Changes'''" button. The sweep parameters with its values now appears in the bottom table. It shows 4 iterations based on the range you just defined.  
 
+
[[File:b2TUT5_17.png|thumb|600px]]
+
  
 
{{Note|When you have more than one sweep parameter, you can changes their hierarchical order using the "'''Move Up'''" and "'''Move Down'''" buttons. The order is important for plotting families of curves.}}  
 
{{Note|When you have more than one sweep parameter, you can changes their hierarchical order using the "'''Move Up'''" and "'''Move Down'''" buttons. The order is important for plotting families of curves.}}  
 
      
 
      
 
Close the Sweep Settings Dialog and return to the Transient Test Setup Dialog. In the "Output Results Options" section of dialog, check the "Graph" box. Open the Edit Plots List Dialog and keep only the output voltage signal v(2) in the Graph table. Click the Run button to run the transient sweep test. The graph shown in the opposite figure will appear at the bottom of the Workshop. It shows the output voltage signal for the successive values of the resistance R1. As you can see, once the resistance falls below 100K, the circuit fails to function properly and ripple start to appear. At R = 1K, the output voltage is a sawtooth waveform with a peak amplitude of only 5V as the sinusoidal input.
 
Close the Sweep Settings Dialog and return to the Transient Test Setup Dialog. In the "Output Results Options" section of dialog, check the "Graph" box. Open the Edit Plots List Dialog and keep only the output voltage signal v(2) in the Graph table. Click the Run button to run the transient sweep test. The graph shown in the opposite figure will appear at the bottom of the Workshop. It shows the output voltage signal for the successive values of the resistance R1. As you can see, once the resistance falls below 100K, the circuit fails to function properly and ripple start to appear. At R = 1K, the output voltage is a sawtooth waveform with a peak amplitude of only 5V as the sinusoidal input.
 +
 +
<table>
 +
<tr>
 +
<td>
 +
[[File:b2TUT5_17.png|thumb|720px|The results of parametric sweep transient test of the voltage doubler circuit.]]
 +
</td>
 +
</tr>
 +
</table>
  
 
<p>&nbsp;</p>
 
<p>&nbsp;</p>
[[Image:Back_icon.png|40px]] '''[[RF.Spice_A/D#RF.Spice_A.2FD_Tutorial | Back to RF.Spice A/D Tutorial Gateway]]'''
+
[[Image:Back_icon.png|40px]] '''[[RF.Spice_A/D#RF.Spice_A.2FD_Tutorials | Back to RF.Spice A/D Tutorial Gateway]]'''

Latest revision as of 14:28, 4 November 2015

Tutorial Project: Creating a New Part from Your Analog Circuit
B2TUT5 1.png

Objective: In this project, you will first build and test a voltage doubler circuit and you will then turn it into a reusable database part.

Concepts/Features:

  • Diode
  • Markers
  • Subcircuit Port Marker
  • Transient Test
  • Parametric Sweep
  • Sweep Parameter

Minimum Version Required: All versions

'Download2x.png Download Link: Analog Lesson 5

What You Will Learn

RF.Spice A/D allows you to take a circuit and turn it into a user defined part. Almost any circuit can be turned into a part with just a few steps. The new device is stored in RF.Spice's Parts Database. You can create multiple instances of your new device in any circuit. In this tutorial lesson, you will learn how to use RF2.Spice's Device Manager. You will create a voltage multiplier circuit as shown below and then will turn it into a new database device. in this lesson, you will also learn how to set up a parametric sweep in RF.Spice A/D.

Building the Voltage Doubler Circuit

RF.Spice A/D consists of two separate applications: the Workshop and Device Editor. in this first part of this tutorial lesson, you will build a voltage doubler circuit in the Workshop. Here is a list of the parts needed for your circuit:

Part Name Part Type Part Value
V1 Voltage Source Waveform = Sinusoidal, Amplitude = 5V, Frequency = 1MHz, Offset = 0V
C1 Capacitor 1n
C2 Capacitor 1n
D1 Diode Defaults
D2 Diode Defaults
IN Subcircuit Port Marker N/A
OUT Subcircuit Port Marker N/A
GND Subcircuit Port Marker N/A
The Marker's property dialog.

Connect the part as shown in the figure below and place a ground.

The voltage doubler circuit.

Markers have many uses in RF.Spice A/D. First and foremost, they are used to identify and label the nodes of a circuit. When creating a new part out of your circuit, you need to use markers to designate the input/output nodes or pins of your new device. In other words, you need subcircuit port markers. To place a Subcircuit Port Marker, you can use the keyboard shortcut Alt+R, or alternatively, you can go to the Markers Submenu of the Parts Menu and pick up the right marker type.

Attention icon.png If two nodes in a circuit have markers with the same name, then those two nodes are considered to be identical or connected to each other.
Attention icon.png For analog and mixed-mode circuits, you use Subcircuit Port Markers to designate the ports and device pins.

Running a Transient Test of the Voltage Doubler Circuit

To make sure that your voltage doubler circuit works properly, run a quick transient test with the following parameters:

Start Time 0
Stop Time 10u
Linearize Step 10n
Step Ceiling 10n
Preset Graph Plots v(in), v(out)

Run the transient test and you will get a graph like the one shown in the opposite figure. You can see that after 8 microseconds, the output voltage is an almost clean DC of 8.71V. An ideal voltage doubler would produce a DC voltage of 10V. The discrepancy here is due to the junction voltage drops at the two diodes.

The results of transient test of the voltage doubler circuit.

Creating a New Part

Before creating your new part, you need to make some decisions. Do you want to create a part that functions a one-port DC voltage source with an internal sinusoidal source? Or do you want to create a signal conditioning device that takes a time varying signal at its input port and generates a doubled DC voltage at its output port? In this lesson, you will choose the latter case. Therefore, you do not need the sinusoidal voltage source as part of your new device. Go ahead and delete it!

At this point, you are ready to create your new part. Go to the Workshop's File Menu and select "Create Part from Circuit...", or simply use the keyboard shortcut "Ctrl+M". The program will then prompt you for a name. Enter the name you wish for the new part, say, "MyVDoubler", and click OK. Then the program will ask if you would like it to create a symbol for your part. If you already have a symbol ready, click NO and Workshop will then ask you to select a symbol from the Parts Database. Otherwise, click YES and Workshop will create a generic box symbol to be used with your new part. The new device "MyVDoubler" is now in the database and you're ready to use it or further customize it.

Attention icon.png After you create a new part either from the Workshop or using Device Editor, you need to close the RF.Spice A/D application and re-open it to update the Parts Bin.

Using Your New Part in a New Circuit

Your new device "MyVDoubler" must by in your Parts Bin and ready to use. Start a new RF.Spice A/D project in the Workshop. Open the Parts Bin in the "Add Part" tab of the Toolbox. Open the "Name" tab and click the letter "M" to display all the part names starting with M. Scroll all the way down to find your new part. Double-click on it and place its ghost on the schematic. You should see a rectangular box like in the figure below.

B2TUT5 12.png

Keep in mind that since you asked the program to create a symbol for your new device automatically, the new symbol might be far from good-looking (as you can see from the above figure). But don't worry - you can change the symbol and improve its appearance as you will do later. For the time being, you would like to see if your new device functions correctly as you would expect. Double-click the device to open its property dialog as shown in the figure below.

The new part's property dialog.
The new part's subcircuit model text.

Notice the new symbol appearing in the property dialog of the part. Click the button labeled "Edit Model..." on the right side of the dialog. A new dialog open ups with the title: "Edit Subcircuit Text" as shown in the above figure. Here you see the Netlist code for your model, which is in fact the Netlist representation of your original voltage doubler circuit minus the voltage source. You can edit this Netlist model at any time if you like. Close both dialogs and return to the Schematic Editor.

Now, insert a new sinusoidal voltage source with an amplitude of 5V and a frequency of 1MHz identical to the previous section of the lesson. Connect it to the "IN" port of your device. Connect the "GND" pin of your device to the new circuit's ground. At the "OUT" pin of the device, place a large 1M resistor as a sort of "Open" load. Your new circuit should like the figure below:

The results of parametric sweep transient test of the voltage doubler circuit.

Run the same transient test as before from 0 to 10 microseconds. This time look for the voltages at nodes 1 and 2. The resulting graph is shown in the opposite figure. It is almost identical to the previous graph that you got when testing your original voltage doubler circuit. Congratulations! Your new device works!!!

The results of the transient test of your new circuit with the new MyVoltageDoubler part.

Running a Parametric Sweep

The reason you placed a large 1M resistor at the output of your device was to reproduce the same conditions as in your original circuit just for the purpose of verification. Next, you will explore the effect of resistive loading on your device. You will use RF.Spice's "Parametric Sweep" capability for this task. The goal is to vary the resistance of R1 and observe the effect on the output voltage, hoping that your new device still continues to provide a clean DC voltage twice as large as the input amplitude. The test type you will perform is still "Transient" as before.

Bring up the Transient Test from the Tests Toolbox, and set the parameters for the test as follows:

Start Time 0
Stop Time 10u
Linearize Step 10n
Step Ceiling 10n
Preset Graph Plots v(in), v(out)

Don't forget to uncheck the "Basic" check box of Transient Test from the previous step of this tutorial lesson. Instead, check the middle check box in the "Sweep" column as shown in the figure below. Click on the Setup button to open the Transient Test Setup Dialog, also shown below. Note that this time the "Sweep" tab is active at the lower portion of the dialog.

Transient Test Settings Dialog
Sweep Settings Dialog

Click the "Sweep Setup..." button of the dialog to open up the Sweep Settings Dialog as shown in the above figure. This is where you set up all your sweep parameters and their ranges and other properties. In this case, you will sweep the resistance of R1. Note that the top table of the dialog list's all the parts in your circuit along with their individual parameters. For example, you can see the "resistance" of the resistor "r1" and all the specific properties of the sinusoidal voltage source "v1" including its peak amplitude "Va" and frequency "Freq". Click on the first row of the table to highlight the resistance of "r1". In the middle section of the dialog titled "Parameter Setup", you will see the name "r1.resistance". Select the radio button "Sweep Parameter". You will sweep the resistance with the values 1K, 10K, 100K and 1M. So select the "Decade" option for "Interval Type". Set the start and end values at 1k and 1M, respectively, with the number of steps per interval equal to 1. Click the "Accept Changes" button. The sweep parameters with its values now appears in the bottom table. It shows 4 iterations based on the range you just defined.

Attention icon.png When you have more than one sweep parameter, you can changes their hierarchical order using the "Move Up" and "Move Down" buttons. The order is important for plotting families of curves.

Close the Sweep Settings Dialog and return to the Transient Test Setup Dialog. In the "Output Results Options" section of dialog, check the "Graph" box. Open the Edit Plots List Dialog and keep only the output voltage signal v(2) in the Graph table. Click the Run button to run the transient sweep test. The graph shown in the opposite figure will appear at the bottom of the Workshop. It shows the output voltage signal for the successive values of the resistance R1. As you can see, once the resistance falls below 100K, the circuit fails to function properly and ripple start to appear. At R = 1K, the output voltage is a sawtooth waveform with a peak amplitude of only 5V as the sinusoidal input.

The results of parametric sweep transient test of the voltage doubler circuit.

 

Back icon.png Back to RF.Spice A/D Tutorial Gateway