Shop OBEX P1 Docs P2 Docs Learn Events
My CBA, Parallax, Pololu, Arduino Mash-up Robot — Parallax Forums

My CBA, Parallax, Pololu, Arduino Mash-up Robot

Martin_HMartin_H Posts: 4,051
edited 2010-08-17 16:58 in Robotics
In another thread I mentioned I've been derailed from Scribbler by another robot project. The robot is currently unnamed, but I thought I would post the details now that I'm in the software phase.

Component Parts

– Mike Davey's CBA robot kit with wheel encoders and line following module. The kit is great and serves as a nice base to build on. It has the Basic Stamp 2e, so multi-bank programming allows for bigger and more modular programs than the Basic Stamp 2. The servos seem pretty beefy too.

– Parallax Ping.

– Ping Mounting Bracket.

– Hitachi HM55B Compass Module from Parallax.

– BCM Gripper from Pololu on removable bracket.

– 74HC595 from Solarbotics (lonely chip in the corner of breadboard for experimenting with serial I/O).

My motivation for building was that even with my Scribbler additions, I ran out I/O pins. I wanted to use the compass module, Ping and wheel encoders together to allow the robot to travel a heading and avoiding obstacles. The wheel encoders allow for precise turns and allow back tracking to the origin position. A line follow module is handy because you can use it to detect line boundaries or follow lines. The only thing I've done with the gripper is open and close it, but I plan to try and grab and drag objects with it.

Because the robot is similar to Boe-bot and Scribbler I can port old programs and sample code really easily. For example I intend to try my hand at using the line following module to read bar codes using code generated from Scribbler's GUI.

I plan to upload a video, but I have a learning curve to climb in that area.

Martin

Post Edited (Martin_H) : 8/5/2010 1:51:53 AM GMT
1946 x 1204 - 357K
3400 x 2530 - 1M

Comments

  • WhitWhit Posts: 4,191
    edited 2010-04-28 16:34
    @Martin_H

    Looks great. The CBA is a nice little bot. I like your add-ons!

    You know that the S2 will solve all your problems! smilewinkgrin.gif· Start saving a little dough...We'll have to figure a·way to get the gripper on there.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Whit+


    "We keep moving forward, opening new doors, and doing new things, because we're curious and curiosity keeps leading us down new paths." - Walt Disney

    Post Edited (Whit) : 4/28/2010 4:39:06 PM GMT
  • Martin_HMartin_H Posts: 4,051
    edited 2010-05-02 02:17
    Thanks Whit.

    As I said above I've ported a few Boe-bot and Scribbler programs, but that doesn't make use of the BS2E scratchpad or multiple EPROM banks.· So I've begun breaking up existing programs into modules and unit testing them from a main module.· I've attached my sensors module and test harness.· The motor and wheel encoder module is next.

    To make things simplier I use exactly the same variables in both modules.· Some of the variables are considered volatile work variables.· Others are state variables and aren't updated unless robot state changes.· I'm using the scratchpad and a variable SP as an ad hoc call stack for call linkage and·variable saving.· My task number scheme and stack allows a call from bank 0 to 1,·then from 1 to 2, and an orderly return.

    I know everyone is moving on to the propeller chip which makes all this trivial.· But I figured I would post what I'm up to with multi-bank programming anyway.· I should be able to write much bigger programs than for Scribbler.· Also, the modules mean that you just write new main loop programs and link in all the existing modules that do·the tricky bits.

    One thing that really flumoxed me was adding or assigning a signed byte to a signed word.· It looks like PBasic requires manual sign bit extension which is easy to forget.
  • WhitWhit Posts: 4,191
    edited 2010-05-02 12:39
    Martin_H said...

    I know everyone is moving on to the propeller chip which makes all this trivial.·

    Martin_H - As far as I am concerned the BASIC· Stamp will never be trivial. Work like this requires the sort of thought process that is applicable to any micro-processor.

    There are also folks who love to squeeze everything possible out of the Stamp -erco comes to mind.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Whit+


    "We keep moving forward, opening new doors, and doing new things, because we're curious and curiosity keeps leading us down new paths." - Walt Disney

    Post Edited (Whit) : 7/8/2010 2:16:04 AM GMT
  • Martin_HMartin_H Posts: 4,051
    edited 2010-07-06 23:57
    Attached is the latest version of my source code for this robot. This version integrates the motor movement with the Ping to roam a room. In addition the movement routine supports a distance constraint. When set the robot checks the Ping each servo pulse and will move as long as a distant constraint is not violated. I'm going to use this for wall following and maze solving.

    Note that this uses the multi-bank feature which may be a bit confusing to someone used to a regular BS2. You can think of a bank as a program module. A task is a module entry point not unlike a Windows DLL ordinal number. The way I have this set up a module can support 16 entry points, but I can ease that restriction pretty easily. For a regular BS2 you would merge these two modules into a single file and use a direct GOSUB.

    While debugging I had a bug where an encoder count dropped below zero. The code IF LCount > 0 doesn't catch this because it appears > is an unsigned comparison. The poor robot ground into the couch and bent the ping bracket! This kind of bug is subtle because most of the time the counter hit zero and the loop terminated.

    Post Edited (Martin_H) : 7/7/2010 1:06:21 AM GMT
  • Martin_HMartin_H Posts: 4,051
    edited 2010-08-05 01:46
    In another thread I mentioned I ran out of BS2 I/O pins and was looking for a way to offload work from the BS2. The CBA's line following module (LFM) consumes seven I/O pins and was a natural to turn into a smart device using a microcontroller. I contemplated wiring up a BS2-lite circuit, but realized that I would learn more using another architecture.

    I looked at PICAxe, a breadboard version of the Arduino, and though about a Propeller module. I decided on the Arduino because it was cheap (low financial risk) and I know C. I made an adapter to convert the LFM's cable to rows in the breadboard which matched Arduino I/O pins. It was a piece of cake to port some PBASIC to C and read the LFM on the Arduino.

    The next step is to get the BS2 and Arduino talking to each other using serin and serout. I also plan turn over control of the compass to the Arduino as well. The first picture shows my current progress. I plan to add more sensors to the BS2 to detect motor stall and collisions missed by the Ping))). My desired end state is to have the Arduino be the navigator and the BS2 be the pilot, and divide labor between them equally. Plus having two cores allows for true multi-tasking.

    The second picture shows the result of my getting really annoyed at breadboarding servo headers using three jumpers all the time. The CBA breadboard has a power bus at the bottom which matches two pins of a servo header. So I bent the third pin, soldered a lead, covered it with heat shrink tubing, and ran it to the I/O pin. It worked like a charm, and I liked it so much I made more.

    Note: I re-uploaded my images because I hated seeing them truncated.
    800 x 741 - 66K
    800 x 456 - 20K
  • Martin_HMartin_H Posts: 4,051
    edited 2010-08-17 16:58
    I've been extending the functions of the gripper I mentioned in the first post. I bought two GWS mini servos which have the torque of regular servos. I then cut a Technic beam in half and screwed the servos to it perpendicular to each other. Finally I bolted the gripper to one of the servo horns. So now I have wrist action coupled with grip action.

    The to do's are to glue a Lego plate to the top of the CBA's bottom base. This will give me a quick connect/disconnect for the gripper. I also bought a sharp close range IR object sensor which I'm going to connect to the front of the gripper servo to give the gripper object detection.

    All told the gripper will use at least four pins. Five if I add a contact sensor to the gripper itself.
    799 x 800 - 48K
    800 x 575 - 30K
Sign In or Register to comment.