20160901

Rectangular(square) wave in LTspice.(Usage "limit" function)

20160831 screenshot0000.png

Usage "limit" function: limit(x, min, max)

For example,
V = limit(sin(10 * 2 * pi * time), -1e-2, 1e-2)

20160831 screenshot0000.png

with offset
V = limit(sin(10 * 2 * pi * time), -1e-2, 1e-2) + 1e-2

20160831 screenshot11.png

steep slope
V = limit(sin(10 * 2 * pi * time), -1e-2, 1e-2) * 10


Read B-Sources part in Undocumented LTspice for more details.


1. Put two GNDs.
20160831 screenshot00.png

2. Then put a voltage source
20160831 screenshot01.png
20160831 screenshot02.png

3. Then put a Resistor or something, set parameter of it and wire them.
20160831 screenshot03.png
20160831 screenshot04.png
20160831 screenshot04-1.png20160831 screenshot04-2.png

4. Then set parameter of the voltage source(in this step, sin curve is setted.)
Don't forget typing "V =" or error message will be apeared.
Don't forget typing "time" for argument in sin function or the transient shape will be DC.
for example,
V = sin(2 * pi * 10 * time)
in case of 10 Hz.
20160831 screenshot05.png
20160831 screenshot06.png
20160831 screenshot07.png

5. Run
20160831 screenshot08.png
20160831 screenshot09.png

V = sin(2 * pi * 10 * time)
20160831 screenshot08-1.png

V = limit(sin(10 * 2 * pi * time), -1e-2, 1e-2)
20160831 screenshot0000.png


英語のサイトを参考にしたので、たまには英語で書いてみる。
間違ってたらごめん。

posted by yuchan at 07:00 | Comment(0) | LTspice