You need to check if your encoder outputs quadrature.If it's true, it will be easier and cheeper to buy a Granit device driver for that.

Sent from my SM-A705FN using Tapatalk