Ltspice "armchair design" and insides into sloppy PCB design

Account Closed
Joined 2010
Thanks to PMA remarks I thought of launching a subject on trying to simulate audio amplifiers from a pcb designer perspective.It might have been analysed somewhere else, but I'm not aware of it so let's get started:
As I'm not really a professional in LTspice simulations , the only tool I know to make a quick check on stability and performance including the pcb design skills is using the cshunt .option. From what I could see, the default settings in Ltspice approximate a .chunt value of 1e-15 which is basically ideal while a true very high quality pcb would be approached by 0.5e-12...1e-13 farrads with a mean average of 1e-12 for sloppy designs and I put togeter a collection of simulations to show the differences that this simple cshunt directive brings into the game. There are simulations done on 2 ohms load, 1khz and 10 khz with 3 values for cshunt and 4 values for the bode plot.Obviously 1pF capacitance between every nodes being the worst nightmare.It can be seen if you bother analysing my printscreens that a 0.5pF difference means around a full order of magnitude in distortions at 10 khz while just about 4...5 times at 1 khz which is kind of predictable . A full picofarad difference can mean a lot more though.
I'd be really thankfull for some other insights like other directives or techniques to simulate the worst case scenarios from a pcb designer perspective and also how to prevent them in the real design.
I myself don't make any pcb design currently and I'm all into solderable pcb breadboard as I can fly wires over any two points avoiding a lot of trouble.I avoid smd components as much as I can and usually i doVERY fine with breadboards that offer lots of me stitching vias to isolate ground loops by design.
 

Attachments

  • your usual crappy simulation with no cshunt option.png
    your usual crappy simulation with no cshunt option.png
    79.2 KB · Views: 290
  • fantastic pcb design.png
    fantastic pcb design.png
    93.9 KB · Views: 216
  • Good pcb design.png
    Good pcb design.png
    26.8 KB · Views: 190
  • slightly sloppy pcb design.png
    slightly sloppy pcb design.png
    27.9 KB · Views: 187
  • sloppy pcb 1e-12.png
    sloppy pcb 1e-12.png
    30.3 KB · Views: 171
  • V3 NO Cshunt option.png
    V3 NO Cshunt option.png
    36.6 KB · Views: 185
  • Bode 2ohm NO Cshuntoption.png
    Bode 2ohm NO Cshuntoption.png
    26.7 KB · Views: 159
  • Bode 2ohm 1e-14.png
    Bode 2ohm 1e-14.png
    20.2 KB · Views: 155
  • Bode 2ohm 1e-12.png
    Bode 2ohm 1e-12.png
    18.9 KB · Views: 146
  • V3 10K 2ohm 1-12.png
    V3 10K 2ohm 1-12.png
    43.3 KB · Views: 167
  • V3 1k 2ohm 1e-12.png
    V3 1k 2ohm 1e-12.png
    45 KB · Views: 173
  • V3 10k 8ohm 1e-12.png
    V3 10k 8ohm 1e-12.png
    43.2 KB · Views: 155
  • V3 1k 8ohm 1e-12.png
    V3 1k 8ohm 1e-12.png
    40.5 KB · Views: 153
  • V3 1K 2ohm 0.5-12.png
    V3 1K 2ohm 0.5-12.png
    46.7 KB · Views: 167
  • V3 10K 2ohm 0.5-12.png
    V3 10K 2ohm 0.5-12.png
    40.5 KB · Views: 141
  • V3 1k 8ohm 0.5e-12.png
    V3 1k 8ohm 0.5e-12.png
    41.1 KB · Views: 179
  • V3 10k 8ohm 0.5e-12.png
    V3 10k 8ohm 0.5e-12.png
    37.3 KB · Views: 140
  • V3 1k 8ohm 1e-13.png
    V3 1k 8ohm 1e-13.png
    43.5 KB · Views: 149
  • V3 10k 8ohm 1e-13.png
    V3 10k 8ohm 1e-13.png
    41.4 KB · Views: 140
  • V3 1k 2ohm 1e-13.png
    V3 1k 2ohm 1e-13.png
    45.6 KB · Views: 222
Last edited:
They probably need to be known in the first place...I obviously have no real power supply here, no decoupling, let alone real world regulator simulations and decopling which are nothing like usual simulations bring in, but if you see what you get by just adding 0.5 pf of capacitance into a simulation can do to these ideal 0.00000x % thd simulations is a lot for me .
From my own experience real world thd on real loads of 0.1% is absolutely fine, basically much better than most speakers ever made as all amplifiers will drive a real speaker in the end.
 
