¿ªÔÆÌåÓý


Re: Dual Active bridge

 

¿ªÔÆÌåÓý

Yes, my 8A/16A figures were what I saw without expanding the waveform. Using CTRL-left click, I see 5.9124 A, but that includes the inrush current at t=0+. Is there any way to change the 'Interval start', other than changing the sim time to omit the inrush current? Doing that, I get 5.8583 A, so we are in violent agreement on that point.

On 2025-05-07 15:10, Andy I via groups.io wrote:
After adding Rser=1 ohm to V9:
?
The average current from V9 is 5.858 Amps, compared to the 8 Amps you said yours had.? Our simulations should not have differed by more than 2 Amps!? Something is wrong.? (Unless you eyeballed your "8 Amps" without measuring it.)? The current waveform there does look kind of sinusoidal with about 8 Amps peak amplitude, varying from -1 A to about +16.5 A.? But it is a highly distorted sinewave and that makes a big difference; the average is not in the middle.? LTspice says the average is 5.858 A DC, in my simulation.
?
The average power from V9 simulates as 507 W, which is nowhere near the roughly 800 W that you estimated.? Again, was that by ayeballing, or measuring it?
?
At the load, I measure 132 V DC as you did, plus some ripple.? Average power there is 385 W, so the converter loses 122 W to heat (76% efficiency).? That is not so bad, but again most of it is in M4, M5, M6, and M7, which can be reduced by building some dead-band into their gate waveforms.
?
Simulating with a discrete 1 ohm resistor instead of Rser=1, I have 640 W sourced by V9 and 108 W dissipated by the 1 ohm resistor.? Between the two, that is 532 W supplied by V9+1ohm to the rest of the circuit.? It is not quite the same as the 507 W when Rser was internal, but I don't know why (it should not have differed, right?).? Will check into that later.
?
In any event, with LTspice XVII, the power losses of the circuit are reasonable, and can be reduced further.? If LTspice 24 tells you a different story, that needs to be understood.? If LTspiceXVII says 122 W is lost and LTspice24 says 400 W is lost, that is a big problem.
?
Andy
?
--
Best wishes John Woodgate RAYLEIGH Essex OOO-Own Opinions Only If something is true: * as far as we know - it's science *for certain - it's mathematics *unquestionably - it's religion

Virus-free.


Re: Dual Active bridge

 

¿ªÔÆÌåÓý

I entirely agree. I may be doing something wrong, but I can't see what. Do you get a very long series of entries in the expanded netlist about relaxing tolerances to seek convergence?? That occurs even with the 1 ohm in series with V9, in the sim which runs OK to 100 ms. V9 current near 100ms is an 8 A peak sine wave with the positive peak clipped, sitting on 8A DC.

On 2025-05-07 14:32, Andy I via groups.io wrote:
?
It would be interesting to see why LTspice 24 simulates badly whereas LTspice XVII does not.
?
--
Best wishes John Woodgate RAYLEIGH Essex OOO-Own Opinions Only If something is true: * as far as we know - it's science *for certain - it's mathematics *unquestionably - it's religion

Virus-free.


Re: Dual Active bridge

 

