A system and a method for controlling a tool (30) pivotably mounted to an articulated boom (20) connected to a work machine (10) having a control unit (50), comprising determining the direction a predetermined point of the boom (20) or the tool (30) is moving to (i.e. the moving direction) and controlling orientation of the tool (30) as a function of one or several predetermined dependencies, the predetermined dependencies defining at least the orientation of the tool (30) in relation to the moving direction.