Compensating for probe to workpiece spacing