Spice Limitations? - Page 1
Forum section: electronics / projects

author: Glenn0010
author_rank: Regular Contributor
timestamp: September 05, 2019, 07:50:24 am
content: Hi All,So I've been using LTSpice to simulate switching events in power devices. IGBTs MOSFETs and diodes. I have added an OnSemi IGBT model to the library and simulated it. Sweeping through gate resistors, and currents.One of the main issues I've been facing is getting the darn thing to converge. So a "healthy?" does of parasitic conductors and resistors did the trick. I also used the Alternate solver to get it to converge. Not fully sure what that does tbh.A curious thing is that it would converge for half and the sweeps for example and then fail. Or it would fail for a temp of 125 degrees.So my question is. What are the limitations of this? What is not being shown as it would be in the simulation? Obviously I know that my circuit does not include all the parasitics that would represent a real system.For whoever wants to have look here is my model.IGBT Spice Model Link:https://www.onsemi.com/products/discretes-drivers/igbts/ngtb25n120fl3

author: Ian.M
author_rank: Super Contributor
timestamp: September 05, 2019, 08:27:03 am
content: When asking LTspice questions, please post your .asc file + links to any 3rd party symbols and models used.One obvious thing is: you haven't set a source impedance for the pulsed V1. 30 ohms would be 'in the ballpark' for a CMOS gate output.I'd bet its barfing on something internal to the OnSemi IGBT model. 3rd party models are often subcircuits that are optimised forPSpice, or that manufacturer's own SPICE, not LTspice. Sometimes they work well with LTspice, sometimes they are troublesome and occasionally you get one that just wont run under the LTspice engine, either because of incompatible syntax, or it stalls or even crashes it. The best way forward is to reconstruct the schematic of the subcircuit from its netlist so you can see what's there and what needs tweaking, then tweak as required.

author: Glenn0010
author_rank: Regular Contributor
timestamp: September 05, 2019, 08:33:54 am
content: Quote from: Ian.M on September 05, 2019, 08:27:03 amI've added the .asc file and the link to the model. It is from the OnSemi website and they have a model that is done specifically for LTSpice on there.With regards to the convergence it was mainly getting stuck with the IGBTs as you said. Either the diode of the IGBT or the IGBT itself.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: September 05, 2019, 09:07:57 am
content: Who fkn knows, it's an encrypted blob, all three versions.I'm sure there are fairly simple ways of decrypting SPICE models (runtime memory inspection perhaps?), but I haven't seen any posts on it so you're probably on your own unfortunately.The usual things are bad functions (poles or discontinuities, and sometimes even just exponential and hyperbolic functions), and simulation settings that need to be tweaked for the device or circuit. SPICE defaults are fine for general analog work, but not very good for switching circuits; LTSpice changes a number of these already, but gets rid of a lot too, so even if you're using "alternate" (actually the original solver, trapezoidal integration (or higher order Runge–Kutta methods ("GEAR" of specified order); LT's default solver is an approximate hack that is a lot faster in switching circuits, but misses a lot, too), you might not be able to set all the parameters you need to.Tim

author: Ian.M
author_rank: Super Contributor
timestamp: September 05, 2019, 01:50:20 pm
content: Cracking LTspice model encryption is *NOT* something we can safely discuss here. L.T. (now Analog Devices) historically have been tough on anyone disclosing what they regard as proprietary data, and it would not be fair to bring that level of legal scrutiny down on our host Dave's neck!@Anyone: If this offends your belief in a right to free speech, are you willing to put your money where your mouth is and provide Dave with a large enough legal defence fund to go up against A.D's corporate legal team?@Glenn,Therefore the only legal way forward to get insight into the OnSemi model internals is to work with OnSemi's product support team. First try any test jigs they show in the datasheet and if any of them have similar sim issues, send them the .asc file and ask what you are doing wrong. If their test jigs sim O.K. try simplifying your circuit until you get a minimal one that has the problem, then submit that to them for comment. If you have any personal contacts at OnSemi reach out to them for how to escalate to whoever actually writes the models. Also you could try begging for an unencrypted model, hopefully not under a NDA so you are free to discuss it here.Unfortunately the link you provided was to models and symbols for NGTB25N120FL3WG, not the NGTB25N120S in your 'Draft6.asc' sim. I've just found the latter here:https://www.onsemi.com/products/discretes-drivers/igbts/NGTB25N120SI'll give it a try later today and see if I can reproduce your problem and find any workarounds.So far, I have noticed that the .ic command for L1 current isn't being applied (no uic option in the .tran command) and also has an inappropriate space between the I and the (. Also if you want that current to actually 'take' you need to set it as an initial condition for *ALL* the inductors in the loop it will be flowing through via the U2 body diode before U1 first switches on.Its possible that issues with the model's internal diode could be 'patched' by adding a suitable external diode in parallel.General LTspice hints:Multiple SPICE dot commands can be placed as a single item on the schematic. Ctrl-Enter starts a new line in the dot command edit dialog, and it also accepts blocks of text complete with line endings copy/pasted from external text editors etc. This is particularly useful for stuff that should be kept together e.g. multiple .measure or .option commands, that you can then enable or comment out as a blockAlso, with a very slow or glitchy sim, you may well want to move your .measure statements to a separate file and .include it rather than putting them directly on the schematic, as then you can edit and re-run them byFile:Execute .MEAS scriptwith the waveform subwindow in focus without having to rerun the sim.

