The present invention provides for a milking implement for automatically milking a dairy animal. The implement includes a measuring device for measuring a position of an object such as at least one of a displaceable element of the milking implement and a teat of the dairy animal, and a control device for controlling at least the measuring device. The control device is configured to take at least one measurement, using the measuring device, on at least one point on the object in order to obtain a position information regarding the object, compare the obtained position information with a known position information regarding the object, and calibrate the measuring device on the basis of the comparison between the obtained position information and the known position information.