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

Member
Joined 2010
Paid Member
True about the consistency of being aware of which install used for updates. So, one last question: If you choose the "Install for all users" option, is there an advantage over the "Install for me" option assuming you are consistent with both, and , if you are not consistent with your options, is their any negative consequences beside's the extra space used for application in Program files.
Thanks
 
Member
Joined 2009
Paid Member
Hi Mr Mooly really sorry to disturb but i am very lost with FFT
I have tried to follow your very precious directions but i think i am doing mistakes with settings and actions
I would just like to get the 1kHz distortion spectrum and stop of the simple circuit attached below
Maybe i have entered values of components wrongly I see Farad for caps ???
Could you please me redirect to the relevant post in this thread where the passages to get a FFT are depicted ?
thank you very much indeed
Kindest regards
gino
 

Attachments

  • cfp.asc
    2.1 KB · Views: 19
Last edited:
Administrator
Joined 2007
Paid Member
A couple of things wrong :)

The AC input should be like this. You set your amplitude here and the '1' is a reference designator for that voltage source, its not an amplitude setting:

Screenshot 2024-05-08 175247.png


Set the sim to 'Transient' and set a suitable run time such as 100ms which would display 100 cycles at 1kHz. Set a 'Time to Start Saving Data' and it lets the sim run for that time before displaying the result.

Screenshot 2024-05-08 175442.png


Add a load resistor and you can also label the output. Also add the Spice Directives shown to set the 'window' for sampling:

Screenshot 2024-05-08 175717.png


And the FFT Right click the area with the trace and select FFT:

Screenshot 2024-05-08 175842.png


Select Vout as the node to view:

Screenshot 2024-05-08 175948.png


If you make the caps massive and run the sim longer you get a more detailed FFT. Make the electrolytics '1' which is 1 Farad and set the sim times for 1000ms and start saving data at 600ms:

Screenshot 2024-05-08 180159.png


Modified sim:
 

Attachments

  • Modified cfp.asc
    2.4 KB · Views: 24
  • Thank You
  • Like
Reactions: 1 users
I see nobody respone on mine last post, not a problem, but the new LTspice has problems, it conflict with brave and other software, it stops simulating when I set menu invisible., it give 0.3 procent total distortion when I get -100dB on fft, and pc hangs a lot when I try to open brave for watching internet.

I have now install the old one, and no problems at all.

And no, the pc is not to blame.

UPDATE! known problems, I have a update now, try again.

UPDATE again, I get 24.07 in stead of the newest version, how strange is this.

https://www.analog.com/en/resources/design-tools-and-calculators/ltspice-simulator.html
 
Last edited:
Member
Joined 2009
Paid Member
Good evening Mr Mooly and thank you very much for your extremely kind and valuable reply
I tried to follow your instructions and settings
I think i have set something wrong because i get an ugly looking fft (file .asc and jpeg of the fft attached)

I run your modified file and it is perfect :)(y)

So there must be a problem with options setting and four 1kHz 10 4 v(vout) :rolleyes:
 

Attachments

  • cfp.asc
    2.3 KB · Views: 20
  • cfp fft.JPG
    cfp fft.JPG
    153.7 KB · Views: 20
Last edited:
UPDATE! known problems, I have a update now, try again.

UPDATE again, I get 24.07 in stead of the newest version, how strange is this.
When an update to any program causes problems, one approach is to do a complete uninstall (including deleting the installation folder in Program Files) and then do a fresh install with the latest installer, which 24.0.12 in this case. A clean install can fix a lot of issues.
 
Good evening Mr Mooly and thank you very much for your extremely kind and valuable reply
I tried to follow your instructions and settings
I think i have set something wrong because i get an ugly looking fft (file .asc and jpeg of the fft attached)

I run your modified file and it is perfect :)(y)

So there must be a problem with options setting and four 1kHz 10 4 v(vout) :rolleyes:
This is interesting: Here is what I found:
1. The max timestep needs to be a (binary?) multiple of the signal frequency and "Number of data points in time" (defaults to 262144=2^18 in FFT dialog), ie something like {1/1k/4096}. Otherwise you get a bent bumpy ~noise floor. There does not seem to be a windowing function that works better than "none" with harmonic sampling.
2. Coupling capacitors need to be huge, ie 1 farad. Otherwise, you get a slanted noise floor that rises on the left low frequencies. But using too large a value (~100) causes some kind of math problems and all the detail is wiped out, straight line.
Hope this is useful.
3. A huge time sample is unnecessary. 100mS vs 1S is fine.

OBTW, your version of cfp.asc has two R3's so I changed one to R6.
 

