In this paper, a recently proposed single-solution memetic computing optimization method, namely three stage optimization memetic exploration (3SOME), is used to implement a self-tuning PID controller on board of a mobile robot. More specifically, the optimal PID parameters minimizing a measure of the following error on a path-following operation are found, in real-time, during the execution of the control loop. The proposed approach separates the control and the optimization tasks, and uses simple operating system primitives to share data. The system is able to react to modifications of the trajectory, thus endowing the robot with intelligent learning and self-configuration capabilities. A popular commercial robotic tool, i.e. the Lego Mindstorms robot, has been used for testing and implementing this system. Tests have been performed both in simulations and in a real Lego robot. Experimental results show that, compared to other online optimization techniques and to empiric PID tuning procedures, 3SOME guarantees a robust and efficient control behaviour, thus representing a valid alternative for self-tuning control systems.