SPICE tarnsient analysis of oscillators - sampling time

Although its true that too large a drive might kill the xtal, that is not usually the determinator of max drive current in a precision oscillator xtal. A key issue is ageing. Excessive overdrive makes the xtal frequency drift over time. A second issue is the creation of anomalous frequency variations over temperature that can't easily be compensated out.

formatting link

An, arguable, more convenient alternative to setting node initial conditions to speed startup is to simple set the initial inductor current of the xtal inducter e.g. to form a line:

LXTAL 1 2 1m ic=1.5ma

In SuperSpice, you just set it in the inductor setup dialog.

In standard spice you also need to set UIC (use initial conditions). not sure how LTSPice handles this.

To get an accurate value requires running a sweep of initial values to find the correct value, typically running a deQed circuit to speed up that evaluation. What looks like a steady state amplitude, isn't. It still takes the time associated with its c1/L to stabilise.

Yes.

It is indeed an excellent example of a mathematically chaotic system. The fact that a simulation will repeat itself exactly, with the same data does not make the system non chaotic. Indeed, the predictability of the apparent randomness is, arguable, the key feature of chaotic systems. The classic example being the rediscovery of chaos theory when Edward Lorenz noted a difference in results for what he initially thought was an identical simulation.

formatting link

Oh dear... "Don't believe just because a computer was involved" includes "be careful about the data" . Data is what drives a computer

The models are never 100% accurate, and neither is the simulator, even if the models were 100% accurate. Spice, now get this, has a reltol, vntol, chgtol and an abstol, additionally it has a gmin. These create errors... Now....

In order to simulate high Q xtal oscillators (c1=0.3fF), especially embedded into larger circuits one might well need to put a clamp across the inductor. This is because operating voltages across the the inductor may be 100kV, and whilst searching for the solution, the iterator might start generating voltages of 1000s of MV. If not clamped, the large span of voltages can cause convergence failure. Typically numbers need to be restricted to about

12-13 digit spans.

A two diode series clamp using a spice default gmin=1p across the inductor will totally collapse the phase response so that the system won't oscillate. Reducing gmin can cause convergence failure for other parts of the circuit.

1 Tohms is too low a resistance!

The point here, is that the simulator itself has limitations independent of the accuracy of the models that can cause it to fail. Its not just the models that cause accuracy problems.

-- Kevin Aylward

formatting link
- SuperSpice
formatting link

Reply to
Kevin Aylward
Loading thread data ...

I am going to guess that you must be using LTSpice with compression on.

Running straight spice with a max step of 1ms, wont get you any jaggies until zooming in to the 100uV region of the top. Zooming in to say, 25mV range of the top shows a pretty smooth curve from where I'm standing.

-- Kevin Aylward

formatting link
- SuperSpice
formatting link

Reply to
Kevin Aylward

LT Spice will sometimes do weird things, and maybe not do them, with the tiniest change of anything. Sometimes an entire sim run will slow down by 100:1. Sometimes it will cruise along and then stall at some arbitrary point for seconds or minutes, then wake up and resume. The initial conditions solution can take forever.

Does SuperSpice do that? Is that inherent with Spice?

I used to run ECA under DOS. Nothing would stop it; not convergence problems, not divide by zero, nothing.

--

John Larkin         Highland Technology, Inc 

lunatic fringe electronics
Reply to
John Larkin

Right, that is the default.

--

John Larkin         Highland Technology, Inc 

lunatic fringe electronics
Reply to
John Larkin

My advice is to never use compression. Its a solution looking for a problem.

-- Kevin Aylward

formatting link
- SuperSpice
formatting link

Reply to
Kevin Aylward

Yes. Its inherent in solving any system of equations that convergence at spot points and regions may be more difficult than others. As the circuit gets bigger, so does the convergence problems. Even with Cadence Spectre one someone has to do quite a bit of fiddling to get convergence.

-- Kevin Aylward

formatting link
- SuperSpice
formatting link

Reply to
Kevin Aylward

The point I was making, somewhere far above, is that the LT Spice defaults seem to go for speed. That usually works fine for things like opamp circuits, but sometimes doesn't.