It is a misunderstanding, I was talking about amplifier PCB tracks, their inductances (especially ground tracks) and amplifier capacitors inductances. Do you assume they make no difference? Try to add real inductance of Re output stage emitter resistors and check the influence on stability. No difference? 😉
 
You need a program that takes the PCB diagram layout, the spice model and then creates an enhanced model with all the capacitances/inductances etc between them.

People have commented that LTSpice isn't superb modelling complex stability for example. However you're also relying on the manufacturers model being relatively correct.

My shunt is current 1e-6.
gmin 1e-12
abstol 1e-12
retool 0.001
chgtol 1e-14
trtol 7
voltol 1e-6
sstol 0.001
mindeltagmin 0.0001
I use the modified trap and normally 'alternate' solver.
 
@PMA have I implied anything of what your eyes are winking about? By the way I can avoid the inductance of emitter resistors if I want that...I wasn't talking about component's intrinsic parameters here...not even about this schematic which is completely unreal at 4 amps iddle current, but left that way for education purposes.
 

Attachments

  • 20220527_131200.jpg
    20220527_131200.jpg
    450.7 KB · Views: 86
You need a program that takes the PCB diagram layout, the spice model and then creates an enhanced model with all the capacitances/inductances etc between them.

People have commented that LTSpice isn't superb modelling complex stability for example. However you're also relying on the manufacturers model being relatively correct.

My shunt is current 1e-6.
gmin 1e-12
abstol 1e-12
retool 0.001
chgtol 1e-14
trtol 7
voltol 1e-6
sstol 0.001
mindeltagmin 0.0001
I use the modified trap and normally 'alternate' solver.
Have you followed this site? I have to admit I have no ideea what a lot of stuff there is about..."Monkey see , monkey does 🙂 "
 
Last edited:
It is a misunderstanding, I was talking about amplifier PCB tracks, their inductances (especially ground tracks) and amplifier capacitors inductances. Do you assume they make no difference? Try to add real inductance of Re output stage emitter resistors and check the influence on stability. No difference? 😉
By the way...20nH...1 uH ...https://4hv.org/e107_plugins/forum/forum_viewtopic.php?id=82518
 
While building my latest amplifier, I encountered stability and oscillation in reality that did not show in simulation. Once I added a lot of tiny inductors in series with each component terminal, the simulation became more realistic and I was able to approximate what I was observing on the bench.
The cshunt option is helpful, but considering the inductance is at least equally important.
In case the PCB design is done already, one can put actual connections and their estimated inductance values into the simulation. In case the PCB design is not done, 10nH may be a good starting point and this is more realistic than no inductance at all.
I found that the number of components for approximating the PCB may outnumber the actual components by far. Sure, this is a lot of additional complexity, but may be worth it.
Inaccurate component models are another story.
With gaining more experience, I wouldn’t overestimate the result of simulation. It is good for checking the concept, but likely the numbers derived don’t mean too much actually.
 
If you consider the [pF]-capacitances of components pads and traces you also have to consider trace- and other inductances.
Capacitances are often tiny (not saying they should be neglected) but you quickly have 100´s of [nH] or more in typical audio amplifiers you see around here.
Especially critical in feedback paths, more so than in emitter resistors.
Just plug typical numbers of traces in an inductance calculator.
There is little use to low inductance and expensive emitter resistors when you effectively create a feedback path with a tank circuit and make your amplifier oscillate/unstable anyway.

See figure 3a+b here for a more complete simulation:
A Practical Guide to High-Speed Printed-Circuit-Board Layout
And even figure 3b ignores parasitics.
There is more inductance in each component wire, the resistors themselves (although in this example they probably assume tiny SMD resistors as it is about RF circuitry), etc...

Look at this for example:
Wayne's Burning Amp 2018 Linestage
Each transistor probably has at least 5nH in each of its legs. Small compared to the trace inductances but it all (can) add(s) up.
 
Last edited:
  • Like