After adding Rser=1 ohm to V9:
?
The average current from V9 is 5.858 Amps, compared to the 8 Amps you said yours had.? Our simulations should not have differed by more than 2 Amps!? Something is wrong.? (Unless you eyeballed your "8 Amps" without measuring it.)? The current waveform there does look kind of sinusoidal with about 8 Amps peak amplitude, varying from -1 A to about +16.5 A.? But it is a highly distorted sinewave and that makes a big difference; the average is not in the middle.? LTspice says the average is 5.858 A DC, in my simulation.
?
The average power from V9 simulates as 507 W, which is nowhere near the roughly 800 W that you estimated.? Again, was that by ayeballing, or measuring it?
?
At the load, I measure 132 V DC as you did, plus some ripple.? Average power there is 385 W, so the converter loses 122 W to heat (76% efficiency).? That is not so bad, but again most of it is in M4, M5, M6, and M7, which can be reduced by building some dead-band into their gate waveforms.
?
Simulating with a discrete 1 ohm resistor instead of Rser=1, I have 640 W sourced by V9 and 108 W dissipated by the 1 ohm resistor.? Between the two, that is 532 W supplied by V9+1ohm to the rest of the circuit.? It is not quite the same as the 507 W when Rser was internal, but I don't know why (it should not have differed, right?).? Will check into that later.
?
In any event, with LTspice XVII, the power losses of the circuit are reasonable, and can be reduced further.? If LTspice 24 tells you a different story, that needs to be understood.? If LTspiceXVII says 122 W is lost and LTspice24 says 400 W is lost, that is a big problem.
?
Andy
?


Re: Calculate average value of a waveform under specific conditions using .meas command

 

On Wed, May 7, 2025 at 03:10 AM, Tony Casey wrote:
I don't see why you have to specify small time intervals if your simulation has achieved steady state - each cycle will be essentially the same, so a full display of only 2 cycles will be ample - search by derivative will always find the transition. Don't make things more complicated than they need to be.
That is true, IF Ankit wants to know only the long-term average of the voltage waveform.? But this is for a thesis project, so I assume it is somewhat research related, and he might want to know things to a greater level of detail.? Such as, what is the average voltage over the short time interval when the inductor current is increasing, versus when it is decreasing, or when it is zero.? I don't know the reasons why, but I think it makes sense that he might need to know to that level of detail.
?
Andy
?
?


Re: Calculate average value of a waveform under specific conditions using .meas command

 

I question whether taking the derivatives of the waveform is good or bad.? Since there is ringing, it might manifest itself as large spikes in the derivative, which could mess up those .MEAS calculations.
?
We can just about see the ringing in the uploaded photo (screenplot from LTspice, green waveform).? It is barely there, but depending on the ringing frequency, their di/dt could be quite large.
?
Andy
?
?


Re: Dual Active bridge

 

On Wed, May 7, 2025 at 05:04 AM, John Woodgate wrote:

Without UIC, it runs under version 24.1.8. The input voltage is 100 V, the input current is 8 A DC plus 8A peak roughly sinusoidal (so the current goes from 0 to 16 A). The output voltage is 132 V DC and the output current is 3 A.

Wow!? Which schematic was that?? What makes our simulations so utterly different?
?
I used dd.asc with UIC removed.? The input current from V9 is hardly sinusoidal.? If you had sinusoidal current, then something must be wrong.
?
My simulation's input voltage is 100 V (of course), but the average input current is 6.159 A, not 8 A DC.? Its waveform peaks at around +105 A (that's not a typo!) and at -23 A (yes, power going back into the voltage source).? Those peaks are quite narrow.? It is definitely not "roughly sinuoidal".
?
The RMS current from V9 is 12.6 A, which includes both the DC portion and the AC component which represents instantaneous power going both ways.
?

So I think the input power is quite a lot bigger than the output power, which is not what is wanted.

The important thing is, do the numbers make sense?? Do they add up?
?
In my simulation, they do.? Using Alt-Left-Click on V9, LTspice plots the instantaneous power (V*I) waveform of V9.? Then using Ctrl-Left-Click on the waveform label at the top of the plot, it says the Average Power is -597.32 W.? That is the power dissipated by V9, meaning that V9 sources +597.32 W to the circuit.
?
Doing the same thing with the load (R1), LTspice shows 458.39 W dissipated by the load.
?
The difference is 597-32 - 458.39 = 138.93 W that V9 sources but does not reach the load.? That is not so bad.? It's not ideal, of course, but nothing is perfect.? I think a lot of power is lost due to short-circuit current through the FETs.
?
Doing the same thing to each of the MOSFETs on the right side (M4, M5, M6, M7) shows that each of them dissipates (loses as heat) approx. 32.4 W, adding up to 129.6 W lost in those four FETs.? That compares favorably with the 138.93 W total power that did not make it from V9 into R1.? It shows that the four FETs on the right side caused most of the power loss.? You can improve that.
?

