Improving the geometric accuracy of the deposited component is essential for the wider adoption of wire arc additive manufacturing (WAAM) in industries. This paper introduces an online layer-by-layer controller that operates robustly under various welding conditions to improve the deposition accuracy of the WAAM process. Two control strategies are proposed and evaluated in this work: A PID algorithm and a multi-input multi-output model-predictive control (MPC) algorithm. After each layer of deposition, the deposited geometry is measured using a laser scanner. These measurements are compared against the CAD model, and geometric errors are then compensated by the controller, which generates a new set of welding parameters for the next layer. The MPC algorithm, combined with a linear autoregressive (ARX) modelling process, updates welding parameters between successive layers by minimizing a cost function based on sequences of input variables and predicted responses. Weighting coefficients of the ARX model are trained iteratively throughout the manufacturing process. The performance of the designed control architecture is investigated through both simulation and experiments. Results show that the real-time control performance is improved by increasing the complexity of implemented control algorithm: controlled geometric fluctuations in the test component were reduced by 200% whilst maintaining fluctuations within a 3 mm limit under various welding conditions. In addition, the adaptiveness of designed control strategy is verified by accurately controlling the fabrication of a part with complex geometry.