Position error compensation as function of speed to compensate detection delay