Jump to content

Converting a Saw-Tooth Signal into a Continuously Increasing Signal


Recommended Posts

Background:

Sensors or calculated tags that totalize a value over time often need to be reset due to maxing out the range of the sensor or the number of available digits in the calculation database. This can create a saw-tooth signal that resets every time this range maximum is reached. In actuality, the signal is constantly increasing rather than building up to the range max and then stepping down to zero to begin counting back up towards the max. 

 

Solution: 

Use Seeq Formula to convert the saw-tooth signal into a continuously increasing signal bounded in time by some reset period determined by the Subject Matter Expert. 

1. In this example we begin with a saw-tooth counter signal that resets every time the sensor reaches its range max of 100. 

image.png

2. Use Seeq Formula to convert the sawtooth signal into a continuous, increasing signal. Note that in order for Seeq to do this calculation, a bounding condition is required. This can either be a repeating periodic condition, or a condition created using the custom condition tool. 

This can be done in one step using the following code:

//creates a bounding condition for running sum calculation
$reset = years()

//calculates running delta of signal between each sample, compares to zero to ignore negative running delta values,
//calculates the running sum of the running delta signal over the bounding condition
$signal
   .runningDelta()
   .max(0)
   .runningAggregate(sum(),$reset)

image.png

 

  • Like 3
Link to comment
Share on other sites

  • 2 years later...

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...