Thinking about my comments more, it may be matter of a distinction without difference. I think what both @UKHeliBob and I are saying is that you could use the encoder pulses to drive an up / down count. Say Right Encoder counts up and Left Encoder counts down. So, the counter’s value is always the difference in pulse count. I was hung up thinking that the suggestion was to count pulses from both encoders then subtract them. No need for that, up / down is fine. The PID then works to drive that delta to zero:
i think is a case where the I term is needed to maintain a non-zero output when the error is zero
Exactly, the (I)ntegral term allows the controller to have a non-zero output even when the error input is zero.
