![ActivMedia Robotics Pioneer 2 Arm Manual Download Page 16](http://html1.mh-extra.com/html/activmedia-robotics/pioneer-2-arm/pioneer-2-arm_manual_2843940016.webp)
Programming
10
Chapter 3
Pr
Pr
Pr
Programming
ogramming
ogramming
ogramming
Because it is attached to the robot’s microcontroller, all Pioneer 2 Arm software
commands, controls, and responses pass through the onboard operating system
software, P2OS. P2OS1_H and later versions have a set of Arm-special servers that
provide convenient and advanced control of the Pioneer 2 Arm from your robotics
software clients. There also is a way to bypass these P2OS servers and manage the Arm
through its generic controller commands. In all cases, command and control of the
Pioneer 2 Arm needs an established client-server connection between P2OS and your
software running on a host PC.
Generic Controls
The Pioneer 2 Arm’s generic controller responds to a simple set of commands that
enable/disable power to the servos and position the servo-driven joints. They also let you
query the controller software version number and accessory digital I/O.
However, the Pioneer 2 Arm’s generic software has no provision for controlling joint
speeds. The servo motors adjust to their new position as fast as they can, leading to
some pretty wild swings unless you are careful. Nor, with the generic commands, can
you query for the current position of a joint. The P2OS Arm support servers, on the other
hand, give you control over joint speeds and maintain current position information, as
well as a variety of other advanced and convenient features. Which is why we
recommend that you program to the P2OS Arm servers and not to the Arm’s generic
command set.
The Pioneer 2 Arm’s generic control protocols consist of a header byte (0xFF) followed by
a command byte and one or two command parameters. The most significant bit (b
7
) of
the command byte determines the mode—set the bit for Control Mode; clear it for Servo
Positioning commands. The next three most significant bits of the command byte (b
4-6
)
select the board number; always 0 for the Pioneer 2 Arm. The remaining bits of the
command byte depend on the command mode.
Generic Control Mode Commands
The Pioneer 2 Arm’s generic Control Mode lets you enable/disable power to the servos,
and query for the controller’s software version number. The native Arm controller
supports three digital control bits and two analog input channels. Only digital channel 0
is connected, and it controls power to the Arm’s servo motors.
Table 1. Pioneer 2 Arm generic Control Mode commands
Control Mode
Command Bytes
Description
Board Response
0xFF, 0xC1
Servo Power ON
None
0xFF, 0xC0
Servo Power OFF
None
0xFF, 0x80
Request version number
ASCII-encoded version number,
followed by 0x0D, 0x0A
7
0xFF, 0x85
Read digital port states
0-7 corresponding to ports 0, 1 and
2, followed by 0x0D, 0x0A
7
Carriage return (0x0D) and line-feed (0x0A) characters.