LT Spice challenge

Aug 19, 2021 Last reply: 4 years ago 33 Replies

Suppose I have a circuit with 20 nodes, N1 ... N20.



I want to plot the node voltages, left to right on the screen.



Any ideas?



Clumsy ways:



Build an analog mux and clock it with a counter, plot with time as x-axis



Push a pulse into a tapped transmission line to sequence a bunch of switches



Export a file and do it in a separate program


So, left-to-right is the node number? Not a time axis? And, node voltage is the vertical axis?

Are you looking for a slide show, one node per slide?

It's the node number, but if LT spice wants to plot it as time, I don't mind. 0-20 seconds could be equivalent to node numbers.

Vertical would be node voltages.

No, all 20 node voltages plotted on the screen, left to right.

Imagine a 20-tap voltage divider with equal resistors, makes a straight line. Unequal Rs could trace out a curve.

You want a bar graph of 20 different voltages.

Don't know how to do that, but it can make 20 graphs in different colors. Of course, I don't think LT spice can even use 20 colors, so not all different.

Isn't there a way to write a simple equation based on time that will put that into a single signal? I could do that pretty easily in Excel, but LTspice is pretty grody. Try the LTspice group. They still have some knowledgeable folks there, but you have to be nice to them.

Sounds like a table, rather than a plot.

You can always swap an axis to get a vertical plot.

RL

I want a plot.

LT Spice now has the ADG1208 analog mux. Three of them lets me scan 24 points. I can drive them from a 1 Hz counter or a few pulse generators.

You can also decode the .RAW file and do anything you want with the data.

Here's an example of a simple noise plot of a 120 ohm resistor into a 100uF capacitor. Here's the ASC file:

Version 4 SHEET 1 2748 1700 WIRE 1456 -352 1440 -352 WIRE 1568 -352 1456 -352 WIRE 1712 -352 1648 -352 WIRE 1776 -352 1712 -352 WIRE 1440 -320 1440 -352 WIRE 1776 -320 1776 -352 WIRE 1776 -240 1776 -256 WIRE 1440 -208 1440 -240 FLAG 1712 -352 Vn FLAG 1440 -208 0 FLAG 1776 -240 0 FLAG 1456 -352 Vin SYMBOL res 1664 -368 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R1 SYMATTR Value 120 SYMBOL voltage 1440 -336 R0 WINDOW 123 35 61 Left 2 WINDOW 39 0 0 Left 2 SYMATTR Value2 AC 1 SYMATTR InstName V1 SYMATTR Value 0 SYMBOL cap 1760 -320 R0 SYMATTR InstName C1 SYMATTR Value 100uf TEXT 1408 -488 Left 2 ;'Noise Calculations TEXT 1408 -464 Left 2 !.noise v(Vn) V1 dec 100 1 1e6

Here's the ASCII header of the RAW file. The data starts after the Binary tag. Just read the numbers as directed in the header and give them to a plot program of your choice.

Title: * C:\SWCADIII\DAT\TL431\524A0417.ASC Date: Fri Aug 20 05:27:56 2021 Plotname: Noise Spectral Density - (V/Hz½ or A/Hz½) Output: vn Flags: real forward log No. Variables: 5 No. Points: 601 Offset: 0.0000000000000000e+000 Command: Linear Technology Corporation LTspice IV Variables:

0 frequency frequency 1 gain gain 2 V(r1) voltage 3 V(onoise) voltage 4 V(inoise) voltage Binary:

I use WPlot32 by W.G. Hood from 1994. It does 2 and 3-dimensional plots with linear or log axis. Data can be fit by a smooth curve or least squares polynomial or exponential. The FFT and functions can be plotted. WPlot can be controlled from a GUI or command line. It works on XP and probably will work on Win7 if you use the TAME program for DOS.

There are plenty of plot programs. WPlot32 can be found at

formatting link

Shift register from D flops plus analog switches.

Sure, but that's a chore and isn't very interactive. People (and mice) learn from rapid feedback.

Yes, but a few analog mux's and a counter is less busy. I just noticed that LT Spice now includes the ADI analog mux chips.

Six pulse generator voltage sources would generate the addresses and enables for three 8:1 mux chips. I guess one could use the LT counter element as a ripple counter too... 4 of those.

Switches with a .model can be made (almost) perfect. One less thing to worry about.

OK, but keep it in mind when you need to do some curve fitting, especially to noisy data.

I like to stay inside Spice when I can. As in adding a lowpass filter for looking at wideband data. My current case would have no noise. Spice doesn't do time-domain noise.

Mike E says that the true value of Spice is for training your instincts. That works best with rapid visual shape-based feedback.

And each switch operated with its own delayed pulse voltage source...

PULSE(0 5 {1*Td} 1u 1u 1m) PULSE(0 5 {2*Td} 1u 1u 1m) PULSE(0 5 {3*Td} 1u 1u 1m) etc

Sure it does. You can use Box-Mueller. You can also add shot noise, as in optical transimpedance amplifiers.

I'd post the ASC files, but they will suffer from word wrap in the text portions and never load. I'd zip them up and post to google drive, but that is turning out to be a real pain. I just got my own website at

formatting link
but I was having problems linking to their nameservers in Filezilla. They sent me an email giving all the directions, but I haven't had time to implement them yet. Soon...

I agree. I am still amazed that one man can write such a powerful program. Have you ever been to one of his seminars? Absolutely amazing! I still have the T-shirt, but I washed it in a load of laundry using bleach, and it turned pink so I can't wear it. But I keep it as a memento.

Hello John, So the issue is LTSpice won't plot that many (n=20) in one graph? Sorry, I use MicroCap, not LTSPice. Plotting 20 nodes is no sweat in MicroCap.

Or, you want 20 separate plots, each in its own window? That, I can't do either.

In any case, I would export* the data & graph it in Excel.

*In MicroCap: Run Transient Analysis (Alt-1). F10 > Numeric Output > Check All, Data Points=Actual, "OK" Re-run Transient Analysis (F2), see Numeric Output (F5)

cheers, RS

No. I want a screen where X-axis is node number and Y axis is the voltage on each node, left to right. That graphs a voltage trend line along a row of nodes.

Looks like a time-stepped analog mux is the best (only?) way to do that.

One approach is to use another program (probably using the BM algorithm under the covers) to generate .wav files and using those. They can be summed together with different delays to generate new instances of the random noise.

You can also add shot noise, as in

Only in .noise simulations, and it's non-obvious. I got it working once but then just bailed out because the math is so simple anyway.

Cheers

Phil Hobbs

Sure, you can make time-domain noise sources and add them into a circuit, but that is a real nuisance when you need a lot of them.

I've used the Spice random functions.

One of my guys attended and learned a lot of tricks.

I went to one 15 or so years back. Not a bad use of a day.

Cheers

Phil Hobbs

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required