Documente Academic
Documente Profesional
Documente Cultură
Cartesian Robot
Faculty of Engineering
Sri Lanka Institute of Information Technology
1
DECLARATION
I declare that this is my own work and this report does not incorporate without
acknowledgement any material previously submitted for a Degree or Diploma in any other
University or institute of higher learning and to the best of our knowledge and belief it does
not contain any material previously published or written by another person except where the
acknowledgement is made in the text.
Also, I hereby grant to SLIIT the non-exclusive right to reproduce and distribute my report,
in whole or in part in print electronic or other medium. I retain the right to use this content in
whole or part in future works (such as articles or books)
2
ACKNOWLEDGEMENT
We would like to thank our friends and colleagues for assisting in the successful build of our
first Cartesian Robot. It was a delightful experience which all of us accept with gratitude.
We would thank to our lectures and instructors for proving us assistance in various problems
encountered during course of our project
We would like to express our gratitude towards our own group members for their kind co-
operation and encouragement which helped us in completion of this project.
We would like to express our special gratitude to all other people who have not been mentioned
here, whom helped us in various ways to make this a success.
Along with all the acknowledgement, we would like to specially recognize and thank Mr.
Prabhath Buddhika, for his guidance, time and providing us with a systematic way to complete
the robot throughout the course of the project. We also would like to recognize his assistance
in solving the technical problems and various other problems we faced during the build of the
robot.
3
1. INTRODUCTION
Project Requirement
In this project our group was requested to manufacture a robot which is capable of
acquiring various respective Cartesian 3-dimenstional locations according to user inputs. This
project was mainly conducted under the requirements of second year second semester
Electronics and Electrical Engineering module Introduction to control and robotics at Sri
Lanka Institute of Information Technology. To accomplish the above mentioned requirements
of the module, our group members were able to design a simple precisely calibrated Cartesian
robot with various mechanical and electronic resources.
How it works
To accomplish the requirements in this module project, our group members were
advised by our mentor Mr. Prabhath Buddhika to use three linear actuators to acquire positions
in 3-dimenstional X, Y, and Z coordinates plane. And to use a matching pointer (End Effector)
to point an exact location.
As our project requirement in this Cartesian robot we have to implement 3 moving axis
s to acquire positions in X Y and Z axis s. To implement 3 axis s in a proper form our group
members decided design a 3D model of Cartesian robots axis s.
4
Figure: Y axis of the Robot
After designing the axis s separately we planned about assembling respective axis s
together. Therefore we designed another 3D model for assembling three axis s.
5
When making the robot our plan was to use sliders as linear actuators in each axis.
After doing some research our group came up with the idea to use drawer sliders for obtain
movements in axis s. In the research our group members were able to find there are drawer
slides in market with the expansion range of 25 Inches and 12 inches. Therefore we designed
our robot to get matching dimensions to use drawer slides.
Rotary Encoders
DC geared motors
Thread Bars
Drawer Sliders
Razor Wheels
6
2. DESIGN PRINCIPLES
When designing the Cartesian robot we used both mechanical and electronic and
material engineering principles to implement our product properly. As everyone can observe
in the usual world robotics is an area which is mainly connected with above three engineering
concepts.
When consider about the usage of material engineering concepts in design implementation,
mainly they are connected with the physical frame of the Cartesian robot. When consider
about the frame of the robot our group members had to select best matching material to
implement the axis s and other parts. When selecting materials our members had to consider
about following facts,
Cost
Easiness of handling
Strength
weight
When consider about the easiness of handling our members considered about sectioning the
material in to smaller parts and assembling the smaller parts to manufacture the frame. After
considering all the facts our group members decided to use aluminum as the main raw
material for the Cartesian robot. When consider about assembling the part to manufacture the
robot frame our group members decided to use three way joints to connect aluminum bars
instead of welding them together.
When manufacturing the robot we used aluminum bars to manufacture our robot
frame. When selecting the aluminum square tube we selected 6063 aluminum square tube
with 1x1 inch dimensions. The reason to choose that model was it was the lightest aluminum
tube we were able to find. Weight was a key factor for our material selection because the
frame should able to movable by a single motor
7
Figure: Aluminum Square Bars
8
Square Tube connectors (3 way)
As mentioned before we used square tube connectors to assemble our Cartesian robot
frame. Square tube connectors make connecting aluminum bars way easier. These are made
out of plastics and have good strength to tolerate serious amount of load. These can be found
in various sizes and for our robot we choose 1sq inch connectors because we used 1 sq. inch
aluminum bars.
Thread Bars
We used thread bars to obtain movements in 3 axis s. These are made out of steel and
there is a screw thread all over the length of the rob. Screw thread is a helical structure used
to convert rotational motion to linear motion. In thread bars there are two type of thread bars
called left handed and right handed thread bars. They are named according to their orientation
of helical structure.
9
Mechanical Engineering Concepts/components
Drawer Slides
We used drawer slides to attach X, Y and Z axis s to our robots main frame movably.
These slides are commonly used in furniture like drawers cupboards etc. These are capable of
sliding a connected component with a very low fiction. These slides offer very smooth
movement while the operation. These are made out of metal and plastic with a linear motion
baring.
10
Stepper Motors
In our Cartesian robot we used a stepper motor to obtain the motion in X axis. Stepper
motors are DC motors that move in discrete steps. They have multiple coils that are organized
in groups called "phases". By energizing each phase in sequence, the motor will rotate, one
step at a time. The advantage of stepper motor is, stepper motors are capable of achieving
positions and good speed with a computer controlled stepping. In our robot we used a
SANYO DENKI Step-Syn Stepping motor.
11
Figure: Mini DC Gear Motor
Arduino
Arduino is an open-source electronics platform based on easy-to-use hardware and
software. Arduino boards are able to read inputs and give outputs which is really important to
this whole project. In arduino we are able to give commands to the board what to do by
sending a set of instructions to the microcontroller on the board. To give instructions to the
board normally arduino programming language and arduino IDE will be used.
12
Figure: Arduino LOGO
Why Arduino?
Arduino has been used in thousands of different projects and applications. The
Arduino software is easy-to-use for beginners, yet flexible enough for advanced users. It runs
on Mac, Windows, and Linux. Following are the main reasons to choose arduino over other
microcontrollers.
Inexpensive
Simple, clear programming
Open source and extensible software
Open source and extensible hardware
13
Arduino MEGA 2560
Atmega2560 Specification
Microcontroller ATmega2560
Operating Voltage 5V
Input Voltage (recommended) 7-12V
Input Voltage (limits) 6-20V
Digital I/O Pins 54 (of which 14 provide PWM output)
Analog Input Pins 16
DC Current per I/O Pin 40 m
DC Current for 3.3V Pin 50 mA
Flash Memory 256 KB of which 8 KB used by boot loader
SRAM 8 KB
EEPROM 4 KB & Clock Speed 16 MHz
14
Figure: Arduino Mega 2560 Board
Arduino UNO
As mentioned before our group members choose two micro controllers to include in our
Cartesian robot due to excess number of components we have to control. As a cheap and
effective option our group members were able select Arduino UNO microcontroller as our
secondary microcontroller. The Arduino Uno is a microcontroller board based on the
ATmega328 (datasheet). It has 14 digital input/output pins (of which 6 can be used as PWM
outputs), 6 analog inputs, a 16 MHz crystal oscillator, a USB connection, a power jack, an
ICSP header, and a reset button.
Specifications of ATmega328
Microcontroller ATmega328
Operating Voltage 5V
Input Voltage (recommended) 7-12V
Input Voltage (limits) 6-20V
Digital I/O Pins 14 (of which 6 provide PWM output)
Analog Input Pins 6
DC Current per I/O Pin 40 mA
DC Current for 3.3V Pin 50 mA
Flash Memory 32 KB of which 0.5 KB used by
Bootloader
SRAM 2 KB
EEPROM 1 KB
Clock Speed 16 MHz
15
MIT APP INVENTOR 2
As mentioned before our groups decision was to use an android application to give
inputs to our Cartesian robot. To develop an android application we used MIT App Inventor
2 web application. MIT app inventor is an open source web application which allows
newcomers to computer programming to create software applications for the Android
operating system (OS). It uses a graphical interface for easiness. This web application was
previously developed by google but it is now maintained by Massachusetts Institute of
Technology (MIT).
16
L298N Motor Driver
When connecting motors in our Cartesian robot we used L298N motor drivers to
drive stepper and DC motors. The main reasons for use motor drivers with arduino board is
microcontroller is not capable of giving enough output power to drive motors and when
motors are rotating they generate back EMF which can damage the controller. Therefore
avoid damaging the arduino MEGA 2560 board we used L298N motor drivers with it.
Following are the specification of L298N motor driver from its data Sheet.
17
3. DESIGN METHOD
Hardware Implementation
When designing this Cartesian robot our group members had to implement a robot
with 3 degrees of freedom. Following are the three degrees of freedom our group wanted to
implement,
When designing the 3 degrees of freedom movements our members had to decide and match
which type of actuators should be included in our robot design. Due to the requirement of
use linear actuators following are the options we had to choose,
Linear sliders
Rack and pinion
Lead screw
In our robot design X axis was designed as the base of our robot. To the X axis, our
group members decided to use sliders to perform the movements. Instead of buying
mechanical motorized sliders our group members decided to design and manufacture few
linear sliders to our robot by ourselves.
To perform the movement in Y axis, our group members idea was to use linear
sliders in Y axis also as same as we decided in the X axis movement. But in here we decided
to use slightly smaller size sliders in Y axis because of some issues can be occur when
assembling the all three axis s.
When designing the Z axis, some problems were occurred to our group, because the Z axis
should move vertically instead of moving horizontally like other two axis s. But our group
members decided to use same techniques which we used to design X and Y axis to the Z axis.
18
When designing the Cartesian robot our group members also had to do a material selection to
manufacture the frame of the Cartesian robot. When selecting the material easiest and
cheapest option was the Aluminum box bars. Aluminum box bars were matched perfectly to
our requirements when considered in terms of assembly and cost. When connecting the
aluminum bars together we used plastic three way joints instead of welding them.
19
As mentioned before our group members decided to manufacture mechanical
motorized sliders to use in the robot. The reason to above statement was mechanical
motorized sliders which are required to build the robot were too much expensive (more than
US $100 per each) and our group members not wanted to spend that much of budget on
sliders. Due to that reason we used few drawer slides and thread bars and motors to
manufacture sliders. Actually these were not a single motorized sliders, our group members
were able to perform sliding effect in our robot using above three components (Drawer slides,
Motors & Thread bar).
Figure: Cartesian Robot Frame after implementing the drawer sliders to move X, Y and Z
axis s respectively.
When using motors, we used one stepper motor and two dc motors to move 3 axis s.
In our Cartesian robot the Y and Z axis planes are connected to x axis due to that x axis was
heavy and using a DC motor we were not able to move it effectively. Then we used a stepper
motor to obtain the motion of X axis. We used a SANYO DENKI step-syn 1.53 V 3A stepper
20
motor to rotate the thread bar connected to the X axis. In All X, Y and Z axis s we used a
rotating thread bar and a Female threaded nut to produce the linear motion in each respective
axis.
Figures: The way we managed to produce lead screw effect to obtain linear motion in X axis.
21
In the Y and Z axis s our group decided to use geared DC motors instead of using stepper
motors due to low load on them. While using geared DC motors to Y and Z axis s our group
members decided to use same techniques we used to implement x axis to use in Y and Z axis
planes. And we also managed to use optical rotary encoders to DC motor due to the reason
DC motors are not good in positioning as stepper motors.
22
Software Implementation
Figure 01
In the Figure above shows the code we have been worked on. This section describe
about the code. In the above figure 01, volatile is a keyword known as a variable qualifier, it
is usually used before the datatype of a variable, to modify the way in which the compiler and
subsequent program treats the variable. A variable should be declared volatile whenever its
value can be changed by something beyond the control of the code section in which it
appears, such as a concurrently executing thread. In the Arduino, the only place that this is
likely to occur is in sections of code associated with interrupts, called an interrupt service
routine.
In the above figure, the const keyword stands for constant. It is a variable qualifier
that modifies the behavior of the variable, making a variable "read-only". This means that the
variable can be used just as any other variable of its type, but its value cannot be changed.
You will get a compiler error if you try to assign a value to a const variable.
Constants defined with the const keyword obey the rules of variable scoping that govern
other variables. This, and the pitfalls of using #define, makes the const keyword a superior
method for defining constants and is preferred over using #define.
23
As the above figure shows there are integer, string and char type variables have
created in our code. As we have created an application in order to pass the values for X,Y and
Z; in order to get receive the values from the phone we have attached a Bluetooth module so
we can easily pass the number to the Arduino Mega 2560. So receiving the values as
character values to separate we used the idea about the assigning to a string buffer or in other
words character buffer. In the fifth line there is a char charBuf[50] that is the reason.
Figure 2
24
Figure 3
The above shown Figure 02 and Figure 03 is the main program. In this project we have used
encoders to get the value where the X-axis, Y-axis and Z-axis located. We have used
interrupt it there is any values is been changed so that the system knows which parameter.
The first parameter to attachInterrupt is an interrupt number. Normally you should use
digitalPinToInterrupt(pin) to translate the actual digital pin to the specific interrupt number.
For example, if you connect to pin 3, use digitalPinToInterrupt(3) as the first parameter to
attachInterrupt. There are pins for interrupts to be generated. In the Arduino Mega2560 there
are pin number following 2, 3, 18, 19, 20 and 21. Interrupts are useful for making things
25
happen automatically in microcontroller programs, and can help solve timing problems. Good
tasks for using an interrupt may include reading a rotary encoder, or monitoring user input.
If you wanted to insure that a program always caught the pulses from a rotary encoder, so that
it never misses a pulse, it would make it very tricky to write a program to do anything else,
because the program would need to constantly poll the sensor lines for the encoder, in order
to catch pulses when they occurred. Other sensors have a similar interface dynamic too, such
as trying to read a sound sensor that is trying to catch a click, or an infrared slot sensor
(photo-interrupter) trying to catch a coin drop. In all of these situations, using an interrupt can
free the microcontroller to get some other work done while not missing the input.
In the Figure 02 Serial begin (9600) means, Sets the data rate in bits per second (baud) for
serial data transmission. For communicating with the computer, use one of these rates: 300,
600, 1200, 2400, 4800, 9600, 14400, 19200, 28800, 38400, 57600, or 115200. You can,
however, specify other rates - for example, to communicate over pins 0 and 1 with a
component that requires a particular baud rate. An optional second argument configures the
data, parity, and stop bits. The default is 8 data bits, no parity, and one stop bit.
pinMode() basically describe the configures the specified pin to behave either as an input or
an output. See the description of digital pins for details on the functionality of the pins. As of
Syntax is following pinMode(pin, mode). Pins will be any digital pins and mode will be
output or input.
digitalRead() basically reads the value from a specified digital pin, either HIGH or LOW. The
syntax is the following digitalRead(pin). Parameters the number of the digital pin you want to
read (int). This returns the value whether it is high or low.
Serial.println() command prints data to the serial port as human-readable ASCII text. This
command can take many forms. Numbers are printed using an ASCII character for each digit.
Floats are similarly printed as ASCII digits, defaulting to two decimal places. Bytes are sent
as a single character. Characters and strings are sent as is. For example:
26
Serial.print("Hello world.") gives "Hello world."
In this we have used while loops to check whether the user have given any data to move
along the 3D axis. Its always check whether the conditions are correct so that it can be
executed the command.
Figure 04
in this we have given PWM signals to the DC motors which is in the Y-axis and Z-axis. That
is given as analogWrite().Writes an analog value (PWM wave) to a pin. Can be used to light
a LED at varying brightnesses or drive a motor at various speeds. After a call to
analogWrite(), the pin will generate a steady square wave of the specified duty cycle until the
27
next call to analogWrite() (or a call to digitalRead() or digitalWrite() on the same pin). The
frequency of the PWM signal on most pins is approximately 490 Hz. On the Uno and similar
boards, pins 5 and 6 have a frequency of approximately 980 Hz. Pins 3 and 11 on the
Leonardo also run at 980 Hz.On most Arduino boards (those with the ATmega168 or
ATmega328), this function works on pins 3, 5, 6, 9, 10, and 11. On the Arduino Mega, it
works on pins 2 - 13 and 44 - 46. Older Arduino boards with an ATmega8 only support
analogWrite() on pins 9, 10, and 11. You do not need to call pinMode() to set the pin as an
output before calling analogWrite(). The analogWrite function has nothing to do with the
analog pins or the analogRead function.
In this void loop we have called a function which was declared below in the program so that
we can make the code more efficient and shorter. From the void loop function onwards we
have come up with functions which we can call them in the void loop over and over again.
28
These above Figures represents the functions which we have coded to make the successful
project in order. These functions works differently from each other in order to various
performance in our product. So that the X-axis, Y-axis and Z-axis can be moved along the
axis. Also we will get a feedback value which the position of the X, Y and Z will be currently
be, by the help of the encoders. This is also will appear in the application which we have
developed by using MITapps.
29
Inputing the Cartesian Robot and User Interface
When designing the cartesian robot our group members had to decide about how to control
the this robot and how to give inputs to this cartesian robot. For the control and Instructions,
our group member decided to use arduino platform due to the easiness of handling. For the
giving inputs our group members had to choose an effective way from following options.
By considering facts that android is a common operating system among most of the persons
and user friendlyness our group members decided to develop an android application to give
input to the Cartesian robot.
When designing the android application we used MIT app Inventor 2 web
application. The MIT App Inventor is a great web application for begineers in android
application developing. It allowed us to creat our application using a graphical user interface.
Following are few screenshots from our application.
30
Figure: Cartesian robot controller app user interface
As mentioned before we used graphical user interface to develop our android application .we
used given blocks in MIT app inventor web application to program our android application
and using the web application we were successfully able to input x y and z axis coordinates to
arduino mega 2560 board using a serial read. Following diagrams shows the graphical
structure of our application.
31
Figure: Designing the User interface of the android application
Figure A
32
Figure B
Figure C
33
4. Performance and Limitations of the Product
When consider about the project we were able to successfully complete our task
within three weeks of time. As we were requested to complete in this project we were able to
complete our Cartesian robot using linear actuators.
Ranges of Axis s
X axis 30 cm Range
Y axis 20 cm Range
Z axis 10 cm Range
Bluetooth Connectivity
Smoothness
Low noise
Low weight
34
Advantages of this Cartesian robot
In this robot, from the point of view of our group there are very good
advantages for users. Following are the advantages according our point of view.
When consider about advantages as the point of view of our group we consider
wireless control interface is a really good advantage of using this Cartesian robot. In
our Cartesian robot it allows user to control it within a 30 feet range.
Low Cost
To implement the complete Cartesian robot, our total cost was LKR 9987.25.
Therefore with comparison to other X Y Z axis robots in the market LKR 9987.25 is
lot less.
Compatibility
Android is the worlds most common mobile platform. 76% of smart phone users use
android as their main mobile operating system. Therefore using an android app to
control this robot becomes more valuable.
Easiness of Maintaining
In this Cartesian robot we never used any of welding or permanent joints when
assembling the parts. All of connections we used in assembling were either nut and
bolt or plastic joints. Therefore user with a few experience with this Cartesian robot
can easily assemble all the parts of this robot. When consider about electronic
components, all the parts connected to arduino board are upgradable.
35
Budget Report of this Project
36
Limitations of this Cartesian Robot
In this robot, there are few limitations the user may observe. Following are the
limitations of this robot.
Time Consumption
In this robot we were not able to make all three axis s to move in same time.
According to the algorithm we used in this robot will point a position in the 3D space
after moving axis s one by one. Therefore the robot take some time to go to a position
in 3 Dimensional Space.
Above are the specifications and limitation of our Cartesian robot. But in overall the
limitations can be reduced by code optimizations. As we understood as a team the limitations
of our product is mainly caused by lack of experience in Arduino programming field. And
also time limitation was one of main reasons to cause limitations in this product.
37
5. Future Enhancements
In this group project we were only requested to build a Cartesian robot using linear
actuators. When consider about practical life robots there are very useful robots which are
using our robots capabilities as a part of it. In most robots only difference is the end effecter
when compared to our Cartesian robot. In our robot we only requested to point a position in 3
dimensional space therefore we did not have the need of designing a special end effecter. As
future enhancements of this robot, our group members would like to propose following useful
machineries.
3D printers.
Pick and Place Machines.
CNC Punching Machines.
CNC Lathe Machines.
XYZ Dispensing machines.
3D Printer
This machine can be used to synthesize a three dimensional object by forming layers of
material under control of computer. Creating object can be almost any shape and they can be
produced using a digital 3D model. In these machines end effecter movement system works
exactly same as our Cartesian robot. Therefore we can enhance our product to a 3D printer by
manufacturing 3D printing end effecter.
38
Pick and Place Machine
These robots are capable of dispensing a solution like glue, cake Icing etc. These machines
usage is varying with the application. Also these machines use positioning in 3D space so that
our Cartesian robot can be modified as a XYZ dispensing system by making some changes to
the end effector.
39
CNC (Computer Numerical Control) Milling machines
These machines are widely used in mechanical engineering environments. CNC milling
machines are vertical mills with the ability of moving the spindle alone X, Y and Z axis s.
Milling is the machining process of using rotary cutters to remove material from a work piece
to form a new design. In CNC milling machines the process can be controlled using a
computer to get maximum accuracy and quality. To move the spindle in CNC milling
machines there are XYZ positioning control system integrated. By making some changes to
our Cartesian robot we can enhance its ability as a CNC milling machine.
These machines are used to punch holes on various surfaces. In CNC punching machines the
productivity has increased in punching under control of a computer. In these machines there
is XYZ movement system to move end effecter to different positions. Therefore by making
some changes to our machine we can enhance it as a CNC punching machine.
40
6. Conclusion
In the project we have completed every procedure in an order so that anyone can use
our product. As a team, the team members worked together in order to complete the objective
which was given under the module of EC2481 Introduction to Controls and Robotics which
was conducted by Mr. Prabhath Buddika our mentor. In the field of industry the most
important component is the team work. Through this project team member worked as one
unite. Also there are many other components which is very important such as the knowledge,
principles, skills etc.
So through this project which was handed over to Group No: ICR/2016/13 learned and shared
a lot of skills, theories, knowledge with each other and successfully completed the project
before the deadline. Also we have able to develop an app for simplicity for use the product
which we can give the coordinates and move the X-axis, Y-axis and Z-axis. The user can
download the application and install the application in the smart phone. For further
information we have created a help section in the application itself so that it can guide the
user. The making of the application is mentioned above section.
41
7. References
2. Arduino.cc
3. Punching machine - Wikipedia, the free encyclopedia
https://en.wikipedia.org/wiki/Punching_machine#CNC_punching
4. Milling (machining) - Wikipedia, the free encyclopedia
https://en.wikipedia.org/wiki/Milling_(machining)#Computer_Numerical_Control
5. SMT placement equipment - Wikipedia, the free encyclopedia
https://en.wikipedia.org/wiki/SMT_placement_equipment
6. 3D printing - Wikipedia, the free encyclopedia
https://en.wikipedia.org/wiki/3D_printing
7. DC motor - Wikipedia, the free encyclopedia
https://en.wikipedia.org/wiki/DC_motor
8. What is a Stepper Motor? | All About Stepper Motors | Adafruit Learning System
https://learn.adafruit.com/all-about-stepper-motors/what-is-a-stepper-motor
9. Bluetooth Module HC-05 - ePro Labs WiKi
https://wiki.eprolabs.com/index.php?title=Bluetooth_Module_HC-05
10. App Inventor for Android - Wikipedia, the free encyclopedia
https://en.wikipedia.org/wiki/App_Inventor_for_Android
42