A machine tool, production machine or robot, comprising a control device having a program memory, in which a computer program is stored which contains code sections to enable the control device when the code sections of the computer program are executed in the control device, to control movement of a machine axle in the event of contact between a machine element of a machine and an object, the machine having a slow and a fast displacement mode, by
- producing with the machine axle a relative movement between the machine element and the object,
- detecting contact between the machine element and the object,
- if the machine axle is moved automatically by a control device in fast displacement mode when making contact, preventing further movement of the machine axle by checking if damage to the machine can be adequately limited when braking with the drive alone, and if damage can be adequately limited, stopping the machine axle with the drive alone, or if damage cannot be adequately limited, using an additional brake to immediately stop the machine axle, or
- if the machine axle is moved automatically by the control device in slow displacement mode when making contact, identifying a collision and stopping further movement of the machine axle.