# Thread: LTSpice and power measurements

1. ## LTSpice and power measurements

Hi folks,

i'm a bit stuck with the need of power determination in LTSpice.

I am doing something like this:

.meas tran Pw rms(V(out)*I(R1))
.meas tran Pw_avg avg(V(out)*I(R1))

The first expression seems to be "marketing director's RMS power" - values too large with limited physical meaning. Which has tricked my during the design of my Little Bea.R but i would guess this might also be the basis for "18W Marshall amps" and the like.

Toward a more realistic determination i tried the 2nd statement yielding more plausible numbers in absolute value. Unfortunately, they are negative.
How do i obtain realistic and trustable values, especially on G2 load?

0

2. Originally Posted by bea
I am doing something like this:

.meas tran Pw rms(V(out)*I(R1))
.meas tran Pw_avg avg(V(out)*I(R1))
I don't know how to write it in LTspice but shouldn't the first expression be -

Power = rms(V(out)) * rms(I(R1)) ?

0

3. fails. Or i did not guess the syntax correctly.

0

4. Originally Posted by bea
fails. Or i did not guess the syntax correctly.
Yes, same here but it gives the right answer when I do it manually.

0

5. And again - modeling something like the power on G2 of pentodes is important but estimating that power is hard to do manually.

0

6. Maybe I misinterprete the power formula rms(V(out)*I(R1)), but power is not the rms value of the product V(t)*I(t) but the time average of V(t)*I(t).
Time average is calculated by integrating the product V(t)*I(t) over an integer number of cycles and dividing the result by the integration time interval.

Only in the special case of a (linear) resistor, where voltage and current are proportional and in-phase, power is given by
P=Vrms*Irms.

1

7. Originally Posted by bea
And again - modeling something like the power on G2 of pentodes is important but estimating that power is hard to do manually.
You mentioned the power output of the Marshall 18W so I simulated that.

Did you see the other thread where we discussed pentode G2 power?
I tried to measure it on my 18W at full power. The calculated power was 2.6W.
It's the black trace on the plot below.

0

8. Originally Posted by Helmholtz
Only in the special case of a (linear) resistor, where voltage and current are proportional and in-phase, power is given by
P=Vrms*Irms.
Yes, it worked in LTspice for the 18W amp's output power but is useless for G2 power.

This could work. Run the sim then use the LTspice "Add Trace" function to plot the trace Ig2 * Vg2, select an integer number of cycles then press 'Control' + 'Click' to display average power.
I think that's what bea wants.

0

9. Originally Posted by Helmholtz
Maybe I misinterprete the power formula rms(V(out)*I(R1)), but power is not the rms value of the product V(t)*I(t) but the time average of V(t)*I(t).
Time average is calculated by integrating the product V(t)*I(t) over an integer number of cycles and dividing the result by the integration time interval.
Correct. That's why i called it "marketing value". My problem is actually that the 2nd approach which was the attempt to do the correct formulation, in some situations gives reasonable values which coincide in absolute value with what i would read from the screen (Veff^2/R) but with the wrong sign. Which clearly should not happen and furthermore is not generally applicable.

0

10. If R is the screen resistor and Veff its voltage drop, (Veff^2/R) gives its dissipation, but not screen dissipation. Because of the square involved, (Veff^2/R) must always be positive.

Screen voltage and current are not proportional nor in-phase. The screen to ground path does not behave like a resistor, so rms values of voltage and current cannot be used for calculation of screen dissipation.

0

11. All correct and not at all in contradiction to me. You can query for both current and voltage directly at the screen node.

Veff^2/R can be done at the final load resistance and hence be used to check for the correctness of the result. And if

.meas tran Pw_avg avg(V(out)*I(R1))

gives a negative number it does not do what it is advertized, or better what i believe is advertized. It just seems to be some kind of sliding arithmetic mean of the product, which in that case is indeed always negative due to the choice of the zero potential in a way allowing NFB.

0

12. Seems there is some misunderstanding.

