nopLabs

Gear Encoder for the Tamiya Twin-Motor Gearbox

The encoder system uses a Hamamatsu P5587 IR emitter/detector and a paper encoder disk. A PCB with the encoder and the encoder disk are mounted inside the gearbox. Mounting the encoder inside the gearbox offers physical protection and a certain level of shielding from outside light sources. The PCB was made as small as practicable to fit inside the Tamiya Twin-Motor Gearbox (Item 70097). Inspiration for the encoder system came from the Seattle Robotics Society's Encoder Newsletter article Home-Brew Shaft Encoders for the Pittman GM8712 Gearhead Motor.

Below is a schematic of the sensor board that includes reference designators. R1 is a current limiter for the IR emitter, R2 provides a pull-up for the VO output signal and C1 is a bypass capacitor for U1, the P5587. The original schematic can be found on the Acroname website, who also sell the P5587. The Eagle 4.15 schematic and board files are available for download.

Schematic


The PCB was fabricated using Techniks Press-n-Peel Blue on 1/32" thick single-sided PCB stock. The surface mount components are 0805 size devices and the P5587 is mounted on the backside of the board. The board dimensions are 0.867 x 0.300 inches. Three pads provide solder points for external connections. The image below shows the location of the components and external connection points.

Board image


The sensor boards are mounted to the center partition of the gearbox using double sided tape. Before affixing the PCB, clean the back of the PCB and the center partition with denatured alcohol or other solvent that will not damage the parts. Two holes, large enough for the sensor to stick through, need to be drilled on the vertical centerline of the crown gear shaft. A layout drawing used to size and position the sensor holes is available for download. From the picture on the right, note that additional material will need to be removed to allow the board to be mounted flush with the edge of the center partition. The wires, in this case 30ga wire-wrap wire, need to be restrained so they do not come in contact with the gears. As shown in the pictures below, small holes were drilled to allow the wires to be secured in place with another piece of wire.

Mounted board Mounted board


Encoder disks were printed using a modified version of the postscript utility from the SRS Encoder Article. The modifications add outer and inner circles to aid in cutting the disks.

Disk image

%! Postscript utility for printing an encoder wheel
%
/inch {72 mul} def    % #points/inch (don't change me)
/size 0.40 inch def   % radius of encoder wheel
/segments 16 def      % number of segments (black and white)
/angle 360 segments div def
/wedge
{ /radius exch def
  /angle_s exch def
  /angle_e exch def
  newpath 0 0 moveto
  0 0 radius angle_s angle_e arc
  closepath
} def
gsave
1.0 inch 1.0 inch translate
0 1 segments {
  360 segments div rotate
  angle 0 size wedge
  2 mod 0 eq {1} {0} ifelse
  setgray fill
} for
grestore
%
% Draw outside and center circles
%
1.0 inch 1.0 inch radius 0 360 arc closepath
stroke
1.0 inch 1.0 inch 0.15 inch 0 360 arc closepath
stroke
showpage



Double sided tape is used to attach the encoder disk to the crown gear as shown in the image below. Before affixing the encoder disk, clean the surface of the crown gear with denatured alcohol or other solvent that will not damage the part.

Encoder disk


The assembled gearbox is pictured below. It's a tight fit but there is plenty of clearance for the crown gear to rotate freely. Although not verified, the sensors should work with the gearbox configured for other gear ratios.

Completed gearbox

home  |  contact  |  copyright
Copyright © 2003-2008, Jesse Marroquin. All rights reserved.
Last modified: March 6, 2008