Tuesday, 5 May 2015

Ratio Based Distance Measurement for Automatic Pick and Place Robot

   Ratio Based Distance Measurement for Automatic Pick and Place Robot.

K.M.I.Yasar Arafath, Adeep Shafi, Adnan Aboobacker, Asha K V, Muhammed Mousoof  K, Rashida P P

ashakandanakam@gmail.com, rashrashida11@gmail.com


AbstractAutomatic pick and place robots have wide applications especially in the field of agriculture, industry, etc. The most important part in the pick and place robots is the calculation of distance between the object and the observer. Since cameras are becoming an integral part of the robot, this work uses a camera for the measurement of the distance. The previous works in this field either uses external hardware in addition to camera in order to measure the distance or has knowledge regarding the size of the object. This also makes the work useful in cases where measuring instruments cannot be used. This work uses a ratio based distance measurement method for calculating the distance between the observer and the object. The camera on the robot takes the picture of the object and calculates the pixel height. Then the robot moves a known distance towards the object and again calculates the pixel height of the object by capturing a new image. The actual distance to the object is calculated using the ratio of the pixel heights and the known distance moved by the robot. Then robot moves the measured distance, picks the object and places the object at the starting position. The MATLAB is used as the processing software and Arduino Uno is interfaced with MATLAB to control the robotic actions.


Keywords robotics, camera, pixel height, ratio based distance measurement, MATLAB, Arduino Uno
I.      Introduction
     Due to the shortage of man power, machines are more used in   the field of agriculture. Automatic pick and place robots have wide applications, especially in the field of agriculture, industry, etc. In the field of agriculture, the fruit picking is an important process. Robots are used to identify the fruits and calculate the distance between the robot and fruit. The robot moves towards the fruit and collect it. In industries, the materials have to be collected and moved from one area to another. Pick and place robots are becoming more common in this field. So there is a great significance in the distance calculation between the robot and the object. Once we calculated the distance, we can do any operation using the same robot by changing their end effectors. According to the application, the structure of end effectors may differ, sometimes we have to grasp or pluck something.
     Traditionally, there are several solutions for measuring distance. For distance measurement, they can roughly be separated into two types, contact and noncontact. In the case of contact measurement, there are lots of products to measure distance. The chief defect is that the objects can be corrosive. For noncontact measurement, there are different solutions, like laser reflection and ultrasonic (or light) reflection. In the case of the laser techniques, laser projectors and receivers are needed. Although using laser technology has the advantage of speed, object reflectivity plays an important role. If the object reflectivity is bad, the system will work poorly or not at all. The ultrasonic technique also has the same problem caused by object reflectivity.
     Since vision is becoming an integral part of robots, in this work, the measurement of distance between the observer and the object is done using camera. The previous works in this field make use of external hardware and some knowledge about object size for distance measurement. In some methods we also use focal length of the camera. This work does not use any hardware other than camera for the distance measurement. The Ratio based method is not depending upon focal length, external hardware and size of the object, and only depend upon the known distance that the camera moved and pixel heights of object before and after movement. MATLAB is one of the software available which provide the platform for finding pixel heights.
      Section II describes about the literature survey. Followed that, ratio based distance measurement is explained and the system description is given in the section IV.


II.      LITERATURE SURVEY
     There are several methods for finding the distance to an object. In this section we discuss three measuring principles. One is the traditional triangular measuring method; second one is based on Fast Fourier Transform and comparison with data stored in the database as reference; third method uses an equation for distance calculation.
     Ming- Chih Lu et al.  in their paper Image-Based Distance and Area Measuring  Systems” [1] proposes a triangular method for measuring the distance between the observer and the object. Here they use a CCD camera and two laser projectors. Two lasers are placed on the bottom and top of the CCD camera and the laser beams produce a triangle as shown in the Fig. 1. Assume two projected points on the two sides of the triangle.

distance measurement
Dk       = The distance between the two projected points
Dmax  = Distance between the two laser projects
Hk       = Distance from two projected points to apex of tringle
Hmax  = Distance from the CCD camera to apex of the triangle
 Dmax and Hmax are known to us. Dk can be calculated by using an extra oscillator. An external clock generated by an extra oscillator measure the time interval between two projected points. External clock value is counted between two projected points. Actual distance Dk is proportional to external clock value. 
     

     From (1) Hk can be calculated. The difference between   Hmax and Hk gives the distance from camera to object.
     In another method, the distance between a camera and an object is calculated by using equation,

D0= Distance to object, f= Focal length (mm)

Hro= Real height of object (mm),Hip= image height (pixel)

 Hop = Object height (pixel)
