270 likes | 428 Views
CS 8903 Demo Wireless Interface for the Bioloid Robot. Chetna Kaur. Problem Statement. Set up a Wireless Communication Interface for PC-Bioloid communication. Dynamically control the Bioloid’s movements from an external program using wireless communication.
E N D
CS 8903 DemoWireless Interface for the Bioloid Robot Chetna Kaur
Problem 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.
The 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.
Programming 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.
Motion 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.
Behavior 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.
Building the Wireless Interface • Bioloid supports the Zig-100 Wireless Communication Module • Supports ZigBee Communication Protocol
Building the Wireless Interface • 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!
Zig 100 Communication Protocol • 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)
Algorithm for PC-Bioloid Communication Open Serial Port Set baud rate to 57142Loop 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
Behavior Control Program to receive data • Show Development Environment Now
Protocol 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!
Interfacing with the C5M code base Interface CM5/ Bioloid Inter Robot Comm Protocol C5M Based System Zig Bee Protocol
Interface Design Interface Manager Config IRCP UDP Module (Receiver) Joint Positions Handler Serial Communication Module C5M Based System (IRCP UDP Sender) Zig100
IRCP • 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
Motion 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).
Setting Motor Positions • Minor Type: SET_TARGET_POSITIONS • Subpacket Payload contains Index Matched Array • Index = Motor Id; Value = Motor Position Index 1 Value 1 Index 2 Value 2 ………. Index n Value n
Mapping 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.
Encode 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.
Interfacing with the Huggable Huggable Interface Bioloid 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 Send Motor Positions to Bioloid
Huggable’s Motors publicstaticfinal 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
Demo • Show Demo Now!