Download Wireless Interface for connecting the Bioloid Robot to the C5M code

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
CS 8903: Wireless Interface for
connecting the Bioloid Robot to
the C5M code base
Chetna Kaur
Advisor: Dr. Andrea Thomaz
Background and Introduction
Problem Statement:
The task at hand was to develop a wireless interface to the bioloid to
dynamically control the Bioloid’s movements from an external program
using wireless communication. The next step was to provide the input
to the program (controlling the bioloid) from a c5m based robot. This
would allow us to use the bioloid as the demonstration environment for
the c5m based systems built in our lab.
The Bioloid Kit:
The bioloid robot allows for range of movement and versatile modular
construction, the Bioloid can be configured as the default human form,
or assembled into dozens of different robotic creatures. 18 servos, a
full motion editor and visual programming environment allow you to
make the Bioloid interact with it's surroundings while performing
complex movements.
The sensor module in the head of the robot features an IrDA receiver
(for communicating with other robots via infrared), three proximity
sensors (left, right and front) that can measure distance and
luminosity, a microphone for sound detection and a piezo-electric
speaker that can be used to play musical scales or generate simple
beeping sounds.
The bioloid kit comes with following development tools:



Motion Control Editor - A full motion editor to program your
own custom movements
Behavior Control Program - Visual programming environment
for behavior logic. Allows the programmer to transition the
state of the robot when a particular stimulus or events is
triggered.
A Terminal for configuration of components, etc.
Introducing the Solution
The wireless interface for Bioloid-PC communication has been built
using the Robotis Zig-100 chips. Our PC based program communicates
with the CM5 module of the Bioloid via the Zig100. The communication
protocol is Zig Bee protocol. The pc-based program sends motor
position commands to the Bioloid. The bioloid upon receiving a
command (to move a motor) sets the motor to the position specified
by the command.
Next we used the Inter robot communication protocol to set up a
communication channel between the c5m system and our pc-based
program. This allows us to control the movements of the bioloid robot
from our c5m based system.
C5M Based
Based
System
Intra
Robot
Comm
Protocol
Interface
ZigBee CM5/ Bioloid
Protocol
l
l
IRCP – Intra Robot Communication Protocol
The IRCP is essentially designed for intra-module communication.
Protocol is based on UDP and can be used for communication between
multiple processes on a single computer and between different
computers. Description and details of the protocol can be found in Matt
Hancher’s thesis.
Essentially each subsystem of the robot is assigned unique id and all
modules belonging to a robot communicate using the Robot Id, and a
source and destination subsystem Ids.
Zig 100 Communication Protocol
The bioloid’s CM5 module is designed to send and receive intergers
ranging from 0 to 65535.
The CM5 module encodes these integers as described in the example
below before transmission. The received packets are decoded to
extract the received integer data.
Packet format explained with example


The data is the integer 2049 = 01 + 256decimal * 08
The CM5/Zig100 format, as hex bytes is:
FF 55 01 FE 08 F7
where:
FF 55 is the header.
FE is checksum for 01 -> 255decimal - 01 = FE
(i.e. Complement of byte)
F7 is checksum for 08 -> 255decimal - 08 = F7
(i.e. Complement of byte)
Building the PC-Bioloid Interface

Solder one Zig-100 module in the Bioloid robot's CM-5 control
module.

Solder the second Zig-100 to a Zig2Serial adapter.

Install and configure the USB2Dynamixel module.

Use the USB2Dynamixel converter between the PC and the
Zig2Serial Board.

Configure the Zig100 module from the Terminal program

Issue commands to the robot via the computer's serial port!
The instructions for configuring the hardware can be found the Robotis
Manuals for these parts.
Algorithm for PC-Based Program
Open Serial Port
Set baud rate to 57142
Loop
If input from keyboard/other program
Begin
Accept Input
Code it to CM5 format
Write to Serial Port
End
If input from USB Serial Port Then
Begin
Read it
Decode CM5 format
Do processing
End
End Loop
Algorithm for the Behavior Control Program for the Bioloid
Protocol for Encoding the Motor Ids and Positions:
Since the CM5 can only receive a single integer in a message, we need
to define messages which signify the motor id as well as its position.
The following encoding function has been used to encode the motor
position and id. The result of this encoding function is then coded to
the CM5 format and transmitted to the Bioloid.
Message id = Motor Id *1024 + Motor Position
Algorithm for the Behaviour Control Program
Loop
If (received data from other Zig100)
Decode data to get the Id and Position of Motor
Set the Motor corresponding to Id to the received Position
End Loop
Interfacing the C5M based system with the Bioloid
Any interface between a C5M system and a physical robot will
essentially have to serve as the Motor System for the C5M based
robot. Matt Hancher’s thesis provides a good description of how to
develop a low level motor system for a C5M based robot.
This motor system will run in a slave mode and will wait for another
(master) module of the C5m robot to invoke it. All modules that
communicate with a motor system will have agreed on a set of joint
names.
• The Master will request a Motor System Information sub-packet
from the motor system (slave), which will list the names of the
joints supported by the motor system and assign each one an
integer index.
• The master will verify that the joint names are as expected and
assign indices to each of these motors.
•
All future communication with the motor system will refer to each
joint by its index for efficiency.
• Once this is set up the Master can now send messages to Set the
Joint Positions (and also several other messages).
C5M based Robot
(Huggable)
Interface
Bioloid
Request Motor
Information (Msg Type:
MOTOR_NAMES)
Send Indexed Array
containing Huggables
Motor Names (Msg Type
:
REQUEST_RESPONSE)
Send target positions
for Huggable Motors
(SET_TARGET_POSITION)
Map to
Bioloid
Motors
Send Motor Positions
to Bioloid
Processing the SET_TARGET_POSITIONS Message:
The Motor Ids and Positions received from the C5M have to mapped
to the Bioloid’s Motor System. For this we use a configurable map of
C5M to Bioloid Motor Ids. This is read from a config file and installed
on start-up. Next we map the motor positions using a mapping
function. Once we have the Motor Id and Positions which need to be
communicated to the Bioloid, we encode them into the CM5 format
and send the encoded data to the serial port where the Zig2Serial
interface is connected.
Discussion & Future Work
Currently we are using the Huggable robot to interface with the
Bioloid. While this has allowed us to develop a framework for
communication between the C5M based systems and a robot kit the
Bioloid, this solution is currently unable to exploit the entire
capabilities of both the Bioloid and the C5M huggable robot. One of the
reasons for this is that the motors of the Huggable cannot map exactly
to any configuration of the Bioloid. Our next step would be to build a
robot on the c5m which shares the Bioloids configuration and
capabilities. Also, our current solution has demonstrated
communication from the c5m to the Bioloid. But we do not have any
data being sent back from the bioloid to the c5m based robot. The
next step would be to have the input from the Bioloid’s sensors being
transmitted to the c5m based system for processing. Once we have
this up we could set up a variety of cool demos where we could get the
bioloid to interact with its surroundings.