Download International Journal of Science, Engineering and Technology

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Immunity-aware programming wikipedia , lookup

Control theory wikipedia , lookup

Distributed control system wikipedia , lookup

Resilient control systems wikipedia , lookup

Control system wikipedia , lookup

Electric motor wikipedia , lookup

AC motor wikipedia , lookup

Metadyne wikipedia , lookup

Brushless DC electric motor wikipedia , lookup

Induction motor wikipedia , lookup

Brushed DC electric motor wikipedia , lookup

Variable-frequency drive wikipedia , lookup

Rotary encoder wikipedia , lookup

Stepper motor wikipedia , lookup

Transcript
International Journal of Science, Engineering and Technology Research (IJSETR)
Volume 3, Issue 5, May 2014
PC Based Position Control for Robot Arm
Ngu Wah, Kyaw Thiha
Department of Mechatronic Engineering
Mandalay Technological University
[email protected], [email protected]

Abstract— Nowadays, robots are widely used in many
applications such as military, medical application, factories,
entertainment, automobile industries and etc. In the world of
robotics, robot arm has become popular to help automation in
place of human. So, this system is implemented to control the X,
Y positions of stepper motors for robot arm. The position
control system of robot arm used a peripheral interface
controller (PIC18F452), three stepper motors and rotary
encoder. The PIC acts as the main controller of the position
control system and three stepper motors are used for robot arm
rotation. For feedback on motors, the rotary encoder is used to
record the changes in position. To control the motors position,
the input commands are applied to the motor driver through
the PC. This system can control the robot arm during the
310mm X position and 310 mm Y position. This system is
implemented by using Visual Basic. Net and MikroC Pro.
In this system, PIC18F452 microcontroller is used because
it can provide serial communication interface and incorporate
all of the peripheral I/O facilities that is needed. Personal
computer (PC) is used as graphical user interface (GUI) for
monitoring and control of the devices. The implementation of
position control system is provided by Visual Basic. Net
(VB.Net), and MikroC programming languages. Depending
on the control commands on VB.Net window, robot arm will
move exactly the required position.
20 cm
2
m
0c
Y motor
Z motor
X motor
Keywords—PIC18F452 microcontroller, Stepper motor, Rotary
encoder, Visual Basic. Net, MikroC Pro.
Figure 1. Sketch Design of the Robot Arm
I. INTRODUCTION
During the past few decades, industrial robots have
become a very important factor in the manufacturing
industries. A robot can be describes as a mechanical device
programmed to perform a task under automatic control.
Robots are used effectively in application where a
complicated process is going to be repeated. They are also
used effectively in hazardous areas, where a person might be
harmed by fumes, high temperature or other harmful factors.
Unlike human labors, robots do not need heat, light, coffee
breaks, overtime pay and worker’s compensation insurance.
So, robot is important and useful device for many industries
[1].
As robot is important, the position control for robot arm is
also important to correctly perform tasks in industry. This
system is designed the real time position control for robot
arm that is used to correctly pick and place object. This
system contains three axes that are the X direction stepper
motor, Y direction stepper motor and Z direction stepper
motor. Stepper motors are used to control the motions of the
robot. Sketch design of the robot arm is shown in Figure 1.
Three degree of freedom (3-DOF) plastic robot arm is
proposed in this system. It is the combination of individual
joints where the action must be controlled in order to perform
tasks on the desired motion cycle. The robot arm motion will
be controller with the inverse kinematics solution.
Ma Ngu Wah, Department of Mechatronic Engineering, Mandalay
Technological University (MTU), Mandalay, Myanmar, +959425274457,
[email protected].
Dr. Kyaw Thiha, Department of Mechatronic Engineering, Mandalay
Technological University (MTU), Mandalay, Myanmar, +95943035800,
[email protected].
II. SYSTEM BLOCK DIAGRAM
The overall block diagram of the system is shown in Figure
2. In this system, the PIC18F452 microcontroller, stepper
motors, MAX232 IC and rotary encoder are used for position
control of pick and place robot arm. For picking and placing
process, the position of robot arm is important.
Driver-1
M1
(X)
RS232
PC
Serial
Interface
Circuit
PIC
MICROCONTROLLER
Driver-2
M2
(Y)
Driver-3
M3
(Z)
Encoders
Figure 2. Block Diagram of the Position Control System for
Robot Arm
In this system, three stepper motors are used to design
three degree of freedom (DOF) and to control the motions of
robot arm such as X motor, Y motor and Z motor. The
position of motion for robot arm is controlled by using
control commands of VB.Net. After pressing the command
buttons on VB.Net window, the required signals send to the
1
All Rights Reserved © 2014 IJSETR
International Journal of Science, Engineering and Technology Research (IJSETR)
Volume 3, Issue 5, May 2014
RS-232 serial port with serial communication. RS-232 also
sends the receiving signals from PC to PIC microcontroller
via MAX232. Depending on the receiving signals, PIC
microcontroller controls the required motions. And then, the
X-axis stepper motor, Y-axis stepper motor and Z-axis
stepper motor can rotate forward or backward to position.
III. SYSTEM HARDWARE COMPONENTS
This system consists of several units or modules. These are
• PIC18F452 microcontroller
• Unipolar stepper motor
• Stepper motor driver
• Rotary Encoder
• Interfacing circuit between PC and PIC
Overall circuit diagram of the proposed system is shown in
Figure 3.
E1
TIP
122
B. Unipolar Stepper Motor
Stepper motor is an electromechanical device which
coverts electrical pulses into discrete mechanical movements.
The number and rate of the pulses control the position and
speed of the motor shaft. The motor rotation has several
direct relationships to this applied input pulses. The sequence
of the applied pulses is directly related to the direction of
motor shafts rotation. The speed of the motor shaft's rotation
is directly related to the frequency of the input pulses and the
length of rotation is directly related to the number of input
pulses applied. The unipolar stepper motors have the
advantage of producing high torque at low speeds [4, 5].
TIP
122
VDD
VDD
E2
motor. Encoder is connected at RC0, RC1, RC2 and RC3.
And then, MAX232 IC is connected at RC6 and RC7.
10KΩ
X motor
10KΩ
10KΩ
E2
TIP
122
TIP
122
10KΩ
GND
VCC
10KΩ
13 OSC1/CLK1
1
MCLR/VPP
VCC
16
2
1
6
From
PC
R2OUT
T2IN
2
7
8
3
8
7
4
9
5
+V
2 RA0/AN0
3 RA1/AN1
4 RA2/AN2/VREF5
RA3/AN3/VREF+
6
RA4/TOCK1
7
RA5/AN4/SS/LVDIN
14 RA6/OSC2/CLK0
9
10
1
R2IN
3
T2OUT
4
5
15
6
GND
33
RB0/INT0
34
RB1/INT1
35
RB2/INT2
36
RB3/CCP2B
37 RB4
38 RB5/PGM
39 RB6/PGC
40 RB7/PGD
MAX232
15
RC0/T1OSO/T1CKI
RC1/T1OS1/CCP2A 16
17
RC2/CCP1
RC3/SCK/SCL 18
23
RC4/SDI/SDA
24
RC5/SDO
25
RC6/TX/CK
26
RC7//RX/DT
TIP
122
10KΩ
Y motor
10KΩ
TIP
122
10KΩ
RD0/PSP0
RD1/PSP1
RD2/PSP2
RD3/PSP3
RD4/PSP4
RD5/PSP5
RD6/PSP6
RD7/PSP7
19
20
21
22
27
28
29
30
TIP
122
VDD
VDD
TIP
122
GND
8
RE0/RD/AN5
RE1/WR/AN6 9
RE2/CS/AN7 10
TIP
122
TIP
122
VDD
VDD
PIC18F452
Z motor
10KΩ
10KΩ
10KΩ
TIP
122
TIP
122
10KΩ
GND
Figure 3. Overall Circuit Diagram of the Proposed System
A. PIC Pin Assignment of the System
The main part of the system is PIC18F452 which is used to
control the system. PIC18F452 has 40 pins and 5
input-output (I/ O) ports [2, 3]. The pin connections of
microcontroller are important to control the position of robot
arm motion. The diagram of pin connection is shown in
Figure 4.
vcc
RC0
RC1
RC2
MCLR
RC3
RC4
RC5
RA0
Encoder
RA1
X motor
RA2
RA3
RC6
PIC18F452
RC7
MAX 232
RD0
RD1
RD2
Z motor
RB0
Y motor
RB1
Figure 5. Unipolar Stepper Motor
10KΩ
RD3
RB2
RA3
Unipolar stepper motor is shown in Figure 5. In this
system, three unipolar stepper motors are used as X-axis,
Y-axis and Z-axis motors. The properties of this motor are as
follows:
• Unipolar stepper with 0.1" spaced 5-pin cable
connector
• 48 steps per revolution
• 1/16 geared down reduction
• 5V-12V DC suggested operation
• Weight: 37 g.
• Dimensions: 28mm diameter, 20mm tall not including
9mm shaft with 5mm diameter
• 9" / 23 cm long cable
• Holding Torque @ 12VDC: 250 gram-force*cm, 25
N*mm/ 3.5 oz-force*in
• Shaft: 5mm diameter flattened
C. Stepper Motor Driver
In this system, TIP 122 Darlington transistor is used as the
stepper motor driver. It is designed for general-purpose
amplifier and low speed switching applications. Features of
TIP 122 Darlington transistor are as follows:
• High DC Current Gain,
• Collector-emitter sustaining voltage is 100V,
• Collector-emitter saturation voltage is 2V,
• Monolithic construction with built-in base –emitter
shunt resistors,
• Pb-Free Packages are available [10].
Figure 4. Pin Connection of PIC18F452
In this system, the power supply of this controller is +5V
DC and connected the pin no. 1. RA0, RA1, RA2 and RA3
are used for X-axis stepper motor and bit numbers 0, 1, 2, 3
from PORTB are also connected to Y-axis stepper motor.
Then, RD0, RD1, RD2 and RD3 are used for Z-axis stepper
Figure 6. TIP 122 Darlington Transistor
2
All Rights Reserved © 2014 IJSETR
International Journal of Science, Engineering and Technology Research (IJSETR)
Volume 3, Issue 5, May 2014
TIP 122 Darlington transistor is shown in Figure 6. In the
design of the TIP 122 Darlington transistor, Pin 1 is Base, Pin
2 is Collector, Pin 3 is Emitter and Pin 4 is Collector.
D. Rotary Encoder
Rotary encoders are used in many applications that require
precise shaft unlimited rotation—including industrial
controls, robotics, special purpose photographic lenses,
computer input devices, controlled stress rheometers, and
rotating radar platforms [9]. Rotary encoder is shown in
Figure 7.
IV. SOFTWARE IMPLEMENTATION OF THE SYSTEM
Overall flowchart of the robot arm position control system
is shown in Figure 9. This system is implemented as the PC
based position control system for robot arm. In this system,
robot arm needs to reach the required grid locations which is
located in the 3x3 matrixes between X=310mm and
Y=310mm. So, the robot motion will be control with the
inverse kinematic solution. PC based position control system
for robot arm allows the user to control the designated
position during working area.
Start
Define Required Grid Locations as
Inputs in PC Program (VB)
Calculate X, Y and Z degree with
Inverse Kinematics in PC program
Figure 7. Rotary Encoder
Rotary encoder provides information about the motion of
the motor shaft on DC motor, which is typically further
processed elsewhere into information such as speed, distance,
and position. In robot applications, the feedback device
(encoder) plays a vital role in ensuring that the equipment
operates properly. By using the rotary encoder, the
microcontroller can't afford to miss any pulses or the
resolution of movement that is going to suffer.
E. Interfacing Circuit between PC and PIC
Interfacing circuit is required to control the input and
output conditions of the process, and to use as serial port.
MAX232 IC is used for signal/ level translation. MAX232 IC
provides RS232 serial communication with PC easily.
This IC is used to perform necessary adjustment. This
circuit is powered with a single 5V voltage. It is used to
convert a serial signal from TTL to RS232 standard and vice
versa by means of a built-in voltage generator [8].
MAX232 board is connected to a PC via a standard serial
cable provided with a pair of female connectors DB9. The
female connector DB9 enables connection with devices that
use RS232 standard, whereas the connector enables
connection with the microcontroller pins intended for serial
communication (USART) [6]. Interfacing circuit between PC
and PIC is shown in Figure 8.
Calculate X, Y and Z degree to Step
Values in PC Program
Send X, Y and Z Step Values to PIC
by UART
Drive X, Y and Z Step Values by
PIC
Check X, Y and Z Encoder Values
by PIC To detect current Grid
Send back X, Y and Z Encoder
Values by PIC To PC (VB Program)
Check X, Y and Z Encoder Values
by VB Program to verify current
location
Is current location
correct?
NO
Adjust X, Y and Z Degree/
Step by Program to correct
current location
YES
VDD
End
Figure 9. Overall Flowchart of the Robot Arm Position
Control System
PIC18F452
microcontroller
RC7/RX/DT
RC6/TX/CK
VCC
1µF
2
From
PC
1
6
2
7
3
8
4
9
5
8
7
R2OUT
+V
9
T2IN 10
1
3
1µF
4
5
1µF
R2IN
T2OUT
15 GND
6
1µF
Figure 8. Interfacing Circuit between PC and PIC
In this system, PIC18F452 microcontroller is used for the
heart of process. MikroC Pro programming is used to control
the whole process. Three stepper motors are driven with
stepper motor drivers (TIP 122 Darlington transistor).
When the operation is started, the robot will be in its home
position. Required grid locations are defined as input in PC
via VB.Net. And then, X, Y and Z degree are calculated by
using inverse kinematics method. After calculating, X, Y and
Z step values are sent to PIC by using MAX 232 IC. And
then, PIC drive X, Y and Z step values. To detect current grid,
X, Y and Z encoder Values are checked by PIC. Then, PIC
sends back X, Y and Z encoder values to PC. To verify
current location, X, Y and Z encoder values are checked by
3
All Rights Reserved © 2014 IJSETR
International Journal of Science, Engineering and Technology Research (IJSETR)
Volume 3, Issue 5, May 2014
VB.Net.
A. Inverse Kinematics for Robot Arm
In this system, when the desired location for the tip of the
robotic arm is given, the inverse kinematics method calculates
the angles of the joints to locate the tip of the arm at the
desired location [7]. For the 3DOF planner robot arm, these
inverse kinematics equations can be simplified as follows:
cos2 
x 2  y 2 l2 l2
1 2
2l l
12
sin 2  1 cos2 
k1  l1  l2 cos2
After clicking, the correct θ1, θ2 and θ0 will be showed at
“Command”. Manual position control for robot arm is shown
in Figure 10.
(1)
(2)
2
(3)
k 2  l2 sin 2
(4)
1  a tan 2(y, x)  a tan 2(k1, k 2)
(5)
2  a tan 2(sin 2,cos 2)
(6)
0  a tan 2(y, x)
(7)
In the above equations, θ0 is the angle of base rotation, θ1
and θ2 are the angles of first link joint and second link joint. k1
and k2 are constants. l1 and l2 are the lengths of first link and
second link. x and y are the lengths of target positions.
TABLE I
RESULT OF SAMPLE JOINT DEGREES
Figure 10. Manual Position Control for Robot Arm
At auto mode, required target positions are chosen by
clicking the check box. After choosing, the “Connect” button
must be clicked to display the correct θ1, θ2, θ0, X, Y, Z motor
directions and steps at “Command”, and OK at “Received
Data”. Auto mode can be run one or more target points in 3x3
matrixes. Auto position control for robot arm is shown in
Figure 11.
Figure 11. Auto Position Control for Robot Arm
V. SIMULATION AND TEST RESULTS
The proposed robot arm position control system used the
personal computer (PC) to control the system by using the
serial port. This system is implemented by using Visual
Basic. Net (VB.Net), and MikroC Pro programming
languages.
In the VB.Net form, the proposed system allows the user to
choose either the manual mode or the auto mode. At manual
mode, X position and Y position are firstly entered in the
message box. And then, the “RUN” button must be clicked.
To open the virtual terminal, the “RUN” button must be
clicked. And then, the data enter in the virtual terminal.
According to the entered data, the required motors will be
operated with the exact motor step. As an example, if X, 1,
00008# is entered in virtual terminal, 8 steps will be rotated
due to the clockwise of X motor direction. If Y, 0, 00008# is
entered in virtual terminal, 8 steps will be rotated due to the
counter clockwise of Y motor direction. If Z, 1, 00008# is
entered in virtual terminal, 8 steps will be rotated due to the
clockwise of Z motor direction. The simulation result of the
system is shown in Figure 12.
4
All Rights Reserved © 2014 IJSETR
International Journal of Science, Engineering and Technology Research (IJSETR)
Volume 3, Issue 5, May 2014
components at the local market. In this system, both auto and
manual modes can be used to control the position of the robot
arm. The robot arm is intended for simple pick and place
operation. By using this robot arm position control system,
many benefits can be obtained including the reduction of
unpleasant tasks, improved quality of pick and place process,
and reduced time consuming. This system can be extended by
changing the motors and microcontroller for future work.
Figure 12. Simulation Result of the System
Photo of complete circuit is shown in Figure 13.
ACKNOWLEDGMENT
The author is very thankful to Dr. Myint Thein, Rector of
Mandalay Technological University, for his encouragement,
invaluable permission and his kind support in carrying out
this paper work.
The author is deeply grateful to Dr. Wutyi Win, Associate
Professor and Head, Department of Mechatronic Engineering,
Mandalay Technological University for supplying all
necessary things.
The author also wishes to thank to supervisor Dr. Kyaw
Thiha, Associate Professor, Department of Mechatronic
Engineering,
Mandalay
Technological
University,
accomplished guidance, his willingness to share his ideas and,
helpful suggestions and for his patience, continuous
supervision and encouragement during a long period of this
paper.
The author especially appreciates and thanks all her
teachers for paper support, and guidance during theoretical
study and paper preparation durations.
REFERENCES
[1]
[2]
[3]
[4]
[5]
Figure 13. Photo of Complete Circuit
[6]
Photo result of 3DOF robot arm is shown in Figure 14.
[7]
[8]
[9]
[10]
Naoki Asakawa and Yoshimi Takeuchi. “Techingless Spray-Painting
of Sculptured Surface by amn Industrial Robot”, Department of
mechanical
and
Control
Engineering,
University
of
Electro-Communications, Chofu, Tokyo, 182 Japan, 1997.
Microchip PIC18FXX2 Microcontroller Data Sheet, Microchip
Technology Inc., 2006.
Ken Toe, “PIC18F452”, University of Cambridge, UK.
DC Motor Driver Fundamentals, Semiconductor Components
Industry, March, 2014.
Moududur
Shamim,
“Stepper
Motor
Interfacing
with
Microcontroller”, March 23, 2011.
“MAX232 Board”, MikroElektronika, Software and Hardware
Solutions for Embedded World.
MECH 498: Introduction to Robotics, Inverse Manipulator
Kinematics by M.O’Malley.
http:// en.wikipedia.org/wsiki/MAX232.
http:// en.wikipedia.org/wiki/Rotary_encoder.
http://www.onsemi.com/PowerSolutions/product.do?id=TIP122.
Figure 14. Photo Result of 3DOF Robot Arm
VI. CONCLUSION
The PC based position control system for robot arm is
designed to get optimum performance with available
5
All Rights Reserved © 2014 IJSETR