I can probably provide some guidance on the HW encoder configuration. I'm also reading them without using the library I use to configure them. Actually quite simple to do, once they are set up.
Which I/O pins are all of your encoders going into?
Post #337 is the I/O map of my PCB. But that's before I realized I can't have both a HW and SW encoder on the same pin. So the first two columns are as wired on my PCB. I was thinking of swapping the Z DRO inputs with the X, since I could use Quad Encoder on pins 30 & 31.
But now I need to map some pins for the SW encoders to run my code. I haven't thought of a clean mapping from the SW encoders to the HW. The HW encoder library (as written) can't do the motor control function. Could it do it eventually, probably. At the moment, not a chance. Their paradigms are totally different.
For now, I want to run the encoders in parallel (somehow) for diagnostics. Just hoping the added burden doesn't impair the system. I have no idea what the root problem is. All I know is behaviorally is that the thread doesn't start at the same place every time. Exactly why, I don't know. Beyond that all I have is conjecture.
I have a timing pulse, that seems to vary. It used to be on the order of 1-2 encoder tick times. Now it seems to be much longer. That's not necessarily bad, but it's different. It now varies 1-5 encoder tick times. But even that variable delay is insufficient to cause the thread to shift as much as I see. One rev = ~ 150 ms. I'm seeing equivalent delays of 10-75ms, but 5 encoder tick times is only 182us.
It's as if my display routines are interfering, only they can be that long. But the display updates are low priority mainline routines. Display updates are bypassed during the critical sync time interval, for several rotations of the spindle. (300ms). (blank time is calculated based on the time for one revolution at the current RPM)