edge detection sensor calibration