An automatic calibration system for angular encoders