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

Title of Your Dissertation

A Project Presented for the


Degree of Bachelor
To
Computing Engineering Department,
College of Engineering,
by

..
Supervised by
..
University of Tripoli
Term Year(Fall 2013)

Table of Contents
Table of Contents .................................................................................................................................... 2
Abstract ................................................................................................................................................... 3
Acknowledgement .................................................................................................................................. 3
Chapter 1 Introduction ........................................................................................................................... 3
Chapter 2 Background ............................................................................................................................ 3
Microcontrollers ................................................................................................................................. 3
Sensors and Switches .......................................................................................................................... 3
Programming Languages..................................................................................................................... 3
Chapter 3 Related Work.......................................................................................................................... 3
Chapter 4 Your Project ............................................................................. Error! Bookmark not defined.
Experiments ......................................................................................... Error! Bookmark not defined.
Testing & Evaluation ............................................................................ Error! Bookmark not defined.
Results and Discussion ......................................................................... Error! Bookmark not defined.
Chapter 5 Conclusion ............................................................................................................................ 10
Chapter 6 Future Work ............................................................................ Error! Bookmark not defined.
Reference .............................................................................................................................................. 16
Appendices............................................................................................................................................ 16

Abstract

Briefly summarizes the report.

Should describe motivations, methods, results, and conclusions.

One paragraph long (Have a words limit, e.g., maximum 500 words)

Acknowledgement
-

Acknowledge every person or instauration involved in funding, supporting, guiding, and


working on the project and thank those who have helped in the process of obtaining the
degree.

Chapter 1 Introduction
Should briefly stat and explain:
-

What is the problem

The importance of the experiment being reported, and WHY it is important

The main steps in your project to solve the problem

Overview on the following chapters

Chapter 2 Background
-

Present some background information on the key equipment and tools and WHY this was tools
was chosen.

This chapter can, for example, include sections like :

Microcontrollers
Sensors and Switches
Programming Languages

Chapter 3 Related Work


-

Survey and describes previous work that is similar to your work.

Should focus on closely related work which have been developed and introduced in the recent
years (last 5 years).

Chapter 4 Driver Layer


4.1.1 Port Monitoring
Determining the type of connection and understanding the communication protocol between the
computer and the device is the first step for successful interfacing. The Robotic Arm Controlling
Device RACD is connected with the Computer trough
a Serial Communication Port COM port, using the
RS232 protocol as the protocol for communication (fig
4.1).
The official software uses the COM port to control the
RACD which in turn controls the servo motors in the
Robotic Arm to conduct the desired movement with
minimum error and precise feedback.
Before successfully controlling the port many
uncertainties arise including.

Fig 4.1 RS232 COM port

-Buadrate.
-Data packet size and speed and end bit.
-Type of flow control.
Once determined data can be successfully monitored and exported to a file for decoding and
analysis.
The official signals that control the RACD were determined by monitoring the communication port
between the RACD and the Computer while the official software is running and active. When the
official software sends a movement signal for example the monitoring software acquires the sent
code and exports it to a text file.
The received data at first glance looked like a scrambled set of code, this code was analysed by
locating at the commonalities and recursions while testing and repeating the different commands
using the official software. The assumption was that a movement function for example will always
result in the same code combination once called again by the official software. This method proved
to be successful when interfacing in general unless some form of encryption was used to obscure the
control commands.

4.1.2 Port Monitoring Results


Advanced Port Monitor a Dedicated serial communication port monitoring program was used to
monitor the transmission between the RACD and the computer. The connection parameters were
determined by estimation and trial of other known COM devices.

Data was successfully obtained through the following settings:


Buadrate: 9600
Data Packet Size: 8 Bits 1 End bit
Flow control: none
When the data acquired from the Advanced Port Monitor was analysed and viewed in the
hexadecimal format many recurring code combinations were noticed. This was explained by the
assumption that every command has a unique set of bytes that represent it, a position command for
example will result in the same code combination when called (fig 4.2).

Fig 4.2 Received Data in HEX Format


For example, 4d 4f 56 45 50 05 01 0D is a command that moves the base servo motor to the left
from the last position the robotic arm stationed in, where (4d 4f 56 45) is the command
combination, 50 byte is a separator, 05 is the servo motor identifier number in this case the base
and the 01 is the direction which can be 1 or -1 for left and right.
In addition, the byte 0D was found in the end of all the commands sent from the official software
to the Robotic Arm Controlling Device. The 0D is a special ASCII character that represents a new
line or carriage return, the RACD keeps waiting for additional data until Carriage return is found.

