Changes

/* 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 B2RF2.Spice's Device EditorManager. 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 ==
</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]].
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:
== 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 B2RF.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:
{| border="0"|-| valign="top"||-{| class="wikitable"|-! 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.
|}
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.
{{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.}}
<p>&nbsp;</p>
[[Image:Back_icon.png|40px]] '''[[RF.Spice_A/D#RF.Spice_A.2FD_Tutorial 2FD_Tutorials | Back to RF.Spice A/D Tutorial Gateway]]'''
28,333
edits