About the use of simulation for circuit design.

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Member
Joined 2018
Paid Member
Like many members of this forum I grew up with soldering irons, magazines with circuits and projects, tubes and data books. So before constructing, a lot of thought, and taking precautions to prevent "glowing grids, anodes and smoke". At that time, filters had to be calculated via tables or worse - rather cumbersome. When (long ago, at work) Micro-cap (Mc) was introduced, filter design became easy, even allowing standard parts (no alignment required). Faster computers resulted in simulating more complicated circuits, analyzing distortion quickly and showing stability (of amplifiers). So nowadays, retired, I am using the best of both: setting up a circuit that should work, analyzing with Mc, optimizing it, see if I have the required components and if not, use the nearest equivalents and do the simulations with them. Even then, a small change of a resistor might be needed to get something working, especially when using comparators. One example of using that procedure was improving the "linearity of inductance" measurement (Manfred Mornhinweg) so that only 1 knob is required to set the current through the inductance. It works like simulated, including the spikes ;-)
 
Hi ! may i ask you which way has provided the best outcome ?

When you design a circuit, there are usually errors in the design that need to be found and corrected. Simulating and building experimental circuits on perfboard are both ways to find the errors.

At work, I design analogue and mixed-signal integrated circuits, and the possibilities of finding errors by experimentation are quite limited. Making an experimental chip costs lots of time and money, the techniques to modify an existing chip (FIB) have serious limitations and you don't have access to most of the internal circuit nodes. Hence the emphasis on simulations.

The circuits I design as a hobby can generally be put on a piece of perfboard and probed with an oscilloscope. As I find that more fun than simulating, that's what I do, unless there is a good reason not to. For example, I once built an amplifier with 2660 V supply voltage. As I was quite scared of it, I simulated more than I usually do for hobby circuits, just to debug it as far as possible without risk of electrocution.

In the end you have to rely on experiments anyway, because simulations never catch everything. They can catch a lot, though.
 
>"So you mean that is possible to have a good result from a sim and yet end up with smoke and flames ?"

Some amount of attention and care must be paid to the simulation output. A colleague's story about a fellow engineer, after things blew up on the bench, famously remarking "But it worked in the simulation!?"

A post-blowup check of the sim result showed an "E+4" after one of the current values. The guy apparently went ahead and built it, powered it up, w/o noticing that part of the result.

I suppose this is where some real world experience compliments the simulation output ;')
 
Disabled Account
Joined 2017
Designing is done by finding a way to connect output to input (in that order). Lots of predesigned blocks are readily available, but one cannot assume that connecting blocks yields in a reliable result. Simulation in advance of building things to avoid blunders are welcome, but it is a verification too only. And simulation is not the real world, just a representation of it. And the real world had it flaws, so the simulation tool too. That counts as two variables in one equation, so it's only a vague pointer to go. If simulations go beserk, the design is wrong and redesign and calcultions are needed.
 