author: Glenn0010
author_rank: Regular Contributor
timestamp: September 05, 2019, 02:10:30 pm
content: Hi!Thanks for all your pointers!.With the IGBT I don't know what happened there. I actually want to simulate the NGTB25N120FL3WG. I have changed the simulation to include this and am working on trying to get it to converge.I understand what you mean with regards to the Inital condition with the current and I have removed the space. However previously it was still working somehow. Anyways no I fixed it and looking to get it to converge. I have also removed all the parasitic inductors. I have only left the 1mH "Load" inductorLooking forward to see if you can get it working.

author: Ian.M
author_rank: Super Contributor
timestamp: September 05, 2019, 02:54:58 pm
content: Errr...... you forgot to attach your new .asc file!

author: Marco
author_rank: Super Contributor
timestamp: September 05, 2019, 03:18:01 pm
content: They have a simetrix model and your circuit is simple enough to be able to be done with their demo version ... so use that. It's far more forgiving convergence wise.

author: Glenn0010
author_rank: Regular Contributor
timestamp: September 05, 2019, 03:49:25 pm
content: I've attached the new one. Tried using a current source instead of an inductor. Simulating as we speak.I've tried on Simetrix already. Had trouble converging as well. Plus I can't seem to figure out how to sweep through 2 parameters. I can only seem to sweep through 1!

author: Ian.M
author_rank: Super Contributor
timestamp: September 05, 2019, 10:26:53 pm
content: I still cant get your sim to run properly and at a reasonable speed under LTspice IV (which the model claims to be written for) on 32 bit WinXP.I 'm working on getting theNGTB25N120FL3WG datasheetFig. 27. Test Circuit for Switching Characteristicsrunning satisfactorily. I've had some success under the standard solver SPICE engine, with the help of hints from these discussions of LTspice convergence issues and fixes for them:https://www.eevblog.com/forum/projects/lt-spice-convergence/https://www.audio-perfection.com/spice-ltspice/ltspice-tips-tricks/undocumented-ltspice-features-solving-some-of-convergence-problems-using-backward-euler-integration-method.htmlhttp://ltwiki.org/index.php?title=Convergence_problems%3FIts a royal P.I.T.A finding a combo of tweaks that actually work as some suggestions don't play well with each other or are unstable if the circuit is changed.IMHO the OnSemi NGTB25N120FL3WG model is at least 95% borked, and if their other LTspice models are of similar quality Analog Devices should be ashamed they've licenced OnSemi to use LTspice!I am trying to get it working with .savebias and .loadbias to speed up subsequent runs, which (when it works) is very useful if you need to .step anything. I'm putting comments in the sim for what needs commenting out or reenabling after the first successful run.N.B. if you are using .savebias and .loadbias, and you change the sim name *don't forget to change the .savebias & .loadbias data file name, otherwise you risk loading a totally borked operating point from a different circuit and much head-scratching will result! Its also advisable to name as many circuit nodes as possible so the node names don't change with respect to the .savebias file if you make any small changes to the circuit layout. If you are making incremental changes uncomment both .savebias & .loadbias, and it will use the existing file then update it after the first 900ns of the sim (100ns before the drive pulse rising edge).EDIT: its not stable enough to release, and tends to fail if you don't use .tran uic so is probably not worth wasting your time on, unless you are a bored LTspice tweak guru!

author: Ian.M
author_rank: Super Contributor
timestamp: September 08, 2019, 01:02:48 am
content: I've got it semi-cracked. The model doesn't like excessive Vce dV/dt during powerup or the turnoff risetime. A small emitter resistance seems to make it less sensitive to fast risetimes. but ultimately with an inductive load the only way that lets it work for repeated pulses without blowing out with Def Con>50 and a timestep too small error on an internal diode, is to limit the dV/dt with a diode, capacitor and discharge resistor snubber.Inductive load sim attached. Its looking good under both the standard and alternate solver SPICE engines, and runs without any .option convergence hacks. The hacks I tried are there but commented out. I still cant get it to find the operating point in a reasonable length of time without risking it bombing out so it uses .tran uic and to get to a steady state starting condition in a reasonable runtime, ramps up the supply over 225ns while clamping the lower IGBT gate to ground and clamping across the upper IBGT for 250ns to minimise Miller effects on the model internals.You'll have to get cleverer than .ic if you want to set I(L1) effectively. I would suggest a pulsed voltage source in series with it that can drive it to the required current while the upper IGBT is shorted during the sim startup.I've also put my parametrised .measure script for automated 10% to 90% rise and fall time measurement on the sim. Move the R_X_X Vout X_X 1 that connects the signal to be measured to the script out to the sim if you want to make the script a separate file and run it as post-processing after a successful sim run.

author: Glenn0010
author_rank: Regular Contributor
timestamp: September 09, 2019, 07:06:05 am
content: Hi Ian,Thanks for all your help! I am currently on holiday and showing my parents round so I won't have time to have a look at it till the end to the month. I'll have a look at what you did when I get back.I was also thinking of running the same simulation with the IKW25T120 as it's a simialr device and hope that infineon's SPICE Model is better than the OnSemi.Thanks again for your help!I'll have a look at it when I get back!Cheers