EEVblog Electronics Community Forum

Electronics => Projects, Designs, and Technical Stuff => Topic started by: ifonlyeverything on November 04, 2022, 05:07:53 pm

Title: LTspice: simulating op amps with capacitive (MOSFET) load
Post by: ifonlyeverything on November 04, 2022, 05:07:53 pm
I'm working on an electronic load project. My goal is a reasonably accurate modulation of 10mA to 5A current flow per FET, with the device under test ranging between 1V to 100V.  I want relatively good bandwidth so I can use this to test SMPS response to load. I've read Jay_Diddy_B's post here https://www.eevblog.com/forum/projects/yet-another-diy-electronic-load/msg2457405/#msg2457405 (https://www.eevblog.com/forum/projects/yet-another-diy-electronic-load/msg2457405/#msg2457405) to help my understanding of stability basics (I'm an amateur with no background in EE or control systems.) Right now I'm using an IRFP250N MOSFET model (SPICE straight from Infineon's website, https://www.infineon.com/cms/en/product/power/mosfet/n-channel/irfp250n/ (https://www.infineon.com/cms/en/product/power/mosfet/n-channel/irfp250n/) ). I've substituted this MOSFET into Jay_Diddy_B's schematic and fiddled around a bit with the compensation network. Everything seems to work fine. I even used the LTspice ".step param" to step through different resistor and capacitor values and LTspice worked great to find solutions and show a Bode plot for every capacitor/resistor combination I input.

I want to re-invent the wheel and hopefully learn something, so I chose the ADA4522 op amp because it has better input offset than LT1014 and it's in stock and fairly affordable. I'm having a lot of trouble with performing AC analysis in LTspice: sometimes the calculations solve, other times they calculate indefinitely. As an example, I'm looking at V1 = 3.3 V device under test. I command V3 = 1 mV and it solves quickly. Same with 10 mV. Indefinite calculation or no solution for 50mV. Jump up to 155 mV and it solves. Jump up to 165 mV and indefinite calculation/no solution. Jump up to 265 mV and it solves. Jump to 450 mV and it also solves. Jump to 500 mV and indefinite calculation.

My thoughts were to use .step param, similar to what I could do with an LT1014, and analyze for various V1 (DUT voltage) and V3 (commanded current flow) -- but obviously this isn't going to work with an ADA4522 due to so many combinations causing the calculations to hang. Is there something obviously wrong with what I'm doing in LTspice? Or is this just a bad choice of op amp? Or am I running into a limitation of simulation -- should I just prototype this and test with a current limited power supply as my DUT?

Example of a successful calculation
[attach=1]
The .asc file I'm using
[attachurl=2]
Title: Re: LTspice: simulating op amps with capacitive (MOSFET) load
Post by: RoGeorge on November 04, 2022, 05:33:10 pm
If you need LTspice help, please attach the .asc file here, so others can run/fix the same schematic you have.
Title: Re: LTspice: simulating op amps with capacitive (MOSFET) load
Post by: ifonlyeverything on November 04, 2022, 05:39:03 pm
If you need LTspice help, please attach the .asc file here, so others can run/fix the same schematic you have.

Sorry, edited my post + attached it.
Title: Re: LTspice: simulating op amps with capacitive (MOSFET) load
Post by: RoGeorge on November 04, 2022, 05:49:35 pm
Seems to be running fine, took 10 seconds or so to run.
Attach the one with the faulty simulation you want to be fixed.
Title: Re: LTspice: simulating op amps with capacitive (MOSFET) load
Post by: Kleinstein on November 04, 2022, 05:59:19 pm
Not all OP-amp models properly include the open loop output impedance and as a consequence the performance with heavy load (inlcluding capacitive) may not be accurate modeled.
If in doubt one should run a test jig simulation to check (e.g. ouput impedance for a very high gain amplifier to approximate open loop) and look at the output impedance.
Title: Re: LTspice: simulating op amps with capacitive (MOSFET) load
Post by: ifonlyeverything on November 04, 2022, 06:02:05 pm
Seems to be running fine, took 10 seconds or so to run.
Attach the one with the faulty simulation you want to be fixed.

Sure. The one attached to this post will calculate indefinitely.

[attachurl=1]
Title: Re: LTspice: simulating op amps with capacitive (MOSFET) load
Post by: RoGeorge on November 04, 2022, 07:50:26 pm
Either go to LTspice control panel (the hammer icon on the taskbar) and in the tab 'SPICE' check the checkbox 'Skip Gmin Stepping'.  Beware many of the settings might be memorized and affect future schematics if you forget to revert them back to their default values.

To avoid that, you can add inside the schematic the equivalent spice directive instead of ticking that checkbox, with the last '.op' button on the taskbar add:
Code: [Select]
.options gminsteps=0
To find the name of each option, see
https://ltwiki.org/LTspiceHelp/LTspiceHelp/_OPTIONS_Set_simulator_options.htm