it was later determined that this was true only for the case of commands being sent to the RACD.
When commands are received by the Computer from the RACD the ending byte was determined as
0A instead.
The Carriage return character was an indicator for the RACD ability to understand ASCII and it was
assumed that the HEX data was actually ASCII code and commands. By transforming the
Hexadecimal code to its ASCII equivalent the monitored code immediately became understandable
easier to decode with assembly like programming characteristics proving the recursive code
assumption. For example, the command 4d 4f 56 45 50 05 01 0D becomes MOVE 50 05 01 0D
which is easier to decode and understand.
More commands for the different functions and modes in the official software were successfully
found and noted by repeating the steps mentioned previously.
The Robotic Arm was successfully controlled by setting up a COM port session using the previously
mentioned settings and sending the noted commands and code combinations trough the COM port
to the RACD without the need for the official software.
For successful control the commands must be sent precisely as found in the decoded file, if a part
was missed or added buffer overflow might occur and the RACD will crash and require manual
reboot.

4.1.3 Robotic Arm Control Commands


All the commands that control the Robotic Arm were noted and can used with any software or
language with the correct settings. All commands must be ended with a line terminator 0D, if a
line terminator was not sent with the command the RACD interpreter will keep receiving data and
wait.
Only one command at a time can be sent to the RACD, except for the STOP command which
interrupts any current execution and immediately stops the Robotic Arm, if the arm was executing a
command and a new command was sent before the arm ends execution a busy or Error
message will be returned.
The RACD can be directly controlled trough the COM port by the following commands

COMMAND: REMOTE 0D
Check for the states of the Robotic Arm
RETURNS:
OK Robotic Arm is ready for commands
BUSY Robotic Arm is executing a movement or not connected.
ERR An error occurred or Robotic Arm is not connected.

COMMAND: HARDHOME 0D
Calibrate the Robotic Arm and the RACD by testing the Arms physical limit setting the Arm
position and checking the arm states.
RETURNS:
The command keeps returning the feedback position of the Robotic Arm while conducting
the different boundary tests. In the end the RACD returns the final calibrated position
closing with an END message.

COMMAND: MOVE 50 Y X 0D
Move one selected joint of the robot until a stop order is initiated or arm reaches its physical
limit.
INPUT:
Y Identifies which servo motor is targeted for movement
X Identifies the direction
RETURN:
None
Y=0
Move Gripper until physical limit is reached or a stop command is ordered.
X = 1 Grippers motor conducts an opening movement
X =-1 Grippers motor conducts a closing movement

Y=1
Rotate gripper physical limit is reach or a stop command is ordered
X = 1 Grippers rotates to the right
X =-1 Grippers rotates to the left

Y=2
Move wrist until physical limit is reached or a stop command is ordered.

X = 1 Wrist motor conducts an ascending movement


X =-1 Wrist motor conducts a descending movement

Y=3
Move arm until physical limit is reached or a stop command is ordered.
X = 1 Arm motor conducts an ascending movement
X =-1 Arm motor conducts a descending movement

Y=4
Move shoulder until physical limit is reached or a stop command is ordered.
X = 1 Shoulder motor conducts an ascending movement
X =-1 Shoulder motor conducts a descending movement

Y=5
Move shoulder until physical limit is reached or a stop command is ordered.
X = 1 Shoulder motor conducts an ascending movement
X =-1 Shoulder motor conducts a descending movement

COMMAND: STOP 0D
Override any order and immediately stop the Robotic Arm
RETURN:
None

COMMAND: SET ESTOP 0 0D


Release the emergency stop lock. This command is used to resume a session after the
physical emergency button was pressed and physically released.
RETURN:
none

COMMAND: FREE 0D
Free servo motors if torqued.
RETURN:
none

COMMAND: TORQUE 0D
Torque servo motors if free
RETURN:
None

COMMAND: GET POS 0D


Return the current articulate position of the arm.
RETURN:
The command returns the position as one array with all the positions of the servo motors.
P A B C D E F 0 0
P indicates a position array and the coordinates are presented with articulate values and 0 0
as ending bytes.
A Base, B Shoulder, C Elbow, D Arm, E Rotation, F Gripper
Example:
P 247 -7 -7 37 -86606 -99540 0 0
Specifies the current position of the arm in terms of the feedback system.

COMMAND RUN 50 0 A B C D E F 0 0 1 0D
Go to required articulate position, in this command all the servo motors work together in
parallel to reach the designated location.
INPUT:
A Gripper, B Rotation, C Wrist, D Arm, E Shoulder, F Base
The 50 separates the command from the coordinates and the 0 0 1 0D are end bits

Example:
RUN 50 0 50000 50691 44054 -3195 -4660 7000 0 0 1 0D
Moves the arm to the specified coordinates where all motors run in parallel to reach
destination
RETURN:
The robotic arm returns its position while moving to the designated location until the final
position is reached.
The RACD uses a special articulate coordinate system that only uses integers to define degrees and
angles. For example, 64995 in RACD articulate coordinates equal 89.9 degrees in world articulate
coordinates.
To Transform from RACD articulate coordinates to world articulate coordinates a number Linear
equations must be used. Each joint has its own linear transform equation based on its position and
characteristics. The equations were derived by using three point values as a reference.

