Replies
Welcome, guest
Join CrazyEngineers to reply, ask questions, and participate in conversations.
CrazyEngineers powered by Jatra Community Platform
-
@reachrkata-FOcqhH • Jun 27, 2008
Re: Encoder data: How to interpret encoder data from a motor going into the PIC16F877
An Encoder normally works like this.
1) Channel A is connected to a processor interrupt for LOW->HIGH transition.
2) When the interrupt is detected, the status of Channel B is read. If Channel B is LOW, this means that the encoder was turned one step in Clockwise. If Channel B is High, then the encoder was turned one step anticlockwise.
3) You can maintain a counter variable which counts +1 for each clockwise and -1 for each anticlockwise.
4) In the case of IE2-512, there are 512 encoder steps in 1 turn (360deg) of the encoder.
I hope this clarifies eveything.
-Karthik
😁 -
@el3ktr1k-Tt5S33 • Jun 28, 2008
Re: Encoder data: How to interpret encoder data from a motor going into the PIC16F877
Is the encoder continuously sending data and I just have to chose a time period when to sample the data or is the data sent at specified time intervals? If I have to chose the time interval that I'm counting the steps, do I use TMR1 to let me know how much time has passed? Thank you for your help. -
@reachrkata-FOcqhH • Jul 2, 2008
Re: Encoder data: How to interpret encoder data from a motor going into the PIC16F877
No the encoder doesn't send data continuously. It only sends pulses when you turn it.
As I specified previously, you can maintain a counter to count the encoder turns in the Interrupt Service routine. In parallel, you can also configure an internal timer for sampling. After the timer time-out, just do what you want to do with the present counter value and then reset the counter to zero.
-Karthik -
@kinetic-joules-Qk9kmk • Jul 2, 2008
Re: Encoder data: How to interpret encoder data from a motor going into the PIC16F877
-Is confused-