In this paper a 3D CFD model of a three-port pilot valve for the displacement control of positive displacement pumps is presented. The model considers the spool radial clearance and the fillet radii of the metering edges. The valve was tested with imposed positions of the spool for measuring the modulated pressure and the control flow. The spool position was measured by means of a high accuracy contactless transducer. The model was used to determine the relationship between the valve discharge coefficients and the flow number. It was also found that cavitation occurs, leading to a reduction of the discharge coefficient. The developed 3D model can be used for tuning a 0D model of a pump displacement control.