A method for determination of at least one reference value of speed for a module, comprising an automated processor, the module controlling a speed of a vehicle, based on the at least one reference value of speed, wherein said at least one reference value of speed may differ from a value of speed corresponding to a set speed indicated by a driver of the vehicle, the method comprising: - acquiring, by the module, the set speed indicated by the driver; - making (C1; C3), by the module, a first prediction and a second prediction of a speed of the vehicle along a horizon, said first prediction being based on an engine torque which retards the speed of the vehicle when compared with the speed of the vehicle when the reference value of speed equals the set speed indicated by the driver, and said second prediction being based on an engine torque which increases the speed of the vehicle when compared with the speed of the vehicle when the reference value of speed equals the set speed indicated by the driver; - comparing (C2; C4) said first prediction, and said second prediction respectively, with a lower limit value and/or an upper limit value, wherein the lower limit and the upper limit values delineate a speed range within which the speed of the vehicle is maintained; - determining the at least one reference value of speed, based on at least one of said comparisons and said first prediction and second prediction of the speed of the vehicle along the horizon, so that the set speed indicated by the driver is within said speed range bounded by the lower and upper limit values; and - outputting, from the module, the at least one reference value of speed to an engine system of the vehicle for control of the engine of the vehicle, wherein said comparison assesses whether said first prediction and said second prediction of the vehicle speed fulfil at least one of the following criteria: said second prediction is below or equal to said upper limit value; and said first prediction is above or equal to said lower limit value. - acquiring, by the module, the set speed indicated by the driver; - making (C1; C3), by the module, a first prediction and a second prediction of a speed of the vehicle along a horizon, said first prediction being based on an engine torque which retards the speed of the vehicle when compared with the speed of the vehicle when the reference value of speed equals the set speed indicated by the driver, and said second prediction being based on an engine torque which increases the speed of the vehicle when compared with the speed of the vehicle when the reference value of speed equals the set speed indicated by the driver; - comparing (C2; C4) said first prediction, and said second prediction respectively, with a lower limit value and/or an upper limit value, wherein the lower limit and the upper limit values delineate a speed range within which the speed of the vehicle is maintained; - determining the at least one reference value of speed, based on at least one of said comparisons and said first prediction and second prediction of the speed of the vehicle along the horizon, so that the set speed indicated by the driver is within said speed range bounded by the lower and upper limit values; and - outputting, from the module, the at least one reference value of speed to an engine system of the vehicle for control of the engine of the vehicle, wherein said comparison assesses whether said first prediction and said second prediction of the vehicle speed fulfil at least one of the following criteria: said second prediction is below or equal to said upper limit value; and said first prediction is above or equal to said lower limit value.