Variable displacement axial piston units are the core components of many hydrostatic and hydraulic hybrid drive trains. Therein, the fast and accurate control of the swash plate angle, utilizing the full possible dynamics of the displacement system, is essential for a good performance of the overall drive train. This paper describes the development, implementation and the experimental validation of a control strategy for the swash plate angle based on nonlinear model predictive control (NMPC). A tailored mathematical model, which serves as the basis for the NMPC, is described in the first part of the paper. Two versions of NMPC, an indirect and a direct method, are compared with respect to their numerical complexity and their capability of handling input and state constraints. An observer strategy, which is designed to obtain the non-measurable states and varying parameters of the system, completes the overall control strategy. To reduce the negative influence of stick-slip friction, the concept of dithering is applied in the experimental implementation. The differences of the NMPC methods are analyzed by simulation studies and experiments. Finally, the experimental results, using an industrial electronic control unit (ECU), prove the practical feasibility and the improved control accuracy and robustness in comparison to classical (nonlinear) control strategies.