Systems and methods for calibration of a shaft of a surgical tool are provided. The tool includes an elongate shaft configured to be coupled to an electromechanical arm of a robotic surgical system and having an end effector coupled to a distal end thereof, the shaft being rotatable about its longitudinal axis. The tool also includes at least one target associated with the shaft and configured to be non-independently movable with respect to the shaft, wherein a position of the target is detected using at least one sensor disposed such that the shaft is able to move independently of the sensor. The detected position is used to determine a rotational angle of the shaft. This can involve accessing a memory on the tool or the system storing values related to a target position in association with corresponding values of a shaft rotation angle.