Attachments

  • cfp 1fbin.asc
    2.3 KB · Views: 16
  • Thank You
Reactions: 1 user
Member
Joined 2009
Paid Member
Hi ! thank you very much for all your kind and precious advice
I have used the .asc file provided to me by Mr Mooly as a base and played a little (with having any clue about what i was doing) with resistors values in order to lower the THD as much as possible
I am attaching the result with a hint from which the schematic is sourced ;)
If anyone has any advice on how to lower the THD further without making the schematic too much more complex that would be great
Thank you to all for the kind help
Have a nice day ! :)
 

Attachments

  • zd22 1st.asc
    2.4 KB · Views: 12
Last edited:
Administrator
Joined 2007
Paid Member
I think i have set something wrong because i get an ugly looking fft (file .asc and jpeg of the fft attached)

Its missing the timestep which can be calculated (see post #19 in this thread).

You can keep common settings as a notepad file and just copy and paste them in simulations.

For 1kHz:

Code:
.tran 8m
.options maxstep=0.48831106u
.option plotwinsize=0
.four 1khz 10 4 v(vout)

For 10kHz

Code:
.tran 400u
.options maxstep=0.02441555u
.option plotwinsize=0
.four 20khz 10 4 v(vout)
 
  • Like
  • Thank You
Reactions: 1 users
When an update to any program causes problems, one approach is to do a complete uninstall (including deleting the installation folder in Program Files) and then do a fresh install with the latest installer, which 24.0.12 in this case. A clean install can fix a lot of issues.
A program has to update normally, if I have to do a lot of trouble for this the writer need to change that so people get not into trouble.

For people with bad FFT, version 24.0.7 has a error, 24.0.12 has corrected that.

Still, when I have open browser brave, ltspice do stop simulating, go in pause, brave do hangs randomly so there is a share of a dll file or something else, when I do make ltspice window small, and do soemthing else while simmulating, it staps also., even when it is behind a other program, and I see part of it, it stops and go into pause, I have to close all programs, or put ltpsice in front for let it go on simulating, maybe there is a reason for it.

The FfT plot, I get very low partial distortions, and high total distortion of 0.3 procent while the FFT let see that all signals are around -100dB, maybe because
it is a class d it takes also switching with it. Other possibillity is I set the stuff wrong in FFT. I go try the old one for this.

I have remove the program completely and also the keys windos and reinstall the newest 24.0.12.

regards
 

Attachments

  • Design 134 KEES.jpg
    Design 134 KEES.jpg
    376.7 KB · Views: 12
I did discover another problem.

When I do FFT on a signal, and close it the signals are suddenly out of middel, and give 12 ampere in stead of
4, and out of offset, when I do zoom te fit it is oke again. But the red signal is still 4 amp, that stays oke. Liitle confusing
plot.

So still bugs, a lot things to do for this program is free of that.
 

Attachments

  • Design 158 KEES.jpg
    Design 158 KEES.jpg
    163.7 KB · Views: 15
  • Design 157 KEES.jpg
    Design 157 KEES.jpg
    145.5 KB · Views: 16
I have another issue not solved with update.

The button for simulation start does after a while nothing anymore, the simulation syas ready in a fraction
of a second. Giving first a bunch of garbage left lower window.

The only way to let it work again is close and frestart program, then it work for a 30 minutes of stop and start
after change things as we all do.

regards
 
Hi all here.

All have nice days?.

I did some things testing out in ltspice.

For example, with the new ltspice it do pause simulation if i do other things on the pc, like looking at the internet, when the menu is behind
the browser, or making small, it stops simulating, it do pause it so to say.

The older version XVII do not,it just going on simulating when I look at internet or other things on the pc. Maybe the new one is set so on purpose
to do use more cpu resources, maybe it have setup there.

Distortion measurents, I get in XVII and in lt spice the same outcome, but I am a little confusing about the total distortion and the partial distortion,
that is in the older ltspice XVII total harmonic distortion, and between brackets partial distortion. That can mean, ltspice do measure wrong and the way around, special when FFT does -100dB or lower, then the partial 0.000126 procent is much closer then the total at 0.092213. So there is something wrrong,
total distortion do not match the FFT of -100dB.

Afcause, I maybe can do something wrong, but for me now, it looks like a error in the program because the old XVII does have the right outcome, and the partial between brackets.

have a nice weekend folks.
.
 

Attachments

  • LTspiceXVII.jpg
    LTspiceXVII.jpg
    317.8 KB · Views: 20
  • LTspice 24.0.12.jpg
    LTspice 24.0.12.jpg
    309.1 KB · Views: 21
  • Like
Reactions: 1 user