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]


     

    BOB: The design process.          [Back to BOB index]

    Most new designs are born from a need.  In my case I really needed a robot with wheel feedback.  If it wasn't for that one requirement I would have been perfectly content with the "Mark III" MiniSumo kit sold by Tim Rohaly at [Junun.org] (see my [SUMO page]). 

    Basic Research

    When I started looking for robots with wheel encoders I didn't really find any I liked. The ARobot from [ARRICK Robotics] was close, it had an encoder on the drive wheel, and separate wheels for steering, but I didn't really want the Basic Stamp controller board.  It was even tough finding parts that could be used to assemble a drive that didn't break the bank.

    I bought a few Tamiya Twin Motor Gearboxes (TMG) and experimented with them, by adding my own encoders.  This proved pretty successful as you can see on my [TMG Encoder] page. To experiment with drive electronics I bought an [OOBOT-40] processor from [Oricom Technologies]. This board has an OOPic and two TI SN754410 Quad H-Bridge driver chips on it.  One chip can drive two small DC motors in either direction with an optional PWM (Pulse Width Modulation) inputs for variable speed.  Since the OOPic has two PWM outputs, this is an ideal combination for driving one TMG.

    The epiphany

    One day I was looking around at designing or purchasing a chassis for my new robot, and I realized that if I could get all the sensors on the controller board itself, I wouldn't really need a chassis.  The Encoders were already PCB mouned and this board bolted directly to the gearbox.  I'd been doing a lot of parts hunting at various online sites and catalogs, and I'd seen PCB mount versions of many of the sensors.  The Fairchild Line Sensors for the Mark III had 4 wires attached (which then required connectors and headers) but there was a version with inch long solid leads.  The Sharp Range Finders also had a PCB version (which eliminated costly wires and connectors).  Although the PCB version was simpler with a digital output, it was also cheaper so that was a plus. 

    The last big decision was choosing a PCB size that would be inexpensive, but still provide enough real-estate to accommodate all the parts I would need.  In addition to the basic electronic components, I was going to need room for the sensors, the wheel encoders, the Ball Caster that I was planning to use for the third wheel, and the expansion connector.  And let's not forget a battery, oi!.  Since I knew I'd need at least a couple of tries getting the board right I also needed to consider an economical means to get prototypes built.

    Everyone knows (you should by now) that I really like using [ExpressPCB] to get my boards made.  They have a 3 day "Mini-Board" service that will deliver 3 boards for $59 if they are exactly 2.5" x 3.8".  That's a great price for a small board, and so it behooves me to take advantage of it.  2.5" is a good width for the TMG.  It's just wide enough to accommodate the two mounting bolts.  So the question was: would 3.8" be long enough for all the other stuff that had to go on the PCB?  I made a plastic "fake board" and tried to mount all the mechanical parts.  By the time the TMG and Ball caser were mounted, I had an assembly that was exactly 4" long, which meant it could even be used as a Mini-Sumo.  I'd have to squeeze the Line sensors to fit them in, but I could do it.

    The hard/fun part

    Once the basic outline was decided, I switched back to the electrical design.  I needed to decide exactly what was going to be included in the design, and what was fluff. The best part of any good design is what you learn from others, so I went back and perused the schematics of the MarkIII and OOBOT-40 boards.  I also went to the OOPic.com website and looked at the basic requirements for any OOPic design.  When things started clarifying in my brain, I started up my ExpressPCB Schematic Capture program.  I've used better programs, but none were cheaper (free) and the beauty of this program is that it flows right into the PCB layout program.  Should I explain?..  probably.

    OK, so the process to design a Printed Circuit Board (PCB) goes like this: (Jargon)

    1. Get an idea
    2. Create a circuit diagram that shows how to connect all the parts (also called a Schematic)
    3. Lay Out the Printed Circuit Board (place the pads and traces) so that all the parts are connected as per the Schematic.
    4. Send the PCB design out to get Fabricated.  You get back a Bare Board.

    For me, Step 1 is cool, step 2 is a drag, step 3 is like doing a fun 3D puzzle, and step 4 is totally stressful.

    If the Schematic Capture program that you use for step 2 is compatible with the PCB layout program you use for step 3, then it's much easier to make sure that you got the layout correct.  An analogy might be driving from point A to point B.  If someone gives you directions using landmarks, and someone else gives you directions with street names, it makes it easy to double check as you go.  Some PCB layout programs are even smart enough to "Autoroute" the board for you, which usually saves you time, but produces a messy layout.

    OK, so how about an example!

    The Schematic Design

    Let's consider the optical rotation encoders.  This diagram is the part of the schematic that deals with this function.  See that there are six boxes on this diagram.  Each one corresponds to a physical part. 

    The two boxes at the top are each a resistor network.  If you ever need a bunch of pull-up resistors that all have the same value, a resistor network is the way to go.  Notice that there are five resistors all connected to a common pin 1 in this package.

    In the center of the schematic are the four optical interrupter switches.  These devices are shaped like a thick "U" and they wrap around gears with slots in them.  Each encoder has a LED (shown on the right) and a Photo-Transistor (shown on the left).  The encoders are used in pairs (one pair per gear) to enable the processor to measure speed and direction.

    The circuit is wired so that each LED has a series pull-up resistor to limit the amount of current that flows. The 1K Ohm resistor only allows about 4mA to flow.  Each Photo-Transistor also has a larger pull-up resistor.  When the light from the LED hits the Photo-Transistor, it conducts and causes the Emitter (marked with an E) to go low.  When the light is interrupted, the Photo-Transistor turns off and the Emitter is pulled high.

    The four Emitter signals are essentially the "outputs" of this circuit, so they are sent to the OOPic processor as IO Lines 28 to 31.

    The Printed Circuit Board design

    OK, so the next step is to figure out how to place these components onto a printed circuit board and connect them together.  As I said before, I really enjoy this step because it's like working a 3D puzzle.  First you need to place the components on the board, and then you need to connect them with "traces".  On simple boards, there are only two trace layers, one on each side of the board.  With more sophisticated designs you can have 2, 4 or more extra layers sandwiched inside the board.  I'll stick with a basic two layer board, because they are less expensive, and I just don't have that much going on.

    The image on the right is a piece of the board as seen in the PCB Layout program.  It's actually the part of the board that contains the same six components shown in the previous schematic.  The yellow lines correspond to the "Silk Screen" layer, which is the white printing that you always find on one side of a PCB.  This layer is just to help the person putting components on the board.  You can see the two long Resistor Networks (RN1 and RN2) and the four square Optical Interrupters (U3 to U6).  "U" is usually the designation letter used for integrated circuits.  I have no idea why, it just is :)

    The red and green lines correspond to the copper "traces" (or wires) on either side of the board.  Red traces are on the top of the board, and green traces are on the bottom.  The red circles and squares are the solder pads and holes that hold the components on the board, and also connect the two layers together. The square pads usually indicate Pin 1 of the component.

    Also notice the different widths of the traces.  Traces that may need to carry more current are made wider to eliminate voltage losses.  Power and Ground traces are often made wider.  Notice that Pin 1 of RN1 and RN2 are connected with a thick red trace.  Look at the schematic and you'll see that these pins both connect to +5V, so this is a power trace.  Makes sense!

    As with all puzzles, there are strategies to laying out a PCB.  One trick is to use one side of the board for traces that go horizontally, and use the other side for traces that go vertically.  This makes it easier to move lots of signals from one end of the board to the other.  On BOB you can see that the red traces mainly go up and down, and the green are left and right.  If you need to switch sides, you can use a "via" which is just a connector hole.  It also helps to keep components with a lot of interconnects together.  A good example of this is the OOPic expansion connector.  Just about all of the OOPic's 40 signals are sent to this connector, consequently I've put them right next to each other on the board.

    Complete Prototype Designs

    Since an integral part of doing something new is learning from others, I like to share my own designs.  I've included the full schematics and PCB for the Prototype BOB below.  Click the image for a larger view.  Once the designs are finalized I'll include a high resolution set on my download page.

     

    The Next Step

    Now that you've had a peek inside the design process it's time to see what [features] were included in the final design.

     

     

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