Now we'll add encoding capabilities to the servo so it can report it's incremental or/and absolute position. I'll be using AS5040 - 10-bit Absolute Programmable Magnetic Rotary Encoder with Incremental, SSI, and PWM Output from ams (ex- austriamicrosystems and TAOS) with incremental mode on, but if you care to re-program the device, it can feed you step/dir data. And if you modify PCB you can also use absolute position (that can be read through SPI as well as PWM/analog output).
What you'll need: