Faults in hardware and software are not totally avoidable not even if the components are carefully designed, implemented and tested. In this paper we present a solution for detection, localization and repair of faults in the control software for autonomous mobile robots. The presented diagnosis system uses model-based diagnosis for fault detection and localization. Furthermore, we present a method which enables the robot control software to recover from located faults. The novelty of our approach is that fault localization and repair takes place at runtime. Moreover, we present experimental results of the proposed diagnosis system obtained in the RoboCup Middle-Size scenario.