= 0.001699 1 (1.1)

= 666.66667
1 (1.2)

= ( 0.0015) + 105 (1.3)


=

666.667

(1.4)

4.2 Matlab Robotic Arm Library


Using the decoded commands from the previous section, any standalone software can be written to
control the Robotic Arm. Once the RACD receives a command it immediately executes it without the
need of the official software.
In this specific project Matlab was used as the controlling software. Matlab is a high-performance
language for technical computing. It integrates computation, visualization, and programming in an
easy-to-use environment where problems and solutions are expressed in familiar mathematical
notation.
Matlab Instrument toolbox has a number of low level serial port manipulating functions that can be
used to send signals trough the COM port with the needed specification and control any device
connected with the port. Matlab Instrument toolbox low level functions are the backbone for
Robotic Arm Control Library written in this Project.

The Robotic Arm Control Library functions are stored in a directory with separate .m files for each
function, because Matlab only allows functions to call other functions that are in a .m file that has
the same name.
The following sections will introduce the Library, its different aspects and how to use it.

4.2.1 Robotic Arm Initialization and Shutdown


The first step for using the Robotic arm is to initialize the Serial Port connection between Matlab and
the RACD. This step will create a serial object and adjust the connection parameters to be
compatible with the RACD.
Matlab looks at the COM ports as an object that can be defined and adjusted based on the specific
application required, the COM object must be opened after creation and closed before termination.
The following function must be called to start using the Robotic Arm Library.

Obj = Init_Robot("Port Name")


Reserve and initialize the COM port with the RACD specified settings and open the specified
port for use.
INPUT:
Port Number: COM port name connected to the RACD
RETURN:
Obj: Matlab created object with the specified COM port settings.

After finishing with the Robotic Arm, the serial port COM connected with the RACD must be shut
down by releasing the COM port object and initiating an end signal. The RACD will keep on waiting
for signals even after shutdown until shut physically from the power button.
The following function is used to terminate Matlabs connection with the COM port and release it for
final shutdown or use by another software

States = Close_Robot(Obj)
Release COM port and initiate shutdown with the RACD
INPUT: Obj COM port object
RETURN: The states of the Port

4.2.2 Robotic Arm Calibration


After initialization and before use the RACD must be calibrated
using the Calib_Robot() In the provided Robotic Arm Library. If
the Robotic Arm was not calibrated before use the RACD
feedback system will calculate wrong coordinate results
assuming the robot is on the calibrating position when turned
on.
The RACD calibrates the Robotic Arm by testing the limits of all
the servo motors. For example, when calibrating the base
motor, the robotic arm will rotate towards the right limit until
the right base limit sensor activates. Once reached the Robotic
Arm will rotate towards the left limit until the left limit sensor
activates. The same process is repeated with all the servo
motors ending in the final calibrated position Fig(4.3).
Calib_Robot is designed as a locked function where Matlab
cannot be used until this function ends with the end of the
calibration processes, so that no signal can be sent to the RACD.
If a signal is sent while the Arm is busy the RACD will send a Busy
signal or in some cases crash.

Fig 4.3 Robotic Arm Calibrated


Position

Pos= Calib_Robot(Obj)
Calibrate Robot
INPUT: Obj COM port object
RETURN: The location of the arm after calibration ideally 0,0,0,0,0

4.2.3 Robotic Arm Positioning


Once calibration is set and the Arm is in its final calibrated position, the arm can be used as needed
in different applications.
The robotic Arm has two systems of movement.:
1- Cartesian System:
A coordinate system that uses Cartesian dimension (X, Y, Z) as the bases for positioning the
Robotic Arm in space. This system is complex to analyse from the RACD prospective, but easy to
visualize from a humans prospective.

The RACD built in Cartesian system processing


is minimal and unpractical for position
applications. For example, the official
software can only processes and initiate
Cartesian movement if the wrist angle 3 in
(fig 4.4) doesn't change and remains constant.
For the reasons mentioned above new
methods to solve this problem will be
discussed in the next chapter.

2- Articulate System:

Fig 4.4 Robotic Arm DOF

The articulate system is a coordinates system


