Detect wear by comparing coded value on tool with real value, grind tool