We basically want to calculate our pump rate over any given timespan. This is a pretty pressing analysis we need done so any help would be greatly appreciated. Some quick information about the processing of the machine and digestion pump…
- We have a digestion tank that crushes up food into a sludge like material and pumps it to a cure tank.
- The pump from the digestion tank to the cure tank is not on all the time, but we send the data to Ubidots showing when it is on. This is represented with a 1 (on) and 0 (off).
- We are recording the weights of the digestion tank constantly.
- The digestion tank is ‘fed’ through a sequence that records feed weights.
- We are imagining the pump rate over any given timespan (set by the dashboard time) as the following:
Pump Rate (over any given timespan) = [WeightFIRST – (WeightLAST - ∑ Feed Weights)] / Pump Runtime
WeightFIRST = The first weight in the data set for the specified period of time
WeightLAST = The last weight in the data set for the specified period of time
∑ Feed Weights = The sum of all the feed weights in the data set for the specified period of time
Pump Runtime = The amount of time the pump has been on for the specified period of time
I think we have the Pump Runtime down, using the following…
previousValue = shift( digpumpstatus, -1)
previousTime = shift( digpumpstatus.timestamp, -1)
actualValue = digpumpstatus
actualTime = digpumpstatus.timestamp
dV = actualValue – previousValue
dT = actualTime – previousTime
My large questions are is there a way to grab the WeightFIRST and WeightLAST for any given timestamp? This would literally just have to be the first digestion weight in the timespan and the last digestion weight in the timespan. Also, it seems pretty simple but we’d also need a sum of all the feed weights for any given timespan. I also attached a picture of the calculation.