Reactions: dreamth
While building my latest amplifier, I encountered stability and oscillation in reality that did not show in simulation. Once I added a lot of tiny inductors in series with each component terminal, the simulation became more realistic and I was able to approximate what I was observing on the bench.
The cshunt option is helpful, but considering the inductance is at least equally important.
In case the PCB design is done already, one can put actual connections and their estimated inductance values into the simulation. In case the PCB design is not done, 10nH may be a good starting point and this is more realistic than no inductance at all.
I found that the number of components for approximating the PCB may outnumber the actual components by far. Sure, this is a lot of additional complexity, but may be worth it.
Inaccurate component models are another story.
With gaining more experience, I wouldn’t overestimate the result of simulation. It is good for checking the concept, but likely the numbers derived don’t mean too much actually.
I tried following the link's recommendations for inductances, modified the circuit for optimal class AB operation, added most of the necessary series resistances and in the end the Cshunt directive is still the true king. Simulating the speaker itself would be a much bigger problem for me, but at least from a pcb perspective this I think is a good approach of the problem even if it doesn't show the full picture as you need to properly compensate for the first 100khz...1 Mhz bandwidth in the first place.Now this simulation shows DC instability for some reason, but that's just a different discussion. I'm actually building this amp I hope in a little bit different version adding some germanium trz in the mix although i might end up using this one as is now.I considered first using a balanced version but that doesn't allowme any germanium trz in the mix and I'm a great believer in the Quad/QSC virtual ground output coupling the speaker through capacitors soI'll probably sacrifice the good watts for some lcr natural damping of the woofer.
Have some fun yourself if you feel like.
 

Attachments

  • V4 realistic thd.png
    V4 realistic thd.png
    48.3 KB · Views: 82
  • V4 realistic Bode.png
    V4 realistic Bode.png
    36.2 KB · Views: 83
  • V4 not that good thd.png
    V4 not that good thd.png
    44.7 KB · Views: 72
  • V4 not that good Bode.png
    V4 not that good Bode.png
    36 KB · Views: 72
  • V4 good thd.png
    V4 good thd.png
    45.6 KB · Views: 77
  • V4 good Bode.png
    V4 good Bode.png
    35.3 KB · Views: 75
  • V4goodstepresponce.png
    V4goodstepresponce.png
    39.2 KB · Views: 82
  • V4 realistic step response.png
    V4 realistic step response.png
    34.4 KB · Views: 74
  • kl01AA.asc
    kl01AA.asc
    12.4 KB · Views: 59
  • 20220528_141352.jpg
    20220528_141352.jpg
    523.6 KB · Views: 82
Last edited:
If you consider the [pF]-capacitances of components pads and traces you also have to consider trace- and other inductances.
Capacitances are often tiny (not saying they should be neglected) but you quickly have 100´s of [nH] or more in typical audio amplifiers you see around here.
Especially critical in feedback paths, more so than in emitter resistors.
Just plug typical numbers of traces in an inductance calculator.
There is little use to low inductance and expensive emitter resistors when you effectively create a feedback path with a tank circuit and make your amplifier oscillate/unstable anyway.

See figure 3a+b here for a more complete simulation:
A Practical Guide to High-Speed Printed-Circuit-Board Layout
And even figure 3b ignores parasitics.
There is more inductance in each component wire, the resistors themselves (although in this example they probably assume tiny SMD resistors as it is about RF circuitry), etc...

Look at this for example:
Wayne's Burning Amp 2018 Linestage
Each transistor probably has at least 5nH in each of its legs. Small compared to the trace inductances but it all (can) add(s) up.
Thanks for the document, that's a good one.My first and only try to pcb work was a 6 weeks work while I learned Altium a few years ago , but nobody paid me doing that sh*t so I reverted back to my prototyping boards with flying wires...Although I have very good books on that I'm not really passionate about pcb design to be honest: https://www.diyaudio.com/community/threads/modified-aiwa-riaa-j-fet-phono-preamp.328172/post-5572084
Besides I'm not sure how they transfered the Dolby SR on pcb either...but having tons of 1V/us LF442 doing all the job there working at a few tenths to hundreds of milivolts levels( with35nV/sqr rootHz of noise, yes good engineers can work with that in the milivolts range !) is probably the key to a succesful transfer that modeled the world of tape recordings.When I see people advancing op-amps working at 50...3200v/us claiming to be the only ones capable of rendering a stereo image that was litterally produced on 1v/us op amps dealing with tapeheads histeresis kind of slew rates I can only think of pure incompetence within electronics domain... I had a lengthy article on linkedin about why I consider Dolby the real god of audio electronics, but I'm not going back to that again, I just see a full void that every audiophile avoid ...
 

Attachments

  • Dolby_SR_breadboard.jpg
    Dolby_SR_breadboard.jpg
    311.8 KB · Views: 115
  • Dolby_SR_card_for_multrack.jpg
    Dolby_SR_card_for_multrack.jpg
    65 KB · Views: 104
  • 800px-Dolby_SR_card_for_multrack_without_shield.jpg
    800px-Dolby_SR_card_for_multrack_without_shield.jpg
    179.3 KB · Views: 111
  • Like
Reactions: stv