You are on page 1of 20

Transient simulation (.

Tran)
Ye Zhao, PhD

© 2019 EEsanity A few slides are updated 1


[Simple example: a voltage divider]
Design requirement are:
• Input: voltage step (Vin): 0 to 20 Vdc
• Output voltage ranges from 0 to 2 Vdc
• Voltage sensing gain Hv = R2/(R1+R2) is chosen as = 2V/20V = 1/10
• We choose R1=90 kohm and R2=10 kohm

Vin
Vin
20V
R1
Vsen
0V time R2
1ms 2ms

2
Let’s get started in LTspice
Front panel

• Toolbar: Move your mouse to each icon and


check its name and function.

• It is highly recommended to remember some


commonly used shortcuts (on next slide)

3
Independent voltage source
• Let’s make the same schematic capture in LTspice

• Pulse: rise time = 1ns, delay 1ms

Updated 4
Transient simulation (.tran) - Perform a Nonlinear Transient
Analysis. A simulation directive always starts with a dot
• Let’s make the same schematic capture in LTspice

• Pulse: rise time = 1ns, delay 1ms


• Run simulation, stop time = 2ms

Updated 5
.TRAN -- Perform a Nonlinear Transient Analysis
• Perform a transient analysis. This is the most direct simulation of a circuit.
It basically computes what happens when the circuit is powered up. Test
signals are often applied as independent sources.
• Syntax: .TRAN <Tstep> <Tstop> [Tstart [dTmax]] [modifiers]
.TRAN <Tstop> [modifiers]
• The first form is the traditional .tran SPICE command. Tstep is the plotting
increment for the waveforms but is also used as an initial step-size guess.
LTspice uses waveform compression, so this parameter is of little value
and can be omitted or set to zero. Tstop is the duration of the simulation.
Transient analyses always start at time equal to zero. However, if Tstart is
specified, the waveform data between zero and Tstart is not saved. This is
a means of managing the size of waveform files by allowing startup
transients to be ignored. The final parameter dTmax, is the maximum time
step to take while integrating the circuit equations. If Tstart or dTmax is
specified, Tstep must be specified.
• Several modifiers can be placed on the .tran line.
• Source: LTspiceHelp, by pressing F1 on keyboard
6
When you hit the “Run”

• The plotting window will pop up


Running man
• Need to add the traces of interest

PULSE(0 20 1ms 1ns 0 1ms)

Updated 7
Add traces to the plot by clicking the mouse: voltage or current
Left click the following traces on by one: Vin, Vsen and current of R1

• Voltage probe Current probe (direction of


arrow)

PULSE(0 20 1ms 1ns 0 1ms) PULSE(0 20 1ms 1ns 0 1ms)

Voltage Current
axis axis

Updated
8
Show the Grid. Zoom in and check the rise time = 1ns
Zoom full extents (shortcut CTRL+E)

Current
Voltage axis
axis
V(vin) and I(R1) are overlapping!

9
http://eecs.oregonstate.edu/education/docs/tutorials/LTSpiceIntro.pdf
If we check “Mark Data points”, we can see each data points

• Since LTspice uses variable time step to solve the convergence


problem, there is only a few data points along with each trace.
• These data points (even though only a few) preserves all the
necessary transient behavior of the circuit.

10
To check the raw data

• Put plot window in active


• Then go to File Export data as text  Select waveforms to
export

PULSE(0 20 1ms 1ns 0 1ms)

Updated 11
You can open it using Window’s Notepad

This makes it possible to export data into data processing software


such as Matlab or Octave.

12
In the plot window, Add Plot Pane

13
Left click V(Vin) and drag it to the top pane
Do the same thing on V(vsen)

14
By right click the name of each trace to change the color
Ctrl + left click the trace name to see Average and RMS values
in the given time window

15
The maximum timestep

• As shown below, we set the


maximum timestep as 10ns.
• This results in much more raw
data, which may be unnecessary

16
If we check the raw data.txt as did previously, it shows much
more data are generated and saved than before

17
[Tricks] Power consumption over a component
• “After doing a transient simulation, place the cursor over the component for the power
measurement, hold the ALT key, and left click.
The will display a graph of the power dissipated over the simulation time.”
• “To get the average power over that period, place the cursor over the title for the power graph, hold
the CTRL key, and left click.
Note that if you want the average power of a periodic wave, then you need to display an integral
number of complete cycles.”
ALT key + left click
CTRL key +
left click

PULSE(0 20 1ms 1ns 0 1ms)

http://eecs.oregonstate.edu/education/docs/tutorials/LTSpiceIntro.pdf
https://forum.allaboutcircuits.com/threads/show-the-power-in-ltspice.110252/ Updated 18
It’s better to
memorize the
shortcuts that are
often used.

Source:
http://cds.linear.com/docs/en/software
-and-
simulation/LTspice_ShortcutFlyerC.pdf

19
All done for this lecture

© 2019 EEsanity 20

You might also like