27
CS 8903 Demo CS 8903 Demo Wireless Wireless Interface for Interface for the Bioloid the Bioloid Robot Robot Chetna Kaur Chetna Kaur

CS 8903 Demo Wireless Interface for the Bioloid Robot Chetna Kaur

Embed Size (px)

Citation preview

Page 1: CS 8903 Demo Wireless Interface for the Bioloid Robot Chetna Kaur

CS 8903 DemoCS 8903 DemoWireless Wireless

Interface for the Interface for the Bioloid RobotBioloid Robot

Chetna KaurChetna Kaur

Page 2: CS 8903 Demo Wireless Interface for the Bioloid Robot Chetna Kaur

Problem StatementProblem Statement• Set up a Wireless Communication

Interface for PC-Bioloid communication.

• Dynamically control the Bioloid’s movements from an external program using wireless communication.

• Build an interface for c5m based systems to interface with and dynamically control the Bioloid.

Page 3: CS 8903 Demo Wireless Interface for the Bioloid Robot Chetna Kaur

IntroductionIntroduction

Page 4: CS 8903 Demo Wireless Interface for the Bioloid Robot Chetna Kaur

The Bioloid KitThe Bioloid Kit

• Easy to configure into a variety of robotic creatures.

• Can interact with surroundings while performing complex movements [18 Servos].

• Head contains a sensor module which features an infrared receiver.

• Also has three proximity sensors (left, right and front) that can measure distance and luminosity.

• The brain of the Bioloid is the CM-5 module which runs an Atmel ATMega128 based mcu.

Page 5: CS 8903 Demo Wireless Interface for the Bioloid Robot Chetna Kaur

Programming the BioloidProgramming the Bioloid

• A full motion editor to program your own custom movements

• Visual programming environment for behavior logic.

• A Terminal for configuration of components and other maintenance tasks.

Page 6: CS 8903 Demo Wireless Interface for the Bioloid Robot Chetna Kaur

Motion EditorMotion Editor

• Capture the current positions of the motors/ Pose of the robot.

• Build frame-by-frame Motion Sequences

• Complex animations can be quickly programmed and tested.

• Motions can be downloaded into the Bioloid's memory and called from the Behaviour Control Program.

Page 7: CS 8903 Demo Wireless Interface for the Bioloid Robot Chetna Kaur

Behavior Control ProgramBehavior Control Program• A graphical

programming environment to control the behaviour of the bioloid.

• Allows the programmer to transition the state of a the robot when a particular stimulus or events is triggered.

Page 8: CS 8903 Demo Wireless Interface for the Bioloid Robot Chetna Kaur

PC-to-Bioloid PC-to-Bioloid Wireless Wireless

Communication Communication InterfaceInterface

Page 9: CS 8903 Demo Wireless Interface for the Bioloid Robot Chetna Kaur

Building the Wireless Building the Wireless Interface Interface

• Bioloid supports the Zig-100 Wireless Communication Module

• Supports ZigBee Communication Protocol

Page 10: CS 8903 Demo Wireless Interface for the Bioloid Robot Chetna Kaur

Building the Wireless Building the Wireless InterfaceInterface

– Install one Zig-100 module in the Bioloid robot's CM-5 control module.

– Connect 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!

Page 11: CS 8903 Demo Wireless Interface for the Bioloid Robot Chetna Kaur

Zig 100 Communication Zig 100 Communication ProtocolProtocol

• CM5 is programmed to send and receive integers (0-65535) using Zig100.

• Packet format explained with example

The data in this example is integer 2049 = 01 + 256decimal * 08

Here is the CM5/Zig100 format, as hex bytes:

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)

Page 12: CS 8903 Demo Wireless Interface for the Bioloid Robot Chetna Kaur

Algorithm for PC-Bioloid Algorithm for PC-Bioloid CommunicationCommunication

Open Serial PortSet baud rate to 57142Loop

If input from keyboard/other programBegin

Accept InputCode it to CM5 format Write to Serial Port

EndIf input from USB Serial Port Then Begin

Read it Decode CM5 format Do processing

End End Loop

Page 13: CS 8903 Demo Wireless Interface for the Bioloid Robot Chetna Kaur

Behavior Control Program to Behavior Control Program to receive datareceive data

• Show Development Environment Now

Page 14: CS 8903 Demo Wireless Interface for the Bioloid Robot Chetna Kaur

