**4. Conclusions**

A methodology was developed and implemented for the first time in the form of a web application to allow the monitoring of membrane separation processes online and in real time, making use of statistical techniques for treatment of process data. The proposed methodology comprises the following stages: (i) pre-treatment and characterization of process data; (ii) data reconciliation of process data to minimize measurement uncertainties, with the aid of mass balance equations; (iii) detection of systematic deviations for identification of process malfunctions; and (iv) observation of unmeasured variables (working as a soft sensor or digital twin). The pre-treatment and data characterization steps were fundamental for the understanding and correct formulation of the problem. The characterization step can find wide application, as this procedure can be applied in any chemical process. This step is essential for the appropriate selection of data reconciliation techniques and gross error detection procedures. After that, the proposed data reconciliation and gross error detection steps showed robustness, good performance, and speed. The proposed scheme was based on detailed steady-state balance equations, validated after proper characterization of actual operation data. The numerical procedures were validated offline and then implemented online and in real time for the first time, allowing the successful identification of measurement biases and outliers and providing estimates for unmeasured data. The developed procedures can be used for online and real-time detection of process faults and process diagnosing. In addition, the procedure provides reliable data for future stages of simulations and parameter estimation, allowing the implementation of digital twins, as the model proposed in part I of this research project. Production Management System and Enterprise Resource Planning steps can also benefit from availability of more reliable data, and variables inferred by a soft sensor. Therefore, the main advantages of the procedure are reliable data handling, diagnosis of gross errors/failures, and real-time monitoring of the process.

**Author Contributions:** D.Q.F.d.M.: Conceptualization, Methodology, Software, Validation, Data curation, Writing—original draft, Writing—review and editing; M.C.C.d.S.: Software, Validation, Formal analysis; T.B.F.: Software, Validation, Formal analysis; T.K.A.: Resources and Funding acquisition; F.C.D.: Resources and Funding acquisition; P.H.T.: Resources and Funding acquisition; J.C.P.: Supervision, Project administration, Writing—review and editing. All authors have read and agreed to the published version of the manuscript.

**Funding:** This work was supported by the Petróleo Brasileiro SA (Petrobras); Conselho Nacional de Desenvolvimento Científico e Tecnológico (CNPq) and Coordenação de Aperfeiçoamento de Pessoal de Nível Superior (CAPES).

**Acknowledgments:** The authors thank Petrobras, CNPq, and CAPES for the financial support to this work, as well as for covering the costs to publish in open access.

**Conflicts of Interest:** The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.
