Trouble using .save statement

I am using .save statement to limit the size of the output file.
However, when I use the .save statement I get a warning for the .measure statement during post processing.
Without the .save statement everything goes fine. Am I missing something?

3.- Buck-closed-loop-bode-FRA.qsch (17.8 KB)

Cannot run your simulation for test as you included a user library for your sub-circuit which not included in this post.

Sorry, this is the link for the library with the comparator:

Add freq in .save command.
The reason is that. Qspice process in this sequence

  • QUX.exe to process a schematic (.qsch) into a netlist (.cir)
  • QSPICE64.exe or QSPICE80.exe to process a netlist (.cir) into a data file (.qraw)
  • QPOST.exe is post process for .meas and .func, it process both .cir and .qraw and output .meas result.

As QPOST.exe is executed after .qraw is created. And .save limited expression save into .qraw. You need to have all necessary parameter in .save for .qraw for QPOST.exe to post process.


Thank your very much for your kind help.

Will you consider during your project development, you replace the switch with a behavioral switch?
I changed FET to a switch and replace the comparator in my symbol library which is a TTOL device. This simulation can complete in about 1 second and get similar gain and phase result as using practical FET model.

3.- Buck-closed-loop-bode-FRA - KSKelvin.qsch (19.4 KB)

You are totally right. It is much better to use an ideal switch for this type of analysis. In the past I experienced some convergence issues when using too ideal components in LTspice. That is why I got accustomed to using real components. I will be more careful in the future.
I tested it with 10 points per decade and the simulation time is only 7 seconds compared to more than 500 seconds using the FET! The effect of the TTOL comparator is not so significant though. I suppose it is because I am using a low value for the maxtimestep already (100n).
Thank you!

1 Like