defined in terms of Degrees for movement and feedback in space. The Labvolt 5250 Robotic Arm
has 5 degrees of freedom.
Using the Articulate System is straight forward and easy for the RACD to processes, however
because humans naturally processes space in Cartesian coordinates, from a human prospective
the articulate system is unfavourable in dynamic position applications.
To move the arm to a target five angles must be defined Base, Shoulder, Arm, Wrist, Wrist
rotation, in addition to gripper length.
As mentioned the RACD strictly uses integers and doesn't accept floating point values, the angles
must be transformed from the regular angle system to the RACD value system using Equations
(1.1,1.2,1.3,1.4)
The following function can be used for different positioning tasks:

Position = Grade(Obj)
Get position in world articulate coordinates.
INPUT: Object connected to the RACD COM port
OUTPUT: Regular articulate coordinates

Position = Go_Robot(Obj,Gripper,Wrist_Rotate,Wrist,Arn,Shoulder,Base)
Move Robotic Arm to designated position.
INPUT:
Obj: Object connected to the RACD COM port
Gripper: Size of gripper

Wrist_Rotate, Wrist ,Arm ,Shoulder , Base: World articulate angles for the destination
RETURN: The final position after movement.

Position = Go_Robot_Lock(Obj,Gripper,Wrist_Rotate,Wrist,Arn,Shoulder,Base)
Move Robotic Arm to designated position, lock Matlab and wait until arm reaches
designated position.
INPUT:
Obj: Object connected to the RACD COM port
Gripper: Size of gripper
Wrist_Rotate, Wrist ,Arm ,Shoulder , Base: World articulate angles for the destination
RETURN: The final position after movement.

Stop_Robot(Obj)
Stop any current movement the Robotic Arm is conduction
INPUT: Object connected to the RACD COM port
OUTPUT: Regular articulate coordinates

Wait_Robot(Obj)
Check if arm is moving and lock Matlab and force user to wait until arm finishes conducting
its movement.
INPUT: Object connected to the RACD COM port
OUTPUT: Regular articulate coordinates

mJoint_Robot(Obj)
Move one joint of the robot until a stop order is initiated or arm reaches its physical limit
INPUT: Object connected to the RACD COM port
OUTPUT: Regular articulate coordinates

4.2.4 Robotic Arm Additional Functions

The RACD has a number of other options that can help enhance the experience of using the Robotic
Arm. The emergency button available as a separate unit can be used as a safety measure when
pressed however the RACD remains locked until it is release by a specific order.
In addition, the servo motors in the Robotic Arm can be torqued or freed based on the application
used, for example if the application needed deals with weight it is better to set the Robotic Arm in
torque mode to give sustained power to the Robotic Arm.
The following functions represent the different modes

Emergency_Robot(Obj)
Move one joint of the robot until a stop order is initiated or arm reaches its physical limit
INPUT: Obj COM port object
RETURN: Message from the RACD stating the action performed

Release_Robot(Obj)
Release servo motors
INPUT: Obj COM port object
RETURN: Message from the RACD stating the action performed

Torque_Robot(Obj)
Torque servo motors
INPUT: Obj COM port object
RETURN: Message from the RACD stating the action performed

4.2.5 Robotic Arm Remarks


All the function in the Robotic Arm Library check for the availability of the arm and its states before
conducting their respective functions.
The functions mentioned above use "Printf" for sending and "scanf" for receiving data from the
RACD. Both function are low level function and caution should be taken when sending commands
manually to make sure that the line terminator is sent.
In addition, the RACD waits for a line terminator 0d when sending data which can be specified in
Matlab however when the RACD sends data the receiving user should look for 0A as a terminator.

By trial it was found that Matlab cannot change between terminators in the middle so a better
solution to check if data is received is by looking into the Input Buffer.
When busy the robotic arm usually sends a busy signal however there is a chance that the RACD will
crash if data is sent while busy or unknown commands are sent.
If the gripper in the Robotic Arm is not moving, make sure that the gripper is set manually to SERVO
mode using the physical manual controller provided with the RACD.

4.3 Conclusion
The Robotic Arm Controller Device was successfully interfaced and the Robotic Arm now can be used
independently without the Original Software.
Using the provided low level commands, the RACD can be interfaced in any system required with
any programming language specified for example C++. The only requirement is to setup a successful
connection with the parameters mentioned in the previous sections and send the commands
exactly.
For this project A Matlab library was developed and ready for use. the functions in the library handle
all the low level tasks and give the user the opportunity to focus on higher level problems.

Chapter 5 Conclusion & Future Work


-

Short restatement of important points being presented in the report

Explain how useful the methodology and the results are.

Mention any restrictions, limits or weak points related to the use of the results.

Suggest as a future work what the next step(s) in the study should be to overcome the limitation
or advance the study further

Reference
-

Ccommon knowledge in the field does not need to be referenced such as PI=3.14159 or F=ma.

References from books, essays, journals, World Wide Web, and personal communications must
be clearly stated here.

Appendices
-

Includes extra information and any other supporting information such as code, maps

Вам также может понравиться