6 Replies Latest reply on Apr 9, 2018 10:13 AM by simon76

    PIAF analyses - Compute average of moving range

    simon76

      Hi everyone,

       

      I started to work on PIAF 2-3 weeks ago and I would like some help for an issue that I have. My objective is to construct an individual measurements control chart with PIAF analyses (expression).

      The measures are vibrations and come from PI system. Below, a sample of my values:

      DateValue (mm/s)MR
      21-juil-17 00:00:002,202375345
      21-juil-17 04:00:002,1106269160.09174
      21-juil-17 08:00:002,2289304860.11830
      21-juil-17 12:00:001,9358207790.29310
      21-juil-17 16:00:002,2020279160.26620
      21-juil-17 20:00:002,3096844070.10765
      22-juil-17 00:00:002,4363989570.12671

                                   

      So, I need to compute UCL (UCL = /x + 3 * /MR/1.128 ; LCL = UCL = /x - 3 * /MR/1.128).

      /x is average of column value. (computed with TagAvg() like the screenshot below).

       

      /MR is the average of the column MR. MR = |value i – value i-1|

      My problem is to compute /MR with PIAF. I don't know how could I do this because when we use an expression we can't have the same attribute in input and in output.

      Maybe you have an idea to do that (I hope).

       

      Thank you for your time,

       

      Simon.

        • Re: PIAF analyses - Compute average of moving range
          rborges

          Hi Simon,

           

          If I got it right you have,

          UCL = (x + 3 * MR)/1.28

          LCL = (x - 3 * MR)/1.28

          MR = |value i – value i-1|

           

          So your main problem is how to get the delta between the current value and the previous one, right? If that's the case, there is a function called DeltaValue that does exactly what you are looking for:

          Returns the difference between the current value and the immediately previous value of an attribute with a numeric or DateTime value type

          I hope it helps!

          • Re: PIAF analyses - Compute average of moving range
            simon76

            Hi Rafael,

             

            Thanks for your response. Indeed, the function DeltaValue can work but in my case what I would like is the average of the MR (in yellow in the table below). I give you another example more simplified with random values:

            Value is my measure and his average is 2,75 (easy to compute with the function 'TagAvg()').

            But, to compute the average of MR (2,3333), first, I need to calculate the difference between the current value and the previous value (|3-2|=1 ; |1-3|=2 ; |5-1|=4). For example, DeltaValue will compute 1 (3-2) but where could I store this result? I can't create one attribute for one MR because in this example there are 3 values but in my real case, there are about 100 values.

             

            Moreover, "value" is already an average of all values between each date (interval 4 hours), defined like the screen below:

             

            I hope that I have been understandable and thank you again for your help, I really appreciate!

             

            Simon

              • Re: PIAF analyses - Compute average of moving range
                sraposo

                Hi Simon,

                 

                Why not configure two analyses? One analysis will calculate the difference between two values and the second will compute the average of the differences. The first analysis could output to an attribute with an analysis data reference if you don't want to use two PI Points, though keep in mind this will be more resource intensive as the analysis service will need to calculate the differences on each computation of the average.

                 

                Hope this helps,

                Seb

                1 of 1 people found this helpful
              • Re: PIAF analyses - Compute average of moving range
                simon76

                Hi Sebastien,

                 

                Could you explain more in detail, please?

                 

                I have tried this:

                Analyse 1:

                The dates limits of analyses are 20/07/2017 00:00:00 to 25/07/2017 00:00:00.

                The calculations of MR1 is every 4 hours between this 2 dates.

                 

                Currently, in my attribute "MR1" (output of analyse), there is the value 0,071. And, if I change the date (next interval +4 hours), the output will have another value but how the analyse 2 can compute the average of all the values of attribute "MR1"? (0,071 will be deleted and the next value of MR1 will be stored).

                 

                Thanks,

                 

                Simon.

                  • Re: PIAF analyses - Compute average of moving range
                    sraposo

                    Hi Simon,

                     

                    I'm not sure I understand the need of a start date. What's the purpose?

                     

                    Is the data in 'Vibration_signature' updating every 4 hours? If so, why not configure the analysis as:

                     

                    Difference 'Vibration_signature' - PrevVal('Vibration_signature','*')

                     

                    Configure the analysis as Event Triggered

                     

                    If the data for Vibration_signature does not have a constant 4h frequency, then:

                     

                    Difference 'Vibration_signature' - TagVal('Vibration_signature','*-4h')

                     

                    You can then configure another analysis to use the TagAvg() function.

                     

                    Hope this helps!

                     

                    Thanks,

                    Seb

                  • Re: PIAF analyses - Compute average of moving range
                    simon76

                    Hi Sebastien,

                     

                    The need of a start date is UCL, LCL is computed only during a specific period. This is a reference period determined when an equipment is overhauled (this reference period is different according to each equipment). In the case above, the reference period to make the calculation of UCL, LCL is "20/07/2017 00:00:00" to "25/07/2017 00:00:00" with an interval of 4 hours (configurable, and the data vibration are updating in real time).

                    So, what do you think about event frames in this case?

                     

                    The final objective of the tool is to have a dashboard visualizing the health state of rotating machines. That's why there are vibration sensors installed on each equipment.

                     

                    Thanks,

                    Simon