This paper addresses the system identification and the decoupling PI controller design for a normal conducting RF cavity.Based on the open-loop measurement data of an SNS DTL cavity, the open-loop system's bandwidths and loop time delays are estimated by using batched least square. With the identified system, a PI controller is designed in such a way that it suppresses the time varying klystron droop and decouples the In-phase and Quadrature of the cavity field. The Levenberg-Marquardt algorithm is applied for nonlinear least squares to obtain the optimal PI controller parameters. The tuned PI controller gains are downloaded to the low-level RF system by using channel access. The experiment of the closed-loop system is performed and the performance is investigated. The proposed tuning method is running automatically in real time interface between a host computer with controller hardware through ActiveX Channel Access.Index Terms-Capacitor bank droop, high voltage power supply ripple, least square, Levenberg-Marquardt algorithm, normal conducting RF cavity, operating point, PI feedback control, spallation neutron source, system identification.