A position detecting device in which a count value is incremented or decremented
on the basis of a pulse output from an encoder every predetermined shift amount
of a control target to thereby detect a current value representing a current position
of the control target as the count value, is characterized by comprising: initialization
signal output means for outputting an initialization signal representing an initialization
position at plural positions of a movable range of the control target when the
movable range of the control target is restricted, or at plural positions of an
operating range of integer times of a period when the movable range of the control
target is not restricted and the same state is repeated at the period concerned;
current value storing means for storing, in association with identification information
for identifying each initialization signal, the current value of the control target
at each position where the initialization signal is output by each initialization
signal output means; and count value setting means for moving the control target
to a position where some initialization signal is output from the initialization
signal output means at the initialization time of the count value, and achieving
the current value corresponding to identification information for identifying the
initialization signal from the current value storage means, and setting the current
value thus achieved as the count value.