Efficient system able to automatically regulate the distance of the cutting head from the piece being processed and stop it in the case of collision