Rotary Encoder Disk

Faced with a need to count turns of magnet forward and reverse, and not satisfied with extant code found on the Web, I have developed a somewhat general purpose PostScript program to print a quadrature encoder wheel pattern.

Parameters

Use methods appropriate to download the PostScript source code, encoderdisk.ps 1.4kB then edit it to suit your needs. Units are in printers points, constants are defined so that you can also use inches or millimetres. For example, 144 , 2 inch , 51 mm are roughly equivalent; note that the spaces between number and unit are significant.

For this project I will most likely use Sharp GP2S40 reflective photointerrupters, with 7mm optimal sensing distance.

graphic of single and double (quadrature) printout
Above picture shows wheels printed with single row of segments /doublestripe false def for use with sensors spaced along the circumference, and with a double row /doublestripe true def for sensors oriented along a radial line.


Copyright ©2004 MEEI/ijs, released under the GNU General Public License.
Corrections, additions or comments?
Send email (if supported by your browser) to the author, ijs@epl.meei.harvard.edu.
Original: 2004 July 08
Last modified: Jul 9 14:31 2004 / Ishmael Stefanov-Wagner