Вы находитесь на странице: 1из 12

uArm Serial Communication Protocol 1.

0
Users Manual
Manual Revision: 1.0

5/23/2014

by Scott Gray
TABLE OF CONTENTS

Table of Contents ...................................................................................................................................................................................... 2

Document Revision History ............................................................................................................................................................... 3

uArm Overview ........................................................................................................................................................................................... 4

uArm Communication Overview ................................................................................................................................................... 4

References ...................................................................................................................................................................................................... 6

Acronyms ......................................................................................................................................................................................................... 7

Glossary ............................................................................................................................................................................................................ 8

uArm Serial Protocol Description ................................................................................................................................................. 9

uArm Serial Protocol Code Example ........................................................................................................................................12


DOCUMENT REVISION HISTORY

Revision 1.0 X00: 05/23/2014 (Scott Gray)

Initial Revision
UARM OVERVIEW

The uArm is a 4-axis, desktop parallel-mechanism robotic arm inspired by the ABB
PalletPack industrial robot arm IRB460. The uArm is made by a start-up company called
UFactory that developed the arm as part of a Kickstarter campaign.

The uArm is made up of either laser cut acrylic or wood parts and is powered by standard
R/C hobby servos. In a parallel-mechanism robotic arm, most of the mass is concentrated
on the base, making the robot much more stable and allows the upper Arm to react really
fast.

The uArm is controlled by an Arduino-compatible micro-controller board called the Uduino


and a uArm-specific Input /Output (I/O) board (called a Shield in Arduino parlance).

UARM COMMUNICATION OVERVIEW

The uArm receives communication over an asynchronous serial bit stream from either a
computer or another serial communication data source such as a microcontroller (maybe
even another Arduino!). There are two paths for the serial communication: Through a USB
to serial stream bridge chip, or through the 4-pin socket connector labeled BT on the
uArm shield board.

The Uduino uses a very common USB to UART bridge chip (the FT232RL) from a company
called FTDI. It is important that your computer have the correct software driver installed
for the computers USB port to communicate to the Uduino. The driver makes the USB
connection to the Uduino look like a serial communication (COM) port on the computer.
This is called a Virtual COM Port (VCP) driver. The references section has a link to where
you can download the appropriate driver.

The other serial path is through the 4 pin socket connector labeled BT on the uArm shield
board. This is a TTL-level serial connection that is meant to use the Blue Tooth slave radio
transceiver for communicating remotely to a computer (an excellent choice!). However, it
can also be used to directly connect another microcontroller to send commands to the
uArm.

Asynchronous serial communication is transmission and reception of digital data without the
use of an external clock signal. The data can be transmitted only as often as needed rather
than in a steady stream. Any timing required to recover the data at the receiver from the
communication data symbols is encoded within the symbols themselves.

In the case of the uArm, the data symbol rate is at a 9,600 bits per second. This is called
the baud rate. The uArm uses serial data encoded as 8 bits of data, with no parity bits,
and one stop bit (a resting period) per data symbol. This serial format is very common and
is often written as 9600 Baud, 8N1 encoding. This means it takes 9 bits per data symbol to
encode a single data byte (8 bits).
The uArm requires the position data for the uArm to be sent in a specific format in a block
of data called a data frame. Each data frame provides all the position data needed for the
uArm. For the uArm Serial Communication Protocol (SCP) 1.0, there are 11 bytes that
make up each data frame.

Details on how this serial protocol works for the uArm makes up the rest of this manual.
REFERENCES

https://www.kickstarter.com/projects/ufactory/uarm-put-a-miniature-industrial-robot-arm-
on-your Good information on the uArm.

http://blog.ufactory.cc/category/robot-arms/ - UFactorys Blog on the uArm.

http://forum.ufactory.cc/ - UFactorys User Forum.

http://en.wikipedia.org/wiki/Asynchronous_communication - Information on how


Asynchronous serial communication works.

http://www.ftdichip.com/Products/ICs/FT232R.htm - Information and device drivers for the


USB to UART bridge chip on the Uduino.

http://www.ftdichip.com/Drivers/VCP.htm - Virtual COM Port (VCP) Drivers (software) for


computers to communicate using the USB port as a serial port to the uArm.
ACRONYMS

There are several acronyms that may be used in this manual. Some are listed here for
reference.

DC Direct Current the power used to run the uArm is 5 Volts DC

PWM Pulse Width Modulation the format of the signal sent to the hobby
servos

R/C Remote Control such as an R/C radio used in hobby planes and cars
(and now robots!)

SCP Serial Communication Protocol The data link layer formatting of the data
frame

TTL Transistor-Transistor Logic digital logic levels where a 1 is > 1.6 Volts
DC and a 0 is below 0.8 Volts DC

UART Universal Asynchronous Receiver/Transmitter built-in hardware to send


and receive asynchronous serial communications

VCP Virtual COM Port Software driver to make a devices USB port look like a
serial port to a computer
GLOSSARY

There are some terms used in this reference manual that might be unfamiliar. A few are
listed here for reference.

