have a look here.

Need Encoder for threading