Protocol to drive the motorsProtocol to drive the motors• Essential to define the protocol/commands for

communication between an external program and Bioloid.

• Currently defined for communicating positions of the 18 Motors.

• Command = Motor Id *1024 + Motor Position

• Encode (Motor Id and Position) and send from PC-based program.

• Receive and decode in Behavior Control Program.

• Set the Motor’s position!

Page 15: CS 8903 Demo Wireless Interface for the Bioloid Robot Chetna Kaur

Interfacing with the C5M Interfacing with the C5M code basecode base

C5M Based System

Interface CM5/ BioloidInter RobotCommProtocol

Zig BeeProtocol

Page 16: CS 8903 Demo Wireless Interface for the Bioloid Robot Chetna Kaur

Interface DesignInterface Design

Joint Positions Handler

SerialCommunication

Module

Config

IRCP UDP Module(Receiver)

Interface Manager

C5M Based System(IRCP UDP Sender)

Zig100

Page 17: CS 8903 Demo Wireless Interface for the Bioloid Robot Chetna Kaur

IRCPIRCP• Essentially designed for Inter-module

communication in Interactive Robots• Protocol is based on UDP – can be

used for communication between multiple processes on a single computer and between different computers

Page 18: CS 8903 Demo Wireless Interface for the Bioloid Robot Chetna Kaur

IRCP Packet FormatIRCP Packet Format

Page 19: CS 8903 Demo Wireless Interface for the Bioloid Robot Chetna Kaur

Motion Control Using IRCPMotion Control Using IRCP

• Motor System will work in a slave mode.

• 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).

Page 20: CS 8903 Demo Wireless Interface for the Bioloid Robot Chetna Kaur

Setting Motor PositionsSetting Motor Positions• Minor Type: SET_TARGET_POSITIONS

• Subpacket Payload contains Index Matched Array

• Index = Motor Id; Value = Motor Position

Index 1 Index 2 Index nValue 1 Value 2 Value n……….

Page 21: CS 8903 Demo Wireless Interface for the Bioloid Robot Chetna Kaur

Mapping MotorsMapping Motors• Need to map the Motion of the C5M

based robot to the Bioloid

• Motor Map used to Map Motor Ids. Read from config file and and installed on start-up.

• Map the motor positions.

Page 22: CS 8903 Demo Wireless Interface for the Bioloid Robot Chetna Kaur

Encode and Send to CM5Encode and Send to CM5• Maintain a map of the last values

which were sent for each of the motors of the Bioloid.

• Encode and send messages to CM5 for every motor whose position has changed.

• CM5 will decode the message and set the motor position.

Page 23: CS 8903 Demo Wireless Interface for the Bioloid Robot Chetna Kaur

Interfacing with the Interfacing with the HuggableHuggable

Request Motor Information (Minor Type: MOTOR_NAMES)

Send Indexed Array containing Huggables Motor Names (Minor Type : REQUEST_RESPONSE)

Send target positions for Huggable Motors (SET_TARGET_POSITION)

Map to Bioloid Motors

InterfaceHuggable Bioloid

Send Motor Positions to Bioloid

Page 24: CS 8903 Demo Wireless Interface for the Bioloid Robot Chetna Kaur

Huggable’s MotorsHuggable’s Motorspublic static final String[] motorNameMap = new String[] {

“neckUpDown", "neckTwist", "neckLeftRight", "rEarUpDown", "lEarUpDown", "rEyebrowRotate", "lEyebrowRotate", "lshoulderUpDown", "rshoulderUpDown", "rshoulderRotate", "lshoulderRotate", "lhipLeftRight", "rhipLeftRight", "lhipUpDown", "rhipUpDown", "rAnkleUpDown", "lAnkleUpDown"

};

Currently we ignore most of these and map only lshoulderUpDown, rshoulderUpDown, rshoulderRotate, lshoulderRotate to the Bioloid Motors

Page 25: CS 8903 Demo Wireless Interface for the Bioloid Robot Chetna Kaur

DemoDemo

• Show Demo Now!

Page 26: CS 8903 Demo Wireless Interface for the Bioloid Robot Chetna Kaur

Next Step Next Step Forward?Forward?

Page 27: CS 8903 Demo Wireless Interface for the Bioloid Robot Chetna Kaur

Questions?Questions?