Results 1 to 22 of 22

Thread: LTSpice and power measurements

  1. #1
    Member bea's Avatar
    Join Date
    Dec 2010
    Location
    Germany, FRA
    Posts
    254
    Thumbs Up/Down
    Received: 23/0
    Given: 1/0
    Rep Power
    9

    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 Not allowed! Not allowed!
    Last edited by bea; 01-28-2019 at 03:01 PM.

  2. #2
    Senior Member
    Join Date
    May 2006
    Location
    Cheshire, UK
    Posts
    2,004
    Thumbs Up/Down
    Received: 302/4
    Given: 185/0
    Rep Power
    15
    Quote Originally Posted by bea View Post
    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 Not allowed! Not allowed!
    Last edited by Dave H; 01-28-2019 at 05:22 PM.

  3. #3
    Member bea's Avatar
    Join Date
    Dec 2010
    Location
    Germany, FRA
    Posts
    254
    Thumbs Up/Down
    Received: 23/0
    Given: 1/0
    Rep Power
    9
    fails. Or i did not guess the syntax correctly.

    0 Not allowed! Not allowed!

  4. #4
    Senior Member
    Join Date
    May 2006
    Location
    Cheshire, UK
    Posts
    2,004
    Thumbs Up/Down
    Received: 302/4
    Given: 185/0
    Rep Power
    15
    Quote Originally Posted by bea View Post
    fails. Or i did not guess the syntax correctly.
    Yes, same here but it gives the right answer when I do it manually.

    0 Not allowed! Not allowed!

  5. #5
    Member bea's Avatar
    Join Date
    Dec 2010
    Location
    Germany, FRA
    Posts
    254
    Thumbs Up/Down
    Received: 23/0
    Given: 1/0
    Rep Power
    9
    And again - modeling something like the power on G2 of pentodes is important but estimating that power is hard to do manually.

    0 Not allowed! Not allowed!

  6. #6
    Senior Member
    Join Date
    Mar 2018
    Location
    Germany
    Posts
    1,182
    Thumbs Up/Down
    Received: 787/1
    Given: 541/2
    Rep Power
    4
    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 Not allowed! Not allowed!
    Last edited by Helmholtz; 01-28-2019 at 06:36 PM.
    - Own Opinions Only -

  7. #7
    Senior Member
    Join Date
    May 2006
    Location
    Cheshire, UK
    Posts
    2,004
    Thumbs Up/Down
    Received: 302/4
    Given: 185/0
    Rep Power
    15
    Quote Originally Posted by bea View Post
    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.

    Click image for larger version. 

Name:	EL84 Screen Power.png 
Views:	23 
Size:	24.2 KB 
ID:	52212

    0 Not allowed! Not allowed!

  8. #8
    Senior Member
    Join Date
    May 2006
    Location
    Cheshire, UK
    Posts
    2,004
    Thumbs Up/Down
    Received: 302/4
    Given: 185/0
    Rep Power
    15
    Quote Originally Posted by Helmholtz View Post
    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 Not allowed! Not allowed!

  9. #9
    Member bea's Avatar
    Join Date
    Dec 2010
    Location
    Germany, FRA
    Posts
    254
    Thumbs Up/Down
    Received: 23/0
    Given: 1/0
    Rep Power
    9
    Quote Originally Posted by Helmholtz View Post
    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 Not allowed! Not allowed!

  10. #10
    Senior Member
    Join Date
    Mar 2018
    Location
    Germany
    Posts
    1,182
    Thumbs Up/Down
    Received: 787/1
    Given: 541/2
    Rep Power
    4
    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 Not allowed! Not allowed!
    Last edited by Helmholtz; 01-28-2019 at 07:24 PM.
    - Own Opinions Only -

  11. #11
    Member bea's Avatar
    Join Date
    Dec 2010
    Location
    Germany, FRA
    Posts
    254
    Thumbs Up/Down
    Received: 23/0
    Given: 1/0
    Rep Power
    9
    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 Not allowed! Not allowed!

  12. #12
    Senior Member
    Join Date
    Mar 2018
    Location
    Germany
    Posts
    1,182
    Thumbs Up/Down
    Received: 787/1
    Given: 541/2
    Rep Power
    4
    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 Not allowed! Not allowed!
    Last edited by Helmholtz; 01-29-2019 at 02:51 PM.
    - Own Opinions Only -

  13. #13
    "Thermionic Apocalypse" -JT nickb's Avatar
    Join Date
    Dec 2009
    Location
    Devon, UK
    Posts
    3,272
    Thumbs Up/Down
    Received: 488/1
    Given: 445/1
    Rep Power
    13
    Please see image below for an example on how to do power calc in LtSpice:

    Click image for larger version. 