Hs= sensor height (mm)
Using this equation we can measure the distance to an object. Any programming software like Matlab can be used for this. The disadvantage is that, it is necessary to know the real height of the object. Otherwise we can’t proceed through this method. Measurement of the object’s height is not a practical.
J. Phelawan et al. in their paper A new technique for distance measurement of between vehicles to vehicles by plate car using image processing’ [2] describes another method based on FFT. In this method camera can capture images and the picture process is done by Fast Fourier Transform (FFT). The systems can be compared with data stored in the database as reference. This method will be applicable to only the objects whose size is known.


J. Phelawan et al. in their paper A new technique for distance measurement of between vehicles to vehicles by plate car using image processing’ [2] describes another method based on FFT. In this method camera can capture images and the picture process is done by Fast Fourier Transform (FFT). The systems can be compared with data stored in the database as reference. This method will be applicable to only the objects whose size is known.



III.      RATIO BASED DISTANCE MEASUREMENT METHOD 

     In (2) all parameters are constant except pixel height of the object. So we can reduce as

          d α 1/h                                         (3)
     where,                                                    
d= distance away from the object
        h= pixel height of the object
     The camera captures the object from two positions. The ratio of pixel heights of the object obtained from two positions will give us the distance to the object, if the distance between two positions is known. Initially the camera is at d distance away from the object. The pixel height of object at that time is given by h. Then robot moves a known distance. Let it be 1cm. At that time the angle of camera is not changing, but pixel height of object is varied to h'. So,

                d/(d-1)=h'/h                                           (4)

where, 
d = actual distance to object from camera
h = pixel height of object when camera at d distance
h' =pixel height of object when camera at d-1 distance

IV.       SYSTEM DESCRIPTION

The block diagram for automatic pick and place robot using camera is as shown in fig. 2. This contains mainly eight blocks.                 

     Camera is used as sensor to measure the distance to the object. In modern robots camera is used as a sensor since it scans the entire environment and can be used instead of many other sensors for distance measurement, inspection, identification etc.
     Lighting is an essential part of machine vision. Good illumination of the scene is important because of its effect on the level of complexity of image processing algorithm. Poor lighting makes the task of interpreting the scene more difficult. Proper lighting technique should provide high contrast and minimize reflections and shadows.
     MATLAB is interfaced with camera using the winvideo adapter. It helps us to take video input to the matlab and snapshot required for processing is obtained.
     To get the distance, we have to find out the pixel height of object from the image. For that the object has to be recognized from the image. The object is recognized by comparing the RGB values to a threshold value. And the image will be converted to binary mode. Then the object will be in white colour and the surrounding will be in black colour(Fig. 3).
     The next step is to remove the noises in the recognized image. The morphological operations are used for noise rejection. The structural element used along with morphological operations was a disk. 

thresholding of image

thresholding of image
Now the entire noise will be removed as shown in Fig. 4. The number of rows containing white pixels gives the pixel height of the object.
image processing

The ratio of pixel heights of the object obtained from two positions will give us the distance to the object using Eq. 4.

     The Arduino Uno board is interfaced with MATLAB. A server program is loaded to the arduino that will execute the operations or commands requested by MATLAB and returns the datas needed. So, by using MATLAB we can simultaneously control the arduino and camera.
      L293D is a dual H-bridge motor driver integrated circuit (IC)[7]. Geared DC motors can be defined as an extension of DC motor[8]. A geared DC Motor has a gear assembly attached to the motor. Here, we use a12V, 60 rpm motor. So in one minute there is 60 rotations and in one second there is one revolution.
Distance moved in 1s= circumference of wheel
= 2*pi* r =31.4 cm
Where,
r (radius of wheel) =5 cm
     So, the obtained distance will be divided by 31.4 and the robot will be allowed to move that much time to reach the object. Now the arm motor will be turned on unless the limit switch connected on the gripper is closed. And the robot moves back to the original position by rotating the motor in reverse direction.
     The sequences of operations are shown in the flow chart below in fig. 5.


flow chart distance measurement



[1]   Ming-Chih Lu, Wei-Yen Wang and Chun-Yen Chu."Image-Based Distance and Area Measuring Systems”IEEE sensors journal, vol. 6, no. 2, April 2006
[2]   J. Phelawan, P. Kittisut, N. Pornsuwancharoen.” A new technique for distance measurement of between vehicles to vehicles by plate car using image processing”-science direct2011
[3]   Mikell P Groover, Mitchell Weiss, Roger N Nagel, Nicholas G Odrey, "Industrial Robotics: Technology, Programming and Applications", McGRAW-HILL international edition
[4]   Rafael C. Gonzalez and Richard E. woods, ‘Digital Image Processing
[5] AnkurAgraval, “An elementary introduction toimage processing based robot", IITkanpur
[6]   http://www.arduino.cc/
[8]   http://www.engineersgarage.com/insight/how-geared-dc-motor-works

No comments:

Post a Comment