Sei sulla pagina 1di 4

Robotic Arm Control in Space with Color

Recognition Using a Raspberry PI

Roland Szabó Aurel Gontean, Alexandru Sfiraț


Applied Electronics Department Applied Electronics Department
Fac. of Electronics and Telecom., “Politehnica” Un. Fac. of Electronics and Telecom., “Politehnica” Un.
Timişoara, România Timişoara, România
roland.szabo@etc.upt.ro aurel.gontean@upt.ro

Abstract—In this paper a robotic arm control, with color the robots needed to be preprogrammed and recalibrated
recognition, implemented on a Raspberry PI, will be presented. periodically, which could be done only by stopping the
The Raspberry PI is a small super computer which is suitable for production line, which meant losing a lot of time and money
almost any embedded project. To the Raspberry PI is connected [15].
a Logitech C270 web camera or a TP-LINK TL-SC3230 IP
camera and a USB to serial dongle which does the In the new and smart industrial environment the robotic
communication task. The camera pair films the robotic arm and arms does not require to be preprogrammed, because they can
the USB to serial dongle controls the robotic arm. The color compute the movement path with the help of their integrated
recognition is done with OpenCV installed on the Raspberry PI. vision system [16]. More than this, they can auto calibrate
The robotic arm has glued colored bottle stoppers on the joints using the images acquired by the cameras, so there is no need
which are recognized with color filtering. These joints are united to stop the production line. This was the productivity can be
with lines and other lines are drawn to be guide lines to some increased, because in today’s consumer society is a huge
mathematical computations. Based on these lines a skeleton of the demand of products and this will only grow in the future [17].
robotic arm is created, which is an info for the Raspberry PI
about the position in space of the robotic arm. With further In this experiment a smart robotic arm controlling system
computations the robotic arm can be moved in the desired will be presented. The robotic arm system is controlled by a
position. Raspberry PI, which is a compact card size, smart, embedded
system. To the Raspberry PI cameras like a Logitech C270
Keywords—embedded; IP camera; Raspberry PI; robotic arm; web camera or a TP-LINK TL-SC3230 IP camera are
USB to serial; SCPI commands; web camera. connected, these acquire live images, which are then
processed and the robotic arm is controlled accordingly. The
I. INTRODUCTION robotic arm has no preprogrammed functions, everything is
This paper presents a robotic arm control system made decided in real-time. The robotic arm is controlled via a serial
with a Raspberry PI. The Raspberry PI, the card size super interface by a USB to serial dongle [8].
computer, which is the main component of this control system
[1]. II. PROBLEM FORMULATION
The industry needs these kinds of systems which can In the university’s laboratory there was a Raspberry PI
control a robotic arm in a smart way and also they are made development board, one Lynxmotion AL5A robotic arm, one
around an embedded system [2]. Lynxmotion AL5B robotic arm, two Logitech C270 web
cameras and two TP-LINK TL-SC3230 IP cameras. The task
The industry is changing, the German factories made a was to put this all together and do a smart robot control
new standard called “Industrie 4.0”, where all the devices are system. For serial communication the Raspberry PI had also
connected with each other via a wireless network. Actually the some ports, but there is needed a level shifter, this way the
robots are not anymore controlled by PCs, but with smart microcontroller won’t be fried. For serial communication is
phones, tablets or other embedded devices [3]. needed ±12 V, but the Raspberry PI uses only 0 – 3.3 V,
because of this, the signal’s amplitude is needed to be
These is a prediction about the future that there won’t be
increased; level shifter has to be used. Sometimes is easier to
PCs in the industry, as they are today, there will be only smart
use a USB to serial dongle, because this way there is no need
embedded devices which are connected with each other via a
to complicate the system with other circuitry [9].
big wireless network [4].
The other characteristic of the robots of the future is that III. PROBLEM IMPLEMENTATION
they need to be smarter and more autonomous. This new A. Used Equipment
environment cannot be created by having only preprogrammed
robots, which follow a preset path; they have no decision tasks The selected robotic arm was the Lynxmotion AL5B
or vision systems integrated. In the old industrial environment robotic arm, because is slightly bigger than the Lynxmotion
The authors would like to thank Faculty of Electronics and
Telecommunications, Politehnica University Timișoara for the given support.

978-1-5090-1288-6/16/$31.00 ©2016 IEEE 689 TSP 2016


