(normally only three are used). The remainder of
the routine initializes the arm itself.
Most commands for controlling the
servomotors require an index value to specify which
joint parameter is being addressed. Once set, the
index automatically increments each time a
command is issued, making it very efficient to
control an arm with multiple motors.
Since this arm has only one joint motor, the
index is constantly set back to zero in the routines.
Using an index of one allows control of the
The RROS arm controller allows you to set a
minimum and maximum point for each servomotor.
Once set, the motor position (0-255) specifies a
position between these limits. This means you have
excellent resolution even if a particular servo only
moves a small fraction of its typical 180º range.
This method also helps prevent a faulty
program from moving a joint out of its preset
The demo program in Figure 7 allows the
robot to find an object that will fit into the hand
and move it to a beacon as depicted by Figure 8.
The variable HandPosition is set in the HandClose
routine. Its value represents how far the fingers
were closed before the finger-mounted switch
indicated pressure from the object.
You can use this value to help identify the size
of the object. If desired, the object could then be
moved to various places by using different beacons
to identify the possible destinations.
The RROS manual explains how RobotBASIC
can identify 15 different beacons.
This article and the one from last month have
shown how sensors can be used to locate and
identify objects, so they can be manipulated by a
mobile robot using a simple trap or arm to acquire
the object and move it to a desired destination.
After experimenting with the principles
demonstrated here, we suggest adding additional
sensors (such as a color sensor) to allow your robot
to identify and distinguish even more objects within
Since the arm can be raised to allow full use of
the robot’s perimeter sensors, this month’s robot is
ready for more complex experimentation. You could,
for example, have the robot avoid objects in its path
as it makes its way to the beacon. SV
gosub GetObject // find something to pickup
rSenseType 5 // allows more sensors
rCommand(SetServoIndex,0) // index auto-incr.
// set minimums
// set maximums
gosub ArmHome //set home position & enable
rCommand(SetServoPosition,0) // arm
rCommand(SetServoPosition,0) // gripper
delay 2000 // allow time for movement
// remove strain on the hand by
// moving the fingers slightly
rCommand(SetServoIndex,1) // index for the hand
for HandPosition=0 to 250 step 3
if rSense()&8 then break // check for switch
//HandPosition now indicates size of object
SERVO 04.2013 51