Advances in Production Engineering & Management Volume 11 | Number 2 | June 2016 | pp 105-114 http://dx.doi.Org/10.14743/apem2016.2.213 ISSN 1854-6250 Journal home: apem-journal.org Original scientific paper Visual measurement of layer thickness in multi-layered functionally graded metal materials Zuperl, U.a*, Radic, A.a, Cus, F.a, Irgolic, T.a aFaculty of Mechanical Engineering, University of Maribor, Maribor, Slovenia A B S T R A C T A R T I C L E I N F O Multi-layered functionally gradient metal materials are formed by metal material deposing with Laser Engineered Net Shaping (LENS) technology. LENS is an additive manufacturing technique that employs a high-power laser as the power source to fuse powdered metals into fully dense three-dimensional structures layer by layer. Layer thickness is an important factor in machining and processing of such advanced materials, as well as in the production, as a feedback to LENS machine operator. Knowing the thickness of the manufactured layer of multi-layered metal material is fundamental for understanding the LENS process and optimizing the machining operations. In this paper, software for visual multi-layered functionally graded material layer thickness measurement is presented. The layer thickness is automatically determined by the software that is programmed in Matlab/Simulink, high-level programming language. The software is using cross-section metallographic images of cladded layers for thickness measuring. Graphic User Interface (GUI) is also created and presented. The results of measurement are presented to demonstrate the efficiency of the developed measurement software. © 2016 PEI, University of Maribor. All rights reserved. Keywords: Functionally graded material LENS Visual measuring Layer thickness Machining *Corresponding author: uros.zuperl@um.si (Zuperl, U.) Article history: Received 21 January 2016 Revised 19 May 2016 Accepted 20 May 2016 1. Introduction The beginning of LENS technology was in the 1960s, when the first functional laser was found by Maiman [1]. Industrial usage began in the 1980s. This technology is a non-conventional production technology [2]. LENS technology is based on selective continuous material deposition. Metal powder is melted by laser and deposed onto metal substrate. The process is planar. After finishing the first layer, laser head lifts up and deposition of second layer begins, as shown in Fig 1. This production technology is used for rapid prototyping, product reparation and coating [2]. LENS is still unexplored technology and optimal machine settings, such as Laser power and Cladding speed (speed of laser head) are difficult to determine. These two parameters have an impact on the hardness and thickness d of the manufactured layer in multi-layered functionally graded metal material. Furthermore, the undesirable effect of delayerization (shelling of cladded layers) of the multi-layered material is tightly related with the thickness of deposited layers. The thicknesses of deposited layers have also a significant influence on cutting forces, generated in machining of these advanced materials. Nevertheless, Laser power and Cladding speed are usually determined based on technologist experience in order to produce the desired layer thickness. Therefore, there is a practical interest to investigate the impact of LENS process parameters on the thickness of the manufactured layer. The effective layer thickness measurement would help to determine the relation between the layer thickness and LENS process parameters [3]. 105 Zuperl, Radic, Cus, Irgolic The LENS machine operator could use the determined relation for the optimum selection of the LENS process parameters. The manufactured layer thickness is also an important parameter for optimizing of the machining of multi-layered metal materials. The detail knowledge about the produced layer thickness makes easier to find optimal cutting conditions for the milling processes. Especially in end-milling, the layer thickness is extremely important for optimum axial depth of cut determination. In this paper, a visual layer thickness measurement algorithm is described. The detailed structure of the automated measurement algorithm is presented. In the past, the layer thickness of the multi-layered functionally graded material was measured manually, from the prepared metallographic microscopic images. These images were suitable for the automated visual measurement. This procedure was time consuming, labour intensive and above all inaccurate. The measurement software was developed for simplifying this procedure. Due to the very encouraging test results, the GUI has been also developed and embedded successfully into the measurement software. There has been no published research on the inspecting of layer thickness of multi-layered gradient materials by using visual measurement systems. In recent years, some optical measurement systems have been developed to inspect the surface roughness of the machined piece [4, 5]. One system employs a machine vision system to inspect the machined surface roughness [6]. Other uses fibre-optics to measure the diffuseness of the reflected light from the surface [7]. Coman in his research [8] outlines the application of distance measuring with Matlab/Simulink. Advances in computer vision technology have led to the investigation of its application in tool wear measurement Weis [9] have employed machine vision for measuring the condition of inserts on an end mill during the machining process. Dutta [10] and Shahabi [11] constructed a tool wear measuring system using a CCD camera in high speed machining. Jovanovic [12] developed a measuring device for automated control of machined automobile parts. He developed measurement program and user interface in LabView for visual inspections of dimensions with commercial web camera. The use of all mentioned vision-based measuring systems is limited to the laboratory environment. These articles gave great encouragement for visual measuring method used in this article. The rest of the paper is organized as follows. The developed layer thickness measurement algorithm is described in the second section. The third section is presenting the GUI development and the results. Conclusions and suggestions for further work and development are given in the final section. 106 Advances in Production Engineering & Management 11(2) 2016 Visual measurement of layer thickness in multi-layered functionally graded metal materials 2. Distance measurement software algorithm The layer thickness is measured based on the metallographic microscopic images. The resolution of the images is 1200 x 720 pixels. Fig. 2 shows a gradient material cross section of a metallographic microscopic image. This image is the input to the distance measurement software. The layer thickness d is a measured dimension. The distance measurement software consists of a *.m file which is an algorithm part and a *.fig file which is a GUI (see Section 2) file. The output from the GUI is the layer thickness in micrometers and in pixels. The detail flowchart of the distance measurement algorithm is shown in Fig. 3. Fig. 2 Microscopic image with measurement distance marked. Part 1 Fig. 3 Detailed flowchart for distance measurement Advances in Production Engineering & Management 11(2) 2016 107 Zuperl, Radic, Cus, Irgolic Measurement starts with image reading from the memory. The image must be saved in a jpg format and placed in the same folder as the m file (algorithm). Then the algorithm transfers the color image into a grayscale image with "rgb2gray" command. This step is necessary for edge recognition. After the edge recognition, the distance d is measured (see, Fig 4). The algorithm for measuring distance finds a top edge and a bottom edge of the multi-layered metal material layer. Image is saved as a matrix in Matlab software; white pixels have value "1", black pixels have "0" [13]. The algorithm finds the cells in the matrix with value "0". As the position of the top and bottom edge is known in the picture matrix (value "1"), it is possible to calculate the distance between two edges. Finally, the distance calculated in pixels is transformed into micrometers. The measurement result is shown in Fig. 4. The measured distance is marked with red lines on the image from memory (metallographic microscopic image). The grayscale image is visible in the middle. The image with the detected edges is shown at the bottom. Noise from edge detection is circled red, therefore edge detection is not successful, measured distance is not correct. The algorithm had found "edges" which are not layer edges. This problem was solved with image filtration. There are built-in functions in Matlab which are used for filtration [13]. Image from memory Grayscale image "rgb2gray" Fig. 4 Edge detection result 108 Advances in Production Engineering & Management 11(2) 2016 Visual measurement of layer thickness in multi-layered functionally graded metal materials Noise reduction "medfilt2" Fig. 5 "Salt and pepper" noise removed Binary image "im2bw" .^Z :rr.-^V'. .'i*: : ■. JPr , • j ¿ ., . u. ® . ,-f J "i-____jii - '■ _ iff ■ tnx H.-l Fig. 6 Binary image "Salt and pepper" noise is removed with median filtering "medfilt2" command. Command "medfilt2" executes median filtering of the image in two dimensions. Each output pixel contains the median value in a 3-by-3 neighbourhood around the corresponding pixel in the input image [13]. Image after noise reduction is shown in Fig. 5. After noise reduction, image is transferred to a binary image. First step in this transformation is global threshold (level) computation. This is performed with "graytresh" command. The "graythresh" computes a global threshold (level) that can be used to convert an intensity image to a binary image with command "im2bw". The level is a normalized intensity value that lies in the range between "0" and "1" [13]. The second transformation step is conversion from the grayscale image to the binary image by using computed threshold from previous step. A command "im2bw" is used for this action. Fig. 6 shows an image after the "im2bw" command. The command substitutes all pixels in the image with luminance greater than computed threshold with the value "1" (white) and substitutes the rest pixels with the value "0" (black) [13]. The objects forms with perimeter smaller than 8 pixels are cleaned in two steps. Circle shape with perimeter 8 pixels is chosen in the first step with a command "strel('disk',8)". In the second step, binary image is morphologically opened with a command "imopen". The morphological open operation is an erosion followed by a dilation, using the same structuring element for both operations [13]. Final step in image filtration is extremes removing which is performed with a "imreconstruct" command. An image without extremes or objects with perimeter smaller than 8 pixels is shown in Fig. 7. Through the above mentioned steps, the image is prepared for edge detection. Command "edge" is used for this task. The prepared image for thickness measurement is shown in Fig. 8. The thickness is measured between two red lines. After edge detection, algorithm finds cells with value "1" in the image matrix. The top edge (cell) is found with command "max". The bottom edge (cell) is found with command "min". A difference between top and bottom edge is the layer thickness. This value is printed in "Command Window" of Matlab. Thickness from pixels to micrometers is calculated using Eq. 1. Advances in Production Engineering & Management 11(2) 2016 109 Zuperl, Radic, Cus, Irgolic ^m^iM (!) Transformation ratio k is determined from microscope measurement scale (circled red), as shown in Fig. 9. To determine the transformation ratio, known distance, in this case 500 [im, must be measured in pixels. Quotient between distance in pixels and distance in micrometres is transformation ratio k (Fig .10). In this paper, the algorithm was tested for two metallographic microscopic images. The first is shown above in Figs. 2 to 9 (measured thickness d = 889.5 [im). The second test is shown in Fig. 11. Fig. 7 Image without objects with perimeter smaller than 8 pixels Fig. 8 Image prepared for thickness measurement Fig. 9 Microscope measurement scale 110 Advances in Production Engineering & Management 11(2) 2016 Visual measurement of layer thickness in multi-layered functionally graded metal materials 500 |jm - 387 pixels - Fig. 10 Comparison between distance in pixels and distance in micrometers Image from memory Noise reduction "medfilt2" Cleaned objects . « Grayscale image "rgb2gray" Binary image "im2bw" ■ « Found edges "edge" Fig. 11 Algorithm testing for second metallography microscopic image, d = 920.4 |m Advances in Production Engineering & Management 11(2) 2016 111 Zuperl, Radic, Cus, Irgolic 3. Graphic user interface development, results and discussion Graphic User Interface (GUI) was created after testing phase. Matlab "GUI Quick Start" was used for the GUI creation. The created GUI is saved as *.fig file. Matlab automatically generates the *.m file. The measuring algorithm is implemented in the generated *.m file. The GUI is started with a "Run" command. An image for layer thickness measurement is chosen from a GUI drop-down menu. The GUI (Fig .12a) is consisted of three parts. The first part is located in the left side of the Fig. 12. It shows the image which is measured. The layer thickness which is measured is marked with two parallel red lines. The second part of the GUI is located in the upper right side. This part shows the measured thickness, both in pixels and in micrometres. The third part of the GUI is a drop-down menu. The developed GUI and the measurement results are shown in the Fig. 12(a) to 12(d). The two-layered functionally graded metal material was used in these tests. The powder material is stainless steel 316L and substrate material is steel Ck 45. The materials are the same in all tests. To minimize the porosity of multi-layered material, the laser head trajectories during cladding of two consecutive layers were programmed to be perpendicular and horizontal. The weld overlapping in all layers was set to 40 %. The diameter of laser ray was 0.8 mm. The influence of laser head trajectories during cladding on the properties of the manufactured layers was not investigated in this research. The scanning patterns could have an influence on the layer thickness. H GUI_thkkness_measurement Multi-layered functionally graded metal material layer thickness measurement a) n AntonioRadic_v1 2_eng -nd . 2 part Thickness [pix] 459 fhickness [urn] 889.535 Choose image for thickness measurement Imagel Image2 Image3 Image4 - 3rd part FJ GUI_thickness_measurement Multi-layered functionally graded metal material layer thickness measurement c) Thickness [pix] 451 Thickness [um] 920.408 Choose image for thickness measurement AntonioRadic_v 1 2_eng Q GUI_thicknesï_mea su rement Multi-layered functionally graded metal material layer thickness measurement b) íéiíIeémwÉ ; ¿fe a ¡h -fx, nitf Thickness [pix] 359 Thickness [um] 695.736 Choose image for thickness measurement Image2 AntonioRadic_v1,2_eng Q GUI_thicknesî_mea i-u rement Multi-layered functionally graded metal material layer thickness measurement d) 5 v c ~ * Í;IIÍMV'WIÍÍÍI':I''I Silliii £ Thickness [pix] 361 Thickness [um] 448 447 Choose image for thickness measurement nage- AntonioRadic_v1,2_eng Fig. 12 Measured multi-layered functionally graded metal material layer thickness for different LENS machine settings (cladding speed, laser power); a) 30 mm/s, 400 W; b) 48 mm/s, 380 W; c) 60 mm/s, 350 W; d) 90 mm/s, 320 W 1 part 112 Advances in Production Engineering & Management 11(2) 2016 Visual measurement of layer thickness in multi-layered functionally graded metal materials A multi-layered functionally graded material with measured thickness of 889.5 [im is shown in Fig. 12(a). The LENS machine settings for this test piece were: cladding speed 30 mm/s; laser power: 400 W. Real thickness of the analysed layer is 862.4 [im. This gives an error of 3.14 %. A multi-layered functionally graded material with measured thickness of 695.7 [im is shown in Fig. 12(b). The LENS machine settings for this test piece were: cladding speed: 48 mm/s; laser power: 380 W. Real thickness of the analysed layer is 622.1 [im. This gives an error of 11.8 %. A test piece with measured thickness of 920.4 [im is shown in Fig. 12(c). The LENS machine settings for this test piece were: 60 mm/s; laser power: 350 W. Real thickness of the analysed layer is 912.3 [im. This gives an error of 0.9 %. A test piece with measured thickness of 448.4 [im is shown in Fig. 12(d). The LENS machine settings for this test piece were: cladding speed: 90 mm/s; laser power: 320 W. Real thickness of the analysed layer is 414.9 [im. This gives an error of 8.1 %. The distance measurement software needs approximately 1 second to complete the measurement of the thickness of one deposited layer. In this period seven steps of the measurement algorithm are executed automatically. The developed software is able to recognize multi-layers bounds and measure the thickness of a separate layer in the multi-layered workpiece where several layers of identical material are deposited on the substrate. The software requires two seconds to determine the distances between the four-layer bounds in four-layered material. The distances are displayed on the GUI in the order form the upper to the lower layer. Therefore, the measurement process is fast once the initial metallographic microscopic images are available in a JPEG file format. 4. Conclusion The scientific implication of this paper is to present a prototype for the visual measuring of layer thickness in multi-layered metal materials. The layer thickness is automatically determined by the software based on cross-section metallographic images in a few seconds. The developed algorithm can be used in industrial environment without special preparation and any knowledge of graphics and programming. This makes the proposed measuring algorithm practical and appropriate for industrial application. The measurement algorithm consists of seven steps, which can be separated in 3 parts (Fig. 3). The first part is responsible for image preparation and noise filtration. The second part of the algorithm finds edges of the analyzed layer in the metallographic image. The third part measures distance between found edges. The developed GUI is intuitive, simple to use and easy to implement. The algorithm is not memory consuming. Measurement error depends on the layer structure. For compact layer error is up to 3 %. For less compact layer error can be as high as 11 %. Therefore it can be used in controlled industrial environment. Knowledge about multi-layered functionally graded metal materials layer thickness makes easier to find optimal cutting conditions for the milling process. Optimal cutting conditions are important for cutting tool durability. The critical parameter is an axial depth of cut. For technologist it is important to know whether the milling cutter is machining in the hard or soft layer of gradient material. The LENS machine operator could use the measured layer thickness for the machine parameter setup. It would be useful to find correlation between LENS machine parameters and layer thickness. This will be the goal of future research. The metallographic microscopic images shown in this paper are not taken with the same microscope zoom; therefore it would be beneficial to create an image base with identical zoom. Such base would make software easier to use. It is now necessary to adapt software for every measurement because of different transformation ratio k. The future work focuses on the metallographic microscopic image base with identical microscope zoom. Additionally, automated measurement with camera is the ultimate goal for the developed measurement algorithm. Advances in Production Engineering & Management 11(2) 2016 113 Zuperl, Radic, Cus, Irgolic References [1] Maiman, T.H. (1960). Optical and Microwave-Optical Experiments in Ruby, Physical Review Letters, Vol. 4, No. 11, 564-566, doi: 10.1103/physrevlett.4.564. [2] Tabernero, I., Lamikiz, A., Martinez, S., Ukar, E., Figueras, J. (2011). Evaluation of the mechanical properties of Inconel 718 components built by laser cladding, International Journal of Machine Tools and Manufacture, Vol. 51, No. 6, 465-470, doi: 10.1016/j.iimachtools.2011.02.003. [3] Articek, U., Milfelner, M., Anzel, I. (2013). Synthesis of functionally graded material H13/Cu by LENS technology, Advances in Production Engineering & Management, Vol. 8, No. 3, 169-176, doi: 10.14743/apem2013.3.164. [4] Samta§, G. (2014). Measurement and evaluation of surface roughness based on optic system using image processing and artificial neural network, The International Journal of Advanced Manufacturing Technology, Vol. 73, No. 1, 353-364, doi: 10.1007/s00170-014-5828-1. [5] Klancnik, S., Ficko, M., Balic, J., Pahole, I. (2015). Computer vision-based approach to end mill tool monitoring. International Journal of Simulation Modelling, Vol. 14, No. 4, 571-583, doi: 10.2507/IISIMM14(4)1.301. [6] Jurevicius, M., Skeivalas, J., Urbanavicius, R. (2014). Analysis of surface roughness parameters digital image identification, Measurement, Vol. 56, 81-87, doi: 10.1016/i.measurement.2014.06.005. [7] Gupta, M., Raman, S. (2001). Machine vision assisted characterization of machined surfaces, International Journal of Production Research, Vol. 39, No. 4, 759-784, doi: 10.1080/00207540010011045. [8] Coman, M., Stan, S.D., Manic, M., Balan, R. (2010). Application of distance measuring with Matlab/Simulink. HSI 10, In: Proceedings of the 3rd International Conference on Human System Interaction, 113-118, doi: 10.1109/hsi. 2010.5514581. [9] Shahabi, H.H., Ratnam, M.M. (2010). In-cycle detection of built-up edge (BUE) from 2-D images of cutting tools using machine vision, The International Journal of Advanced Manufacturing Technology, Vol. 46, No. 9, 11791189, doi: 10.1007/s00170-009-2180-y. [10] Dutta, S., Pal, S.K., Mukhopadhyay, S., Sen, R. (2013). Application of digital image processing in tool condition monitoring: A review, CIRP Journal of Manufacturing Science and Technology, Vol. 6, No. 3, 212-232, doi:10.1016/j.cirpj.2013.02.005. [11] Shahabi, H.H., Ratnam, M.M. (2009). Assessment of flank wear and nose radius wear from workpiece roughness profile in turning operation using machine vision, The International Journal of Advanced Manufacturing Technology, Vol. 43, No. 1, 11-21, doi: 10.1007/s00170-008-1688-x. [12] Jovanovic, B. (2015). The device for automated control of bushes (Naprava za avtomatizirano kontrolo pus), In: Proceedings of the 9th conference Automation in economy and industry, Maribor, Slovenia, 1-7, from http://www.aig.si/15/zbornik/clanki/Jovanovic.pdf. accessed February 8, 2016. [13] Blanchet, G., Charbit, M. (2015). Digital signal and image processing using MATLAB®, (2nd edition), John Wiley & Sons, Inc. doi: 10.1002/9781119054009. 114 Advances in Production Engineering & Management 11(2) 2016