A method to control a fuel pump for a direct injection system of a heat engine provided with a common rail comprising the steps of: determining a minimum threshold (Q MIN, Q TEMP) of fuel to be fed by the high-pressure pump; calculating the objective fuel flow rate (M ref) to be fed by the high-pressure pump to the common rail instant by instant in order to have the desired pressure value (P TARGET) inside the common rail; comparing the objective fuel flow rate (M ref) with the minimum threshold (Q MIN, Q TEMP); and controlling the high-pressure pump based on the comparison between the objective fuel flow rate (M ref) and the minimum threshold (Q MIN, Q TEMP); the method is characterized in that the step of determining a minimum threshold (Q MIN, Q TEMP) comprises the sub-steps of: - determining a first contribution (Q MIN_COLD) and a second contribution (Q MIN_HOT) based on the pressure (P RAIL) in the common rail and on the speed (n) of the heat engine; wherein the first contribution (Q MIN_COLD) is the minimum threshold of fluid to be pumped under cold conditions that are far from the triggering of cavitation phenomena for given values of the pressure (P RAIL) in the common rail and of the speed (n) of the heat engine, and the second contribution (Q MIN_HOT) is the minimum threshold of fuel to be pumped under hot conditions that are close to the triggering of cavitation phenomena for given values of the pressure (P RAIL) in the common rail and of the speed (n) of the heat engine; - determining a coefficient based on the temperature (T PUMP) of the high-pressure pump and on the inlet pressure (P LOW) of the high-pressure pump; wherein said coefficient expresses the closeness of the high-pressure pump to the condition of triggering of cavitation phenomena; and - determining said minimum threshold (Q MIN, Q TEMP) based on the first contribution (Q MIN_COLD), on the second contribution (Q MIN_HOT) and on the coefficient. determining a minimum threshold (Q MIN, Q TEMP) of fuel to be fed by the high-pressure pump; calculating the objective fuel flow rate (M ref) to be fed by the high-pressure pump to the common rail instant by instant in order to have the desired pressure value (P TARGET) inside the common rail; comparing the objective fuel flow rate (M ref) with the minimum threshold (Q MIN, Q TEMP); and controlling the high-pressure pump based on the comparison between the objective fuel flow rate (M ref) and the minimum threshold (Q MIN, Q TEMP); the method is characterized in that the step of determining a minimum threshold (Q MIN, Q TEMP) comprises the sub-steps of: - determining a first contribution (Q MIN_COLD) and a second contribution (Q MIN_HOT) based on the pressure (P RAIL) in the common rail and on the speed (n) of the heat engine; wherein the first contribution (Q MIN_COLD) is the minimum threshold of fluid to be pumped under cold conditions that are far from the triggering of cavitation phenomena for given values of the pressure (P RAIL) in the common rail and of the speed (n) of the heat engine, and the second contribution (Q MIN_HOT) is the minimum threshold of fuel to be pumped under hot conditions that are close to the triggering of cavitation phenomena for given values of the pressure (P RAIL) in the common rail and of the speed (n) of the heat engine; - determining a coefficient based on the temperature (T PUMP) of the high-pressure pump and on the inlet pressure (P LOW) of the high-pressure pump; wherein said coefficient expresses the closeness of the high-pressure pump to the condition of triggering of cavitation phenomena; and - determining said minimum threshold (Q MIN, Q TEMP) based on the first contribution (Q MIN_COLD), on the second contribution (Q MIN_HOT) and on the coefficient. - determining a first contribution (Q MIN_COLD) and a second contribution (Q MIN_HOT) based on the pressure (P RAIL) in the common rail and on the speed (n) of the heat engine; wherein the first contribution (Q MIN_COLD) is the minimum threshold of fluid to be pumped under cold conditions that are far from the triggering of cavitation phenomena for given values of the pressure (P RAIL) in the common rail and of the speed (n) of the heat engine, and the second contribution (Q MIN_HOT) is the minimum threshold of fuel to be pumped under hot conditions that are close to the triggering of cavitation phenomena for given values of the pressure (P RAIL) in the common rail and of the speed (n) of the heat engine; - determining a coefficient based on the temperature (T PUMP) of the high-pressure pump and on the inlet pressure (P LOW) of the high-pressure pump; wherein said coefficient expresses the closeness of the high-pressure pump to the condition of triggering of cavitation phenomena; and - determining said minimum threshold (Q MIN, Q TEMP) based on the first contribution (Q MIN_COLD), on the second contribution (Q MIN_HOT) and on the coefficient.