Processing encoder data

Encoder data is a two-channel pulse out with 90 degrees out of phase. Using this data, we can find the direction of rotation and how many times the motor has rotated, and thereby find the displacement and velocity.

Some of the terms that specify encoder resolution are pulses per revolution (PPR) or lines per revolution (LPR) and counts per revolution (CPR). PPR specifies how many electrical pulses (0 to 1 transitions) there will be during one revolution of the motor final shaft. Some manufactures use the name CPR instead of PPR, because each pulse will contain two edges (rising and falling) and there are two pulse channels (A and B) with 90-degree phase shift; the total number of edges will be four times the number ...

Get Learning Robotics using Python - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.