Significant Ltspice precision error/bug?

Thread Starter

Hypatia's Protege

Joined Mar 1, 2015
3,203
Kind friends

I seem to have encountered a rather egregious 'precision error' Re: LtSpice

Granting that past experience suggests the problem is likely down to my-own misunderstanding of the application -- I will nonetheless be most grateful for assistance in settling the matter either way!:)

The circuit under study is a 'bone-basic' 1/2 wave rectifier/filter operating at 60kHz / 50kV (peak)

Cursors set as follows:
Cursor #1: For an amplitude of 49.999993Kv (For all intents and purposes 90°)
Cursor #2: Cursor 1 +100.6626ns (i.e. ≈ 2.1743° 'ahead' of cursor #1)

Hence I would expect an amplitude difference of ≈ -36V However the simulator returns a value of ≈ -40.9V:confused:??? --- The cited disparity would seem to exceed that ascribable to a 'rounding' error'?

Note that while the selected diode does not, in actuality, support the simulated frequency or EMF -- such should not be an issue inasmuch as LtSpice does not 'enforce' Trr or Vrrm

Please note that, for the convenience of the readers, I have annotated the screen capture...

Many, many advance thanks for any assistance or insight!!!:):):):)

Diode.jpg
 

Thread Starter

Hypatia's Protege

Joined Mar 1, 2015
3,203
4v out of 50kv is egregious? Are you using it to design a probe to the next black hole?
Perhaps 'egregious' is a bit strong:oops: Even so an error of 0.0098% is larger than one would expect? --- In any event I'm ok with it so long as I may be certain such is merely a rounding artifact:):):)

Many thanks for your response!:)

Best regards
HP
 
Last edited:

GopherT

Joined Nov 23, 2012
8,012
I cannot zoom in to see the text details of your entire circuit on my tablet but, as noted a 0.01% "error" could be that a diode has about 0.01% of the capacitance of a 10nF capacitor, that is 1pF. (I cannot see the numbers on your voltage source or any information on the o-scope)

Also, many simulators do not like capacitor circuits with no resistance. You can put a 0.01 ohm resistor in series with your diode or a multi-megOhm in parallel with your capacitor to meet the typical criteria while minimizing the impact to the circuit.
 

Thread Starter

Hypatia's Protege

Joined Mar 1, 2015
3,203
I cannot zoom in to see the text details of your entire circuit on my tablet but, as noted a 0.01% "error" could be that a diode has about 0.01% of the capacitance of a 10nF capacitor, that is 1pF. (I cannot see the numbers on your voltage source or any information on the o-scope)

Also, many simulators do not like capacitor circuits with no resistance. You can put a 0.01 ohm resistor in series with your diode or a multi-megOhm in parallel with your capacitor to meet the typical criteria while minimizing the impact to the circuit.
Many thanks for your reply!:):):)

FWIW Here's the ".asc":)
 

Attachments

Thread Starter

Hypatia's Protege

Joined Mar 1, 2015
3,203
Are you using the default Tolerances, or have you set them to something else in Control Panel?
I merely opened the program, selected new schematic, then drafted the circuit -- If it's of any assistance I've attached the .ASC file to post #5

Many thanks for your reply!

Best regards
HP:)
 

Thread Starter

Hypatia's Protege

Joined Mar 1, 2015
3,203
@Bordodynov (and anyone wishing to respond):cool:

First of all many thanks for your time and effort in assisting me with this!:)

So... I have a few questions -- please be patient - I'm new to LtSpice (my experience with said application being confined principally to 'schematic entry').

But to begin:
Ltspice directive/statement:...............My Interpretation....................................Questiom
.param Tmax={7440.25/60000}........ Load Tmax = (7440 Cycles+90°) := 124ms --- Why 'add' the extraneous 7440 Cycles?:confused:


Please indicate whether I have correctly interpreted the following statements:)
Statement................................................My Interpretation
.meas Vmax Find V(a) at {Tmax}
...............Load 'Vmax' := EMF at 90° ?
.meas Vsh Find V(a) at {t1} ......................Load 'Vsh' := EMF at 90° ± ≈ 2.1743° ?
.meas delta param Vmax-Vsh....................Load 'Delta' := Vmax-Vsh ?
.meas ph param 100.6624n*60000*360......Load 'ph' := calculated angle per T1 interval (≈2.1743°) ?

Please explain why this 'textual run' returns the correct result whereas the graphical simulation was in error? (IOW what was I doing wrong?:oops::oops::oops:)

With heartfelt thanks and very best regards!
HP:):):):)
 
Last edited:

Bordodynov

Joined May 20, 2015
2,469
Hypatia's Protege.
Yes. Tmax=7465.25*60000
I looked at your chart. But the difference in the result not will be. You can take any period. You did not properly understand the results. I increased the calculation accuracy. Ask directive ".opt reltol=1u" and make calculations, and repeat your measurements. With the default settings the result was just as bad as you.
 

Attachments

Last edited:

Thread Starter

Hypatia's Protege

Joined Mar 1, 2015
3,203
Hypatia's Protege.
Yes. Tmax=7465.25*60000
I looked at your chart. But the difference in the result not will be. You can take any period. You did not properly understand the results. I increased the calculation accuracy. Ask directive ".opt reltol=1u" and make calculations, and repeat your measurements.
So, as I understand your reply, my error owed to insufficient precision?

I've just attempted to set the Relative Tolerance to '1u' (i.e. 1*10^-6) as (shown below) -- however that seems to have compounded the error?:confused::confused::confused:
Please advise...?

Again, I entreat patience:oops: -- I apologize for my slow-wittedness in this matter!:oops: --- Many thanks!
HP:)

Diode2.jpg
 

Thread Starter

Hypatia's Protege

Joined Mar 1, 2015
3,203
@Bordodynov -- Thanks!

I've run the simulation having issued the 'onscreen' directive: ".option plotwinsize=0." -- with much improved results (please see immediately below):) - Howbeit not as accurate as your results (attached to post #8)

---Post continued 'below' image---
DiodePlot1.jpg

When attempting to run the simulator having issued the ".model" directive shown in post #8, I receive the following error/warning dialog:

---Post continued 'below' image---
DiodeError.jpg

And the erstwhile erroneous results on the 'plot' (Please see below):confused: - Please advise? ---- Many thanks for your patience!:):):):)

DiodePlot2.jpg


Best regards
HP:)
 
Top