Controlling waterpump speed