Though efficient, precise and generally reliable, CNC can go wrong. Errors can occur, and sometimes they can badly damage not just the material, but the CNC tool and machine. The piece or the machine can be incorrectly placed, causing a crash where the tools break. Incorrect code or other factors can contribute.
Linear, rotary and angle encoders can be used with servo motors and other systems to minimize errors by checking the machine is moving as expected. Moreover, industrial closed loop machines significantly reduce errors as the control always knows the axis position.

