This paper aims to research the position control of the hydraulic cylinder controlled by the high-speed on-off valve to realise the precise position control. The flow characteristic of the research on the relationship between the duty ratio and the average flow is researched. The mathematical model of the hydraulic cylinder is analysed and simulated with MATLAB/Simulink using the bulk-cavity-node method, and the compound algorithm of PD and speed feedforward-displacement feedback with the pulse width modulation (PWM) control is put forwarded. The position control of different control parameters is researched and the genetic algorithm is used to tune the control parameters. The hydraulic loop is set up to verify the simulation result with the optimised control parameters on the FESTO platform. The design methodology and control algorithm can be applied to other hydraulic system with position control requirement.