Justin Ratliff's ping robot article
5
If you choose to paint the Plexiglas I recommend you use a plastic primer spray paint
from your hardware store to cover the Plexiglas before you apply your final paint color.
A final layer of clear coat will add protection to your robot’s paint and body.
With the J2 programs based on Subsumption behavioral subroutines it makes it easy to
add new behaviors and adds at times at least the appearance of intelligence. To
program the J2 you’ll need to download the Basic Stamp editor either the DOS or
Window’s version from www.parallax.com. Below is the J2SubSumExplore program.
You can download the latest J2 code from www.j2rscientific.com See Figure 6 for the
standard J2 Explore program.
Lesson Learned: It is always better to start small. Master all that you can, seek
perfection from every part of your small robot before you move onto larger projects.
Always apply the “keep it simple” approach to your design. Lay out your robot designs
on paper with as much detail as possible in the hardware and programmed actions of
the robot. Imagine your robot going through the actions of your program with the
hardware you have drawn out. Many mistakes and limitations can be discovered before
you begin building your robot if you invest the time to think through your design.
For instance, the J2 does not have a servo to turn the sonar side to side but it can look
up and down, why is that? On such a robot (in my opinion) it would be wasteful to
include a servo to rotate the head side to side when the robot can turn its wheels to look
side to side. Also if the robot sees something of interest to the side, it will already be
ready to drive toward what it sees. If a servo rotated the neck to the side, the robot
would need to turn its body to match what the head saw.
This one detail of removing one servo from the head saves on power consumption,
code space, and weight and makes the robot more efficient.
Figure 6. Robot Code
' {$STAMP BS2}
'J2SubSumExplore.BS2
'J2R Scientific
'12-12-2005
'J2 will explore about the world using subsumption based
'behavioral based intelligence.
'Generic values
tmp VAR Word ' tmp var, many routines
ltmp VAR tmp.BYTE0
htmp VAR tmp.BYTE1
seed VAR Word 'random number seed
val05 VAR Byte
time VAR Word
i VAR Byte 'loop counter