The present invention relates to a method for controlling a power source (9) at a rock drilling apparatus, said power source (9) being arranged to drive at least a first load (8,10,15) at the rock drilling apparatus, wherein said first load (8,10,15), in operation, provides power to a first consumer (11,21), and where the power that can be delivered by- said first load (8,10,15) depends on the rotation speed of the power source. The method includes, by means of a representation of said first consumer (11,21), determining a power demand of said first consumer (11,21), and based on said determined power demand, determine a rotation speed demand of said first load (8,10,15). The rotation speed of said power source is then controlled based at least on said determined rotation speed demand of said first load (8, 10, 15 ). The invention also relates to a system and a rock drilling apparatus.