Keyboard Shortcuts
ctrl + shift + ? :
Show all keyboard shortcuts
ctrl + g :
Navigate to a group
ctrl + shift + f :
Find
ctrl + / :
Quick actions
esc to dismiss
Likes
- LTspice
- Messages
Search
Re: plot window
alan,
?
I don't think you can add more than what LTspice gives you already in those plots.? There is no option to change the "Quantity Plotted" on the right axis, so no, you can't "hack" it to add something else.? In .AC analysis it insists on having the left and right axes that way.
?
Of course you can plot S21 and SWR in separate plot panes, which might be a better way to handle it.? ?(My LTspice is set up to use Vertical window tiles, which helps a bit.)
?
Andy
? |
Re: .MEAS Failure
Indeed, it is troubling to wonder exactly what is meant by asking when a signal is "< 2V".? That happens continuously, after the signal crosses below 2.0 V.? Surely you would not want the .MEAS command to spit out volumes of data for every possible time value from that point forward.? (There are infinitely many, after all.? Try fitting THAT in your .LOG file.)
?
IMO, that is one of the many things that causes much grief and confusion about the .MEASURE syntax.? Well, for me it is.
?
That is not LTspice's fault.? The .MEASURE command evolved over years (decades?) before there was an LTspice, so LTspice inherited the varied and confusing syntax that was already out there.
?
Also, for syntax sticklers, the fact that the .MEASURE command uses the assignment operator ("=") as if it were a comparison operator (should have been "==") is a little bit troubling.? But that is life and it is what it is (we have to accept it).? LTspice can't "fix" syntax mistakes without breaking it for thousands of existing SPICE users.
?
FYI, changing the "Quantity Plotted" is not a normal feature that everyone needs to know and understand.? It is one of those "rarely used" things that occasionally comes in handy, but you are not likely to know until then, and maybe never.
?
Andy
? |
Re: plot window
¿ªÔÆÌåÓýOn 27/02/2025 16:10, alan victor via
groups.io wrote:
Only for Bode. If you choose the Cartesian format, you can get imaginary. what other options do you want? S-parameters of 1 and 2 port networks are automatically available as plot options if you use the .NET directive with .AC analyses. This then gives you the options: Sxx, Yxx, Zxx, Zin & Zout. See: Help > LTspice > LTspice? > Dot Commands > .NET ¡ª Compute Network Parameters in a .AC Analysis For SWR and other formats like Gmax and MSG, I have defined plot functions, which are stored in the plot.defs file. Hardly anyone actually uses plot.defs, but it's very useful once you get used to it. E.g.: * Functions for RF design using S-parameters with 2 port networks * Note: due to the way LTspice displays functions (as voltages), MSG & Gmax are exported as square roots since they are powers to start with .func mS11() {mag(S11(V1))} .func mS21() {mag(S21(V1))} .func mS12() {mag(S12(V1))} .func mS22() {mag(S22(V1))} .func DeltaInt() {S11(V1)*S22(V1)-S12(V1)*S21(V1)} .func MSGInt() {ms21()/ms12()} .func KR() {(1-ms11()**2-ms22()**2+mag(DeltaInt())**2)/2/mag(S21(V1)*S12(V1))} .func GmaxInt() {1/(Kr()+sqrt(Kr()**2-1))*MSGInt()} .func MSG() {sqrt(MSGInt())} .func Gmax() {sqrt(GmaxInt())} .func VSWR(Sxx) {(1+mag(Sxx))/(1-mag(Sxx))} (Functions including "Int" are not for plotting, they are intermediate functions. Note: if you edit plot.defs (Plot Settings > Edit Plot Defs file), the changes don't become active until LTspice is closed and re-started. -- Regards, Tony |
Re: plot window
Thanks Tony.?
?
Yes, I tried. All I get are selections on GD and phase.?
?
For example, in using the s parameter script it would be nice to plot transmission gain s21 and SWR (for which I have a simple
expression) on left and right axis of a single plot pane. Are there more plot options if I rev up from LTspice XVII??
?
All done in simple AC analysis, so X axis is frequency.? |
Re: LTspice XVII error work around
#Time-step-too-small
Yes, I did try setting the maximum timestep, and all the other things in the FAQ. I also tried tweaking the circuit (same function, different way of achieving it), but as eewiz has found that just moved the problem to another random part of the circuit. Nothing I tried solved the problem, until I shifted the time base. Of course that could just as equally create a problem where none existed, as may the other fixes, but why would you go out of your way to create a convergence problem? As for models being "dodgy", well that is inevitable when a component behaves in a complicated way. A PTC fuse has only two legs and a simple task to perform, but in modelling terms its behaviour is complicated. Add in a monolithic SMPS, and there is even more to go awry when modelling.
?
Later this morning I added the remaining five SMPS's. I would like each to have its own reservoir cap, so I can measure the DC current each contributes, but that just results in a convergence failure. So I'm having to live with them sharing one big capacitor in the model.? ?Same (perfect) capacitance in the same electrical location, but one way of achieving that works and the other doesn't. |
Re: plot window
¿ªÔÆÌåÓýOn 27/02/2025 15:38, alan victor via
groups.io wrote:
(This only applies to plots in the frequency domain.) Did you try to change it? If you bring the cursor close to the left axis, its appearance will change to a ruler. You can right-click and you will get a dialogue where you can change the quantities plotted: Bode, Nyquist or Cartesian. For Bode, you can choose either phase or group delay, or none, by right-clicking on the right axis. -- Regards, Tony |
Re: LTspice XVII error work around
#Time-step-too-small
¿ªÔÆÌåÓýOn 27/02/2025 11:33, Robert via
groups.io wrote:
While changing the time base in some way can apparently cure the #Time-step-too-small problem, it can also do the reverse, as can any other circuit change. You also don't mention whether you have set a maximum time step. Sometimes this also makes the issue disappear. The underlying issue remains that one or more of the models is dodgy in some way. -- Regards, Tony |
Re: LTspice XVII error work around
#Time-step-too-small
I have also found that altering the start time of switching regulators can stop singular matrix (SM), time step (TS) and/or femtosecond crawl issues.
The MC34036 switcher invariable causes problems if permitted to start on its own.
Precharging its timing capacitor with ic=1.5 added to the capacitor's value causes the regulator to start later because the capacitor must discharge down to 1.24V before the requlator starts pumping.
In one instance, this was all it took to eliminate my singular matrix issue.
?
In another case, changing a capacitor ESR value in a charge pump eliminated a time step issue.
Also, I often find that reducing the tolerance values of trtol, abstol, vntol and chgtol help convergence and to reduce the likelyhood of SM, TS or femtosecond pace issues as a circuit grows.
?
I have a simulation that only runs with the level3a op-amp that comes with LTspice with its parameters set to mimic my desired op-amp.
Replacing the level3a with almost any "real" op-amp's model immediatly causes a singular matrix in some diode or transistor in some other part of my project that has nothing to do with the amplifier circuit where the op-amp was replaced.
Erasing that semiconductor with modifications to keep things working, simply shifts the complaint to another unrelated semiconductor and then another and so on, until I go back to the level3a op-amp.
I have tried dozens of "real" op-amp models and most cause the ascribed failure.
The ones that don't, have been so far removed from my desired op-amp, they are of no use to me in this instance.
Every one of those op-amp models works as it should when in a simple test circuit. ?
At times, I have to add a V source between ground and the output of switching requlator to prop up that output.
Doing so elimintes any ripple at the switcher's output and most likely reduces transient currents within the regulator circuit.
It can take a lot of trial error problem solving from there to eliminate the return of SM or TS issues when the prop is removed.
?
I push the go button and hold my breath each time after adding to or altering something in my project
?
All for now ?
Sent:?Thursday, February 27, 2025 at 5:33 AM
From:?"Robert via groups.io" <birmingham_spider@...> To:[email protected] Subject:?Re: [LTspice] LTspice XVII error work around #Time-step-too-small Well after a day of fiddling about with the values in my .OPTIONS and different integration methods (including the suggestions in the FAQ), I finally got my circuit modelling with just:
?
.OPTIONS ITL4=100 ABSTOL=1E-9 VNTOL=1E-3 RELTOL=0.01
?
You'll notice I took out CSHUNT. 5e-12 was the value I had to use (with LTSpice XVII) before I added the LT1375HV. Now I have got the model to converge with the LT1375HV (for the moment, at least; I have more things I need to add), I found that I could make CSHUNT anything from 5e-20 to 5e-12, with no obvious effect, so I then removed CSHUNT completely and it still converges. So what did I do to make it converge?
?
What I'm trying to determine is inrush current, so I have a PWL voltage source set to mirror what the external power supply will do when the test is performed for real. I happened to have it going from 0 volts at 1 ms to 28 V at 2 ms (because the test is defined in ms, and I like to steer clear of whatever SPICE does at time 0). Sometimes it's good to leave a problem overnight, and in the middle of the night I realised the model always fell apart before it got to 1 ms.? ?So this morning I simply changed the voltage generator to go from 0 at 1 ?s to 28 V at 1 ms, and the problem went away >doh!<. I do still need the .OPTIONS line above, but I'm using the default integration method (which is trapezoidal on LTSpice 24).
?
So there's another way to address the problem; timeshift the model so the circuit is doing something different at the time when the non-convergence kicks off.
|
Re: LTspice XVII error work around
#Time-step-too-small
Well after a day of fiddling about with the values in my .OPTIONS and different integration methods (including the suggestions in the FAQ), I finally got my circuit modelling with just:
?
.OPTIONS ITL4=100 ABSTOL=1E-9 VNTOL=1E-3 RELTOL=0.01
?
You'll notice I took out CSHUNT. 5e-12 was the value I had to use (with LTSpice XVII) before I added the LT1375HV. Now I have got the model to converge with the LT1375HV (for the moment, at least; I have more things I need to add), I found that I could make CSHUNT anything from 5e-20 to 5e-12, with no obvious effect, so I then removed CSHUNT completely and it still converges. So what did I do to make it converge?
?
What I'm trying to determine is inrush current, so I have a PWL voltage source set to mirror what the external power supply will do when the test is performed for real. I happened to have it going from 0 volts at 1 ms to 28 V at 2 ms (because the test is defined in ms, and I like to steer clear of whatever SPICE does at time 0). Sometimes it's good to leave a problem overnight, and in the middle of the night I realised the model always fell apart before it got to 1 ms.? ?So this morning I simply changed the voltage generator to go from 0 at 1 ?s to 28 V at 1 ms, and the problem went away >doh!<. I do still need the .OPTIONS line above, but I'm using the default integration method (which is trapezoidal on LTSpice 24).
?
So there's another way to address the problem; timeshift the model so the circuit is doing something different at the time when the non-convergence kicks off. |
Re: LTspice XVII error work around
#Time-step-too-small
5pF is not unreasonable for the circuit I'm modelling, but I've changed this value over a wide range trying to model my circuit and the OP might also want to try that; pick a value (eg 0.5pF) and take the exponent both up and down.
?
Regarding my own fight with this problem, I can model the LT1375HV on its own, and I can model the PTC fuse on its own, but when the two are combined I get convergence problems, either a complete failure or continuous use of tiny timesteps that make modelling impossibly slow (fs/s). If I continue to get nowhere I'll upload the files and start a new thread. |
Re: .MEAS Failure
On Wed, Feb 26, 2025 at 12:19 AM, Andy wrote:
?
FYI, that is not what I suggested.? Leave the Start and Stop (or Left and Right) values alone.? Let LTspice figure them out on its own.? Change the text in the "Quantity Plotted" box.? THAT is the thing that shifts the entire waveform horizontally.
?
Thank you for removing my blinders.
It's the Quantity Plotted box located within the Horizontal Axis dialog.
That box that has no drop-down arrow that always just says "time".
Forgive me, I'm a Quantity Plotted virgin.
I use LTspice to develop entire PCB's using multiple logic, op-amp, reference, regulator, and discrete parts.
.TRAN simulations of "time" on the abscissa is all I've ever asked of LTspice.
I have had no use for the Quantity Plotted box for so long that it became invisible to me.
?
A side note for the ADI folks:
According to the help file under Axis Control;
"For example, for real data, if you move the mouse to the bottom of the screen and left click, you can enter a dialog to change the horizontal?quantity?plotted."
?
A right click enters the Quantity Plotted box, not left click as stated in the help.
?
?
But I suggested it only as a way to visually see smaller increments of time, which you do not need to do if you don't want to.
?
Yes, now I understand where the disconnect in communication occured.
I sought to enquire of LTspice if a certain signal ever went below 2 volts.
I then sought to enquire of the group, why less-than (<) errored out, in my search for that signal to go below 2 volts.
You explained how LTspice uses interpolation to obtain the precise time when the signal would have reached exactly 2 volts.
?
Looking for the time when it happened was only secondary to my investigation.
The exact time when it happened to 15 digits was not on my radar screen.
I was seeking the time value of the first sample that was found to be less than 2 volts so I could know where to zoom the plot window.
I simply needed to locate the event in the plot pane to support further visual analysis of the plots.
The correct answer to a question that was not asked confused me.
?
Beware observer bias.
?
All for now
?
_._,_._,_
|
Re: Stepping MOSFETs
¿ªÔÆÌåÓýOn 27/02/2025 04:45, Andy I via
groups.io wrote:
As of 24.1.4, it is still broken. I tried the original method, which failed, before adding the modification suggested by Matthias.But it was temporarily broken when V24.1 was first introduced.Is it still broken? An equally serious issue, IMHO, is that the new method is not supported by older versions of LTspice. Obviously, there is a workaround by including both options on a new schematic, with a note to enable only one of them, but that is no help for people with old schematics wanting to use the new LTspice version. -- Regards,
Tony |
Re: Stepping MOSFETs
Is it possible to STEP 2 different MOSFETs in a simulation run.? I've read about stepping models, and about basic subcircuits, but can you call one MOSFET file for the first step run and another MOSFET file for the second step run.Yes, it can easily be done with the simple use of the AKO: syntax. ... One small FYI --
?
It is not the AKO: syntax that enables .STEP'ing through MOSFETs or any other devices.
?
The one key thing to remember is that you can only .STEP numbers.? As long as your MOSFET models have numerical names, you're all set.? AKO: is a way to temporarily change their model names to numbers.
?
Typically you would include both MOSFET model files, then select which model inside them by way of the .STEP'ed parameter.? I do not know off-hand if you can .STEP the files themselves.? I suspect it does not work to .STEP the files.? I think both files would be loaded anyway.
?
But it was temporarily broken when V24.1 was first introduced.Is it still broken? ?
Andy
? |
Re: LTspice XVII error work around
#Time-step-too-small
On Wed, Feb 26, 2025 at 11:07 AM, Robert wrote:
Did you try some or all of the options listed in the LTspice FAQ (Frequently Asked Questions) file?? Please see the message # 158795 that I sent earlier today about that. ?
These "Timestep too small" errors do not have one remedy that always works.? That is why the FAQ file lists several things to try, and suggests trying all of them until you find something that works.
?
More than likely, your original circuit already had issues which had prompted you to add those .OPTIONS to the simulation to get it to work - and they helped that one case.? Then, adding another component to the circuit changed the mix of part models that were in your simulation, causing the "time step too small" error to return.? Like I say, no single remedy always works.? You have to be persistent.
I would not expect that to make any difference.? It is not a bug in a version of LTspice.? Both versions have essentially the same simulator algorithms so they do pretty much the same thing.
That is but one of several things to try.? Download and read that FAQ file, then start trying the many things it suggests to try. ?
Tony's note about the rather large value for CSHUNT is important.? That number is "huge", and it is applied to every single circuit node!? It probably significantly (negatively) alters your simulated results, whether or not it helps avoid the "timestep too small" errors.? I think it should be at least one order of magnitude smaller than 5E-12.? The original note you said you got this from, did not mention CSHUNT, but it is one of the things that can help with these errors.
?
Andy
? |
Re: Issues running LTspice as a batch service
¿ªÔÆÌåÓýDid you change your schematic and model references to NOT use the absolute locations? e.g. use ".include bunchOfModels.mod" rather than ".include \Home\Users\MyName\MyLibs\bunchOfModels.mod" A web search on that error (and on the equivalent 0xc0000409)
suggests stack overflow in the process; not sure how that might
help you, but there it is. FWIW. Most appropriate link I found is
whose OP found was a referenced file had an o-umlaut in its name. Donald. On 2/26/25 13:49, Jeff Kayzerman wrote:
|
to navigate to use esc to dismiss