User Tools

Site Tools


The Analog Dog Blog

Day 1 -- Transistor Characterization ID-VDS

Today let's do some basic simulations using the ON Semiconductor C5 models. I built the schematic for a NMOS device with two independent voltage sources in XCircuit.

In the schematic, you can see three voltages sources, V1, V2, and VM. In the simulation we will sweep VDS (V1) from 0V to 5V for fixed gate voltages (V2) to generate the ID-VDS family of curves. Notice that VM is set to 0V. It is essentially a short circuit. The reason that it is included in the schematic is only because ngspice can only measure current through voltage sources. One could just use the VDS source to measure the current, but since it is sourcing current, the result would be negative. Also, notice that V1 and V2 have values assigned which will be used for the operating point simulation.

The big red labels are net/node names.

Below you can see the net list created by XCircuit.

**SPICE circuit <ID-VDS> from XCircuit v3.7 rev 57

M1 D G GND 0 N1 w=20u l=2.0u m=1


The first line is the title of the file. I believe that all lines that start with * are comments, but the first line is the title line.

The netlist is in the following format:

<letter><name> <n1> <n2> …[mname] [parvals]

Once we have the netlist, we have to add the commands to simulate and plot.

To do that, I'll append the following to the netlist file

.include ami_models.txt

destroy all
dc V1 0 5 0.01 V2 0 5 1
plot i(VM) xlabel VDS ylabel IDS

The first line, .include ami_models.txt is just to include the model file.

The .control line enters ngspice into control mode, which allows one to write out the commands just like in the interactive mode (we'll get to that later).

destroy all clears all previous simulation data and plots.

Next I have a comment showing the syntax for the dc simulation. *DC SOURC1 VSTART VSTOP VSTEP SOURC2 START2 STOP2 STEP2 The next line runs the simulation, sweeping V1 from 0V to 5V in 0.01V steps. It then steps V2 from 0V to 5V in 1 steps. This will generate the ID-VDS family of curves for the device.

dc V1 0 5 0.01 V2 0 5 1

After the simulation is run, one needs to plot the data.

plot i(VM) xlabel VDS ylabel IDS

The last command runs an operating point simulation (just a dc simulation at one point).

and now for the results….

We can explore the DC node voltages computed from the operating point simulation using the print command.

You can also use the show command to print information about non-linear devices.

Look at all that useful information!

day_1_10-14-2015.txt · Last modified: 2015/10/14 21:59 by admin