The Basrah Refinery, Iraq, similarly to other refineries, is subject to several industrial constraints. Therefore, the main challenge is to optimize the parameters of the level controller of the process unit tanks. In this paper, a PI controller is designed for these important processes in the Basrah Refinery, which is a separator drum (D5204). Furthermore, the improvement of the PI controller is achieved under several constraints, such as the inlet liquid flow rate to tank (m2) and valve opening in yi%, by using two different techniques: the first one is conducted using a closed-Loop PID auto-tuner that is based on a frequency system estimator, and the other one is via the reinforcement learning approach (RL). RL is employed through two approaches: the first is calculating the optimal PI parameters as an offline tuner, and the second is using RL as an online tuner to optimize the PI parameters. In this case, the RL system works as a PI-like controller of RD5204. The mathematical model of the RD5204 system is derived and simulated using MATLAB. Several experiments are designed to validate the proposed controller. Further, the performance of the proposed system is evaluated under several industrial constraints, such as disturbances and noise, in which the results indict that RL as a tuner for the parameters of the PI controller is superior to other methods. Furthermore, using RL as a PI-like controller increases the controller’s robustness against uncertainty and perturbations.