Name:	LTS_POWER.JPG 
Views:	27 
Size:	113.8 KB 
ID:	52214

    0 Not allowed! Not allowed!
    Last edited by nickb; 01-28-2019 at 09:15 PM.
    Experience is something you get, just after you really needed it.

  14. #14
    Senior Member
    Join Date
    May 2006
    Location
    Cheshire, UK
    Posts
    2,004
    Thumbs Up/Down
    Received: 302/4
    Given: 185/0
    Rep Power
    15
    EL34 screen dissipation sim.

    Click image for larger version. 

Name:	EL34 Screen dissipation.png 
Views:	30 
Size:	21.6 KB 
ID:	52215

    1 Not allowed! Not allowed!

  15. #15
    "Thermionic Apocalypse" -JT nickb's Avatar
    Join Date
    Dec 2009
    Location
    Devon, UK
    Posts
    3,272
    Thumbs Up/Down
    Received: 488/1
    Given: 445/1
    Rep Power
    13
    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 Not allowed! Not allowed!
    Experience is something you get, just after you really needed it.

  16. #16
    Senior Member
    Join Date
    May 2006
    Location
    Cheshire, UK
    Posts
    2,004
    Thumbs Up/Down
    Received: 302/4
    Given: 185/0
    Rep Power
    15
    Quote Originally Posted by nickb View Post
    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

    Click image for larger version. 

Name:	EL34 G2 Power.png 
Views:	14 
Size:	28.7 KB 
ID:	52223

    0 Not allowed! Not allowed!

  17. #17
    Senior Member
    Join Date
    Mar 2018
    Location
    Germany
    Posts
    1,182
    Thumbs Up/Down
    Received: 787/1
    Given: 541/2
    Rep Power
    4
    Quote Originally Posted by Dave H View Post
    EL34 screen dissipation sim.

    Click image for larger version. 

Name:	EL34 Screen dissipation.png 
Views:	30 
Size:	21.6 KB 
ID:	52215
    Interesting that the power curve looks very similar to the current curve.

    0 Not allowed! Not allowed!
    Last edited by Helmholtz; 01-29-2019 at 03:28 PM.
    - Own Opinions Only -

  18. #18
    Senior Member
    Join Date
    Mar 2018
    Location
    Germany
    Posts
    1,182
    Thumbs Up/Down
    Received: 787/1
    Given: 541/2
    Rep Power
    4
    Quote Originally Posted by Dave H View Post
    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

    Click image for larger version. 

Name:	EL34 G2 Power.png 
Views:	14 
Size:	28.7 KB 
ID:	52223
    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 Not allowed! Not allowed!
    Last edited by Helmholtz; 01-29-2019 at 04:24 PM.
    - Own Opinions Only -

  19. #19
    "Thermionic Apocalypse" -JT nickb's Avatar
    Join Date
    Dec 2009
    Location
    Devon, UK
    Posts
    3,272
    Thumbs Up/Down
    Received: 488/1
    Given: 445/1
    Rep Power
    13
    Quote Originally Posted by Dave H View Post
    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

    Click image for larger version. 

Name:	EL34 G2 Power.png 
Views:	14 
Size:	28.7 KB 
ID:	52223

    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 Not allowed! Not allowed!
    Experience is something you get, just after you really needed it.

  20. #20
    Senior Member
    Join Date
    May 2006
    Location
    Cheshire, UK
    Posts
    2,004
    Thumbs Up/Down
    Received: 302/4
    Given: 185/0
    Rep Power
    15
    Quote Originally Posted by nickb View Post
    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 Not allowed! Not allowed!

  21. #21
    "Thermionic Apocalypse" -JT nickb's Avatar
    Join Date
    Dec 2009
    Location
    Devon, UK
    Posts
    3,272
    Thumbs Up/Down
    Received: 488/1
    Given: 445/1
    Rep Power
    13
    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 Not allowed! Not allowed!
    Last edited by nickb; 01-31-2019 at 09:04 AM.
    Experience is something you get, just after you really needed it.

  22. #22
    Member bea's Avatar
    Join Date
    Dec 2010
    Location
    Germany, FRA
    Posts
    254
    Thumbs Up/Down
    Received: 23/0
    Given: 1/0
    Rep Power
    9
    Well, i needed to make a short break with this and hope I'll get back to it over the weekend.

    0 Not allowed! Not allowed!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. LTSpice model for output transformer
    By hkc in forum Theory & Design
    Replies: 36
    Last Post: 11-08-2016, 01:22 PM
  2. Getting started in LTspice.
    By SoulFetish in forum Theory & Design
    Replies: 13
    Last Post: 03-05-2016, 08:45 AM
  3. Where can I get tube model for LTSpice
    By Alan0354 in forum Theory & Design
    Replies: 4
    Last Post: 04-25-2014, 05:14 PM
  4. simulations in LTspice
    By Tun in forum Music Electronics
    Replies: 13
    Last Post: 02-16-2014, 02:22 AM
  5. Focusrite Saffire 26 Power supply measurements
    By Jaxn in forum Music Electronics
    Replies: 3
    Last Post: 12-17-2013, 06:03 AM

Bookmarks

Posting Permissions

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