But I have 1 ohm in series with V9 to limit the inrush current.

Ah, of course!? That is what makes your simulation so much different than mine.
?

Without the 1 ohm, it still stalls after a few hundred microseconds, with no error message.

If it stalls, then it is still simulating, right?? If it is still simulating, then there won't be an error message (yet).? It would be great if LTspice always times out after a while, but when should it time out?? Apparently it thinks it is still making positive progress.??From what you wrote earlier, I think LTspice 24 was heading towards a "timestep too small" error, but not reaching it.? That rarely happens.? Usually when it is heading towards a "timestep too small" situation, it positively reaches it, and aborts.? Apparently it saves itself before that happens.? Hmm.
?
LTspice XVII does not stall at any point, with or without Rser-1 ohm.
?
It would be interesting to see why LTspice 24 simulates badly whereas LTspice XVII does not.
?
Andy
?
?


Re: Dual Active bridge

 

Set Lp = 2,3mH Ls=5,1mH Llkg=76uH . Imagn=magnetizing current =8% of primary peak current, Llkg = 3% of Lp (values chosen for 30KHz).
Imagn/Ipeak may be a little bit higher, i.e. 15%
A small gap between the upper and lower Bridge MOS will prevent from cross-conducting current spikes. At present, currents are overlapping.?
Also check the phase angles between the primary and secondary side bridge drive pulses to achieve?output voltage, as desired.
-----
Udo


Re: Dual Active bridge

 

¿ªÔÆÌåÓý

Without UIC, it runs under version 24.1.8. The input voltage is 100 V, the input current is 8 A DC plus 8A peak roughly sinusoidal (so the current goes from 0 to 16 A). The output voltage is 132 V DC and the output current is 3 A. So I think the input power is quite a lot bigger than the output power, which is not what is wanted. But I have 1 ohm in series with V9 to limit the inrush current. Without the 1 ohm, it still stalls after a few hundred microseconds, with no error message.

On 2025-05-07 01:18, Andy I via groups.io wrote:
On Tue, May 6, 2025 at 05:33 PM, <arhamishtiaq42@...> wrote:
so do you think my primary side current is fine?
That is a somewhat difficult question for me to answer.? Maybe others can speak to this better than I can.
?
But I think the answer is "yes", I think it is normal.
?
Because the waveforms are not sinusoidal and the voltage and current waveforms are so very different from each other, you can not use Vrms*Irms to estimate power.? You must multiply V(time) by I(time) at every moment in time, then average the product over time.? And when you do that, you find that the power into the primary = 593 W, even though its Vrms * Irms = 95.6 * 12.9 = 1233 VA.
?
(I am still wondering where you got 40 A from.? My simulations did not come close.)
?
I think the only way for the primary current to be around 500 W / 100 V = 5 A, is if the transformer's primary current was also a square wave and in-phase with the voltage there.
?
The energy source (V9) provides 597 W, the transformer passes 593 W, and the load (R1) dissipates 458 W.? These are from simulating your third schematic, dd.asc, without UIC, and waiting until after the initial transients die out.
?
Andy
?
?
--
Best wishes John Woodgate RAYLEIGH Essex OOO-Own Opinions Only If something is true: * as far as we know - it's science *for certain - it's mathematics *unquestionably - it's religion

Virus-free.


Re: Calculate average value of a waveform under specific conditions using .meas command

 

On Wed, May 7, 2025 at 12:40 PM, Tony Casey wrote:
I don't see why you have to specify small time intervals if your simulation has achieved steady state - each cycle will be essentially the same, so a full display of only 2 cycles will be ample - search by derivative will always find the transition. Don't make things more complicated than they need to be.
Dear Tony,

