LTSpice resistive divider

Hi,

what has recently happened to my Spice? Below is a simple resistor divider and this is the R2 voltage:

formatting link
Switching between solvers doesn't make any difference.

Best regards, Piotr

Version 4 SHEET 1 880 680 WIRE 208 32 96 32 WIRE 368 32 288 32 WIRE 368 48 368 32 WIRE 96 80 96 32 WIRE 96 176 96 160 WIRE 368 176 368 128 FLAG 96 176 0 FLAG 368 176 0 SYMBOL voltage 96 64 R0 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR InstName V1 SYMATTR Value SINE(0 320 50) SYMBOL res 352 32 R0 SYMATTR InstName R1 SYMATTR Value 64 SYMBOL res 304 16 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R2 SYMATTR Value 10m TEXT 64 200 Left 2 !.tran 1

Reply to
Piotr Wyderski
Loading thread data ...

Reinstalling Spice doesn't help either. Would it be the new physics they've been looking for at CERN recently?

Best regards, Piotr

Reply to
Piotr Wyderski

I entered the schematic from scratch and get the same thing. I suspect the solder joints. Try touching them up with a hot iron and lots of flux.

Reply to
Ricky

Thanks for the heads-up, Piotr. It does it for me too, at least in XVII.

It only seems to do it with the "modified trap" integrator--switching to plain trapezoid or Gear fixes it, it looks like.

None of the tolerances I fiddled with did anything.

It works fine in LTspice IV.

That's a super good test case for a bug report!

(JT, were he here to see it, would be crowing about how much better Original Crispy PSPICE was. RIP.)

Cheers

Phil Hobbs

Reply to
Phil Hobbs

No problem, albeit I am shocked that you both can replicate it. I was sure it was due to my messing up with the Control Panel parameters. Now I am getting worried: how many planes above my head were simulated with this tool? ;-)

So does tran 40m instead of tran 1 with the default settings.

Reported.

Best regards, Piotr

Reply to
Piotr Wyderski

It looks OK with a smaller time step.

Reply to
John Larkin

Or not. Apparently, my location is essential. How would our beloved P. Allison respond to that?

Hi Piotr, For technical support, ADI requests additional contact information. Please reply to this email with your:

Company or University Email address Phone number Name of your Company or University Office Address, City, State, Zip Code

Regards, ADI Tech Support

Reply to
Piotr Wyderski

Not quite, with the default "modified trap" setting using 40ms tran does indeed give the proper waveshape but the voltages are still wrong!

piglet

Reply to
piglet

Their way to filtering out the rif-raff, obviously. The "company" email address only means no Yahoo or Gmail accounts, even if that's what you actually use.

There's an ADI part I want to redesign out because of price. The only alternative I've found so far is a Maxim part that can be even higher priced... and is now an ADI part. lol

Low resistance, high voltage analog switch. Powered from ±12V and around 2-3 ohms, quad in a TSSOP-16. Being able to get the Maxim part was hugely important when the ADI part was not available.

Reply to
Ricky

Well, it's nice for them to be able to phone you up for clarification.

An address along the lines of "1600 Pennsylvania Ave NW, Washington DC

20500" is always good. ;)

Cheers

Phil Hobbs

Reply to
Phil Hobbs

FWIW it worked perfectly for me on all PSpice integration methods.

To be fair I had updated (Tools->Sync Release) a week ago...

Reply to
Chris

This is an old message thread, but I want to let you all know what the "problem" was.

What you are seeing is the effect of LTspice's Modified Trap integration method, and a little more. Modified Trap is identical to regular Trap except that an additional nonlinear filtering step is applied to waveforms before saving them to disk (it doesn't affect the simulation itself). It is described on the LTspice Help page for "Integration Methods".

Now, a change was made to LTspice XVII in 2020(?) to disable this nonlinear filtering on only certain signals - namely those that come directly from things like voltage sources, because they should be immune to "Trap Ringing", which was the reason for the nonlinear filter. I don't know why they changed it, but I guess maybe customers complained that their ideal voltage sources were slightly "off". That change fixed it.

All good so far. But the problem comes when you directly compare nearly identical signals where one is ModTrap-filtered and the other is not. That is the case in your circuit with the signals on the two ends of R2. R2 is much smaller than R1 so the two voltages on R2's ends are large but nearly equal (millivolts compared to hundreds of volts). But - and here's the key thing - when saved to disk with Modified Trap selected, the right end of R2 has the ModTrap nonlinear filter, and the left end does not. Now, depending on the timestep, this can cause the voltage between the ends of R2 to look distorted on account of that nonlinear filter that was applied differently to the two signals. If both signals had Modified Trap filtering, they would look fine because the nonlinear filter would be applied to both signals. Also, when looking at any signal by itself (not compared with another), it looks correct because the effect of the nonlinear filter is usually negligible unless there is Trap Ringing. But because you are looking at the small difference between two large signals, you see something that shouldn't be there.

There are multiple ways to eliminate it:

- Make the timestep smaller. Add a Maximum Timestep to the .tran command.

- Don't use Modified Trap. Select either (regular) Trapezoidal or Gear. (Note that you can't force regular Trap by way of ".OPTIONS METHOD=TRAP". That just picks either Trap or Modified Trap depending on which one was selected in the Control Panel.)

- Add a dummy resistor from the top of V1 to nowhere. Give it any value other than 0. There is exactly zero current through it, so no voltage drop across it. But LTspice applies the ModTrap's nonlinear filter to the floating end of that added resistor, whereas the driven end (connected to V1) doesn't have the nonlinear filter. Now if you probe the voltage between that floating end, and the right end of R2, the plotted waveform looks correct again.

Regards, Andy

Reply to
Andy I

Interesting, thanks.

Cheers

Phil Hobbs

Reply to
Phil Hobbs

is

I love LT Spice except when she lies to me. It's good to always be a bit skeptical.

Reply to
John Larkin

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.