The PLC Shift Gas Flow computer is a software-only solution that calculates pressure and temperature-corrected gas flow. It implements the AGA-3 1992, AGA-3 2013, AGA-8 1994, and AGA-8 2017 Part 1 and Part 2 algorithms. It also generates and stores data required for regulatory compliance, like an event log, alarm log, configuration change log, and others.
A common question that we get asked about our gas flow computer is, "How many runs can your flow computer do?". Our answer is, "It depends", and is quite unsatisfying for you, the end user. But, it really does depend, and some of the factors that it depends on are:
The performance of the CPU that you are running our software on.
How quickly sensors can be polled. Using Modbus RTU at 9600 baud and polling sensors sequentially limits how quickly data can get into the flow computer.
What other software that the computer that you are using is running. We recommend either dedicating the computer to PLC Shift or using a very fast computer.
The amount of RAM on the computer that you are using.
The architecture of the CPU (ARM vs x86).
The PLC Shift flow computer is different than existing solutions because our flow computer will run on most Debian Linux-based systems, whereas conventional flow computers are tied to a specific type of custom hardware. This means that you can scale our system by adding hardware, and hardware can be purchased from a variety of vendors, which matters in today's world where component shortages are rampant.
In any effort to provide a better answer to the question of how many flow runs we can support on a single piece of hardware, we've tested a system where we add runs to see how execution times are affected. All tests are run with the following standard configuration, except where noted.
Raspberry Pi 4 hardware with 2 GBytes of RAM.
PLC Shift Gas Flow app with configuration version 1.3.
All gas flow runs are configured to use the AGA-3 2013 algorithm.
All gas flow runs are configured to use the AGA-8 1994 compressibility algorithm, except in a few tests as noted below.
All flow data (events, alarms, configuration, minute, hour, and day) is exported to Azure table storage.
Gas flow applications are configured to poll a simulated Schneider Electric 4102 multivariable sensor (MVS) directly using the Modbus TCP protocol.
Resource usage is monitored using the "htop" program.
Raspberry Pi is not just a toy for hobbyists. Many companies are making industrial computers out of Raspberry Pi compute modules, including:
Base System
The same table is used for all tests:
Run Count is the number of active gas flow runs.
CPU (%) is the CPU utilization by the PLC Shift runtime as seen in htop.
RAM (%) is the amount of RAM consumed by the PLC Shift process as seen in htop. The test Pi has 2 GBytes of RAM.
Manager Connected indicates whether the PLC Shift Manager is connected. When the manager is connected, tag data is constantly synchronized with the manager, and there is a noticeable increase in CPU utilization. The PLC Shift Manager is not expected to be connected during normal operations.
Exec Time (ms) is the execution time for all applications and is pulled from the Total Execution Time Average (Minute) status parameter at the device level. This is the time it takes for all applications to execute their run loop. Apps are executed sequentially. Data export is a background task and does not interfere with the execution of applications.
Run Count | CPU (%) | RAM (%) | Manager Connected | Exec Time (ms) | Notes |
0 | N/A | N/A | No | N/A | PLC Shift runtime not installed |
PLC Shift Runtime
Run Count | CPU (%) | RAM (%) | Manager Connected | Exec Time (ms) | Notes |
0 | 1.2 | 2 | No | N/A | PLC Shift runtime installed |
One Flow Run, Manager Connected
Run Count | CPU (%) | RAM (%) | Manager Connected | Exec Time (ms) | Notes |
1 | 5.2 | 5.5 | Yes | 3.51 | |
One Flow Run
Significant drop in CPU usage when PLC Shift Manager is not connected.
Run Count | CPU (%) | RAM (%) | Manager Connected | Exec Time (ms) | Notes |
1 | 2.0 | 6.2 | No | 3.513 |
One Flow Run, AGA-8 2017 Part 2 (GERG) Compressibility
CPU and RAM usage is stable, but execution time has increased by 10 ms. GERG is algorithmically complex, and the PLC Shift Gas Flow computer executes the compressibility calculation once per second for maximum accuracy.
Run Count | CPU (%) | RAM (%) | Manager Connected | Exec Time (ms) | Notes |
1 | 2.6 | 5.6 | No | 12.87 | AGA-8 2017 Part 2 (GERG) |
Two Flow Runs
Going from one run to two, execution time increases by about 3 ms, 0.5% increase in CPU usage, no change in RAM.
Run Count | CPU (%) | RAM (%) | Manager Connected | Exec Time (ms) | Notes |
2 | 2.6 | 6.2 | No | 5.94 | |
Two Flow Runs, AGA-8 2017 Part 2 (GERG) Compressibility
Going from one run to two with GERG enabled, execution time increases by about 10 ms, 0.6% increase in CPU usage, no change in RAM. Executing a run with GERG enabled consistently takes about 10 ms, whereas a run with AGA-8 1994 enabled takes about 3 ms to execute. GERG is 3x slower.
| | | | | |
2 | 3.3 | 5.9 | No | 24.20 | AGA-8 2017 Part 2 (GERG) |
Eight Flow Runs
Total execution time is 20 ms for 8 runs, or around 2.5 ms per run.
Run Count | CPU (%) | RAM (%) | Manager Connected | Exec Time (ms) | Notes |
8 | 6.6 | 7.2 | No | 20.3 | |
Sixteen Flow Runs
Total execution time is 43 ms for 16 runs, or around 2.7 ms per run.
Run Count | CPU (%) | RAM (%) | Manager Connected | Exec Time (ms) | Notes |
16 | 9.2 | 7.8 | No | 43.5 | |
Thirty-Two Flow Runs
Total execution time is 80 ms for 32 runs, or around 2.7 ms per run.
Run Count | CPU (%) | RAM (%) | Manager Connected | Exec Time (ms) | Notes |
32 | 11.3 | 9.9 | No | 85.6 | |
Desktop Computer
The execution time for a single run on a desktop computer with an AMD 3900X processor and 32 GBytes of RAM is about 0.4 ms, or about 6 times faster than on a Rasberry Pi 4. With GREG enabled, the execution time is about 1.2 ms, which is around 3x slower than AGA-8 1994, and about 8 times faster than a Rasberry Pi.
The execution time for 32 runs on the same desktop computer is 8.1 ms, or around 10x faster than the Raspberry Pi 4.
By moving from ARM to a powerful x86 desktop processor, execution times can be greatly reduced, which means that the real answer to, "How many runs can you do", is "What type of hardware do you have?". This is not a simple answer with a single number like other flow computers, but it gives you, the user, the flexibility to tune your system as needed for whatever comes up.
Conclusion
It's possible to configure a PLC Shift system such that there as many gas flow runs as you need by choosing different types of hardware. If you only need a few runs, save money by using a low-cost ARM computer. If you need many runs, use a desktop-class processor.
Comments