International Journal of Science, Engineering and Technology

International Journal of Science, Engineering and Technology Research (IJSETR)
Volume 1, Issue 1, July 2012
Computer Interfaced Robotic Arm for Packaging
System in Pharmaceutical Factory
Zin Mar Tun, Kyaw Thiha

Index Terms—SCADA, HMI, Visual Basic.Net, Mikro C and
PIC.
Moving from trend to tradition, more and more packagers
are adding robotic systems to their packaging process. The
standard use for robots in the manufacturing environment is
in packaging such as for loading wrapped articles into
cartons, case packaging and palletizing as well as high-speed
pick and place applications. In contrast to packaging
machines that automatically stop if too much product
accumulates at the discharge, robotic loaders and unloaders
meet or exceed the in feed and discharge rate that packaging
machines require. This ability allows the robot to keep the
packaging process running at full production capacity.
Research is emphasized on human-machine interface and
SCADA and considers integration with robot packaging
system to streamline the drug production process in the
pharmaceutical industries. PC-based human machine
interface (HMI) for robot system allows the user to control
the packaging system, view production data, correct
malfunction, view manuals. This user-friendly interface
minimizes system complexity and operator training.
Graphical display screens improve production control and
reduce troubleshooting time. Password-protected screens
eliminate unauthorized adjustments. The system is designed
the real time monitoring for packaging process. It includes
signal sensing, supervisory control using PIC, data
acquisition and visualization programs.
I. INTRODUCTION
II. SYSTEM DESCRIPTION
Abstract— The research emphasizes on SCADA system to
control and monitor drug bottle packaging operation in the
pharmaceutical factory. Robot packaging system is designed to
integrate drug production process and perform packaging with
the help of computer. Personal computer is interfaced with
hardware module using serial interfacing circuit. Human
Machine Interface (HMI) is developed to monitor the whole
process and control the functions of process. The monitoring
and running conditions are shown by motors and sensors on the
screen of computer using a group of program as Visual
Basic.Net and Mikro C. The robot is constructed using
aluminum and the gripper is made by plastic. The control
circuit is consisted of PIC, DC motors, motor drivers, LDR and
limit switches. The design and construction of robot packaging
system is accomplished by local available components. It is also
used own programs using VB.NET instead of SCADA software.
The research is studied to develop automation manufacturing
technology in Myanmar industries and implement the software
packages to control the operations in various automations. It is
designed the real time monitoring for packaging process and
included signal sensing, supervisory control using PIC, data
acquisition and visualization programs. Graphical display
screens improve production control and reduce troubleshooting
time.
In order to support the needs of health sector in
Myanmar, more pharmaceutical factories should be built and
new technologies should be used. Packaging is an important
process in drug production. There are two steps in packaging:
primary packaging and secondary packaging. Primary
packaging is the material that first envelops the product and
holds it. Secondary packaging is outside the primary
packaging, perhaps used to group primary packages together.
Choice of packaging machinery includes: technical
capabilities, capital cost, labour requirements, worker safety,
maintainability, serviceability, reliability, ability to integrate
into the packaging line, floor space, flexibility (change-over,
materials, etc...), energy usage, quality of outgoing packages,
qualifications (for food, pharmaceuticals, etc.),throughput,
efficiency, productivity, economics, return on investment,
etc.
Manuscript received Oct 15, 2011.
First Author name, His Department Name, University/ College/
Organization Name, ., (e-mail: fisrtauthor@gamil.com). City Name,
Country Name, Phone/ Mobile NoSecond Author name, His Department
Name, University/ College/ Organization Name, City Name, Country Name,
Phone/ Mobile No., (e-mail: secondauthor@rediffmail.com).
Third Author name, His Department Name, University/ College/
Organization Name, City Name, Country Name, Phone/ Mobile No., (e-mail:
thirdauthor@hotmail.com).
The study emphasizes on the control of the PC based
packaging robot. DC motors are used to control the motions
of the robot. The motor motions are controlled by PIC
microcontroller. PIC 16F877A Microcontroller is used
because it can provide serial communication interface and
incorporate all of the peripheral I/O facilities that is needed.
The firmware program is implemented by Mikro C
programming language. Personal computer (PC) is used as
human machine interface (HMI) and provides a series of
screens or windows for monitoring and control of the
devices.
The design, implementation and displaying of packaging
process for the monitoring and control system is provided by
Visual Basic.Net programming language. Depending on the
control commands that programming on VB window, robot
will move exactly the required direction, position and r.p.m.
After pressing the command buttons on VB window, the
required signals send to the 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. The sketch diagram is shown in Fig 1.
1
All Rights Reserved © 2012 IJSETR
International Journal of Science, Engineering and Technology Research (IJSETR)
Volume 1, Issue 1, July 2012
range of flexibility or reach. This is a safety precaution so that
even if there is a signal coming from the computer to move
the joint in a certain direction, then the joint will not move in
the said direction if the limit switch of the joint associated
with the said direction is asserted. To ensure that the user or
any control program will not drive the motor’s limbs beyond
its mechanical limits and damage it, limit switches were used
in the robot. The limit switches are activated when the limbs
reach its limits [4].
Hardware Operation(Packaging Process)
Filling Process
Secondary Packaging Process
CappingProcess
M
M
Human Machine
Interface
Fig. 1 Sketch diagram of packaging system
III. COMPONENTS OF THE SYSTEM
The overall block diagram of secondary robot packaging
system is shown in Fig 2. There are three main circuits:
interfacing circuit, sensor circuit and DC motor driving
circuit. Personal computer is connected to the hardware using
serial DB9 pin.
Serial Interfacing Circuit
LDR
Sensor
Personal Computer
MAX
232
LDR
LDR
Driver
Sensor
Circuit
Robot
Base
DC
Motor
2
Conveyer
DC
Motor
3
Robot
Arm
PWM
Circuit
PIC16F887
DB9
Connector
DC
Motor
1
Logic Supply
Motor
Driver
Circuit
(+5V)
Power
Supply
Motor Supply
(+15V)
Limit
Switches
DC
Motor
4
Gripper
Fig. 2 Block Diagram of Robot System
A. Power Supply Unit
The input power supply 230V, 50Hz AC is given to step
down transformer, where it is stepped down to18V. This step
down voltage signal +18V is given to the bridge rectifier
which converts AC to DC voltage [1-5]. The output DC
voltage is regulated by the voltage regulators to get regulated
voltages like +5V and +15V.
B. Sensor
The position sensor circuit is used to know the arrival of
the drug bottle. LDR (Light Dependent Resistor) sensor is
designed as dark active circuit. The signal is sent when the
drug bottle passes through the sensor. The output signal of the
position sensor circuit must be 0V all the time and nearly 5V
output is sent to the PIC when the drug bottle is passed.
C. Limit Switches
Limit switches were placed strategically on the each of the
moving parts of the robot arm. The purpose of these limit
switches is to stop a certain part/joint from moving out of its
D. PIC Microcontroller
A microcontroller is a complete microprocessor system
built on a single IC. Microcontrollers were developed to meet
a need for microprocessors to be put into low cost products.
Building a complete microprocessor system on a single chip
substantially reduces the cost of building simple products,
which use the microprocessor's power to implement their
function, because the microprocessor is a natural way to
implement many products. The microcontroller contains full
implementation of a standard microprocessor, ROM, RAM,
and I/O, clock, timers and also serial ports. Microcontroller
also called system on a chip or single chip microprocessor
system or computer on a chip [6]. PIC 16F887
microcontroller that has been used for this project is from PIC
series. Core features of PIC 16F877A microcontroller are
 High-performance RISC CPU
 Only 35 single word instructions to learn
 All single cycle instructions except for program
