This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PSPICE-FOR-TI: Calculating average power loss via S() function

Part Number: PSPICE-FOR-TI

I have an instantaneous power loss signal.

I would like to calculate the average power of its.

This guide say, that the average power can be performed using integration S function in PSpice.

Single-Switch-Forward-Converter-App-Note_Final.pdf (pspice.com)

Chapter Switching Losses in MOSFETs

It seems, it should work as in the picture here:

Here are my results:

You can see, that the value has to be about 100mW as it can be calculated via AVG functions.

Maybe I have mistake understanding this function.

Help definition: "S(x) is integral of x over the range of the X axis variable"

Why does S() not give correct value?

Attila

  • Hi Attila,

      the average power should be something like S(X)/total_time. Not sure if the total_time was put into your calculation.

    Regards,

    Yong

  • Hi Yong,

    You are right. S() is only a simple integral and it is not area functon. 

    P(x)=S(x)/time

    where "time" is a integrated function name in PSpice. 

    or in my case a tricky way

    P(x)=S(x)/(time-3.9ms)

    Because I ran the simulation from 0-3.9ms, but logging was only made from 3.0ms. So buffer content is only between 3.0-3.9ms.

    Is there any way to replace the time-C? When I change the simulation start-stop parameters, I have to modify it by manual.

    If I use ful log, then P(x)=S(x)/time seems okay.

    Other: I have found a power measurement function in PSpice. Its name is PowerDissipation_mW().

    I don't understand the definition of this, and I can not get the same result to compare S(x).

    PowerDissipation_mW: "Total power dissipation in milli-watts during the final period of time (can be used to calculate total power dissipation, if the first waveform is the integral of V(load)"

    V(load)? Integral of V(load)? Maybe this is typo here and means W(load)?

    What is the meaning of final period?

    The function waits constant as Periode, so any equations like time-3.9m, or 1/Period(x) and so on can not be used.

    Link: 

    Attila

  • Attila,

      I cannot think of a better way to replace time-C since it is a user defined equation to calculation power dissipation. 

    As far as the PowerDissipation_mW, the pspice manual does not have the detials. Please post the question to PSPICE forum. PSPICE developer/AE should be able to clarify the usage of the function.

    https://www.pspice.com/forum

  • Here is the result, after nobody have response here and on the recommended pspice forum.

    After I have diggested into the dark side of software, it was usefull to see what measurement functions doing in real live.

    It seems, the PSpice documentation is wrong (typo).

    Infos in nutshell:

    1. First of all, AVG(W(t)) is equal with S(W(t))/time.

    So if you would like to calculate the average power of full W(t) record, then you can use AVG()

    2. In case of partial log buffer, you can use S(W(t))/(time-t1), where t1: timestamp of log begin

    3. You can use moving average of signal with AVGX(W(t),Tperiode). This could be usefull if you would like to drop the startup phase of transient analyze, or other commumative preliminary events.

    4. You can get avg power of signal via the PowerDissipation_mW() function. It calculate the last periode of power signal. The periode is not auto detected, it is input argument of this function!

    Every functions have details (trace->measurement), where View command shows what given function does internaly. The most important feature is the Eval command, where you could give more details about function internal behaviour, you can see what kind of points are found by scipts when the they run. It is very usefull, when you create own measurement functions and you would like to test, eval them.

    Back to PowerDissipation_mW(). The Eval button shows where P1 and P2 points are found. This function waits integral of a power signal and finds the last point of S(W(t)) as P1 and steps back Tperiod to find the others (P2). From these P1 and P2 points, it calculates the power of input signal. That's all.

    You have to call integral of watt function as input parameter, e.g. PowerDissipation_mW(S(W(U1)), 1u)

    PowerDissipation_mW(1, Period) = (y1-y2)*1000/(x1-x2)
    *#Desc#* Total Power dissipation in mW during the final 'Period' of time.
    *#Desc#* Find the difference between the final Y value of the trace and
    *#Desc#* the Y value one period before that.
    *#Desc#* (Can be used to calculate total power dissipation in mW, if the
    *#Desc#* first trace is the integral of V(load)*I(load).)
    *
    *#Arg1#* s(load_voltage * load_current)
    *#Arg2#* Period
    *
    * Usage:
    * PowerDissipation_mW(s(<load_voltage>*<load_current>), <period>)
    *
    {
    1|Search forward xvalue(100%) !1
    Search backward /x1/ xvalue(.-Period) !2;
    }

     

    Example

    W(t):


     

    AVG of W(t):


     

    AVGX of W(t) under T: T is 810.716ns now


     

    S(W(t)) with found P1 and P2 eval points:


    PS: you can rename any function/probe names if you use this syntax: "<probe_name>;<your_name>", e.g. S(W(U1));INTEGRAL of POWER

     

    Attila

  • Thanks. This is very helpful