Just another Moderator
Joined 2003
Paid Member
My electronics knowledge and design capabilities are fairly limited, so Sims are of great help to me. I read datasheets, app notes, and get an idea of how to proceed. I put that in ltspice and make sure it does what I think it will in the sim. I might play with values to get the lowest distortion or lowest noise (bearing in mind that these results are not reliable indicators of actual performance, but in general trends map to real world. ie if distortion goes up in the sim it will probably go up in the real world"

When I am happy that things seem ok in the SIM I then breadboard the circuit. If that is OK then I might move to using verroboard or experimenter board. finally I may even go to designing a proper pcb.

A number of circuits that I have designed, I probably would not have been able to if it weren't for the speed of experimenting that sims provided. I was able to experiment in my lunch hour at work, or on the train too and from work. Something I could not do if I was using a breadboard exclusively.

Tony.
 
When you design a circuit, there are usually errors in the design that need to be found and corrected. Simulating and building experimental circuits on perfboard are both ways to find the errors...
In the end you have to rely on experiments anyway, because simulations never catch everything. They can catch a lot, though

Thanks a lot again. For me the very important question is how the sim results correlate with the measured results. I mean if the sim provides a certain THD spectrum and a very similar spectrum is measured ... that is a very good sign.
Even more important stability of the design.
I tried to lower the gain in a small integrated amp just lowering a resistor and destroyed the amp and burned my fingers on the heatsink. That was a hard lesson ... do not gamble with electronics :whazzat:
I think it could be repaired anyway.
 
>"So you mean that is possible to have a good result from a sim and yet end up with smoke and flames ?"
Some amount of attention and care must be paid to the simulation output. ...

Hi ! you mean that he did not read the sim results well enough ? it is very important to me to understand if the sim provides evidence of instability of the design. That the circuit cannot work properly. That is fundamental ... of course
 
Heh, ok. No, we can make a design without simulation. A way less poor compared, but really handwrited at a napkins.
Really, sim is a way to understand what happening and then you go further and further

Hi ! when a device behaviour can be described with equations and a circuit can be calculated also with equations a sw that does the dreadful calculation work for us is a godsend. Like i guess in any other engineer field.
Is this idea that audio design is different from other tech design that puzzles me.
Of course models are the Achille's heel of the process.
I am not sure but to make a model is just a matter of carry out measurements ? maybe a long process but not impossible.
For newer devices models should be more available i guess.
 
:cop: Threads have been merged and moved back to Software Forum.
Please do not start multiple threads on the same question.
Hi thanks and very sorry. I was afraid that in the section dedicated to the sw my question would sound a bit provocative/naive and in fact I got an insult :eek:
On the other hand, I feel like in the Lounge there is more tolerance for chatting ?
Thanks again and best regards, gino
 
Just another Moderator
Joined 2003
Paid Member
Hi ! you mean that he did not read the sim results well enough ? it is very important to me to understand if the sim provides evidence of instability of the design. That the circuit cannot work properly. That is fundamental ... of course

Sometimes it does and sometimes it does not. If the problem is with the design itself and the models are accurate enough then the sim may break into oscillation. If you do not have a low enough value for time step then it may not be caught, the lower you go the longer the sim takes to run. I tend to sim with a maximum time step of 0.1uS if I'm wanting to be sure about things.

The areas where the sim won't help you are where the design is ok (but sensitive to layout) if you do a bad layout even though it worked fine in the sim it may not be stable in real life.

I had a marginally stable circuit, and it would show oscillation using some opamp models, but not others. When I breadboarded it, the oscillation was present regardless of which opamp I used (this told me that some models were better than others). The thing that stopped the oscillation in the sim (with those opamps that exhibited it) didn't necessarily work in real life. Some more experimentation on the breadboard was required to finally make it stable.

If you go to the trouble of adding parasitics to capacitors and inductors it should make your sims more realistic, but where do you stop, you could also add parasitics for traces etc.

The sim is a great tool but at least with the ones available for free to us hobbyists they do have their limitations.

Tony.
 
Thanks a lot again. For me the very important question is how the sim results correlate with the measured results. I mean if the sim provides a certain THD spectrum and a very similar spectrum is measured ... that is a very good sign.
Even more important stability of the design.
I tried to lower the gain in a small integrated amp just lowering a resistor and destroyed the amp and burned my fingers on the heatsink. That was a hard lesson ... do not gamble with electronics :whazzat:
I think it could be repaired anyway.

Regarding stability, there are three things to keep in mind:

1. In a circuit simulation, the wires/traces are often not modelled. That is, the wires are treated as ideal connections that store no charge or flux and don't couple with anything. That's not how wires behave in real life. As a result, you often need base, grid or gate stopper resistors and local decoupling capacitors to keep the real circuit stable while those are not needed in the simulation.

As a rough approximation, you can model all wires with inductances of 0.5 nH per millimetre of length with a capacitance to ground on either side of 0.035 pF per millimetre of length (those are roughly the correct values for 1 mm-wide traces on a double-sided PCB with a ground plane on the other side). It doesn't cover everything, but it is closer to the truth than ideal connections. For wires that are not close to a ground plane, the usual rule of thumb is 1 nH/mm.

2. Small signal stability doesn't guarantee large signal stability. That doesn't relate specifically to simulations, but you need to keep it in mind anyway: when the circuit is stable for small excursions around its bias point, you still have to check if it bursts into oscillation after clipping or at start up.

3. Some integration methods used for transient simulations have numerical damping, that is, they make the circuit seem more stable than it actually is. For example, the second-order Gear method does this. Trapezium rule integration doesn't have this issue, but it causes weird looking triangles on the current waveforms.
 
Last edited:
Hi ! i understand my question is quite trivial but any design is based on calculation.
To have a SW that does the calculation for us is too handy not to use it.
My guess is that main issues with simulation could be:
1) availability of models that reproduces well the behaviour of the part used
2) lay-out variable that is not considered by the sim software
I want to be honest ... i am awaiting for the first negative answer ... like ... no i do not sim. Then what ?

It depends. If you make a mistake with 500V then it's likely that people aren't here to respond ;) :D

You're correct the layout and the EMI is not modelled in LTSpice but the $$$ software packages will model EMI for circuit boards etc.

In the end there is an understanding of what it should do so you know the target is good, and then there's implementing it - at which point typically good practices and techniques play a way to achieve the target with minimal issues.

Take the new 13000l koi pond I'm building - I simulated the water flow to see where the dead spots however common sense gives a good idea where the flow problems would be. It took hours of work to simulate.. it confirmed my suspicions.
I know that I'll get 15000 litres per hour through the 110mm pipes and that it needs 8" of concrete under I and under the bottom draint. Those back of napkin calculations are the sorts of no-need-to-over-analyse and just use normal practices.
 
Disabled Account
Joined 2017
Real problem is a much worse.
Even well before models, let's vote for one correct statement:
1. BJT are operated by base current while Vbe voltage drop are parasitic.
2. BJT are operated by Vbe voltage while base current are parasitic.

Have no doubt you'll be very wondered with a voting results.


Moderators: branch off this very new thread!


First count: I'm on ONE!
 
The late Bob Pease was infamous for disliking simulators (he probably mentioned it many times in his Pease Porridge columns), and with good reasons, though if you learn enough about what they do and don't normally do, you can often avoid such problems.

As at least one post implied, spice doesn't detect out-of-limits values such as excessive voltage, current, power, Safe Operating Area and such (unless turned on, and I don't know if they can be turned on, much less how). No doubt this speeds up simulation, but of course it means a simulation appears to run fine, but in real life some component rating may be exceeded. Spice doesn't even know the ratings of many components, for example whether a resistor is a 1/10th watt SMT or a 100 watt dummy load. LTspice has some nice graphing stuff so you can multiply a voltage curve and a current curve to see what the power looks like, but like any took you have to know what you're doing or at least know in what ways you can expect "not like real life" results.
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.