A position-sensing system magnetically senses the position of a piston rod
moving with respect to a cylinder. A magnetically hard layer on the
piston rod provides a recording medium. Information is magnetically
recorded in regions of the magnetically hard layer. These regions provide
a relative encoding scheme for determining the position of the piston
rod. Magnetic-field sensors are positioned over redundant tracks of
magnetically recorded regions. Each magnetic-field sensor positioned over
a given track senses the same magnetized regions while the piston rod
moves with respect to the cylinder. Other magnetic-field sensors can
sense ambient fields for use in performing common-mode rejection. A write
head can dynamically repair damaged or erased regions detected by the
magnetic-field sensors. Energized by a battery-backup power source, the
magnetic-field sensors and associated circuitry can continue to track
movement of the piston rod when the machinery is off.