Research on Floating Point Accumulation Based on Improved Kahan Algorithm - Wang, Chunling (Manufacturing Technology Journal, 2023)
In the actual factory production, there are often cases of liquid flow accumulation, and most of the controllers used in the project are PLC. Usually, the flow meter is used to measure the instantaneous flow, and then the analog (4-20mA) signal is transmitted to the PLC, and the PLC accumulates the cumulative flow within a certain period of time according to the instantaneous flow transmitted by the flow meter. Due to the floating point type of PLC, the direct accumulation will not reach the accuracy standard, and the cumulative error will occur. In order to eliminate the cumulative error, this paper proposes an improved algorithm based on Kahan 's algorithm. The improved algorithm greatly reduces the error of the cumulative flow than the original Kahan algorithm. The reduction of error is of great significance to the data analysis and production calculation of liquid or solid flow in the field of process industry control.
Keywords: Traffic accumulation; Kahan algorithm; pLC; Floating point number calculation; Reduce error