In the paper, a robust control algorithm is proposed for the speed control of a pump-controlled motor system. The controller consists of two parts, an optimal part and an auxiliary part. The optimal part is used to specify the characteristics of the whole system, and the auxiliary part is used to cope with the uncertainties of the system dynamics. The control algorithm is written in Turbo C and implemented on a personal computer. A series of simulations and experiments are performed, and the results show that the control performance is satisfactory and can be maintained under changes of pump speed and load inertia. The results also indicate that the proposed control scheme is robust to the external torque disturbance.