branches which are two cycle
 Operating speed: DC - 20 MHz clock input , DC - 200
ns instruction cycle
 Up to 8K x 14 words of Flash Program Memory
E. Serial Interface
USART (Universal Synchronous Asynchronous Receiver
Transmitter) are one of the basic interfaces which will be
found in almost all the controllers available in the market till
date.This interface provide cost effective, simple and reliable
communication between one controller to another controller
or between a controller and PC. RS-232 (Recommended
Standard 232) is a standard for serial binary data signals
connecting between a DTE (Data terminal equipment) and a
DCE (Data Circuit-terminating Equipment). MAX232 line
driver/receiver which is used to convert TTL(0–5V) voltage
required by data acquisition system to the -12 V and +12 V
needed by the computer for RS232 communication [9].
F. Driver Circuit
DC motor drive is needed where control the magnitude of
supply voltage in order to control the speed of DC motor. The
DC motor driver circuits that will be used in this research are
a dual full bridge driver, chip L298N, and the SG3525 pulse
width modulator control circuit that offers improved
performance and lower external parts count when
implemented for controlling all types of switching power
supplies [1].
G. DC motor
DC motors can be used in various areas of
microcontroller projects such as making robots, robotic arm,
automatic system etc. They are part of the electric motors
using DC power as energy source. These devices transform
electrical energy into mechanical energy. The basic principle
2
All Rights Reserved © 2012 IJSETR
International Journal of Science, Engineering and Technology Research (IJSETR)
Volume 1, Issue 1, July 2012
of DC motors is same as electric motors in general, the
magnetic interaction between the rotor and the stator that will
generate spin 30RPM 15V DC motors for robotics
applications [2].
The Features of DC motor are
4mm shaft diameter with internal hole
125gm weight and 2kgcm torque
No-load current = 60 mA(Max), Load current = 300
mA(Max).
R6
R3 R4
10k
U3
NINV
SYNC
4
10k
OSC OUT
7
6
RV1
9
+VIN
4011
8
SHDN
RT
COMP
SS
VSS
5
11
13
4
6
1
15
10
Q1
9
9
4
IN1 VCC
IN2
IN3
IN4
ENA
ENB
VS
4011
SENSA
SENSB
4011
D9
OUT1
OUT2
OUT3
OUT4
2
3
D10
D11
D12
13
14
GND
D13
NPN
D14
8
12
2
3
4
5
6
7
14
13
10k
C1
22pF
X1
4MHz
22pF
RC0/T1OSO/T1CKI
RC1/T1OSI/CCP2
RA0/AN0/ULPWU/C12IN0RC2/P1A/CCP1
RA1/AN1/C12IN1RC3/SCK/SCL
RA2/AN2/VREF-/CVREF/C2IN+ RC4/SDI/SDA
RA3/AN3/VREF+/C1IN+
RC5/SDO
RA4/T0CKI/C1OUT
RC6/TX/CK
RA5/AN4/SS/C2OUT
RC7/RX/DT
RA6/OSC2/CLKOUT
RA7/OSC1/CLKIN
RD0
RD1
RB0/AN12/INT
RD2
RB1/AN10/C12IN3RD3
RB2/AN8
RD4
RB3/AN9/PGM/C12IN2RD5/P1B
RB4/AN11
RD6/P1C
RB5/AN13/T1G
RD7/P1D
RB6/ICSPCLK
RB7/ICSPDAT
RE0/AN5
RE1/AN6
RE2/AN7
15
16
17
18
23
24
25
26
19
20
21
22
27
28
29
30
R10
4
10k
R
DC
5
D9
Q3
3
D15
D16
NPN
7
R8
10k
CV
2
LED
10k
U6
Q
TR
D1
TH
D2
6
LDR1
1.0
LDR
C6
555
1nF
8
9
10
+88.8
33
34
35
36
37
38
39
40
RE3/MCLR/VPP
+88.8
R9
U1
1
R5
100
C2
U5:B
12
11
UC2525
C4
C5
5
7
10
12
6
11
4011
U5:D
14
OUTB
CT
3
2
15
DISCHARGE OUTA
5
10
8
R2
U5:A
1
13
VC
VCC
3
10k
U5:C
8
+88.8
2
R7
10k
16
VREF
GND
INV
1
1
The entire process is overseen by the operator via
computer. Graphical display screens are developed by Visual
Basic and serial interfacing circuit (RS232 protocol and
MAX232 voltage level converter) is used to connect
computer and controller. Light-Dependent Resistor (LDR)
and limit switches are sensors of the robot. LDR is used to
detect whether the drug bottle is present or not at pick-up
location. Two limit switches are assembled at gripper and
four are for palletizing.
For robot motion, three DC motors are utilized which
each is for robot base, arm and gripper. For conveyor, one DC
motor is also used. DC motor control is performed by L298N
motor driver and SG3525 pulse width modulator. The
operation and monitoring of the system is handled and
enhanced by utilizing the microcontroller. PIC16F887A
microcontroller is used to control and process the entire
device in the system. Microcontroller sends sensor data for
PC to analyze and display. PC sends commands to control the
robot. Communication between PC and microcontroller
circuit is connected by serial communication circuit.
D3
D4
D5
D6
PIC16F887
C2
5
C3
4
ERROR
RI
DTR
CTS
TXD
RTS
RXD
DSR
DCD
8
7
13
14
R1
10k
C2+
VSVS+
R2IN
T2OUT
R1IN
T1OUT
R2OUT
T2IN
R1OUT
T1IN
C1-
9
10
12
11
1
15
C1+
C1
3
1
5
7
10
12
6
11
9
4
IN1 VCC
IN2
IN3
IN4
ENA
ENB
VS
SENSA
SENSB
OUT2
OUT3
OUT4
2
3
13
D7
D8
14
GND
MAX232
8
P1
U2
OUT1
+88.8
9
4
8
3
7
2
6
1
6
2
U4
10uF
C2-
L298
10uF
COMPIM
Fig. 3 Overall circuit diagram
IV. IMPLEMENTATION PROCESS
The target of this research is to control and monitor the
process of robot that performs the secondary packaging in
Pharmaceutical Factory. The structure of the robot arm is
constructed using aluminums which is lightweight, no
corrosion and strong. The outstanding performance from the
use of lightweight materials such as aluminum and plastic
allows a high strength to weight ratio for the moving parts.
The robot arm has a cylindrical workspace with a vertical
range of 30cm and a horizontal range within a circle of 70cm
on diameter. It can accelerate of up to 90g in experimental
environment. It moves with a speed of up to 20 picks per
minute in the palletizing line. The speed of the robot arm
motion can be adjustable according to the drug production
line.
Fig. 5 Electrical setup
START
CHECK
MICROCONTROLLER
(self check)
Robot Arm
in Normal Position?
NO
RESET
Arm to Base in
Normal Position
YES
Take data from sensors
Process data
Send drive signals to motors
NO
Motor drivers get
signal?
YES
Monitor motions in safe
operating range?
NO
YES
END
Fig. 4 Mechanical setup
Fig.6 Process flow chart
3
All Rights Reserved © 2012 IJSETR
International Journal of Science, Engineering and Technology Research (IJSETR)
Volume 1, Issue 1, July 2012
With the help of Mikro C compiler, the code for PIC
16F887A is written. The html code is written in the PIC
microcontroller memory as per requirement and it is
transferred to the PC with the help of the USART
communication. The process flow chart is shown in Fig. 6.
the output system. Motors are controlled on the same way.
The running conditions of dc motors used to drive for robot’s
motions and sensors used to measure the reach of drug bottle
are shown by operation page.
V. MONITORING AND CONTROL SYSTEM
The system is designed using graphical user interface
thus allowing easy access to real time control. The Windows
application in Microsoft Visual studio was selected for the
GUI due to its ability to easily support Input/output
operations via serial port (RS232). The GUI has been
developed for monitoring and controlling robot from remote
location. The GUI uses the command buttons to activate the
selected port of the microcontroller that controls the robot as
output instruction commands.
Thus every command button on the GUI represents
certain ASCII code from the keyboard. The program waits
for another ASCII code to be entered by the mouse. The
communication port between the PC and the microcontroller
can be interfaced either directly via an RS-232 port or the PC
USB port. Since computers today are developed with the
USB (Universal Serial Bus) port, the GUI based on Windows
platforms is designed to be capable of transferring and
receiving data via such ports.
Fig. 8 Process page
In the motor monitoring page shown in Fig. 8, the image
of motor are included and they are moving like the motor of
the process. Each is represented a motor used in the robot
motion. It includes four motors – gripper motor, arm motor,
base motor and conveyor motor for packaging system. If the
input signal of pins assigned for motor get, the operation of
motor will show on the VB form. The page is linked with the
operation page and the back button is used to go back the
operation page.
Fig. 7 GUI screen developed by VB programming
Fig. 9 Motors monitoring page
When the SCADA software developed for the packaging
system is applied, the page shown in Fig. 7 is seen firstly. By
clicking the command button on this page, the corresponding
page will be appeared. This page is linked with operation
page, design page, graphical simulation page and user guide.
For running and stopping condition of the system which is
real time process, operation page is designed with start and
stop buttons. Design page shows the robot’s specifications
and characteristics.
Simulation page is a main process designed with the
sample components for the real devices by using the figures
that are images for devices. User guide is included about how
the system uses and what it includes. The whole software of
data acquisition, processing and monitoring system is linked
each other. The software must run and send appropriate
command to the processing module according to the user.
After receiving and checking the command, the data
acquisition processing module are processed by the received
command.
If the command is selected to acquire data from sensors
used in packaging process, the operation window takes the
input signal from sensors, processes and sends the result to
Fig. 10 Sensors monitoring page
The sensor monitoring page screen is indicated in Fig. 9.
If the input signal of pins assigned for sensors get, the sample
components on the above VB form change the colour red to
green. There are seven sensors to perform the robot
packaging process. The LDR sensor detects the reach of drug
bottle and six limit switches restrict the rotation of motors for
gripper, robot’ arm and base. In this system, window based
4
All Rights Reserved © 2012 IJSETR
International Journal of Science, Engineering and Technology Research (IJSETR)
Volume 1, Issue 1, July 2012
application forms are developed for the real-time monitoring
and control of each operation devices.
VI. CONCLUSION
The packaging system have been developed considering
the conditions of being compact (all electronics should be
included), lightweight, and low-cost. It can be employed in
places where precision and accuracy are required. Robots can
also be employed where human beings cannot. The robotic
arm so far designed is able to lift the objects of medium
weight. In order to extend it to some extent, more advanced
tools and material with the capacity to withhold the heavy
weight objects are to be used, which is then applicable in
several places where there is a need. The important part of the
design, HMI, facilitates the engineer works in order to enable
monitoring and controlling functions from remote locations.
ACKNOWLEDGMENT
I am thankful to the Ministry of Science and Technology for
the support rendered for carrying out this research work. I
also would like to express deeply grateful thanks to all my
teachers from Mandalay Technological University who will
concern to support in preparing this paper. Finally, I
especially acknowledges my great special thank to my
parents.
REFERENCES
[1] Jegede Olawale, Awodele Oludele, Ajayi Ayodele, “Development of a
Microcontroller Based Robotic Arm”, in Proceedings of the 2007
Computer Science and IT Education Conference pg: 549-557.
[2] “Robot software” from Wikipedia, the free encyclopedia on 04-3-2012
[3] Application Note 83 published by Dallas Semiconductor-in human
readable language all aspects of the RS-232 interface, 2010.
[4] Lee Y.C, Lim, S. J., and Han, C. S., “Development of the robot gripper
for a home service robot”, Proceeding of ICROS-SICE International
Joint Conference, Fukuoka, Japan, pp. 1551-1556, August 2009.
[5] Aung Naing Myint, Hla Soe, Theingi, Win Khaing Moe
’Implementation of control unit using SCADA system for filling
system’, World Academy of Science, Engineering and Technology,
2008
[6] Andeen, Gerry B., ed. “ Robot Design Handbook”. McGraw-Hill Book
Company: USA, 2012.
[7] Axelson J, Access Serial Ports with Visual Basic.NET, Nuts & Volts,
April 2008.
[8] Thomas R Kurfess, “Robotic and Automation Handbook,” Washington,
D.C., United States of Amarica, 2005.
[9] Microsoft serial port class documentation:
http://msdn2.microsoft.com/library/30swa673(en-us,vs.80).aspx
5
All Rights Reserved © 2012 IJSETR