This paper presents a method for robot self-recognition and self-adaptation through the analysis of the contact between the robot end effector and its surrounding environment. Often, in off-line robot programming, the idealized robotic environment (the virtual one) does not reflect accurately the real one. In this situation, we are in the presence of a partially unknown environment (PUE). Thus, robotic systems must have some degree of autonomy to overcome this situation, especially when contact exists. The proposed force/motion control system has an external control loop based on forces and torques exerted on the robot end effector and an internal control loop based on robot motion. The external control loop is tested with an optimal proportional integrative (PI) and a fuzzy-PI controller. The system performance is validated with real-world experiments involving contact in PUEs.