Side note, didn't carefully look at the schematic, but R1 seems too small.  I would have expect R1 to be rather 500 ohm than a 5 ohm.
Title: Re: LTspice: simulating op amps with capacitive (MOSFET) load
Post by: Jay_Diddy_B on November 04, 2022, 10:36:36 pm
Hi,

The simulation works better if you add a negative supply to the ADA4522's negative supply terminal instead of ground. It doesn't need very much -0.1V is enough.

To the OP, I suggest you look at this thread:

https://www.eevblog.com/forum/projects/dynamic-electronic-load-project/ (https://www.eevblog.com/forum/projects/dynamic-electronic-load-project/)

In this thread I show to design the load.

Jay_Diddy_B
Title: Re: LTspice: simulating op amps with capacitive (MOSFET) load
Post by: ifonlyeverything on November 05, 2022, 12:00:21 am
Either go to LTspice control panel (the hammer icon on the taskbar) and in the tab 'SPICE' check the checkbox 'Skip Gmin Stepping'.  Beware many of the settings might be memorized and affect future schematics if you forget to revert them back to their default values.

To avoid that, you can add inside the schematic the equivalent spice directive instead of ticking that checkbox, with the last '.op' button on the taskbar add:
Code: [Select]
.options gminsteps=0
To find the name of each option, see
https://ltwiki.org/LTspiceHelp/LTspiceHelp/_OPTIONS_Set_simulator_options.htm (https://ltwiki.org/LTspiceHelp/LTspiceHelp/_OPTIONS_Set_simulator_options.htm)



Side note, didn't carefully look at the schematic, but R1 seems too small.  I would have expect R1 to be rather 500 ohm than a 5 ohm.

gminsteps=0 appears to have fixed my issues! Appreciate it.

Hi,

The simulation works better if you add a negative supply to the ADA4522's negative supply terminal instead of ground. It doesn't need very much -0.1V is enough.

To the OP, I suggest you look at this thread:

https://www.eevblog.com/forum/projects/dynamic-electronic-load-project/ (https://www.eevblog.com/forum/projects/dynamic-electronic-load-project/)

In this thread I show to design the load.

Jay_Diddy_B

I'll have to give that thread an in-depth read tomorrow. Thanks for taking the time to post such a detailed project. Right now I'm just playing around, trying to get a feel/understanding of how this all works. The real test will be making something that works in real life...
Title: Re: LTspice: simulating op amps with capacitive (MOSFET) load
Post by: TopQuark on November 05, 2022, 11:48:59 am
https://www.eevblog.com/forum/projects/gt1mhz-bandwidth-electronic-load/ (https://www.eevblog.com/forum/projects/gt1mhz-bandwidth-electronic-load/)

Take a look at my attempt at building a fast load if you are interested.  ;D
Title: Re: LTspice: simulating op amps with capacitive (MOSFET) load
Post by: ifonlyeverything on November 05, 2022, 04:09:10 pm
https://www.eevblog.com/forum/projects/gt1mhz-bandwidth-electronic-load/ (https://www.eevblog.com/forum/projects/gt1mhz-bandwidth-electronic-load/)

Take a look at my attempt at building a fast load if you are interested.  ;D

I saw that, very cool project. Is such a high bandwidth and slew rate required to test an ordinary SMPS with a <200kHz switching speed? Part of my goal is to use my design to load/response test small DC/DC converter prototypes before I integrate them into a larger project. In terms of commercial electronic load units, I see that the BK 85xx series has a maximum slew rate (at maximum rated current) between 0.5 and 1.0 A/uS. Your design is considerably faster!
Title: Re: LTspice: simulating op amps with capacitive (MOSFET) load
Post by: TopQuark on November 05, 2022, 04:54:20 pm
You are right, I actually haven't had any need to test such high amplitude current pulses at such bandwidth, even after I built my load project  :-DD , except for the time when I wanted to test the specs of a current probe I bought. These days when I test power supplies, I just use my Siglent SDL1030x-e which can do 2.5A/us, which is plenty.

I am sure my DIY load can produce cleaner and faster pulse loads, and I can have whatever current load profiles my arb gen can generate. But at the end of the day, good enough is good enough, and the user experience of a polished piece of equipment is much better than my hacked together load. The final 20% of work in a project takes 80% of the effort, and my interest in the project was diverted elsewhere.

One thing to note about the effective bandwidth of a dynamic DC load is, the rise time increases and effective bandwidth decreases with a smaller amplitude pulse, and that's the reason the bandwidth tests were done at the maximum current amplitude I was comfortable with testing. In this respect, the professional load's programmable slew rate setting (independant from the current amplitude) is much more useful and more predictable than saying e.g. my load and do 1us rise time at 20A, but who knows how fast / slow it is at 2A.

I did my dynamic load project mostly as a skill building exercise, (and for the ego boost of one-upping Jim Williams' design  ;D).
Title: Re: LTspice: simulating op amps with capacitive (MOSFET) load
Post by: ifonlyeverything on November 13, 2022, 02:26:47 pm
Does anyone have an example of how constant current and constant power would be implemented in analog hardware -- is this just done with analog multiplier ICs? Or is this always done in software, even in big $$$ electronic loads?