We are currently working on calculating a flow rate using digital pulse inputs. At the moment, we collect pulses over a 60-second interval and then multiply that total by 60 to convert it into a barrels per hour (bbl/hr) rate. Is there a PID (Proportional, Integral, Derivative) controller function or a mathematical formula that can process these pulses to yield a more precise flow rate in real-time? Has anyone had experience with this? We are utilizing RSLogix 5000 for our programming. Thank you for your assistance!
There are two methods to accomplish this task. You can continue using your current approach, or alternatively, you can measure the time interval between pulses, which will provide you with milliseconds per pulse. To determine the number of pulses per millisecond, simply take the inverse of this value by performing the calculation of 1 divided by your measured result.
One enhancement I would suggest is incorporating a moving average (MAVE). This addition can effectively smooth out fluctuations and noise in the data readings, providing a clearer analysis.
An effective method for implementing a filtered moving average involves creating an array to store successive data readings. With each new input, you should shift the existing values in the array and insert the latest reading into the newly created space. Next, copy the array to another array for further processing. Sort this new array to organize the values, then calculate the average while excluding the highest and lowest elements. This process helps filter out transient or outlier readings. For even stricter filtering, consider averaging fewer elements from the copied array—such as omitting the top and bottom two values, which can enhance accuracy in your moving average calculations.
According to Daba, an effective approach for implementing a filtered moving average involves creating an array to store successive readings. With each new data input, shift the existing values in the array to make room for the latest reading. Then, duplicate this array into a second one and sort it. To calculate the average, exclude the highest and lowest values — this process helps filter out transient spikes in data. For enhanced filtering, you can choose to average fewer elements by disregarding the top and bottom two values, for instance. This method is so efficient that it has become an adjustable drop-down option in the analog input configuration for Unitronics PLCs. By using these techniques, you can greatly improve data accuracy and reliability in your automation projects.
In situations like this, I typically determine the time units per pulse instead of counting pulses over a set time frame. I then reverse the formula to convert the results into parts per minute, hour, or second, depending on what is required. This approach provides immediate feedback on the rising edge of each pulse, which can often lead to fluctuations. To mitigate this, it's frequently beneficial to apply a filtering or averaging technique to the results. The primary objective is to avoid waiting an entire minute to observe changes in the rate while still providing a stable and reliable number that won’t alarm the operators.
✅ Work Order Management
✅ Asset Tracking
✅ Preventive Maintenance
✅ Inspection Report
We have received your information. We will share Schedule Demo details on your Mail Id.
Join hundreds of satisfied customers who have transformed their maintenance processes.
Sign up today and start optimizing your workflow.