Jump to content

Continuous Signal to Represent Uptime


Recommended Posts

Hello Seeq, 

I have a bad actor pump that requires relatively frequent maintenance and replacement. I am using a flow measurement in Seeq to indicate whether my pump is operating or not but I'm having trouble creating a new signal that captures the running hours/days of my pump at any given time. I was able to use Signal from Condition to give me each operating periods total duration (see attached) but I'm looking for a more continuous signal. 

image.png

Please let me know if there is a way to accomplish this in Seeq.

Link to comment
Share on other sites

  • Seeq Team

Great question!

Yes - Seeq is able to create a new signal that represents the running hours/days of your piece of equipment. Signal from Condition is a great start as you've already found. To get what you are looking for, you'll need to use Seeq's Formula tool. I have mocked up a like-example below for your reference.

In the first two lines of our Formula, we create hour long capsules with the hours() function, then transform those capsules to samples by counting the number of capsules that occur every hour, and give each sample a timestamp at the start of the hour using the .getstart() function.  

"hours().transformtosamples(                                          
$capsule -> sample($capsule.getstart(), hours().count($capsule)))"

The 3rd line of our formula, 

".runningsum($on).setunits('hr')" 

keeps a running sum of hours contained within your "ON" condition, then sets the appropriate units. In your example, this would be your purple "Pump is running" condition. 

image.png

image.png

As you can see in the display pane, our new signal resets for each new 'Compressor On' capsule. 

I hope this is what you were looking for. Please let us know if you have any additional questions.

 

-Chris

 

  • Like 1
Link to comment
Share on other sites

  • 7 months later...
  • Seeq Team

In R21+ versions of Seeq, an easier way to accomplish the up time counter would be to use the following code:

1.toSignal().integral($on)

You can add on the modifier .convertUnits('h') to convert the counted time from seconds to hours (or replace 'h' with min for minutes, d for days, etc.)

A side note, With the R21.043 release we no longer require a maximum duration when creating capsules, but still require it when performing certain functions like integral(), if you are getting a maximum duration error, just tack on .setMaximumDuration(7d) on to your condition like so:

1.toSignal().integral($co.setMaximumDuration(7d)).convertUnits('h')

 

More info on the maximum duration can be found in this thread: 

 

Link to comment
Share on other sites

  • 3 years later...
On 1/7/2019 at 10:53 AM, Chris Orr said:

Great question!

Yes - Seeq is able to create a new signal that represents the running hours/days of your piece of equipment. Signal from Condition is a great start as you've already found. To get what you are looking for, you'll need to use Seeq's Formula tool. I have mocked up a like-example below for your reference.

In the first two lines of our Formula, we create hour long capsules with the hours() function, then transform those capsules to samples by counting the number of capsules that occur every hour, and give each sample a timestamp at the start of the hour using the .getstart() function.  

"hours().transformtosamples(                                          
$capsule -> sample($capsule.getstart(), hours().count($capsule)))"

The 3rd line of our formula, 

".runningsum($on).setunits('hr')" 

keeps a running sum of hours contained within your "ON" condition, then sets the appropriate units. In your example, this would be your purple "Pump is running" condition. 

image.png

image.png

As you can see in the display pane, our new signal resets for each new 'Compressor On' capsule. 

I hope this is what you were looking for. Please let us know if you have any additional questions.

 

-Chris

 

Okay Chris,  I want to do this, but instead of "resetting to Zero" i want to some how splice the last value of the previous capsule to the new one and keep increasing.

 

Final goal:  Show % Uptime as a signal that is a running sum throughout the year.    and it doesn't reset to zero until Jan 1st 00:00:00.  

Link to comment
Share on other sites

  • Seeq Team

We can utilise the timeSince() function to achieve what you're trying to get at.

First, we can create a downtime condition and use that inside the timeSince() function. This allows the signal to continue from the last value rather than resetting to zero. 

$downtime =  not $uptime
timeSince($year, 1d, $downtime)

Next, we can use timeSince() to count the amount of time that's lapsed in the year

timeSince($year, 1d)

Finally, we can find the %Uptime 

($uptime_counter / $yearly_counter).convertUnits('%')

 

Edited by Amanda Chng
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...