Installing and using LTspice IV (now including LTXVII), From beginner to advanced

But it is not, it is only different from what one (the modern human) expects.

The F(ahrad) is implicit, so it is always missing (e.g. never included) [the same is true for R(esistance), L, …]

Thus 1p(F), 1n(F), 1(F) etc.

The confusing part is (maybe) that the parser ignores all that is does need and/or understands. This also removes the (F) [implicit or explicit] from the parser output as it is 'extra' [not needed and/or understand]

Thus 1p(F)xxxx<EOL>

This works not universally on everything and everywhere, it seems that the LTspice implementation does not use the same parser for all data.

In this case 1p as expected, the F is implicit, xxxx is any characters up to the end of line, <EOL> is end of line

Also the SPICE parser is ignoring case, thus 'p' is equivalent to 'P' etc.
 
Last edited:
AX tech editor
Joined 2002
Paid Member
Frans, Karl, mystery solved.
The issue is the freq range analyzed versus the period for the waveform.

Someone at the Yahoo LTspice forum suggested this:

Code:
The following delay.net file:

~~~
* delay
B1 out 0 V=V(src) laplace=exp(-s*period)
V1 src 0 AC 1
.param period=50us
.ac dec 1000 2k 30k
.end
~~~

... produces a perfect circle when you 
look at V(out) in Nyquist view with linear axes.

But if I increase the freq range for the .ac, or the period in the param statement, the circle progressively becomes a 'ball of wound wool', filling up from outside to inside! See attachments.

Which I believe can be taken care of by making the period a specific fraction of the stop frequency.

The other ways of drawing the circle probably had a similar issue.

Jan
 

Attachments

  • 50us 5Meg.JPG
    50us 5Meg.JPG
    455.2 KB · Views: 119
  • 5us 500k.JPG
    5us 500k.JPG
    137.5 KB · Views: 117
  • 5us 5Meg.JPG
    5us 5Meg.JPG
    161.3 KB · Views: 115
AX tech editor
Joined 2002
Paid Member
Try increasing the number of steps in the .ac line, you are seeing interpolation between datapoints.

Also you are plotting multiple-turn circles, so the datapoints are a lot farther apart than they need to be.

Anthony, that does not seem the case. Less points leads to a circle circumference that starts to show line segments instead of smooth curvature, but does not influence the '# of circles' so to say.
20 points vs. 2000 points.

Jan
 

Attachments

  • 20points.JPG
    20points.JPG
    126.9 KB · Views: 120
  • 2000points.JPG
    2000points.JPG
    128.8 KB · Views: 102
Last edited:
Jan, I played with it and figured out how to limit the circle to 1 turn and not waste data points. You have to let the Laplace transform know over what BW it needs to plot the circle, otherwise the circumference will change depending on the AC settings.

EDIT: sorry, that one was bad. Image updated.

To get an even smoother circle, set the AC analysis to linear. With logarithmic frequency the points concentrate towards the high frequencies.
 

Attachments

  • Nyquist-circleplot-LTspice-keantoken.png
    Nyquist-circleplot-LTspice-keantoken.png
    60.1 KB · Views: 65
Last edited:
AX tech editor
Joined 2002
Paid Member
Excellent!
I guess the 20k in the Laplace is related to the 50uS period.
Can that also be parametrized and made dependent on other parameters?
I mean, period = 1/20k which is the frequency you put in the Laplace. Why 20k?

Edit: if you make that 'test freq' = 1, and the period 1/1 = 1, it also works fine.

So the final then becomes:

V=V(src) laplace=exp(-s*(stopfreq-startfreq)**-1)

Thanks,

Jan
 
Last edited:
Yes, I just realized that. I thought the period was a Laplace variable. Ah, what will I do with myself. :/

It could be simplified to laplace=(-s*ACstop**-1) if you can tolerate a small gap in the circle.
 

Attachments

  • Nyquist-circleplot-LTspice-keantoken.png
    Nyquist-circleplot-LTspice-keantoken.png
    55.9 KB · Views: 69
Last edited:
AX tech editor
Joined 2002
Paid Member
So to wrap up so far: the blue curve is the 6dB gain curve. If I understand the theory correctly (not 100% sure yet) this shows that at some frequency the gain margin is minimum at 6dB. That freq being about 1.3MHz.

Thanks guys, this was a very nice exercise, learned some new tricks thanks to you.

Jan
 

Attachments

  • 6dB.JPG
    6dB.JPG
    128.6 KB · Views: 112
AX tech editor
Joined 2002
Paid Member
Little strange I get no mail anymore from diyaudio if there are posts. just suddenly I get nothing, now for more then a week.

I am getting the notifications for this thread daily, seems still to work.
But I know Jason is working on a complete overhaul/replacement of the forum so maybe sometimes pieces break and are then fixed.

BTW I probably will visit my sister in Sprang-Capelle this afternoon. I'll wave to you ;-)

Jan
 
That would be nice but in all simulators I have seen a number alone always works, like 1e-15 is always a femto-Farad. Differentiation between upper and lower case letters is always problematic especially with software that has a long legacy. Case in point email addresses.

But for email there is a good reason Baudot code - Wikipedia :)

Note that SPICE may claim the same reason, but it then is not a good reason, it was (most likely) done for easy(er) parsing and compatibility with (then) older terminals (even Baudot teletypes).

Anyway, one days solution is an other days problem. I think SPICE needs a workover :)
 
Last edited:
I am getting the notifications for this thread daily, seems still to work.
But I know Jason is working on a complete overhaul/replacement of the forum so maybe sometimes pieces break and are then fixed.

BTW I probably will visit my sister in Sprang-Capelle this afternoon. I'll wave to you ;-)

Jan

Your hand was not big enough, I did not see it, or you came not through sprang-capelle, I do ride a recumbent bicycle, ligfiets, en die is inmiddels beroemd en berucht doordat ze me hier zwart maken tot aan pedo aan toe, en zijn veroordeeld, en 500 euro schadevergoeding gehad, maar wordt wel bedreigt zo nu en dan, wel afnemend...Misschien heeft zelfs je zus wel eens wat gehoord over de ligfietser uit schrevelstraat, staan zelfs huizen leeg hier, tja een pedo, Leuk sprang-capelle, maar ben hier wel geboren, ken je Casper uit kaatsheuvel? zijn vader is Ingenieur. So far a little dutch, because it was not technical meaning, sorry for this off tread...

Today I did get again mail, maybe it is because i did not visit here some time, busy with court, myine nabure want the wood heater out of mine house, so I am busy coming time.

I did not now you had a sister here, the world is pretty small.

Someone do now superspice?, I did came buy of that and installed it..

regards
 

Attachments

  • ScreenHunter_1235 Jun. 10 12.32.jpg
    ScreenHunter_1235 Jun. 10 12.32.jpg
    411.5 KB · Views: 92