Keyboard Shortcuts
Likes
Search
Modeling Constant Power Load with AC Source in LTspice
Hi all, I'm trying to model a constant power load fed by a single-phase AC source in LTspice. I seem to run into convergence failure when I run transient analysis What I¡¯m doing:
My goal:
Questions:
|
On Tue, Apr 29, 2025 at 03:48 PM, <thunderboy.johnson86@...> wrote:
LTspice has a constant power load already.? See: ?
However, that is intended for .TRAN or .OP or .DC analysis, and I do not know how well it behaves for .AC analysis.? Maybe it's just fine, or maybe not.? .AC analysis is strictly linear with constant unvarying circuit elements, and a constant power load needs to vary dynamically as a function of the signal amplitude - therefore making it nonlinear (and non-constant).? It seems like that could be a real problem for .AC analysis.
?
(I am assuming that you did actually mean .AC analysis, and not time-varying signals, right?)
?
Your question implies a possible interaction between the load and the rest of the circuit.? Maybe the interaction between your circuit and the load's need to vary, result in the stability problem?? That is just a guess.
?
For a better answer, considering uploading your simulation to the group for all to see.? As always, check the guidelines on this group's webpage before attempting to upload anything.
?
Andy
? |
On Tue, Apr 29, 2025 at 03:48 PM, <thunderboy.johnson86@...> wrote:
I am not sure how that relates to the circuit elements and their equations that you used.? But note that the formula for P has a significant discontinuity at V(vout) = 5.? The discontinuity also means the derivative is not a continuous function, and that is (almost by definition) the recipe for instability. ?
SPICE wants all functions and their first derivatives to be continuous everywhere.
?
Andy
? |
Smoother functions are almost always better, in terms of stability and avoiding instability. What zero crossing?? If it is an .AC analysis that you're doing, there are no zero-crossings.? There are no time-varying waveforms in .AC analysis.? Signals are assumed to be single-frequency, therefore they represent the amplitudes of sine waves, but there are no sine waves anywhere in the simulation when you are doing an .AC analysis.? A "1V" sinusoidal signal in .AC analysis is represented by the quantity "1", not by a time-varying sine wave. ?
That can also lead to confusion about whether a "1V" signal is an RMS level or a peak level.? The truth is that it doesn't matter.? You get to decide, as long as you are consistent about it.? If you decide that "1V" is the RMS amplitude, then everything is RMS.? If you decide that "1V" is the peak amplitude - or even peak-to-peak - then that is what it is and everything else in the simulation is measured the same way.? Because everything is strictly linear, it makes no difference.? Just be consistent about it, and you're OK.
?
So -- if you think you are experiencing difficulty because of zero crossings of sine waves, you are not.? There are no sine waves in the simulation itself.
?
Andy
? |
For AC analysis of an active network, isn't the "gain" at the operating point used? If so, does that load function provide a stable operating point - that is, can an operating point really be found? Constant power loads are inherently negative resistance loads.
?
Jim Wagner
|
¿ªÔÆÌåÓýAndy, I am surprised at your response; you are typically very on point! The OP stated: ¡°convergence failure when I run transient analysis¡± ? That zero crossing¡ ? That said, with two devices, I was having no problems with convergence: ? V: SINE(0 170 60) BI: P=if(abs(V(V))<5, 0, 500) .tran {1/30} ? Dave ? From: [email protected] <[email protected]>
On Behalf Of Andy I via groups.io
Sent: Tuesday, April 29, 2025 1:19 PM To: [email protected] Subject: EXTERNAL: Re: [LTspice] Modeling Constant Power Load with AC Source in LTspice ?
Smoother functions are almost always better, in terms of stability and avoiding instability.
What zero crossing?? If it is an .AC analysis that you're doing, there are no zero-crossings.? There are no time-varying waveforms in .AC analysis.? Signals are assumed to be single-frequency, therefore they represent the amplitudes of sine waves, but there are no sine waves anywhere in the simulation when you are doing an .AC analysis.? A "1V" sinusoidal signal in .AC analysis is represented by the quantity "1", not by a time-varying sine wave. ? That can also lead to confusion about whether a "1V" signal is an RMS level or a peak level.? The truth is that it doesn't matter.? You get to decide, as long as you are consistent about it.? If you decide that "1V" is the RMS amplitude, then everything is RMS.? If you decide that "1V" is the peak amplitude - or even peak-to-peak - then that is what it is and everything else in the simulation is measured the same way.? Because everything is strictly linear, it makes no difference.? Just be consistent about it, and you're OK. ? So -- if you think you are experiencing difficulty because of zero crossings of sine waves, you are not.? There are no sine waves in the simulation itself. ? Andy ? |
All,
Thank you all for the different responses. I truly appreciate it. I am new to LTspice so all comments are educational. for that thank you I have uploaded the schematic, "Modeling Constant Power Load with AC Source in LTspice". I notice the schematic runs fine with an ideal wire. the issues starts when I add a series components? |
On Wed, Apr 30, 2025 at 12:04 PM, Bell, Dave wrote:
Yes, I missed that fact! ?
It shows that I am still human, after all.? :-)
?
So, ignore most of what I wrote that pertains to .AC analysis.
?
Andy
?
? |
Eaglesea,
?
This is probably not much of an answer yet to your questions.
?
LTspice has a lot of trouble.? Sometimes I had "timestep too small" aborts, but mostly I see math errors where it displays values such as "1.#QNAN" or "1.#IND" volts or amps.? Those are math error codes meaning "Not a Number" or "Indefinite/Indeterminate".? That is not a good sign.? Also there was a lot of Trap Ringing, for what it's worth (which is not much).
?
I wonder if it works having a constant power load with a time-varying sinusoidal waveform.? It needs to be very nonlinear, and I think the interaction between that nonlinearity and the series impedance causes havoc.
?
Does that load mimic anything real?
?
Just an FYI - inductance is mostly a function of the loop area enclosed by the wires.? There is a misconception that inductance depends entirely on the wires themselves.? You can find formulas for wire self inductance, but they are often mis-applied.
?
Andy
?
? |
On Thu, May 1, 2025 at 07:38 AM, skyraider2 wrote:
Adding a 100uf cap across B1 gets the simulation to run. The required capacitance depends upon the crossover power setting of B1. If the crossover is increased to 50 then only 1 uF is needed. If the crossover is increased to 100 then no capacitance is needed.?? |
On Thu, May 1, 2025 at 08:23 AM, Dennis wrote:
crossover powerThat should be crossover voltage. ?
With a low crossover voltage the peak current through B1 is very high (500 W / crossover voltage) before the current starts to drop towards zero at the zero crossing of the input voltage. This produces a current peak with a very large derivative when the switch from constant power to operation to polynomial resistive operation happens (i.e. at the crossover voltage). The voltage across the inductor then changes rapidly (V = L * di/dt) at the crossover point and seems to trigger numerical instability in the solver when the change gets too large.? |
On Thu, May 1, 2025 at 09:13 AM, Dennis wrote:
seems to trigger numerical instability in the solver when the change gets too large With trap integration and the alternate solver the crossover voltage can be reduced to 70 V and it is barley able to run to completion. Plotting the voltage across the inductor shows the instability.
?
Changing to gear integration adds damping to the solver which produces clean waveforms with the crossover at 70 V. Using gear integration the solver becomes unstable at a crossover voltage of about 40 V and fails with a crossover at 30 V. |