A method for the safe operation of a movable machine part, in particular a robot arm, preferably as part of a human-robot collaboration, wherein - a reference map comprising one or more map sections is provided, wherein the reference map relates to a stationary coordinate system and position information (X, Y, Z) of the environment of the movable machine part is stored in at least one map section, wherein a plurality of different reference maps are kept available, wherein the different reference maps are used for different work sequences and/or work positions of the movable machine part, - at least one distance measurement for a measurement point of an environmental object (24, 30, 32, 34, 36) is carried out with a distance sensor attached to the movable machine part, wherein the distance measurement determines a distance of the movable machine part from the measurement point, - the position of the measurement point in the stationary coordinate system is determined based on a position of the movable machine part, - the map section associated with the measurement point is determined based on the position of the measurement point if a plurality of map sections are present, - a comparison of the position of the measurement point with the position information (X, Y, Z) is made to determine whether the environmental object (24, 30, 32, 34, 36) lies outside a tolerance range with respect to the position information (X, Y, Z) of the environment, - the movable machine part is brought into a safe state when the environmental object (24, 30, 32, 34, 36) lies outside the tolerance range. - a reference map comprising one or more map sections is provided, wherein the reference map relates to a stationary coordinate system and position information (X, Y, Z) of the environment of the movable machine part is stored in at least one map section, wherein a plurality of different reference maps are kept available, wherein the different reference maps are used for different work sequences and/or work positions of the movable machine part, wherein a plurality of different reference maps are kept available, wherein the different reference maps are used for different work sequences and/or work positions of the movable machine part, - at least one distance measurement for a measurement point of an environmental object (24, 30, 32, 34, 36) is carried out with a distance sensor attached to the movable machine part, wherein the distance measurement determines a distance of the movable machine part from the measurement point, - the position of the measurement point in the stationary coordinate system is determined based on a position of the movable machine part, - the map section associated with the measurement point is determined based on the position of the measurement point if a plurality of map sections are present, - a comparison of the position of the measurement point with the position information (X, Y, Z) is made to determine whether the environmental object (24, 30, 32, 34, 36) lies outside a tolerance range with respect to the position information (X, Y, Z) of the environment, - the movable machine part is brought into a safe state when the environmental object (24, 30, 32, 34, 36) lies outside the tolerance range.