The famous SPG30 with additional magnetic quadrature encoder at the rear shaft, SPG30 is 1.1W DC brushed motor with compact size, a low cost solution for projects such as medium size robot, omni drive robot, mechanism, etc.
This model of SPG30 brushed motor comes with 60:1 gearbox attached. The gearbox output shaft is a D-shaped with 15.5mm long and 6mm in diameter.
For mounting, the depth of the thread of the motor is 3.2 mm. So, you need to use 3.2 mm length of M3 size screw (not included with the thickness of the bracket). Longer screw will damage the gear box. You may need to consider the thickness of the bracket or other mechanism that you need to attach to the motor for choosing the right length of screw.
Resolution of the encoder output:
You may need:
Please checkout the tutorial here.- Sample control using PIC18F4431 (with Quadrature Encoder input)