Things with a huge range of time constants are nasty.

I wonder how it handles time steps when I specify a pulse generator with fast rise and fall times, maybe driving a slow RC or something.

Or transmission lines? How many time buckets inside a transmission line? One txline can theoretically store an unlimited amount of information.

--

John Larkin         Highland Technology, Inc 
picosecond timing   precision measurement  

jlarkin att highlandtechnology dott com 
http://www.highlandtechnology.com
Reply to
John Larkin

Ltspice probably just looks at the simulated signal at the other end of the lines at the apropriate time in the past. it doesn't need separate storage for the line.

--
  When I tried casting out nines I made a hash of it.
Reply to
Jasen Betts

That works for the lossless line, but data is only saved at time-step times of the overall circuit.

The lossy line model has stuff happening all along the line, so can't just look back in time at the input. I wonder how many effective segments Spice chops up a line into, and whether the time step matters there.

I might do some experiments.

--

John Larkin         Highland Technology, Inc 
picosecond timing   precision measurement  

jlarkin att highlandtechnology dott com 
http://www.highlandtechnology.com
Reply to
John Larkin

More fun: seriously mis-terminate a line and poke a pulse into one end. After a while there will be a mess of reflections, maybe of various polarities, things sloshing back and forth. There's no "black box" way to simulate that; you'd need a lot of internal nodes.

--

John Larkin         Highland Technology, Inc 
picosecond timing   precision measurement  

jlarkin att highlandtechnology dott com 
http://www.highlandtechnology.com
Reply to
John Larkin

Sure there is, the current pulse that was not conducted out of the line at the unterminated end is the history of that end node as an input at that end of the line, that gets replayed back to the source end.

--
  When I tried casting out nines I made a hash of it.
Reply to
Jasen Betts

You could do that; Spice can't. Spice simulates circuits; it doesn't understand them.

There's still the issue of the lossy line. It needs internal nodes.

--

John Larkin         Highland Technology, Inc 

lunatic fringe electronics
Reply to
John Larkin

It doesn't need to understand it.

The current (and voltage) into the first end appears at the second end after the line's delay any of that current that doesn't flow into the attached circuit will be as current input to the second end and eventualy appear at the first end.

why? is it dispersive?

--
  When I tried casting out nines I made a hash of it.
Reply to
Jasen Betts

Multiple reflections complicate that endlessly.

Lossy and dispersive.

--

John Larkin         Highland Technology, Inc 

lunatic fringe electronics
Reply to
John Larkin

they only complicate the signal. not the algorithm

how do I do a lossy line in ltspice?

--
  When I tried casting out nines I made a hash of it.
Reply to
Jasen Betts

ltline is a component.

There is a lot of stuff online about Spice transmission lines, but I haven't found anything about the internals.

--

John Larkin         Highland Technology, Inc 
picosecond timing   precision measurement  

jlarkin att highlandtechnology dott com 
http://www.highlandtechnology.com
Reply to
John Larkin

It wants some stuff that I don't know how to write before I can run a simulation.

I've downloaded the source to ngspice but not come to understand the txline stuff beyond seeing that the txline influences the minimum timestep.

--
  When I tried casting out nines I made a hash of it.
Reply to
Jasen Betts

Look up "telegraphers equation" to get the general idea. You've got to build the txline out of Rs and Ls and Cs. I used to do that myself; I wrote a Basic program to make a netlist for a lossy line for ECA. The number of sections explodes as the square of Td/Tr or something nasty like that. Sim times were bad for 1000 sections running on an 8086.

And the min time step affects the risetime of the line!

--

John Larkin         Highland Technology, Inc 

lunatic fringe electronics
Reply to
John Larkin

Cool, that explains L,C,R, and G but where do I put the numbers?

--
  When I tried casting out nines I made a hash of it.
Reply to
Jasen Betts

Sometime last century I made a physical one with 120 sections for testing HDSL modems I was working on. It modelled 3.7km of 0.4mm twisted pair, and was good to about 500kHz.

I actually posted about it in s.e.d:

formatting link

8LuNcWHCm6MJ

Regards, Allan

Reply to
Allan Herriman

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.