AL5A robotic arm. Its gears are made from carbon reinforced mouse, 1 keyboard, 1 USB to serial dongle and 2 for the
metal and not form plastic [10]. Logitech C270 webcams. Instead of the two webcams two TP-
LINK TL-SC3230 IP cameras can be also connected to the
The control circuitry of the Lynxmotion AL5 type robotic Ethernet port of the Raspberry PI with the help of an Ethernet
arms is the SSC-32 servo control board, which can control up switch.
to 32 servomotors. For the Lynxmotion AL5 type robotic arms
only 6 motors are needs to be controlled, so the SSC-32 servo One interesting fact about the setup is the usage of the
control board is more than suitable to do the task. For a 3D RS232 Pmod, which actually replaces the serial interface of
movement even the control of 3 motors is enough. The SSC- the SSC-32 servo control board, because this serial interface
32 servo control board can communicate with a master device, worked better. In other words the SSC-32 servo control board
in the present case with a Raspberry PI, via RS-232 serial port. has a lack of design, because the serial driver chip needs
The SSC-32 servo control board generates PWM signals on bigger voltage levels than an embedded microprocessor board
the digital ports with a specific duty cycle coded in the SCPI can supply, this way the SSC-32 servo control board can be
commands and this is sent over the serial interface. The PWM controlled only by a PC with a very strong power supply. It
signal will move the connected motor proportionally with the cannot be controlled by embedded microprocessor boards,
preset duty cycle [11]. which cannot supply high signal amplitudes. The robotic arm
behaves the following way: it wakes up and after it collapses,
The robotic arm has special Hitec motors, they have gears because the microcontroller from the SSC-32 servo control
for increasing torque and they have also a small control board resets, not being supplied with high signal amplitude.
circuitry which has 3 signals, 5 V, ground and PWM. At the The solution is quite simple, is the usage of the RS232 Pmod
PWM input a signal is received from the SSC-32 servo control from Digilent, which actually has a better serial driver chip,
board, this way the circuit board will move the motor as much which works on lower signal amplitudes. The RS232 Pmod
as the duty cycle of the PWM signal is set. The motors are can be easily connected to the SSC-32 servo control board;
blocked mechanically to be able to move only 180°, so they because this has Rx and Tx signal pins and this way the serial
cannot rotate 360°; they just make very small movements [12], microchip from the SSC-32 servo control board can be
[13]. disconnected with a jumper.
The used Raspberry PI is the model B, which is not the
C. Software Implementation
latest model, but for the robotic arm control experiment it
worked just fine. The software was implemented in Python scripting
language using the OpenCV libraries. The software is running
B. Theoretical Background on the Raspberry PI on Raspbian (Debian) Linux “Wheezy”
Before developing any control application for these robotic v7.0 operating system.
arms, the SCPI commands, for controlling them, need to be The image acquisition is done using Logitech C270
known and understood very well. webcams over USB interface or TP-LINK TL-SC3230 IP
On Fig. 1 is presented the block diagram of the robotic arm cameras over Ethernet interface.
control experiment with a Raspberry PI. With IP camera, the acquisitioning system is a little bit
The main part of the experiment is the Raspberry PI, which different. The IP camera takes pictures which are sent over
is like a small computer it has a display output on the HDMI Ethernet to the Raspberry PI. If the acquisitioning is done with
interface and a mouse and keyboard connected to the USB a big frame rate, the pictures loaded look like a live stream,
port. With a D-Link H4 externally powered 4 port USB HUB but actually there are more pictures loaded like the frames of a
the Raspberry PI model B can have a total of 5 USB ports, 1 movie.

Logitech Lynxmotion AL5A


Raspberry PI Mouse C270 robotic arm
model B webcams
USB
USB
USB

D-Link H4 USB
USB HUB Peripheral
HDMI USB
USB
Digitus USB to RS232
Display Pmod
serial dongle RS-232
Keyboard

Fig. 1. Block diagram of the robotic arm control experiment with Raspberry PI

