# Identification, Control, and Characterization of Peristaltic Pumps in Hemodialysis Machines
## 3 Analysis of Results
### Control System  
In this study, a P.I. controller was tuned based on experimental data obtained from a physical plant subjected to a unit step input. From the samples collected, the first-order transfer function characteristic of the system was identified, which describes the dynamics of the proposed plant. This mathematical model was validated using different error optimization methods, which allowed a precise evaluation of the model fidelity with respect to the experimental data. The error calculation methods used for model validation included IAE, ISE, ITAE, and ITSE. These performance metrics provided a comprehensive assessment of the fit between the simulated response of the modeled system and the actual data obtained from the physical plant. The integration of these metrics helped to identify and validate the magnitude of the system error. The validation results indicated an excellent approximation between the response of the proposed first-order system and the sampled data, with a residual error close to zero. This result highlights the accuracy of the first-order model in capturing the dynamics of the system, suggesting that it is an optimal representation for the analysis and design of control strategies. The low magnitude of the accumulated error over time validates the robustness of the applied methodological approach and supports using the modeled plant as a basis for controller development. The frequency analysis of the system was performed using a Bode diagram, which allows an evaluation of the system's dynamic behavior in the frequency domain. The Bode diagram showed a decreasing magnitude at high frequencies and a phase indicating system stability within the desired operating range. Based on these results, it was determined that implementing a P.I. controller would be the optimal alternative for system control. The P.I. controller was chosen for its ability to correct steady-state errors without compromising system robustness while significantly improving stability and effective disturbance rejection. The tuning of the P.I. controller was carried out, taking into account the plant characteristics identified by the Bode analysis and the MATLAB tool, ensuring optimal performance under the established operating conditions. The automatic optimization technique provided by MATLAB's PID Tuner tool was used to tune the P.I. controller. This automatic tuning tool efficiently adjusted the controller parameters (\(k_{p}\) and \(k_{i}\)) to optimize the control system's performance under the specified operating conditions. The parameters obtained through this technique were then applied to the physical plant to verify its performance in a real experimental environment. The experimental results confirmed the effectiveness of the automatic tuning and demonstrated excellent system behavior under P.I. control. Figure 6 shows the steady-state behavior of the pump under P.I. control at a setpoint of 61.57 RPM. The system exhibits symmetrical deviations of approximately \(\pm 2\) RPM due to the compression and release mechanism of the rollers. Positive deviations occur when a roller stops applying pressure to the hose (yellow dashed circle), while negative deviations are generated when the roller applies pressure to restart the process (blue dashed circle). These fluctuations are controlled by the system to maintain stability. The green dashed circle indicates the center of the deviations, where all the rollers exert pressure on the hose and maintain a constant speed close to the setpoint. The red dashed circle marks the moments when the controller manages to reduce the negative deviations. Considering all the tests carried out for the characterization, as shown in Table 2, the RMSE of the speed deviations concerning the setpoint is calculated, which gives a value of 1.687 RPM. Figure 6: PI control in steady state applied to a peristaltic pump. **Caption:** Variations in pump behavior under P.I. control at a setpoint of 61.57 RPM.