I am new to LTspice, and everyone is trying to help me with my query. You have put time in providing me solutions and so has Andy. I am thankful to both of you.

You are again correct, problems should be solved with as little complications as possible.

With Regards,
Ankit


Re: Calculate average value of a waveform under specific conditions using .meas command

 

¿ªÔÆÌåÓý

On 07/05/2025 08:13, ankitk.ace via groups.io wrote:
I believe I will have to finding the maximums and minimums localized to a specific time interval (example: 10 ms to 11 ms) and then do the rest. Your answer too is a clever solution just like what Andy suggested, however, with a different approach and a little bit of tweaking at my end because the inductor current rises and falls exponentially (due to parasitics).
The rise and fall characteristics are only 2nd order effects - linear or exponential, it makes little difference. If you actually plot the derivative of the waveform, you get very pronounced spikes at the start and finish of transitions. Try it and you'll see.

I don't see why you have to specify small time intervals if your simulation has achieved steady state - each cycle will be essentially the same, so a full display of only 2 cycles will be ample - search by derivative will always find the transition. Don't make things more complicated than they need to be.

--
Regards,
Tony


Re: Calculate average value of a waveform under specific conditions using .meas command

 

On Wed, May 7, 2025 at 12:00 AM, Tony Casey wrote:
.MEAS MaxdV max d( I(L_filter_dc)) ; max +v derivative
.MEAS T1 when d( I(L_filter_dc))=0.98*MaxdV rise=1 ; start of 1st +ve transition
.MEAS MindV min d( I(L_filter_dc)) ; max -ve derivative
.MEAS T2 when d( I(L_filter_dc))=0.98*MindV fall=1 ; start of 1st -ve transition
.MEAS T3 when d( I(L_filter_dc))=0.98*MaxdV td=T2 rise=1 ; start 2nd +ve transition
Dear Tony,
?
Thank you for answering again.

I believe I will have to finding the maximums and minimums localized to a specific time interval (example: 10 ms to 11 ms) and then do the rest. Your answer too is a clever solution just like what Andy suggested, however, with a different approach and a little bit of tweaking at my end because the inductor current rises and falls exponentially (due to parasitics).

With Regards,
Ankit


Re: LTSpice, easy uF / uH with UTF16 saved schematic

 

Also, the comments in the two new uploaded files are somewhat misleading.
?
"u" is always ASCII 0x75, when encoded with the normal ANSI character set.
?
"?" is extended ASCII 0xB5, when encoded as a single byte with the ANSI character set.
?
LTspice transforms a leading "u" to a "?" when it is on a schematic and used as a units multiplier, unless you have changed that setting in LTspice's Settings / Control Panel.? So the default action in LTspice is to convert 0x75 to 0xB5 (that is, to convert 'u' to '?') when it is on a schematic and used that way.
?
LTspice can be changed to the exact opposite behavior, where it treats a "u" as a "u" and converts a "?" to a "u", when it is found on a schematic and used as a units multiplier.
?
Some programs misinterpret the extended ASCII character 0xB5, turning it into a different 1-byte or 2-byte character that it thinks should be similar.? When saved and later read back into LTspice, or saved and read by other text editing programs, in most cases it will appear to be a corrupt letter or pair of letters, of one form or another, and not as a "?" anymore.? I have now seen three different incorrect "substitute" characters for a "?", where none of them work when the schematic or SPICE Netlist file is read back into LTspice.
?
LTspice's handling of UTF* files is somewhat unconventional.? That is a grey area and best avoided, in my opinion.
?
Andy
?


Re: LTSpice, easy uF / uH with UTF16 saved schematic

 

