In this paper is presented the integration of diverse modules for people fallen detection by a mobile service robot. This integration has been achieved in the middleware ROS (Robotics Operation System). The proposed implementation are arranged over an modular architecture of three layers: Hardware, Processing and Decision. The modules implemented are on the processing layer. The first module uses an RGB-D camera to detect and track a person in the environment. This module calculate features to detect the fallen pose. In the second module, a PID controller in a pan/tilt unit is used, in order to track the person with a minimum error and soft movement. For this purpose the centroid of the person is located at the center of the plane image. The main characteristics in our architecture are: 1) Segmentation in depth is used, because 3D information is required for detecting the fallen pose; 2) The parameters of PID control are tuned using a manual method and a genetic algorithm, to compare and improve the performance of the tracking person module. Once the PID controller was optimized, the architecture to follow the person and detect the fallen pose, is probed in real time.