This paper presents and discusses the results of an ongoing R&D project aiming to design and build a fully automated prototype of a specialized spherical robotic welding system for repairing hydraulic turbine surfaces eroded by cavitation pitting and/or cracks produced by cyclic loading. The system has an embedded vision sensor built to acquire range images by laser scanning over the blade's surface and produce 3D models to locate the damaged spots to be registered in a 3D coordinate system into the robot controller, enabling the robot to repair the flaws automatically by welding in layers. The paper is focused on the robot kinematic model and describes an iterative algorithm to process the inverse kinematics with only five degrees-of-freedom. The algorithm makes use of data collected from a vision sensor to ensure that the welding gun axis is perpendicular to the blade's surface. Besides this, it proposes a modelling and optimization mathematical routine for more efficient robot calibration, which can be used with any type of robot. This robot calibration optimization scheme finds the optimal error parameter vector based on the condition number of the manipulator transformation composed from the partial derivatives of the error parameters. Experimental results proved both the iterative algorithm to perform the inverse kinematics and the technique to optimize robot calibration to be very efficient.