On Tue, May 6, 2025 at 10:21 PM, wai wai wrote:
The solution, to force LTspice to save schematic to be UTF8 or UFT16, just add some local "char" (double bytes) to the schematic, and then LTSpice will be saved files as UTF16 by default.
That lacks backwards compatibility to anyone using an older version of LTspice.? (Yes, there are still some out there with old XP computers who do not wish to - or can't - upgrade to a newer LTspice.)? Also, I am unsure whether the native Mac version yet supports "Unicode" schematics.? (I think it does.)? If not, they would be unable to open said schematics.
?
Furthermore, LTspice's "Unicode" has proven to be a much bigger headache than anyone imagined.? Most problems with it have finally died down now, but I am sure they will still arise.? With an alphabet of some 150,000 characters, it is a thousand problems just waiting to happen.
?
The easier solution, is this one:
  • Go to LTspice's Control Panel (or Settings)
  • Netlist Options
  • Check the checkbox next to "Convert '?' to 'u'".
  • Click OK
?
This problem with '?' rarely ever happens anymore, now that the group migrated from Yahoo to Groups.io.? Since people should never email LTspice schematics by cut-and-pasting raw text, that isn't a problem either, or it should not be.? For person-to-person emails, attaching an LTspice schematic (as an attached file) works great, as does attaching a .ZIP file.? For schematics sent to this group, uploading the LTspice schematic works great, and that is what everyone should do.? So there should be no issue anymore, unless you do things wrong.
?
By the way, LTspice is not spelled "LTSpice".? Also, files should only be uploaded to the "Temp" folder.? Always navigate to that folder first, before clicking the "+New/Upload" button.? Just like it says in the group's guidelines.
?
Andy
?
?
?


LTSpice, easy uF / uH with UTF16 saved schematic

 

LTspice default will save schematic (*.asc) as ANSI ASCII file.?
uH or uF, the "u" is extended ASCII "0xB5", "mu" (?) to mean micro,

see the glitching and comments,
/g/LTspice/topic/opa_square_wave_generator/112608874
?
LTspice XVII save such schematic, "0xB5" will be saved as ANSI text file, open the file by editor, and/or copy/paste to HTML or translation, the UTF8 capable application will see double bytes as treated as UTF8/UTF16 etc.

The solution, to force LTspice to save schematic to be UTF8 or UFT16, just add some local "char" (double bytes) to the schematic, and then LTSpice will be saved files as UTF16 by default.
?
this is example of output of the solution,
SYMATTR InstName C2
SYMATTR Value 1?f
TEXT 112 160 Left 2 ;1uF = 1Ϥ
?
testing files,
/g/LTspice/files/u_ANSI_test.asc
/g/LTspice/files/u_UTF16_test.asc


Re: Simulation of MMC 3-Level on Ltspice

 

Bouzid.wis,
?
I am having trouble trying to understand how this circuit works.
?
In the upper submodule, it seems like M1 can not do much, because C1 would charge and then not pass any more current, so that closing M1 does not add any more change.? But I think it is not as simple as that.? There are multiple current paths here, including through the capacitors and through the diodes that bypass the FETs.
?
Can you describe how each submodule was supposed to pull the output either up, or down?
?
Is there a minimum frequency limit for the sinusoidal signal you want to synthesize?
?
As drawn here, the two submodules are not symmetrical to each other.? But maybe that was just a personal choice about how the schematic was made.
?
I am only guessing here, but it looks like maybe you have one of the submodules inverted.? When the voltage V(ControlA) approaches +1V, the FETs with the DC path (M2 and M4) are both OFF while the two with series capacitors and no DC path (M1 and M3) are both ON.? So very little current can flow through L2 or L3, to or from the load.? When V(ControlA) approaches -1V, it is the opposite:? both DC-path FETS are ON, resulting in lots of current in L2 and then out L3 without making it to the output load.? In both cases, the output gets nothing.? Check your connections because I think it is not right.
?
But as far as SPICE goes, I think it simulates OK.
?
FYI, there are easier ways to generate triangle waves.? The normal voltage source with PULSE is ideal for this.
? ? Vm Tri_up 0 PULSE (-1 1 0 50u 50u 0 100u)
? ? Vn Tri_dwn 0 PULSE (1 -1 0 50u 50u 0 100u)
or
? ? .param RF=0.5/fs? ; Rise and Fall time
? ? Vm Tri_up 0 PULSE (-1 1 0 {RF} {RF} 0 {2*RF})
? ? Vn Tri_dwn 0 PULSE (1 -1 0 {RF} {RF} 0 {2*RF})
But it doesn't hurt to do it the way you did.
?
Andy
?
?


Re: Dual Active bridge

 

On Tue, May 6, 2025 at 05:12 PM, John Woodgate wrote:

What version allowed the sim to run without stalling?

Using computer #1 today, so it is lowly LTspice XVII.? Not LTspice 24.
?
You night have been hit by a yet-to-be-fixed bug - er, I mean side effect they added in version 24.1.x.
?
Andy
?


Re: Dual Active bridge

 

On Tue, May 6, 2025 at 05:33 PM, <arhamishtiaq42@...> wrote:
so do you think my primary side current is fine?
That is a somewhat difficult question for me to answer.? Maybe others can speak to this better than I can.
?
But I think the answer is "yes", I think it is normal.
?
Because the waveforms are not sinusoidal and the voltage and current waveforms are so very different from each other, you can not use Vrms*Irms to estimate power.? You must multiply V(time) by I(time) at every moment in time, then average the product over time.? And when you do that, you find that the power into the primary = 593 W, even though its Vrms * Irms = 95.6 * 12.9 = 1233 VA.
?
(I am still wondering where you got 40 A from.? My simulations did not come close.)
?
I think the only way for the primary current to be around 500 W / 100 V = 5 A, is if the transformer's primary current was also a square wave and in-phase with the voltage there.
?
The energy source (V9) provides 597 W, the transformer passes 593 W, and the load (R1) dissipates 458 W.? These are from simulating your third schematic, dd.asc, without UIC, and waiting until after the initial transients die out.
?
Andy
?
?


Re: Dual Active bridge

 

On Tue, May 6, 2025 at 06:35 PM, John Woodgate wrote:

.... But I already told you that there is a very large inrush current because of the large capacitor across the zero-impedance source V9. ...

I think that problem goes away if you get rid of the UIC.? There is no need for UIC here.? Don't use it unless it is needed.? Change:
? ? .tran 0 100m 0 uic
to:
? ? .tran 0 100m 0?
or:
? ? .tran 100m
or even this:
? ? .tran 10m
?
I do not think you can expect to see V*I at either primary or secondary to be only a little more than Vout*Iout.? Both waveforms very non-sinusoidal and in different ways from one another.? Thus, Average(V(time)*I(time)) does not come even close to Vrms*Irms.? I think you need to accept that the RMS current can not be calculated by dividing the power by the RMS current.? Math just doesn't work that way, so long as the waveforms are neither DC nor sinusoidal.
?
Andy
?


Re: Dual Active bridge

 

¿ªÔÆÌåÓý

It should not be much larger than output current x output voltage/input voltage. That is, power out/input voltage. But I already told you that there is a very large inrush current because of the large capacitor across the zero-impedance source V9. The other capacitors also charge when the associated FET switches off.

On 2025-05-06 22:33, arhamishtiaq42 via groups.io wrote:
so do you think my primary side current is fine?
--
Best wishes John Woodgate RAYLEIGH Essex OOO-Own Opinions Only If something is true: * as far as we know - it's science *for certain - it's mathematics *unquestionably - it's religion

Virus-free.


Re: Simulation of MMC 3-Level on Ltspice

 

I don't know if this matters in your simulation, but you have started with much less than a sine wave.? 9 ms is less than one-half cycle of 50 Hz.? The output waveform does not seem right, however.
?
Be careful about using multiple net names on the same net.? In SPICE, every net can have only one net name ("Label" in LTspice).? One of your nets has at least three names assigned to it.? Most of the time LTspice figures it out, but sometimes it does not.
?
Andy
?