a method for controlling operation of a pump unit , where the pump unit includes a primary piston pump having a primary piston and a secondary piston pump having a secondary piston . the primary piston pump is fluidically connected with the secondary piston pump . the primary piston pump includes an inlet valve and an outlet valve , and the pump unit operates periodically according to a pump cycle . the method includes determining a fluid pressure of fluid dispensed by the pump unit , and performing a closed loop control of a position of the primary piston in dependence on the fluid pressure of the fluid dispensed by the pump unit during a first time interval of the pump cycle .