690
Unfortunately on Ubuntu Linux 12.04 LTS installed on PC webcams have Linux drivers. In this manner the Logitech
works fine the OpenCV function for acquisitioning images C270 was a good choice, because it had drivers created on
over Ethernet, but on the Raspberry PI with Raspbian many operating systems.
(Debian) Linux “Wheezy” v7.0 operating system the image
acquisition on Ethernet with the OpenCV function is not The IP camera has the advantage that no driver is needed
working. The solution is to use external function, it can be to interface it with an operating system and can save the
even used a Linux command like the “wget”, because the acquired images on its internal memory; the only task is to
image is already saved on the IP camera’s memory. This way transfer the images over Ethernet to the PC or to the
the image is transferred on the Raspberry PI’s memory card development board. The big disadvantage, on some embedded
and it can be loaded for image processing with OpenCV devices, is that the transferring of the saved images cannot be
functions. done with OpenCV functions, only with external Linux
commands.
Acquisitioning with USB web camera showed no errors
even with OpenCV functions executed on the Raspberry PI. On Fig. 2 is shown the interface of the GUI, made in
The only issue was to install the USB webcams on the Python, with the OpenCV libraries, which can control the
Raspberry PI, which was not so easy, because not all USB robotic arm on the RS-232 serial interface. The application is
created and running entirely on a Raspberry PI.

Fig. 2. The robotic arm control application made in Python with OpenCV library on a Raspberry PI

