I am using dc brush motor of IG32E-05K Planetary DC Geared Motor which having a built in encoder.
1)
Since the encoder input of the IFC dual brush motor card is only support for single channel,
And I need two channel (channel A and channel B) to get the direction and position of the motor,
I can't use the IFC card encoder input,
Thus, I am thinking to connect encoder channel A to encoder input 1 (for the external pull up purpose only) and
connect encoder channel B to encoder input 2 (for the pull up also)'
then connect channel A directly to the RB0 (at the IFC brain board) and channel B directly to the RB1.
I will disconnect the LED resistor from pin RB0 and RB1 from PIC on the brain board.
This setup is so that I can use RB0 and RB1 as interrupt input to keep track on the position of the motor.
Do you think this will work?
2)
Will the encoder output suffer bouncing? Is it an mechanical encoder? Do I need debouching in the software?
3)
I will use interrupt to monitor both the raising edge and falling edge of channel A,
Then at each interrupt will check the level if channel B to know the direction of the motor,
And will counting on the pulse, will know the position of the motor.
Any comment on this algo plan?
Any improvement need? Is this algo creep prove enough?
Or I should monitor the raising and falling edge of channel B as well? and then use the XOR algorithm? will this better compared to my suggested algo?
Pls advise and thanks.