Search This Blog

Saturday, April 30, 2011

Bot Building Day!

   Finally!  A beautiful, sunny weekend with time to work on my new robot.  I cut the acryllic boards for the first layout today, using a Dremel.  I put way more holes in it than planned, and learned alot about how to lay out a chassis.  I built 3 proto boards for the bot's main systems: a carrier board for the brains, a motor driver breakout, and a power regulator board.  When I tested these with the motors, I realized that a single power source of 4 AA batteries was not going to be enough.  I would need a separate power supply for the chips.  I thought it would kill the design I had in mind.  The whole bot was designed to be as small as I could make it.  After some jigsaw puzzle like work, I came up with a new arrangement.  I managed to get all three boards on the bottom layer with the motors.  The top now has the AA battery pack as well as a 9 Volt battery.  It looks a little less pretty, but it will work.  I mounted the 9V at the very back, but this made the bot do wheelies.  I moved it on top of the 6V AA battery.
   The bottom chassis is just 8cm wide by 9 cm long.  The top is 8cm by 10cm.  The extra centimeter allows for the brackets for the servo.  In later bots, the extra centimeter will be on the bottom for the sensor boards.
   I am planning to use all the same basic gear for 3 robots.  The first will have a tiny servo with a Sharp IR sensor on it.  The second will swap these out for a line sensor array on the bottom.  The last will swap this out for 5 IR Led/Phototransistors to sense walls.
  The basic equipment is:

  • 2 Pololu 30:1 Micro Metal Gear Motors - $15.95 USD ea.
  • 2 Pololu Wheel Encoders - $14.95 USD ea.
  • 2 42mm Pololu Wheels ( That work with the encoders ) - $6.95 USD for 2
  • 2 Pololu Extended Motor Brackets - $4.95 USD pair
  • 1 TI SN754410 - a "drop-in" replacement for the L293D - $2.35 USD 
  • 1 5V Voltage Regulator - $1.25 USD
  • 1 Pic 18F2455  - $5.95 USD
  • 1 Pololu Ball Caster - $2.95 USD
  • 1 4 AA batter holder ( The one I'll use has a power switch; not the one shown below ) - $1.99 USD
  • 1 9V battery & 4 1.5 AA batteries
   The mini servo was $8.95 USD and the Sharp IR sensor with pigtail was $14.95 USD.  I haven't put together the other sensor arrays yet.  The proto boards were the little cheap ones from Radio Shack.  They cost a dollar and change.  I used a thin 0.083 sheet of acryllic from Home Depot.  The was about 2 feet by 3 and cost about $7.95 USD.  All of the female pins on the boards are Swiss machine pins ( round holes instead of square ) except for the ICSP header.  The ceramic resonator uses pins, so I can swap out different value.  With this Pic, I can put in a 4MHz crystal and crank it up to 48MHz with PLL.  The total cost of the robot is in the $130-$140 dollar range, adding in the pins, wire, caps, resonator, standoffs, screws, solder, etc.  It weighs in at 137 grams.


   Here are some pictures of the basic assembly.  It's pretty rough, but I'll get better.


   One of the downsides of my hasty layout change is that it is really hard to reach the power switch.  It was supposed to go on the top of the robot.  I bought a new battery holder for the motor's batteries.  It has a built in power switch.  That way, I can catch the bot and kill the motion.  Then I can power down the TTL chips at my leisure.  




   Note the "awesome" soldering job!  I designed boards in Eagle.  I sent the carrier board for the Pic off to batchpcb.com.  If it comes back as a working board, I'll swap out the proto board.  I'll send off the other designs and replace them as well.  More than likely, I'll just get a really little coaster.  We'll see.




   All the junk wire in there are from a quick power and motor driver test.  I plan on taking my time, fitting the wires in tightly.  The exception will probably be the servo wires.  I'll just tie them in a bunch and stuff'em.  Well, that's all for now!

Monday, April 18, 2011

Bootloader - Outdated... ICSP!

    Okay, I'm out of date.  I'm 40, I accept that. I went to program my new Pic 18F2455 with my trusty, updated circa 1996 PicStart Plus programmer.  It couldn't handle the new chip.  I checked my Linux software (picp), my usual suspect, but it supports the new chips.  I checked that I had the updated chip and firmware in my programmer.  No dice.  I went and ordered an older but Linux supported programmer for around $30 from Mouser.com.  I continued work on my Java bootloader for the new chip.  Meanwhile, I looked for things I did wrong with old programmer.  I didn't find anything.
    I needed to keep going, so I pulled out a working chip: the Pic 16F876a.  It wouldn't load from my bootloader.  WTF?  I have upgraded my OS twice since the last time I bootloaded.   I am now on Python version 2.7.  Somehow, uspp will now not work.  I made sure my code was good, my connection still worked, etc.  It boiled down to the new Python with uspp.  So I began the laborious process of porting my Python bootloader code over to my in progress Java bootloader.
    Then my new programmer arrived.  It is a PicKit 2.  This thing programs chips via ICSP.  It hooks to the PC via USB.   Cool,  No more USB to Serial nonsense.  However, it did not come with any kind of cable to connect to the chips!  It is very small.  Here is a pic:

    It's really small!  I needed a cable to connect it, so I grabbed an old EIDE cable from an old computer.  I used an Exacto knife to slice off 6 wires at about 6 inches of length.  I peeled back each wire at both ends about a half an inch.. I sliced into each wire carefully on each side to expose the wire ( about a quarter of an inch ).  On each end, I soldered a 6 pin male, swiss pin header.  I wrapped each pin with electrical tape. I can hear EEs everywhere shouting at me, but it works.  I wrapped each header with more electrical tape.  here is the finished result.  It will do for now:

    What this 'lil guy made me realize is that I don't need my bootloader code at all!  I can just adapt my circuit to accept an ICSP connection.  It is so fast and easy.  I have a new design for my 28 pin chip board all ready.  I just need some silly parts from Sparkfun.  Here is the new design:

    That's a bad picture, but it does show some changes I've made.  I put the A pins back on the other side.  That way, they will be closer to the sensors.  I've added an ICSP header.  I'll be able to program the chip that way instead of via a bootloader.  the ICSP is ***way*** faster.

    That's all for now.  More when the parts arrive and I get them together.  Ciao!