The encoder includes a scale including first and second periodic patterns, and a detector relatively movable with respect to the scale and whose detection state is switchable between a first detection state to read the first periodic pattern and output a first signal and a second detection state to read the second periodic pattern and output a second signal. A processor performs a first process to detect a first absolute position by using the first and second signals and then performs a second process to calculate a relative movement amount by using a specific signal that is one of the first and second signals and detect a second absolute position by using the relative movement amount and the first absolute position. The specific signal is obtained from the detector set in a same detection state as that set last in the first process.
展开▼