Self-calibration of a Cross Grid Encoder