In this work the application of response surface methodology (RSM) to proportional-integral-derivative (PID) controller parameter tuning for electrocoagulation (EC) treatment of pulp and paper mill wastewater was researched. Dynamic data for two controlled variables (pH and electrical conductivity) were obtained under pseudo random binary sequence (PRBS) input signals applied to manipulated variables (acid and supporting electrolyte flow rates). Third order plus time delay model parameters were evaluated through System Identification Toolbox™ in MATLAB®. Four level full factorial design was applied to form a design matrix for three controller tuning parameters as factors and to evaluate statistical analysis of the system in terms of integral of square error (ISE), integral of absolute error (IAE), integral of time square error (ITSE) and integral of time absolute error (ITAE) performance criteria as response. Numerical values of the responses for the runs in the design matrices were determined using closed-loop PID control system simulations designed in Simulink®. Optimum proportional gain, integral action and derivative action values for electrical conductivity control were found to be 1,500 s, 0 s and 16.4636 s respectively. Accordingly, the same optimization scheme was followed for pH control and optimum controller parameters were found to be −8.6970 s, 0.0211 s and 50 s, respectively. Theoretically optimized controller parameters were applied to batch experimental studies. Chemical oxygen demand (COD) removal efficiency and energy consumption of pulp and paper mill wastewater treatment by EC under controlled action of pH at 5.5 and electrical conductivity at 2.72 mS/cm was found to be 85% and 3.87 kWh/m3 respectively. Results showed that multi input–multi output (MIMO) control action increased removal efficiency of COD by 15.41% and reduced energy consumption by 6.52% in comparison with treatment under uncontrolled conditions.