![]() |
Qucs Tutorial - DC Parameter Sweep
This tutor aims at giving the feeling of how to use Qucs to people -especially to students like me- who would like to be independent from comercial or impossible to obtain tools. In this tutorial we will sweep Vds of an nMOS transistor while keeping the Vgs constant to produce the caracteristic I-V curve. See the web page of the tool; there you can find lots of usefull stuff, in terms of both theoric and practic. Click on the image on the left to see what we will achieve. We will use DC analisys, parameter sweep and equation functions of the tool. The project directory is also available here (must be copied to .qucs directory at the users home). Click here for Türkish version. |
Assuming
that you have Qucs installed, start the application. The main window
which is very user friendly comes up. Here the tabs "Projects, Content,
Components" are especially important; they hide a great amount of
functionality. The names listed as LLD, Mirrors and so on are my previous projects already developed. |
![]() |
Using
Project > New Project menu item, create a new project in which our
circuits will reside. Give a new as you wish. |
![]() |
See,
on the
Content tab, Schematics-DataDisplays-DataSets lines which will contain
the schematics, the plots of our simulation results and the data sets
respectively. Now we have a schematic entry window named untitled onto
which we will put the circuit. If you activate Projects tab, you must see the additional name silBeni since it is the last project created. |
![]() |
Using
the
Components tab, put all the items seen in the schematic :
|
![]() |
Now
we will
set the parameters of the components. Double click on V2 and set U
variable of the ideal dc voltage source to Vsweep; this is the
parameter that we want to be swept. Redo the same thing for V1 but the
value would be 0.6 V. (Note that one must click on Apply, OK does NOT
apply before closing the window; I used QucsV07) |
![]() |
Set
nMOS
parameters. Double click on it, list of the modelled parameters and
their current values comes up. Set Lambda to 0.4 and click Apply. As
seen from the list, if one does not set parameters like that (they are
either 1 or 0, that is, un-effective) simply they are not used. I find
this very usefull because one can observe the effects of each model
parameter on the simulation results. If you keep the initial value of
Lambda as it was (zero) a perfect I-V curve would be produced. |
![]() |
Setting
the
dc simulation parameters. Double click on the dc simulation box that we
just put on the left bottom side in the schematic view. I kept the
inital values as they are here since they look convenient. The name of
our dc simulation is DC1 that is to be used in the next step. |
![]() |
Selsect
the
parameter sweep options. Double click on the related box within the
schematic view. Set the name
of the simulation to DC1 that tells Qucs
that the dc parameters will be calculated by DC1 object so that Qucs
will know who to ask for the dc calculation. Then set the
parameter
name as Vsweep; this is the value of V2 ideal voltage source in our
schematic. I wanted Vdd to be 1.5V. Set the start-stop-step values and
the Number is calculated automatically. This is basically the
resolution of our simulation. The bigger this number is, the longer
you wait :) but the better results you would have. |
![]() |
Use
the
Simulation > Simulate menu item on the menu bar to start the
simulator. If everything is ok, you can browse the output log by
Simulations > Show Last Messages. According to this output, there is
no error. |
![]() |
After
lightning-fast simulation step, a new tab named *.dpl becomes visible.
This view waits us to put plots on it. Using the Components > diagrams, select a Cartesian object. Click on the empty area. An empty plot is created. Double click on the empty plot and see the next step. |
![]() |
You
will
see the plottable variables on the left side and selected variables on
the right. Double click on V2.I (or on whatever the name of your item)
on
the left and it is transfered to the right side. Set other trivial
parameters like color and thickness and click on Apply. You can also
set the limits of the plot by hand but now we do not need such an
operation that can be very annoying sometimes. |
![]() |
And
we have
the plot. The polarity of current depends on how you plot the valiable.
This is the current that is sinked from V2 source in the schematic.
Note that the transition between lineer and saturation regions is not
as smooth as we expect. This is basically because of the number of
steps of the dc sweep. We will fix this later. |
![]() |
Using
the
related tool bar button (the one on which M1 is written), you can put
markers on the curves plotted. At this point you can verify, from the
two points that the variable lambda is 0.4; this is where this tool is
very handy for me : it gives exactly what you calculate by hand,
provided that you set device parameters accordingly. Event hough, this
sounds very normal, it is never the case for commercial simulators
since they use extremely complicated models that are extracted for a
specific technology. So sometimes you loose the taste of the initial
design phase :) in which everything is under control. For having the idea on how to do the verification mentioned above, you can also see another tutorial performed with another tool but the idea is exactly the same. (See especialy Method #1 in that tutor) But we will do the same thing here in this tutorial as well. It is at the end of this page. We will use the equation functionality of the tool. Now just continue with the next step. |
![]() |
To
improve
the result, now set the Number to 160 in the dc sweep simulation box as
we did one of the previous steps. See that the Step field is
re-calculated automatically. |
![]() |
Re-simulate
as you did before and see that the transition is better. (Set lambda to
zero again and re-simulate to see a "perfect" I-V curve) |
![]() |
Play
with
the tool; the best way to learn a tool is to use it. Not all the plot
types are possible for all types of simulations but as an example I put
Components > Diagrams > Tabular object. It shows the numerical
values for V2.I, that is, the current flowing through ideal dc voltage
source V2. |
![]() |
Using
the equation functionality
: put
an equation entry by using the related tool bar button (the one on the
right of "NAME" button). Background : Remember the simplified saturation region Id expression : ![]() ![]() |
![]() |
Enter
the equations. On the right side of the window, there are two entry
spaces. The above one represents the left side of the equation and the
below one represents the right side of the equation. In this window,
Id=V2.I means that we declare Id as the current flowing through the
ideal voltage sourge named V2. Id itself is used in the lambda
expression. Diff is one of the functions the tool provides, stands for
differentiation. See the official documents of Qucs for a complete
reference. |
![]() |
Re-simulate
the circuit. This time the equations will be handled. Create a plot as
you did in one of the previous steps. Double click on it and you will
see the items from the equation entry in the plot details window as
seen here. Select lambda by double clicking on it. |
![]() |
Here
is the result. The lamda is what we set which is 0.4; it is constant
over a wide range. You can also put plots on the schematic view in case
of pretty output on one page is required. Also see another tutorial
performed by a commercial simulator here.
See especially the Method #2 in that tutor. |
![]() |