The invention refers to a controller for a work machine, comprising a first control module configured to perform a first control for a steering device to change a steering angle based on a travel route, and a second control module configured to perform a second control on a speed of a traveling device when the steering angle is equal to or above a threshold value, wherein the first control module prioritizes and performs the first control over the second control to be performed by the second control module. Further, a work machine and a method for controlling a work machine are provided.