Servo Servos are DC motors with built-in gearing and electronic feedback control loop
circuitry for positioning the actuator arms (called servo arms) based on a supplied input. A
servo contains an electric motor and is the "muscle" that controls the uArm movements.
The input for the hobby servos used on the uArm is Pulse Width Modulated (PWM) signaling
where the pulses range in width from 1,000 microseconds to 2,000 microseconds and
repeat about 50 times per second.
UARM SERIAL PROTOCOL DESCRIPTION

As mentioned in the communication overview, each data frame provides all the position
data needed for the uArm. For the uArm Serial Communication Protocol (SCP) 1.0, there
are 11 bytes that make up each data frame. The 11 bytes provide 6 values that are shown
graphically below, where the first byte that is to be transmitted is the top byte shown:

Start of Frame Byte #1 (0xFF)

Start of Frame Byte #2 (0xAA)

Base Rotation Value (Top Byte)

Base Rotation Value (Bottom Byte)

Arm Stretch Value (Top Byte)

Arm Stretch Value (Bottom Byte)

Arm Height Value (Top Byte)

Arm Height Value (Bottom Byte)

Wrist Rotation Value (Top Byte)

Wrist Rotation Value (Bottom Byte)

Grip and Mouse Control Information Byte

Each of these values will be explained in further detail on the following pages in the order
that the values must be sent.
Start of Frame (2 Bytes): The first two bytes of a uArm SCP 1.0 data frame are the
Start of Frame bytes and are ALWAYS the same value. These two bytes makes it possible
for the receiver (the Uduino) to find the start of a data frame. For uArm SCP 1.0, these two
bytes are 0xFF and 0xAA (byte FF hexadecimal, or 1111 1111 binary, followed by byte AA
hexadecimal, or 1010 1010 binary).

Base Rotation Value (2 Bytes): The Base Rotation Value is a 16-bit integer value of
uArms base rotation in degrees. The valid range is -90 to 90 decimal, or in hexadecimal
0xFFA6 to 0x005A. Note that the upper byte of the 16-bit value is sent first, followed by
the lower byte. The default starting position is 0 degrees (facing straight ahead).

Arm Stretch Value (2 Bytes): The Arm Stretch Value is a 16-bit integer value of
uArms stretch away from the base. The valid range is 0 to 210 decimal, or in hexadecimal
0x0000 to 0x00D2. Note that the upper byte of the 16-bit value is sent first, followed by
the lower byte. The default starting position is 0 (arm effector closest to base).

Arm Height Value (2 Bytes): The Arm Height Value is a 16-bit integer value of uArms
effectors height. The valid range is -180 to 150 decimal, or in hexadecimal 0xFF4C to
0x0096. Note that the upper byte of the 16-bit value is sent first, followed by the lower
byte. Also note that the uArm can have a height below the floor of the robot arm itself. Be
careful! The default starting position is 0 (arm effector at some default height from floor).

Wrist Rotation Value (2 Bytes): The Wrist Rotation Value is a 16-bit integer value of
uArms wrist rotation at the effector in degrees. The valid range is -90 to 90 decimal, or in
hexadecimal 0xFFA6 to 0x005A. Note that the upper byte of the 16-bit value is sent first,
followed by the lower byte. The default starting position is 0 degrees (wrist is not turned).

Grip and Mouse Control Byte (1 Byte): This byte is made up of 8 bits of command
information which is described on the next page. These 8 bits are sent as the last byte of
the data frame. All of the bits represent some mouse button or mouse wheel movement,
but most are not required as the position data is provided in the data frame.
Grip and Mouse Control Byte Definition:

Bit Bit Name Bit Description

7 Mouse wheel - Mouse wheel rotated in - direction when a 1(used to change


height downward, but this is already explicitly defined, so
currently unused)

6 Mouse wheel + Mouse wheel rotated in + direction when a 1(used to change


height upward, but this is already explicitly defined, so currently
unused)

5 Spare Spare bit, always send a 0

4 Right Button Mouse right button held when a 1 (used to change wrist
Hold Status rotation, but this is already explicitly defined, so currently
unused)

3 Spare Spare bit, always send a 0

2 Spare Spare bit, always send a 0

1 Release Opens grip or turns off pump when a 1, does nothing when 0

0 Grip Closes grip effector or turns on suction pump when a 1, does


nothing when a 0
UARM SERIAL COMMUNICATION PROTOCOL CODE EXAMPLE

Below is pseudocode for sending a data frame of uArm positions in the serial format for
uArm SCP 1.0:

void sendData(int rotation, int stretch, int height, int wrist_rotation, int grip){
// Send the framing characters
sendSerialChar(0xFF);
sendSerialChar(0xAA);

// Send the data


sendSerialChar((rotation & 0xFF00)>>8);
sendSerialChar(rotation & 0x00FF);
sendSerialChar((stretch & 0xFF00)>>8);
sendSerialChar(stretch & 0x00FF);
sendSerialChar((height & 0xFF00)>>8);
sendSerialChar(height & 0x00FF);
sendSerialChar((wrist_rotationt & 0xFF00)>>8);
sendSerialChar(wrist_rotation & 0x00FF);

//grip is 0x00 for no change, 0x01 for grip, 0x02 for release
sendSerialChar(grip);
}

Note that the variable grip is the value for the Grip and Mouse Control byte. Since we are
sending the values for all positions, the only values needed for grip are 1 for gripping or
turning on the suction, 2 for opening the grip or turning off suction, and 0 for no change.