691
The hardest part is that OpenCV had many dependencies [2] W.Yang, J.H. Bae, Y. Oh, N.Y. Chong, B.J. You, S.R. Oh, “CPG based
and they are linked mostly dynamically, this means that self-adapting multi-DOF robotic arm control,” International Conference
on Intelligent Robots and Systems, Taipei, 2010, pp. 4236-4243.
OpenCV need to be installed on the Raspberry PI. Because the
[3] E. Oyama, T. Maeda, J.Q. Gan, E.M. Rosales, K.F. MacDorman, S.
model B has 700 MHz single core CPU, this can take quite a Tachi, A. Agah, “Inverse kinematics learning for robotic arms with
long time, because the OpenCV is better to be installed from fewer degrees of freedom by modular neural network systems,”
source. It is hard to find “*.deb” precompiled packages of the International Conference on Intelligent Robots and Systems, 2005, pp.
OpenCV libraries for a specific architecture, and if it can be 1791-1798.
found, most of the time they are not working on some special [4] N. Ahuja, U.S. Banerjee, V.A. Darbhe, T.N. Mapara, A.D. Matkar, R.K.
ARM platforms like the one from the Raspberry PI. The Nirmal, S. Balagopalan, “Computer controlled robotic arm,” 16th IEEE
Symposium on Computer-Based Medical Systems, New York, 2003, pp.
compilation of the OpenCV takes more than 8 hours on 361-366.
Raspberry PI model B and more than 4 hours on a Raspberry [5] M.H. Liyanage, N. Krouglicof, R. Gosine, “Design and control of a high
PI 2, so when compiling it’s a good choice to take a long performance SCARA type robotic arm with rotary hydraulic actuators,”
brake. Sometimes is better to start it in de evening and it will Canadian Conference on Electrical and Computer Engineering, St.
be done in the morning. After it’s done and it’s compiled with John's, CA, 2009, pp. 827-832.
all the GUI elements, JPEG or TIFF libraries, C/C++ [6] M. Mariappan, T. Ganesan, M. Iftikhar, V. Ramu, B. Khoo, “A design
programming language and Python scripting language, it will methodology of a flexible robotic arm vision system for OTOROB,”
International Conference on Mechanical and Electrical Technology,
work perfectly on a Raspberry PI. Singapore, 2010, pp. 161-164.
On Fig. 2 the first there is the robotic arm image with the [7] H. Guo-Shing, C. Xi-Sheng, C. Chung-Liang, “Development of dual
guide lines and circles created for computing the robotic arm’s robotic arm system based on binocular vision,” International Automatic
Control Conference, Nantou, 2013, pp. 97-102.
position in space.
[8] R. Szabó, A. Gontean, “Controlling a Robotic Arm in the 3D Space with
The second image is the HSV (Hue, Saturation and Value) Stereo Vision,” 21th Telecommunications Forum, Belgrade, 2013, pp.
filter. 916-919.
[9] R. Szabó, A. Gontean, “Robotic arm control in 3D space using stereo
The next four images are the color recognition algorithm distance calculation,” International Conference on Development and
for each color. On the joints there were glued bottle stoppers Application Systems, Suceava, 2014, pp. 50-56.
of different colors. Each color was recognized using the [10] R. Szabó, A. Gontean, “Remotely Commanding the Lynxmotion AL5
contour detection algorithm used over the color filtering Type Robotic Arms,” 21th Telecommunications Forum, Belgrade, 2013,
pp. 889-892.
algorithm. The color filtering is done by setting the minimum
and maximum values of the HSV filter. [11] R. Szabó, A. Gontean, “Creating a Programming Language for the AL5
Type Robotic Arms,” 36th International Conference on
Telecommunications and Signal Processing, Rome, 2013, pp. 62-65.
IV. CONCLUSION
[12] R. Szabó, A. Gontean, “Full 3D Robotic Arm Control with Stereo
As it was presented, a robotic arm control application was Cameras Made in LabVIEW,” Federated Conference on Computer
created, using only simple web cameras and a Raspberry PI. Science and Information Systems, Kraków, 2013, pp. 37-42.
The Raspberry PI is the card size, embedded, super computer, [13] R. Szabo, A. Gontean, “Robotic Arm Control with Stereo Vision Made
with the power and the possibilities of a PC. It has a big in LabWindows/CVI,” 37th International Conference on
Telecommunications and Signal Processing, Berlin, 2014, pp. 635-639.
advantage over a PC, because the operating system is on a
[14] M. Seelinger, E. Gonzalez-Galvan, M. Robinson, S. Skaar, “Towards a
memory card, so the user can have different operating system robotic plasma spraying operation using vision,” IEEE Robotics &
on different memory cards and the operating systems can be Automation Magazine, vol. 5, issue 4, 1998, pp. 33-38, 49.
switched just by changing the memory card from the [15] R. Kelly, R. Carelli, O. Nasisi, B. Kuchen, F. Reyes, “Stable visual
Raspberry PI. servoing of camera-in-hand robotic systems,” IEEE/ASME Transactions
on Mechatronics, vol. 5, issue 1, 2000, pp. 39-48.
The Linux operating system gives many advantages, one [16] V. Lippiello, F. Ruggiero, B. Siciliano, L. Villani, “Visual Grasp
of them is that the applications from it can be ported on other Planning for Unknown Objects Using a Multifingered Robotic Hand”,
systems quite easily, maybe the only task is to recompile the IEEE/ASME Transactions on Mechatronics, vol. 18, issue 3, 2013, pp.
source code and in case of Python this is not necessary 1050-1059.
because the script can run on any machine with Python [17] M. Kazemi, K.K. Gupta, M. Mehrandezh, “Randomized Kinodynamic
installed. Planning for Robust Visual Servoing”, IEEE Transactions on Robotics,
vol. 29, issue 5, 2013, pp. 1197-1211.
Further enhancements would be to port the system on [18] R.T. Fomena, O. Tahri, F. Chaumette, “Distance-Based and Orientation-
FPGA boards with Ubuntu Linux 12.04 LTS like the ZYBO or Based Visual Servoing From Three Points”, IEEE Transactions on
ZedBoard. These boards have little bit better performances Robotics, vol. 27, issue 2, 2011, pp. 256-267.
like the Raspberry PI (700 MHz single core CPU), because [19] N.C. Orger, T.B. Karyot, “A symmetrical robotic arm design approach
they have ARM Cortex-A9 Dual-core with frequencies with stereo-vision ability for CubeSats,” 6th International Conference on
Recent Advances in Space Technologies, Istanbul, 2013, pp. 961-965.
between 650 MHz – 1000 MHz. The final goal is to create an
[20] F. Medina, B. Nono, H. Banda, A. Rosales, “Classification of Solid
ASIC form the FPGA implementations. Objects with Defined Shapes Using Stereoscopic Vision and a Robotic
Arm,” Andean Region International Conference, Cuenca, 2012, pp. 226
REFERENCES [21] M. Puheim, M. Bundzel, L. Madarasz, “Forward control of robotic arm
[1] W.G. Hao, Y.Y. Leck, L.C. Hun, “6-DOF PC-Based Robotic Arm (PC- using the information from stereo-vision tracking system,” 14th
ROBOARM) with efficient trajectory planning and speed control,” 4th International Symposium on Computational Intelligence and
International Conference On Mechatronics, Kuala Lumpur, 2011, pp. 1- Informatics, Budapest, 2013, pp. 57–62.
7.

692

Potrebbero piacerti anche