In this paper, a hybrid position/force controller for electrohydraulic servo-actuators is designed in the presence of residual dynamics. The purpose is to apply a cycle of movement that is mostly used in industrial fatigue test applications, which consists in imposing a specified force on a flexible load after a movement to some position. This cycle can be repeated several times with different magnitudes and frequencies of force and position trajectories. Some damages could occur at switching times, especially in the presence of some residual dynamics. To avoid any damages at switching times, a force trajectory generator is designed. Then, our contribution defines a method to automatically generate the switching signal in order to commute between two controllers with any abrupt change of state. To show the effectiveness of the proposed approach, several simulation tests are carried out on the electrohydraulic system.