You wrote:
reasonable values which coincide in absolute value with what i would read from the screen (Veff^2/R)
From this I concluded that you wanted to calculate screen dissipation from (Veff^2/R), which is not possible.

What is the context of this:

You can query for both current and voltage directly at the screen node.
If you use avg(V(out)*I(R1)) for calculation of output power (assuming that R1 is the load resistor), the result will be negative, if either V or I is not defined properly (i.e. out of phase with each other by 180°), but the absolute value of the result will give the correct power.

Do we agree that screen=G2 and that screen dissipation and output power are not (directly) related?
I am confused.

0

13. Please see image below for an example on how to do power calc in LtSpice:

0

14. EL34 screen dissipation sim.

1

15. To output the G2 dissipation in Spice the syntax for example a 5ms interval is

.MEAS TRANS POWER G2 INTEG (v(S)*Ix(U1:Screen))/0.005

S is the screen grid node, U1 is the device under test.

2

16. Originally Posted by nickb
To output the G2 dissipation in Spice the syntax for example a 5ms interval is

.MEAS TRANS POWER G2 INTEG (v(S)*Ix(U1:Screen))/0.005
Thanks, that worked. I had to change the interval to be the same as the plot window (10mS). With 5mS it gave twice the value. The answer is the same as the previous plot (7.3W) but the coloured sim was ever so pretty

0

17. Originally Posted by Dave H
EL34 screen dissipation sim.

Interesting that the power curve looks very similar to the current curve.

0

18. Originally Posted by Dave H
Thanks, that worked. I had to change the interval to be the same as the plot window (10mS). With 5mS it gave twice the value. The answer is the same as the previous plot (7.3W) but the coloured sim was ever so pretty

With that it should be easy to demonstrate that doubling the load impedance increases screen dissipation while plate dissipation and max. output power decrease.

1

19. Originally Posted by Dave H
Thanks, that worked. I had to change the interval to be the same as the plot window (10mS). With 5mS it gave twice the value. The answer is the same as the previous plot (7.3W) but the coloured sim was ever so pretty

If you want some time interval other than the window you can use the TRIG and TARG modifiers to specify the internal. For example a 2mS interval would be

.MEAS TRANS POWERG2 INTEG (v(S)*Ix(U1:Screen))/2M TRIG TIME=1M TARG TIME=3M

0

20. Originally Posted by nickb
If you want some time interval other than the window you can use the TRIG and TARG modifiers to specify the internal. For example a 2mS interval would be

.MEAS TRANS POWERG2 INTEG (v(S)*Ix(U1:Screen))/2M TRIG TIME=1M TARG TIME=3M
Thanks, I added it to the schematic but had to change 'TRANS' to 'TRAN' (or omit it as below) or it thought it was the measurement name and failed because 'two measurements can't have the same name'.

Syntax:
MEAS PowerG2 INTEG (v(G2)*Ix(U1:Screen))/0.010
MEAS PwrG2 INTEG (v(G2)*Ix(U1:Screen))/5M TRIG TIME=5M TARG TIME=10M

Result:
powerg2: INTEG((v(g2)*ix(u1:screen))/0.010)=7.33422 FROM 0 TO 0.01
pwrg2: INTEG((v(g2)*ix(u1:screen))/5m)=7.33401 FROM 0.005 TO 0.01

I'm sure to be scratching my head over the syntax when I come back to it in a few weeks time.

2

21. Yes, thanks. TRANS was a typo. I'm famous for them. I've contacted Berkley and asked them to change the syntax to match my typos so I don't look so dumb. In the meantime we'll just have to live with TRAN. I'm sure they won't take long. I've suggested a few new commands that we'll all love to have like

.SCHEM AUTO This draws the schematic that I have in my head
.MODELFIX This fixes all the deficiencies in whatever library models you are using.
.HCF Halt and catch fire. A more entertaining alternative to waiting hours for complex sim to complete.

5

22. Well, i needed to make a short break with this and hope I'll get back to it over the weekend.

0

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•