Keyboard Shortcuts
Likes
- LTspice
- Messages
Search
Re: Bug in Version 4.20d
File a bug report with him, at the address in the "About LTspice" dialog.
toggle quoted message
Show quoted text
Jim Wagner Oregon Research Electronics On Dec 12, 2013, at 7:29 AM, Peter Kapas wrote:
|
Bug in Version 4.20d
I updated LTspice yesterday. There is replacement of the jumper with 0 value of the resistor, but the Export Netlist is not working now properly. The values of the resistors are replaced with accidental characters in all types of netlists ... It is just for info, to wait for correction on Version 4.20e. I hope Mike will do it. Peter |
Re: XVAR specification
M.Rakesh sharma wrote, "
I haven't used the Potentiometer models so I can't say with certainty. ?But the one you picked is a subcircuit. ?(That might be true of all of them.) ?It is not only a symbol. ?You must also import or include the subcircuit definition. ?In the case above, it is looking for a subcircuit definition named "potentiometer", and it can't find it.
Check where you found the symbol and look for a subcircuit model that goes with it. ?The subcircuit model should begin with the line
.SUBCKT potentiometer ... followed by other stuff. ?You can either call it with an .INCLUDE statement, or paste it directly into your schematic. Regards, Andy |
Re: XVAR specification
Dear Mr Andy, Thanks for your suggestion. I chose one potentiometer from the all_files folder. But still I am unable to simulate my circuit if I use this component in my circuit. Same error message appears again - "Unknown sub-circuit called in: x001 n003 n008 nc_01 potentiometer rtot=50K wiper = 5" Do it change anything after placing ths component in my circuit? Thanks & Regards, M.Rakesh sharma. |
Reference Information
Some one or two months ago mention was made of a book ¡°The LTSPICE IV Simulator¡± written by Gilles Brocard, published by Wurth Electronik, ISBN 978-3-89929-258-9. I have used LTSPICE for about three years and probably simulated over 100 circuits for both my own and work purposes, but like many others I struggle to interpret the sparse help files and I knew that I had much to learn to improve my knowledge of the simulator. ?I decided to purchase a copy of the book even though it was $60 US here in Australia. I rationalised that since the simulator was free, this cost was reasonable if the book turned out to be of value. Until now I have been slowly improving my skills by keeping a notebook of tips gleaned mainly from this forum. I have also read several of the tutorials produced by universities and others to introduce LTSPICE to undergraduates. These all help but because the information is somewhat random in its coverage and no doubt because I have not taken the time to organise it properly, it can sometimes be of limited help. I also refer to examples in the files section and information gleaned from other web sites. No doubt this would be sufficient if I had the time to spend learning the simulator, however like many others I am time poor at present. The purpose of this post is to provide some feedback on the book. I am only about one third through it but I am able to report that I consider it as having been a good purchase. Sure the style of writing is very dry and some of the phrasing has that awkward feel that often occurs when technical books get translated to English, but the coverage of the subject appears to be thorough. Even though I would have liked a more comprehensive index, so far I have been able to locate all the information I have looked for. I thought this feedback may be of interest to others in a similar situation to myself. I have no association with the author or publisher. Finally, since I rarely post, let me take the time to say thanks for the effort made by Helmut and others who step in to answer questions and offer advice. It is appreciated, if rarely acknowledged, by the many followers of the site. |
Re: FFT Resolution
In any event the resultant "spectral accuracy", even if optimized for some set of conditions, resolution, and bandwidth of spectrum, will be directly dependent on the accuracy of represented distortion (read non-linear) effects. ? - In general large scale spectra will tend to more accurate representation, whereas the smaller the spectral component the more the sensitivity, and deviation, from the actual results in a real world circuit. This effect is exploited in so-called "Harmonic balance" type solvers to great success. ? - Cordially - RC On Tuesday, December 10, 2013 2:58 PM, John Woodgate
?
In message , dated Tue, 10 Dec 2013,
"skleiser@..." writes: > Given (in this case) a square wave of fixed frequency, fast but >non-zero rising & falling edges, 50% duty cycle, and an exact integer >number of cycles (etc.), what's the narrowest possible harmonic >bandwidth that ought to be expected? In other words, when is the >simulation as optimized as it can be? harmonic bandwidth doesn't depend on those things. Embedded in the Help on the B source is: "In LTspice, the impulse response is found from the FFT of a discrete set points in frequency domain response. This process is prone to the usual artifacts of FFT's such as spectral leakage and picket fencing that is common to discrete FFT's. LTspice uses a proprietary algorithm that exploits that it has an exact analytical expression for the frequency domain response and chooses points and windows to cause such artifacts to diffract precisely to zero. However, LTspice must guess an appropriate frequency range and resolution. It is recommended that the LTspice first be allowed to make a guess at this. The length of the window and number of FFT data points used will be reported in the .log file. You can then adjust the algorithm's choices by explicitly setting nfft and window length. The reciprocal of the value of the window is the frequency resolution. The value of nfft times this resolution is the highest frequency considered." The significant words are: "The reciprocal of the value of the window is the frequency resolution." Frequency resolution is the same as the observed 'harmonic bandwidth'. > > On a more general note, assuming artifacts of a non-ideal simulation >have been minimized, does the harmonic bandwidth provide useful >information, or do only the peak values matter? The harmonic energy is averaged over the bandwidth, so widening the bandwidth tends to reduce the observed amplitude. -- OOO - Own Opinions Only. With best wishes. See www.jmwa.demon.co.uk Nondum ex silvis sumus John Woodgate, J M Woodgate and Associates, Rayleigh, Essex UK |
Re: LDO LTC1844
There is a solution to LDO-s that work well enough using a level 2 switch that was described here on the forum. I did my? solution for a L4940 family regulator that works well enough. You won't be able to see the regulator's frequency dependence and why they are noisy at some frequencies, but for a normal operation in a normal circuit it is OK.
LTspice switches converge lightning-fast, so if you are not after some exotic features out of a regulator, it will do much better than a transistor level model. Do you want my solution so you can convert it for your application? |
Re: Determine phase and gain margin in filter/amp
monettsys
--- In LTspice@..., <frank_wiedmann@...> wrote:
I have uploaded to the Temp folder an example circuit from where I have included the .meas commands for the phase and gain margins. For further explanations, please see Measure_Margins.asc. I have also reduced the step size of the .ac simulation in order to get more precise results.Thanks again, Frank. I should mention your file is named "opamp stability 2.asc" for those who may be looking for it. To me, it is one of the most significant files that has ever been uploaded to this forum! When you have an amplifier with ringing and poor step response, plotting the open loop response may be the only way to find what is wrong and fix it. The ability to measure the phase margin means you can keep track of changes and keep the best ones. The excellent repeatability of the .measure commands eliminates human error and typical problems with manual adjustments, so you don't end up chasing your tail on self-induced problems. Very good work, Frank. Thanks! Mike |
Re: Determine phase and gain margin in filter/amp
---In LTspice@..., <405a82e5@...> wrote: Frank, that is absolutely spectacular! Thanks very much. Also thanks for the explanation of the second condition in the Omicron paper. It means we have no problems to use the Voltage Injection method for most practical circuits in LTspice. This is very good news. Thanks very much for the .measure commands. I would probably have had great trouble converting the Tian commands since they are so long. It is much easier to understand how the commands work when they are much shorter: .meas ac phase_margin find V(fb)/V(inm) when mag(V(fb)/V(inm))=1 .meas ac gain_margin find V(inm)/V(fb) when ph(V(inm)/V(fb))=0 In the second command for gain margin, why did you invert the ratio to V(inm)/V(fb)? Was that to give a positive result to the answer? Why is that needed? Yes, like I wrote in Measure_Margins.asc, I wanted to have positive values for stable circuits. Best regards, Frank |
Re: Determine phase and gain margin in filter/amp
monettsys
--- In LTspice@..., <sawreyrw@...> wrote:
Hi Rick, Thanks for the explanation. My version only works with left click. You really should take a look at Frank's solution. I extended the frequency range to .ac dec 1000 1m 10Meg Two runs gave the following results: phase_margin: v(fb)/v(inm)=(-8.38981e-007dB,55.9047) at 1.21103e+006 gain_margin: v(inm)/v(fb)=(15.3886dB,6.6374e-005) at 3.7333e+006 Date: Wed Dec 11 01:01:52 2013 Total elapsed time: 0.140 seconds. phase_margin: v(fb)/v(inm)=(-8.38981e-007dB,55.9047) at 1.21103e+006 gain_margin: v(inm)/v(fb)=(15.3886dB,6.6374e-005) at 3.7333e+006 Date: Wed Dec 11 01:02:33 2013 Total elapsed time: 0.130 seconds. As you can see, they are very repeatable. In fact, the second run was made with no graph, so you don't even need to plot the waveforms to get the answer! This fulfills my wish to have a method that gives the same result for everyone. My very sincere thanks to Frank for his work. Thanks for posting your original results. It led directly to this very excellent solution. Mike |
Re: Determine phase and gain margin in filter/amp
monettsys
--- In LTspice@..., <frank_wiedmann@...> wrote:
Frank, that is absolutely spectacular! Thanks very much. Also thanks for the explanation of the second condition in the Omicron paper. It means we have no problems to use the Voltage Injection method for most practical circuits in LTspice. This is very good news. Thanks very much for the .measure commands. I would probably have had great trouble converting the Tian commands since they are so long. It is much easier to understand how the commands work when they are much shorter: .meas ac phase_margin find V(fb)/V(inm) when mag(V(fb)/V(inm))=1 .meas ac gain_margin find V(inm)/V(fb) when ph(V(inm)/V(fb))=0 In the second command for gain margin, why did you invert the ratio to V(inm)/V(fb)? Was that to give a positive result to the answer? Why is that needed? For others who may be interested, I should mention you have an excellent set of articles on your home page at There is also a very good thread discussing open loop gain starting with your post in 2004: Thanks again, Mike |
Re: FFT Resolution
¿ªÔÆÌåÓýHi Steve and AndyYoull only be able to see the side bands if the sample is long enough to encompass an integral number of modulation periods. (and an integral number of carrier periods. The two should be integrally related to minimize artifacts.) The more info that gets sampled, the better the resolution. Hence is why the default FFT size is 262k, but of course you can set that to any thing needed. Al D. On 12/10/2013 06:11 PM, Andy wrote:
-- AC2CL I do not think there is any thrill that can go through the human heart like that felt by the inventor as he sees some creation of the brain unfolding to success... Such emotions make a man forget food, sleep, friends, love, everything. - Nikola Tesla |
Re: Questions about phase in .AC LTspice Analysis
Hnguyen wrote: "Q1: Why |Vop| and |Vom| are nearly equal??why not equal?"
A1: ?Ideally they are equal. ?Real circuits are not ideal. ?If there is any common-mode component present in the output signal, the two output pins would not be precisely complementary and then their amplitudes might not be equal.
"
A2: ?When exactly complementary, if you look at their AC components (and ignore the DC offset), V(vom) = -V(vop).
V(vop,vom) = V(vop)-V(vom) = V(vop)-(-V(vop)) = 2*V(vop).
So, in an AC simulation, the amplitudes of vop and vom should be equal, and the amplitude of V(vop,vom) should be 6 dB higher.
Andy |
Re: FFT Resolution
The widths of the peaks depend highly on the number of samples per cycle. It also depends a lot on the windowing function that is used.My hunch is that, for an FFT, it is often an indicator of non-infinite sampling duration. If you sample with the same number of samples per cycle, the peaks are narrower as you include more cycles. To me, that says that much of the observed peak width is not "real".?
toggle quoted message
Show quoted text
Jim Wagner Oregon Research Electronics On Dec 10, 2013, at 3:11 PM, Andy wrote:
|
Re: Determine phase and gain margin in filter/amp
---In ltspice@..., <405a82e5@...> wrote: Thanks, Frank. ? ? I have uploaded to the Temp folder an example circuit from ?where I have included the .meas commands for the phase and gain margins. For further explanations, please see Measure_Margins.asc. I have also?reduced the step size of the .ac simulation in order to get more precise results. ? The second condition in the Omicron article means that the voltage loop gain is only a good approximation for the loop gain as long as the loop gain is much larger than the ratio |Zout/Zin|. Because the first condition means that this ratio has to be much smaller than 1, this second condition is automatically satisfied at |T|=1 (or 0 dB), where you measure the phase margin. ? Best regards, ? Frank??????????????????????????? |
Re: FFT Resolution
Steve K. wrote: "
...? what's the narrowest possible harmonic bandwidth that ought to be expected? In other words, when is the simulation as optimized as it can be?"Good question. ?I don't know. Steve continued, "On a more general note, assuming artifacts of a non-ideal simulation have been minimized, does the harmonic bandwidth provide useful information, or do only the peak values matter?"
I think the widths could matter, depending. ?If anything non-ideal is going on that modulates the signal in some way, whether by varying its amplitude or its phase or frequency, that should translate into sidebands around each of the frequency components of the square wave signal. ?So if you are looking for that sort of thing, and assuming that the FFT is good enough to resolve those sidebands (and not just an artifact of doing the FFT), then it could be useful information. ?But to someone else, it might not matter.
When some sort of modulation is going on, energy gets transferred from the signal at the peak, into the sidebands around it. ?So as the amount of modulation gets worse, I think I would expect to see the peak shown by the FFT to decrease, while the width increases.
Andy |
Re: Questions about phase in .AC LTspice Analysis
hoa van nguyen
Hello Andy Andy: If
they were complementary, then |Vop| and |Vom| would be nearly equal,
their phases would be opposite (180 degrees apart), and V(vop,vom) would
be larger than either one, rather than smaller. ?None of these things
are happening in your .AC simulation.
Q1: Why |Vop| and |Vom| are nearly equal? why not equal? Q2: How do you know that V(vop,vom) would be larger than either one. Could you share your thoughts with me? Regards Hnguyen On Saturday, December 7, 2013 4:01 PM, Jerry Lee Marcel wrote:
?
Le 06/12/2013 16:28, Andy a ¨¦crit?:
?Thanks for this explanation. I just wonder why the OP included this statement. |