A controller (134) for detecting an unwanted object (112) in an agricultural machine, wherein the agricultural machine includes a pair of rollers (102, 104) for receiving crop material (108) therebetween, the pair of rollers (102, 104) defining a variable roller opening (106) therebetween, wherein the controller (134) is configured to: receive a roller-opening-value (128) that is representative of the size of the roller opening (108); determine a strength-value based on the roller-opening-value (128) and a roller- speed-value (132), wherein the roller-speed-value (132) is representative of the rate of change of the roller-opening-value (128), with respect to time; compare the strength- value with a threshold-value (340, 342, 344, 346); and if the strength-value exceeds the threshold-value, then provide an output signal (136) that is indicative of an unwanted object (112) being detected.