¿ªÔÆÌåÓý

Date

Re: Funny problem in simulation with .option gshunt=1.5e-7

 

I thought this only add to the external circuits, not the inside of the opamp.


Re: How to include component values in LTSpice trace formulas

 

Thanks so much Andy, and the other folks who responded. That's the approach I'll use. To answer a question in one of the responses about what I'm trying to do, it's to try various values of C, L and other parameters for an LC tank circuit for a Tesla coil to see which values result in the greatest energy being stored.

... and thanks for the other info, like using ** instead of ^ - that would explain the weird results I got when I used ^ :-)


Re: Funny problem in simulation with .option gshunt=1.5e-7

 

Ala,

Gshunt should probably be no larger than 1e-10.

Your value (1.5e-7) is a thousand to a million times too large.? Side-effects like the ones you observed should be expected.

Andy



Re: Problems using Pspice fet model for infineon BSR202N.

 

Richard,

TRTOL is not very well understood, by most of us.? Almost all SPICE programs set TRTOL to 7, which is a slightly odd number.? Most SPICE users don't change that.? LTspice's default is 1, and there is some commentary about it in the LTspice Help pages, but it's not exactly clear.

I would not necessarily assume that smaller TRTOL improves accuracy.? In principle, with the default settings, SPICE simulations should be pretty accurate anyway, since everything was optimized at those settings.? It's those odd cases that require special tweaking, and then there is no certainty that smaller *TOL always equates to greater accuracy.? What TRTOL affects is LTspice's truncation error estimate, which is not the same thing as the inaccuracy of the simulated waveforms.? (My recollection is that the truncation error is a separate calculation on the side of the regular circuit calculations, which doesn't affect the simulated waveforms, but is used only to decide when to discard the current time point, back up a little, and set the timestep smaller.)

The Help page says that a larger TRTOL value (greater than 1) is "usually a better overall solution" for transistor level circuits (compared to SMPS circuits??), but it doesn't say what "better" means.? Faster?? More accurate?? Less likely to do something unexpected with certain third-party models?? Helmut has recommended never setting TRTOL greater than 1, which differs from Mike Engelhardt's suggestion.

If TRTOL affects how often LTspice needs to back up, then there is probably a "sweet spot" where that happens least often and the simulation proceeds fastest.? If so, then setting TRTOL larger might make it back up more often, causing the simulation to run slower rather than faster.? But I might misunderstand how it works.

Regards,
Andy



Re: LTSpive IV vs XVII voltage generators

 

¿ªÔÆÌåÓý

Thanks to all who replied to my question about this.

Larry Benko

On 11/17/2018 11:55 PM, analogspiceman@... [LTspice] wrote:

?

Excellent catch.? Bravo!? This question is closed.



---In LTspice@..., wrote :

I remember I noticed this but also that there was an entry in the
changelog about this and, sure enough, here it is:

04/24/18 Corrected the behavior of SINE voltage and current sources
when Ncycles is specified and revised the help to match.

--

Vlad


Re: Funny problem in simulation with .option gshunt=1.5e-7

 

Hello,

Adding 6MegOhm resistors from every node to GND will kill practically every circuit, because there are resistors with kOhm to MegOhms inside the subcircuit.

Best regards,
Helmut


Funny problem in simulation with .option gshunt=1.5e-7

 

Hi

I encountered a strange problem, I uploaded the file in Temp. It's a simple circuit using LT6202. If I put in .option gshunt=1.5e-7, you can check current through R2 and R3 is 50mA. But if you delete the .option gshunt=1.5e-7, then current goes down to about 3.5mA as specified on the datasheet of LT6202. This happens on LT1803, but ok with LT1360.

Strange!!! Any explanation on this?



Re: Problems using Pspice fet model for infineon BSR202N.

 

Ok. Sorry. I've solved the curiosity. I put in a delay in my gate drive to allow for the delayed "startup" voltage sources. It was my delay causing it to wait 20us before doing anything..


Re: Problems using Pspice fet model for infineon BSR202N.

 

Thank you both Bordodynov and Andy.
That was extremely helpful. I'm hoping you can confirm my understanding, that reducing TRTOL slows the simulation but should make it more accurate. It should not make it less accurate. Is that correct? Similarly with the Alternate solver. Right?

One curiosity... I removed the "startup" .trsn modifier, but the simulation still appears to do nothing for 20us. I've closed and restarted LTspice, but still it seems to be using "startup". Do I need to do something more than removing the modifier?

Regards and thanks..
Richard


Re: LTSpive IV vs XVII voltage generators

 

Excellent catch.? Bravo!? This question is closed.


---In LTspice@..., <imbvlad@...> wrote :

I remember I noticed this but also that there was an entry in the
changelog about this and, sure enough, here it is:

04/24/18 Corrected the behavior of SINE voltage and current sources
when Ncycles is specified and revised the help to match.

--

Vlad


Re: LTSpive IV vs XVII voltage generators

 

I remember I noticed this but also that there was an entry in the
changelog about this and, sure enough, here it is:

04/24/18 Corrected the behavior of SINE voltage and current sources
when Ncycles is specified and revised the help to match.

--

Vlad
______________________
ltspicegoodies.ltwiki.org -- holding, among others:
a universal analog/digital filter, block-level models
for power electronics (and not only), math blocks
with a more stream-lined approach, some digital
ADC, DAC, (synchronous-)counter, JKflop, etc.


Re: Edge triggered b-source logic and integrated averaging in LTspice

 

Hello analogspiceman,

Thanks for your uploaded example "sampled_average_expanded.asc".
I have now a better understanding after I plotted V(4), V(3) , V(x) and V(s) in one plot.


Best regards,
Helmut


---In LTspice@..., <helmutsennewald@...> wrote :

Hello analogspiceman,

Thanks a lot for ths idea of a "sampled" average.

I have made an example with your formulas. Please check my circuit.

I wonder a little bit were the integration really starts and stops compared to the sample clock pulse.

Files > Temp
sampled_average.zip

Best regards,
Helmut


Re: Frequency calc durung trans sim

 

Agreed.? (Although Mike is brilliant he can be very stubborn once his mind is closed.)


---In LTspice@..., <helmutsennewald@...> wrote :

Hello analogspiceman,

I have been aware of this command, but it would be a nightmare to download a few thousands of my schematics, modify it and upload it again. I would also loose the time stamp which is a good indicator for me whether an example may be easier due to new features or more experience. I simply have rated this reset to minimum size as a bad design decision.

Best regards,
Helmut


---In LTspice@..., <analogspiceman@...> wrote :

Hello Helmut,

Mike added a command line switch to automatically resize text when an old file is opened with this switch, but it is a lot of trouble to use and it often only fixes some of the text.


---In LTspice@..., <helmutsennewald@...> wrote :

Hello eT,

Have you tried my older eyamples before?

freq_meter_test1.zip, freq_meter_test2.zip

Don't wonder about the small size of characters in these files. When Mike implemented the variable size of characters, he decided to set the text of all older schematics to a minimum size. This has been a really bad decision. You should manually change the size of all text to the new default for better readability.

Best regards,
Helmut


Re: Frequency calc durung trans sim

 

Hello analogspiceman,

I have been aware of this command, but it would be a nightmare to download a few thousands of my schematics, modify it and upload it again. I would also loose the time stamp which is a good indicator for me whether an example may be easier due to new features or more experience. I simply have rated this reset to minimum size as a bad design decision.

Best regards,
Helmut


---In LTspice@..., <analogspiceman@...> wrote :

Hello Helmut,

Mike added a command line switch to automatically resize text when an old file is opened with this switch, but it is a lot of trouble to use and it often only fixes some of the text.


---In LTspice@..., <helmutsennewald@...> wrote :

Hello eT,

Have you tried my older eyamples before?

freq_meter_test1.zip, freq_meter_test2.zip

Don't wonder about the small size of characters in these files. When Mike implemented the variable size of characters, he decided to set the text of all older schematics to a minimum size. This has been a really bad decision. You should manually change the size of all text to the new default for better readability.

Best regards,
Helmut


Re: How to include component values in LTSpice trace formulas

 

¿ªÔÆÌåÓý

Correction. Replace ^ by **, and the last number should be 10**(-15).? It may be possible to work round the '1F' problem by changing it to '1C/1V', which is '1 coulomb per volt'.

John Woodgate OOO-Own Opinions Only
J M Woodgate and Associates 
Rayleigh, Essex UK
On 2018-11-17 21:38, John Woodgate jmw@... [LTspice] wrote:

Click on the title of the plot of the voltage (V(n005) for example) across your capacitor and change? the expression? to V(n005)^2*10^(-7)/2, if your capacitor is 100 nF. The y-axis is in terms of volt-squared, because LTspice doesn't know that the '10^(-7)' is a capacitor.? It ought to be plotted in joules if you multiply it by 1F/1J (1 farad/1joule), but it doesn't work because LTspice recognizes '1F' as '1 femto', i.e. 1-^(-15).


Re: How to include component values in LTSpice trace formulas

 

¿ªÔÆÌåÓý

You should first of all, read the Help. It is very information-intensive, so it needs reading carefully and reading several time. There is a special way of treating capacitors that do unusual things or are charged in unusual ways, which is at the end of the Help page on Capacitors:

There is also a general nonlinear capacitor available. Instead of specifying the capacitance, one writes an expression for the charge.

LTspice will compile this expression and symbolically differentiate it with respect to all the variables, finding the partial derivative's that correspond to capacitances.

Syntax: Cnnn n1 n2 Q= [ic=] [m=]

There is a special variable, x, that means the voltage across the device. Therefore, a 100pF constant capacitance can be written as

Cnnn n1 n2 Q=100p*x

A capacitance with an abrupt change from 100p to 300p at zero volts can be written as

Cnnn n1 n2 Q=x*if(x<0,100p,300p)

I have assumed from your message that your capacitor value is not constant. If it is constant, just put its value in the expression. You can do this even just with Waveform Arithmetic (see the Help!). Click on the title of the plot of the voltage (V(n005) for example) across your capacitor and change? the expression? to V(n005)^2*10^(-7)/2, if your capacitor is 100 nF. The y-axis is in terms of volt-squared, because LTspice doesn't know that the '10^(-7)' is a capacitor.? It ought to be plotted in joules if you multiply it by 1F/1J (1 farad/1joule), but it doesn't work because LTspice recognizes '1F' as '1 femto', i.e. 1-^(-15).

John Woodgate OOO-Own Opinions Only
J M Woodgate and Associates 
Rayleigh, Essex UK
On 2018-11-17 19:31, douglas.fay@... [LTspice] wrote:

?

Just joined the group and don't know how to search whether this has already been addressed - guidance on that would be appreciated!


But here's my question: I would like to be able to define a trace for the energy stored in a capacitor using the formula E= 1/2 * V^2 * C. But I can't find how to include component values such as capacitance, C, in the trace formulas. Is there a way to do this?


Thanks - Doug


Re: LTSpive IV vs XVII voltage generators

 

Small correction to my reply --

In LTspice IV, at the end of Ncycles, the output of the source suddenly reverted to Voffset or Ioffset, not necessarily to zero.

Regards,
Andy



Re: Frequency calc durung trans sim

 

Hello Helmut,

Mike added a command line switch to automatically resize text when an old file is opened with this switch, but it is a lot of trouble to use and it often only fixes some of the text.


---In LTspice@..., <helmutsennewald@...> wrote :

Hello eT,

Have you tried my older eyamples before?

freq_meter_test1.zip, freq_meter_test2.zip

Don't wonder about the small size of characters in these files. When Mike implemented the variable size of characters, he decided to set the text of all older schematics to a minimum size. This has been a really bad decision. You should manually change the size of all text to the new default for better readability.

Best regards,
Helmut


Re: LTSpive IV vs XVII voltage generators

 

Larry wrote about changed behavior between LTspice IV and LTspice XVII, when a sine wave voltage or current source has Ncycles.

? ? "I assume this was done intentionally or is this possibly an error."

Looking at LTspice's Help, I think it was an old bug that has finally been found and fixed.? The way it behaves now, is the way it was always SUPPOSED to be.

The LTspice IV Help page says that the output before Td or after Ncycles have completed, should be:

? ? V(time) = Voffset?+ Vamp * sin(PI*Phi/180)
? ? I(time) = Ioffset?+ Iamp * sin(PI*Phi/180)

Therefore its steady starting AND ending values should have been the value at that point along the sine wave where it starts and ends, determined by Phi.? Thus the sine wave should be continuous at both ends.? (But even that description is in error, because Ncycles doesn't need to be an integer, and because it doesn't take Theta into account.? That's been fixed in the Help page for LTspice XVII.)

However, LTspice IV's actual behavior differed from this.? Instead of being the steady value given on the Help page (adjusted if necessary if Ncycles is not an integer), it actually shot straight to zero at the end of Ncycles, as you saw.

I would call that a bug in LTspice IV because it clearly doesn't do what the Help says it should have done (for integer Ncycles).

LTspice XVII fixes the bug.

The LTspice XVII Help pages now say, "For times after Ncycles have completed, the voltage (current) is the last voltage (current) when Ncycles have completed.? Note Ncycles does not have to be an integer."? I think that was the intention all along, but LTspice IV was (and is) wrong.

It might be interesting to go back several versions and see if this big appeared at some point or if it was always there.? But I am not currently set up to easily do that.

Regards,
Andy



Re: LTSpive IV vs XVII voltage generators

 

Hello Larry,

I would assume it was done intentionally.? Although there may be arguments for both behaviors, the current behavior seems correct to me.? A simple sine wave is not the only case to consider.? The amplitude may be increasing or decreasing and there may be dc offset.? With all those different cases, having the source just stop at its last value makes the most sense to me.? If going to zero is required, one could always add a pulse source in series with a delay equal to the sine source stop time, a 1ns rise time and a dc value opposite the sine source final value.


---In LTspice@..., <xxw0qe@...> wrote :

I loaded an old circuit that was created in LTspice IV into LTspice XVII today and noticed that the voltage acts differently. Specifying a sine wave voltage source with some number of cycles and some phase so that the ending point is not at 0V the two versions act differently.

Version IV sets all voltage values after the sine wave to 0v where version XVII sets all the values to the last voltage that was specified at the end of the number of cycles.

I assume this was done intentionally or is this possibly an error.

Thanks,
Larry Benko