An agricultural machine comprising: a chassis; a sprayer boom assembly with a center frame mounted for vertical movement on the chassis and laterally extendable right and left foldable and unfoldable booms (22, 24) connected to the center frame, each right and left boom (22, 24) comprising one or more boom sections (26, 28, 30, 32), wherein the right or left booms (22, 24) are foldable or unfoldable in vertical direction; a sprayer boom controller comprising predetermined positioning data of the sprayer boom assembly; a first identification system mounted on the agricultural machine at a determinable position to transmit a predefined frequency radio signal at a first point in time; a second identification system mounted on the right boom and a third identification system mounted on the left boom to receive said radio signal transmitted from the first identification system at a second point in time and at a third point in time, respectively; an integrated identification system controller to calculate actual distances between the first and second identification systems (34, 38) and the first and third identification systems (34, 40) based on the wavelength of the radio signal and the differences of the first and second points in time and the first and third points in time respectively; wherein, an information from the integrated identification system controller regarding the actual distances is transmitted to the sprayer boom controller; characterized in that, the sprayer boom controller is configured to compare the calculated actual distance values with the predetermined positioning data; wherein, the predetermined positioning data comprises reference distance values between the first and second identification systems (34, 38) and the first and third identification systems (34, 40) for discrete folding and unfolding positions of the right and left booms (22, 24); wherein, the sprayer boom controller is configured to stop folding and/or unfolding in case of exceeding or underrunning a tolerance value between the calculated actual distance and the reference distance values. a chassis; a sprayer boom assembly with a center frame mounted for vertical movement on the chassis and laterally extendable right and left foldable and unfoldable booms (22, 24) connected to the center frame, each right and left boom (22, 24) comprising one or more boom sections (26, 28, 30, 32), wherein the right or left booms (22, 24) are foldable or unfoldable in vertical direction; a sprayer boom controller comprising predetermined positioning data of the sprayer boom assembly; a first identification system mounted on the agricultural machine at a determinable position to transmit a predefined frequency radio signal at a first point in time; a second identification system mounted on the right boom and a third identification system mounted on the left boom to receive said radio signal transmitted from the first identification system at a second point in time and at a third point in time, respectively; an integrated identification system controller to calculate actual distances between the first and second identification systems (34, 38) and the first and third identification systems (34, 40) based on the wavelength of the radio signal and the differences of the first and second points in time and the first and third points in time respectively; wherein, an information from the integrated identification system controller regarding the actual distances is transmitted to the sprayer boom controller; characterized in that, the sprayer boom controller is configured to compare the calculated actual distance values with the predetermined positioning data; wherein, the predetermined positioning data comprises reference distance values between the first and second identification systems (34, 38) and the first and third identification systems (34, 40) for discrete folding and unfolding positions of the right and left booms (22, 24); wherein, the sprayer boom controller is configured to stop folding and/or unfolding in case of exceeding or underrunning a tolerance value between the calculated actual distance and the reference distance values.