This article outlines the implementation of a simple yet effective optical wheel encoder system for a robot that utilizes hobby servos for two-wheel differential drive. The focus is on the TJ-PROTM robot platform from MekatronixTM, although the hardware and software can be adapted for any robot equipped with an HC11 controller board. The article provides details on necessary hardware, construction methods, and software techniques for navigation through dead reckoning. Software examples are provided in Newton Labs' Interactive C ("IC") version 3.2, and it is assumed that the reader has familiarity with loading C and binary modules in IC, as well as using the start_process() function. The content is practical rather than theoretical, with a reference to the Rossum Project article for those interested in the underlying theory. Central to this design are two Hamamatsu P5587 photoreflectors, one mounted on each side of the robot behind the wheels. Each wheel is equipped with a cardboard disc featuring 48 alternating black and white segments. The Hamamatsu photoreflector package includes an infrared (IR) LED and a corresponding IR phototransistor, arranged to detect reflected IR light from the LED when a bright surface, such as white cardboard, is within a few millimeters. As the wheel rotates, the photoreflector detects white segments between black segments, producing a digital pulse train from the phototransistor. By counting these pulses and knowing the number of segments and wheel diameter, the robot can calculate its position based on the distance traveled by the wheels. Two small pieces are cut from a stripboard to create circuit boards that will be attached to the servos for mounting the Hamamatsu P5587 photoreflectors. The smallest practical size for these boards is 1.4 inches by 0.4 inches, although a wider board may facilitate easier component placement and wiring. Two 3mm diameter holes are drilled in each board, with specific measurements to ensure proper alignment. It is crucial to note that the boards are mirror images of each other, requiring careful drilling based on the mounting side of the robot. An 8-inch strip of black, white, and gray wire is cut from a ribbon cable, consistent with the wiring color scheme of MekatronixTM robots. A 3-connection header is prepared, with one end of the wires soldered to the header pins. The photoreflector is inserted into the board and soldered in place, with adjustments made to the pins for proper fit. The remaining wires are soldered to the top of the board, and the circuit is built according to the provided schematic.
The optical wheel encoder system is designed to enhance the navigation capabilities of a differential drive robot by enabling precise position tracking. The Hamamatsu P5587 photoreflectors serve as the core sensing components, utilizing IR light reflection to detect the movement of the wheels. The alternating black and white segments on the wheel discs create a pattern that allows the phototransistors to generate a pulse train corresponding to the rotation of the wheels. Each pulse represents a specific increment of distance traveled, allowing for accurate distance measurements.
To ensure reliable operation, the design incorporates careful placement of the photoreflectors and the correct alignment of the stripboard components. The choice of using a cardboard disc with distinct segments is critical, as it provides clear contrasts for the photoreflectors to detect. The circuit design on the stripboard must be executed with attention to detail, ensuring that all connections are secure and that the photoreflectors are correctly oriented to maximize their detection capabilities.
In addition to the hardware assembly, the software component plays a vital role in interpreting the pulse signals generated by the phototransistors. The software must be capable of counting the pulses accurately and converting this data into meaningful distance measurements, which can then be used for navigation algorithms. The integration of these components into the TJ-PROTM robot platform exemplifies a practical approach to robotic navigation, demonstrating how optical encoders can enhance the functionality of differential drive systems.This article describes how to implement a simple, but robust, optical wheel encoder system on a robot that uses hobby servos for two-wheel differential drive. In my case I am using the TJ-PROTM robot platform from MekatronixTM, and some aspects of this article are specific to that platform.
However, it should be easy to adapt the hardware and soft ware for virtually any robot with an HC11 controller board. This article details the hardware you will need (and where you can buy it), construction methods, and software techniques for implementing navigation by dead reckoning. The software examples are written in Newton Labs` Interactive C ("IC") version 3. 2. To make use of the code samples, I am assuming you know how to load C and binary modules in IC, and that you know how to use the start_process() function.
Rather than being heavy in theory, this is written more as a "how to" article. If you are interested in the theory, I would refer you to the Rossum Project article in the Links section at the end. At the heart of this design is a pair of Hamamatsu P5587 photoreflectors (figure 1), one mounted on each side of the robot behind the wheels.
Each wheel has a cardboard disc fixed to it with 48 alternating black and white segments. The tiny 5-legged Hamamatsu photoreflector package contains an infrared ("IR") LED and a matching IR phototransistor, both mounted on the top of the device in such a way that the phototransistor will detect reflected IR light emitted from the LED when a bright surface (such as white card) is positioned within a few millimeters of the device. As the wheel turns, and the photoreflector "sees" the white segments between the black segments, the phototransistor outputs a digital pulse train.
By counting the pulses, and knowing the number of segments and diameter of the wheel, the robot can compute its position based on the distance traveled by the wheels. Cut out two small pieces from the stripboard (figure 2). These will form the circuit boards that will be attached to the servos, upon which the Hamamatsu P5587 photoreflectors will be mounted.
The smallest size into which it is practical to cut the boards is 1. 4 inch x 0. 4 inch. This is the size I used, although in retrospect I could have made the boards wider (perhaps 1. 0 inch rather than 0. 4 inch) to make it easier to populate the components and wire them up. Drill two 3mm diameter holes in the boards, 0. 15 inch from one side, 0. 2 inch from the bottom, and 0. 4 inch apart. IMPORTANT: The two boards are not the same! One is the mirror image of the other, so the holes must be drilled on the correct side as determined by which side of the robot the board will be mounted. Figure 2 shows the board for the RIGHT side wheel. See also figure 8 which shows the assembled board mounted on the right servo. Cut an 8-inch strip (this length is correct for the TJ-PROTM robot; use whatever length is appropriate for your own robot) of black, white and gray wire from the ribbon cable (this is just for consistency with the wiring color scheme used on MekatronixTM robots; use whichever colors make sense in your own robot`s wiring scheme).
Cut a 3-connection header from the header strip, and solder one end of the wires to the header pins. Insert the photoreflector into the board first (figure 3) and solder it in place. The pins of the photoreflector have to be bent apart in order to reach the 0. 1" pitch holes in the stripboard. Solder the wires at the free end of the 3-way ribbon to the top of the board (refer to figure 8). Referring to the schematic in figure 4, build the circuit on the board. If you buy the P5587 from Acroname, it comes with a datasheet that identifies the pin numbers of the part. Right-click on the picture of the encoder disk in figure 6 and save it to your computer`s hard disk. Print out two copies of the image at 300 dots per inch on card (not paper). Use a laser printer if possible (i 🔗 External reference
Related Circuits
No related circuits found.
We use cookies to enhance your experience, analyze traffic, and serve personalized ads.
By clicking "Accept", you agree to our use of cookies.
Learn more