A Robotics Project Page
Google
 
Web    www.PhilBot.com
My other sites
  • OurCoolHouse
  • Phil's Resume
  • Web Portfolio

  • [Home] [Projects] [Hardware] [Software] [Books] [Links] [Downloads]


    Tamiya Twin Motor Gearbox Rotary Encoder Project

    My first small robotics project used modified RC Servos to drive the wheels.  Although this was a simple approach, is wasn't very satisfying when it came to speed or position control.  I really wanted to use a drive system that would provide me some feedback.  I searched around and purchased some inexpensive gear motors with the idea of adding shaft encoders.  There were some commercial encoder add-on out there, but they were pretty expensive and not very elegant solutions.

    One particular drive system that caught my interest was the [Tamyia] Twin Motor Gearbox (TMG).  This is essentially a plastic kit that incorporates two small electric motors and dual sets of plastic gears that could be configured for 58:1 or 204:1 reduction.  I got a great deal on this item at [HobbyLinc.com], along with wheels and other accessories. Lots of robot sites sell this gearbox, and it can be used to run several plastic models (including a treaded Tank), and a cool round Lexan chassis from [Pololu.com].  I use the Pololu chassis for my Pucky robot.

    Tamiya Twin Motor Gearbox showing kit parts and assembled gearbox.


    The photo on the left shows two complete TMG kits.  On the left are all the parts, and on the right is a completed gearbox.  As with all images on this site, click the picture for an enlarged view. The two wheels in the photo don't come with the kit, but they are also available from Tamiya.  The gearbox assembly was straight forward, despite the fact that the instructions are in Japanese :)

    The more I looked at this gearbox, the more I thought there should be a way to add optical encoders to the drive assembly.  Take a closer look at the gear train on the right.  I started to wonder if I could somehow wrap an optical sensor around one of the gears.   If that was possible, I could cut slots in the gear and make it act as an optical interrupter. I needed to be able to choose a gear that rotated at a reasonable speed, and had enough space around it to position two optical encoders.


    I started researching Slotted Optical Switches.  My biggest problem was that I needed the two fingers of the encoder to fit between adjacent gears, but I also needed them long enough to reach past the teeth and into the body of the gear.  I had a very tight size requirement.  After pouring through component catalogs (Digi-Key, Mouser, Newark etc) and searching the web, I finally located an optical switch from OPTEK that was small enough, and long enough to do the job.  I ordered a set of the optical switches from Digi-Key and then set to work converting some gears into optical interrupters.

    I made a little jig that I could use to hold a single plastic gear, and then I used a Spiral Cutting bit from my Roto-Zip tool in the drill press.  I could plunge the drill down, and then rotate the gear with my fingers to cut a nice smooth slot.

    When the Optical Interrupters turned up I was very pleased.  The width and length were perfect.  The only thing that was a little funky was the lead spacing.  When you stacked two units next to each other, they didn't enable a 0.1 Inch spacing, the housings were a tiny bit too wide.  Not to worry, a custom PCB would deal with that. 

    So next I made a prototype circuit on some perf-board.  The interrupter is a basic LED photo-transistor pair, so I started out driving the LED with 10mA, but I found that the IR light got clean through the gear plastic.  So I dropped the drive current down to to about 3mA and with a 4.7K resistor on the Photo-transistor I was able to produce a decent logic level change as the gear rotated.  I experimented with mounting, and found that I could mount the Encoder board 1/8" off the gear chassis and the gears would spin freely and produce a good encoder output. 

    To try out the design on a real robot, I purchased a 1/8" Acrylic Chassis from Pololu.com (which was designed for the Tamiya TMG) and cut a hole in the center to expose the gear workings.

    The proto-board sits flush on the chassis.  In the photo on the right, I've outlined the encoders with a green line to make them more visible.  I outfitted the chassis with an OOBOT-40 board from [Oricom Technologies] and Pucky was born.  I needed to use the OOBOT40 board because it had a Quad H Bridge driver on it that I could use to run the two motors.  See my [Pucky1] page for more details.

    Once I had proven the basic concept, I decided to make a custom PCB to clean up the circuit.  On small projects like this I love to use the PCB service offered by [ExpressPCB]. For just $59 I can design a 2.5" x 3.8" double sided board and get 3 boards back in the mail in 3 days.  Too Cool.  The 2.5" x 3.8" board size is their "mini-board" format, and since my encoder boards were really much smaller, I just duplicated the design to fit 3 encoders on one board.  Since I had about 1/2" of unused space at one end of the board I decided to add a SN754410 Quad H-Bridge driver to the board and run the control signals to a common 20 Pin header.  I arranged the signals on the header to make it easy to connect it to a MarkIII OOPic controller board (my favorite) with a straight through ribbon


    At the left is a picture of the final boards after they had been separated.  Notice the two narrow "Encoder only" boards, and then the larger "Encoder + Driver" board. 

    On the right is the populated Driver + Encoder board.  I bolted this board directly to a Twin Motor Gearbox, using the 1/8" spaces that happened to come with the Gearbox kit.   To convert it into a stand-alone robot, I added a plastic chassis (cut from a "For Sale" sign), a MarkIII OOPic controller board, and built my first Line-Follower.   Naturally I had to go out and write an OOPic UserClass for reading the encoders and controlling the Twin Motors.  You can read more about these projects once I create pages for them.


    A Tamiya Twin Motor Gearbox fitted with the PBot Encoder - Driver.

     

    Web content is copyright © PhilBot.com 2005, Deep Creek Lake, MD.
    Contact: Phil Malone 301.387.2331, webmaster@PhilBot.com