04_passive_tr: time domain simulation: tran

Scope

In this simulation we are going to look at how a multi-stage RC filter behaves when the input voltage is switched from 0 to 5V.

The schematics

The single-sheet schematic contains the filter, directly usable in the PCB workflow.


Click the image to get the sch-rnd sheet; also requires this project.lht in the same directory

SPICE: what a tran simulation is

In the tran(sient) analysis a DC solution is calculated first then a simulation is run with a fixed time stepping, updating the internal states of components (e.g. capacitor charges) and networks (voltages). The result is typically a graph with time along the X axis and voltages/currents on the Y axis.

Preparing for simulation

The process is largely the same as in the base example of dc op point . The simulation setup in this example is called "dc transition". Below are the summary of differences for the current example.

Modifications

Our input source is not a stable DC voltage source anymore, but a pulse. It's still a 'V' for voltage source, connected to CN1-2, but the dc and ac components are left empty and the time dependent value is set to pulse. This exposes a set of pulse-specific fields. The setup in this example uses a square wave that starts at 0V, goes up to 5V after 1 usec (TD). It's not a perfect square, rather a trapezoid, with raise and fall time of 1 usec each (TR and TF).


Simulation modification, adding a pulse source

Note: details of the available functions and their fields can be found in the relevant section of the ngspice manual.

Sim setup: output config

Analysis is set to transient (linear). Linear means the X axis will be presented as a linear axis (common for time domain simulations). Start time is not specified so it is assumed to be 0. Simulation stop time is set to 200 miliseconds, sampling done at 1ms rate (resulting about 200 rows of data).


Simulation output configuration for transient + plot

Presentation is set to plot and the input and two output nets are listed by net name.

Sim setup: run & output

After running the simulation a plot is presented with three color coded traces. The plot can be zoomed and panned with the mouse scroll button. A left click at any point of the plot reads out the closest x value and corresponding y values for the three traces; these are printed above the plot.


Simulation setup dialog, third tab, after execution