Machine for washing and/or sterilizing loose products comprising a treatment chamber (12) provided with at least one functional loading and/or unloading aperture and containing a rotating drum (16) provided with a plurality of angular compartments (32). The machine comprises at least one drum actuation element (85), provided with a drive shaft (90), configured to make the rotating drum (16) rotate around an axis of rotation (X), at least one automatic angular detection unit (15) configured to supply a reference signal relating to a predefined reference angular position of a predefined angular compartment (32) of the rotating drum (16) in relation to the position of the functional loading and/or unloading aperture, at least one control unit (98) configured to communicate with the automatic angular detection unit (15) and to command the drum actuation element (85), so as to make the rotating drum (16) rotate to search for the predefined reference position of the rotating drum (16) and dispose the rotating drum (16) in the predefined reference position.