PI AF Analyses for Pump On/Off (Pump Cycling)

I want to create a PI tag that counts how many times we are cycling our pumps at a daily and monthly interval, using Analyses.

 

The criteria for a "pump cycle", is it has zero flowrate and pump status = 'Off' for 3 minutes or longer. Attached is a picture of the current logic I created in PI AF.

 

However, the Analyses is not working as I expected, and I am getting really high values (hundreds of daily pump cycles, thousands of monthly pump cycles). I think it is likely because there is no stop trigger once the "pump cycle" condition has been met. Therefore, if a pump is off for an hour, it will count this as many pump cycles instead of one, since it meets the zero flowrate and pump status = 'Off' condition for the entire duration.

 

Does anyone have experience with creating a tag for a scenario like this? Or has suggestions on how to fix the logic.

 

Thanks

 


image.png

Parents
  • Hi Asle,

     

    I was able to get the analysis working as I expected using the following analysis:

     

    CycleCountDaily

    // Totalize no. of times the CycleTrigger tag was equal to 1 since midnight
    EventCount('Cycle Trigger','t','*')

     

    CycleCountMonthly

    // Totalize no. of times the CycleTrigger tag was equal to 1 since midnight at start of the month
    EventCount('Cycle Trigger', BOM('*'), '*')

     

    CycleTrigger

    // Check if pump is currently 'Off' and previous value value was 'On' - indicates a cycle
    If 'Pump Off' = 1 And PrevVal('Pump Off', '*') = 0
    Then 1 // If 'Yes', trigger, set to 1
    Else NoOutput() // If 'No', set to 0

     

    PumpOff

    // Check if flowrate is 0 and pump status is 'Off' for last 3 minutes
    If TimeLE('Flowrate', '*-10s', '*', 1) = 10 And TimeEq('Pump Status','*-10s', '*', 0) = 10
    Then 1 // If 'Yes', then pump is off, trigger cycle, set to 1
    Else 0 // If 'No', then pump is on, set to 0

     

    I'm fairly certain that in the CycleTrigger analysis, having 'Else 0' instead of 'Else NoOutput()" was messing with the EventCount formula. Whereas now, with the NoOutput() function it is working as expected.

     

    Thanks for your help/

Reply
  • Hi Asle,

     

    I was able to get the analysis working as I expected using the following analysis:

     

    CycleCountDaily

    // Totalize no. of times the CycleTrigger tag was equal to 1 since midnight
    EventCount('Cycle Trigger','t','*')

     

    CycleCountMonthly

    // Totalize no. of times the CycleTrigger tag was equal to 1 since midnight at start of the month
    EventCount('Cycle Trigger', BOM('*'), '*')

     

    CycleTrigger

    // Check if pump is currently 'Off' and previous value value was 'On' - indicates a cycle
    If 'Pump Off' = 1 And PrevVal('Pump Off', '*') = 0
    Then 1 // If 'Yes', trigger, set to 1
    Else NoOutput() // If 'No', set to 0

     

    PumpOff

    // Check if flowrate is 0 and pump status is 'Off' for last 3 minutes
    If TimeLE('Flowrate', '*-10s', '*', 1) = 10 And TimeEq('Pump Status','*-10s', '*', 0) = 10
    Then 1 // If 'Yes', then pump is off, trigger cycle, set to 1
    Else 0 // If 'No', then pump is on, set to 0

     

    I'm fairly certain that in the CycleTrigger analysis, having 'Else 0' instead of 'Else NoOutput()" was messing with the EventCount formula. Whereas now, with the NoOutput() function it is working as expected.

     

    Thanks for your help/

Children
No Data