CUTTING PROCESS PARAMETERS MEASUREMENTS BY MEANS OF COMPUTER VISION

The objective of this work is to use computer vision techniques, adopting the experimental research as a methodological approach to measure cutting process parameters. This work will present the measurement of cutting time and the passive times during turning process. This proposal can be easily justified because cutting process optimization is a complex task. The measured results will be use to minimize costs and maximize production. All the measurements will be happen in shop floor online with the process evolution. The cutting time and the passive times involved during the cutting process is essential to allow the cutting parameters optimization.


INTRODUCTION
The focus of the optimization, treated in this work, is to determine the optimal machining conditions for a given system Machine, Tool, Piece and Fixture system.In this context, the objective of this work is to demonstrate the use of "Computer Vision", by adopting the experimental research as a methodological approach, to obtain cutting process parameters by means of images taken during cutting process evolution.The optimization of cutting process is relatively complex.Cutting process conditions optimization aims to minimize costs and maximize production when using one of several operations that comprise the process.The acquisition of new equipments is one of the first resources to be explored, since it is believed that these devices have greater flexibility and hence better performance.However, the costs of these items normally are significant investments, becoming almost untenable for small and medium enterprises.A first approach to application of the Computer Vision was performed to measure cutting time and passive times that occur during the turning process.In cutting process several parameters such as depth of cut, feed rate and cutting speed, among others must be selected carefully to have effective profit when the process is applied.In this context, the optimization of these parameters is indispensable to maximize productivity and to minimize costs.It is important to be highlighted that, this way of optimize cutting conditions to improve productivity and minimize costs is, obviously less expensive when compared with other optimization method, mainly when new sophisticated machines and equipments are supposed to be brought.
Preliminary experiments showed some difficulty in setting the threshold for image segmentation, mainly because of the noise caused by chips removal, cutting fluid or other elements from the environment, a fact which constituted a challenge to be resolved.However the application of binarization followed by Distance Transform (DT) technique proved to be a promising approach for solving the problem with low computational cost and high performance, allowing the use of the proposed algorithm in a real-time application.
The propose of this work is to present a new method to measure cutting time and passive times by the use of images collected and simultaneously analyzed during turning operation in shop floor and online with the process occurrence.

Cutting Time
During the machining operations, one of the most important parameters to be considered is the cutting time, that is, the time that the tool is effectively removing the over cut material to reach the final workpiece geometry.This information is outstanding because, thereby, it is possible to determine the tool cutting edge life and, with its value, to determine the maximum productivity time and minimum cost, as well as complement the other operational conditions of the process that enable one to put into practice such conditions Erro! Fonte de referência não encontrada..In order to make these optimized conditions even further efficient, it is necessary that all of the cutting time of the measuring process and its consecutive value application, take place in a manufacturing environment and during the evolution of the process.
To calculate the cutting time, it is possible to use a very simple expression, which is presented as follows in Eq. ( 1): Where: However, this simple formulation is valid only when all of the parameters involved are kept constant, as it is possible, in the case of the piece showed in Figure 1.In it, the difference of the diameters must be removed by simple step turning.On the other hand, what happens quite often in the practice of turning process operations is the piece diameter or cutting speed variation or still, in some situations, both parameters can vary.An extreme instance of such a situation is shown in Figure 2. Though it is possible to keep the cutting speed constant, the diameter will be variable right from the start up to the end of the turning operation and, therefore, the cutting time will become mathematically more complex to be determined.Given the fact that the geometry from piece to piece varies a lot, the equating and easiness of the use of the results would be much more complex than the measuring of the cutting time in process.Figure 2.An example of a workpiece whose diameter is always variable.
The Figure 3 illustrates a real case that the above explanation.This is the case of machining a sphere starting from a cylindrical bar.At the beginning (a), the tool will touch the workpiece during interrupted times, presenting active and passive times successively.The timers in the existing Turning Centers cannot measure only actives times, and they give the total processing time that cannot be used as tool life time, because this last one is the sum of the cutting times which are dedicated to cut each workpiece.Case (b) is the finishing operation with the same tool during which the workpiece profile is effectively copied.Although cutting speed is kept constant, the diameter varies for each new position of the tool.

Computer Vision
Computer vision can be defined as a sub-area of image processing whose the main objective is the study and development of techniques and methods that enable a computer system to recognize objects in images imitating some capabilities of the human visual system, as the ability to describe a scene contained in a digital image [3].An efficient computer vision system (CVS) must be able to extract a set of features that accurately describes a scene and sufficiently small to make feasible practical applications such as robot vision systems, autonomous vehicles, surveillance systems, automatic license plate recognition, industrial inspection and biometrics patterns recognition [4].
Nowadays, CVS play a very important role in several areas because they provide greater accuracy, repeatability and cost savings, beyond the reduction of monotonous and complex tasks.
In the field of machining, its application becomes important in monitoring the quality of parts in the production process, the calibration of electrical devices, the analysis of the conditions of cutting tools [5], measurement of surface roughness, wear and tear of tools [6], among others.
Despite the wide range of use, many image processing approaches requires a great computational effort.Thus, simple and effective methods are always preferred.

Analysis of Connected Components
The concept of pixel connectivity is widely exploited in the determination of boundaries of objects and characterization of regions in an image.Two pixels p and q are connected if they have any adjacency relation and their gray levels satisfy some criterion of similarity [3].The two most common ways of pixel connectivity are 4-connected and 8-connected Figure 5. Considering a pixel located at position (x,y), the 4-connected are the four pixels connected horizontally and vertically in terms of coordinates, i.e. (x+1, y), (x-1, y), (x, y+1) e (x, y-1).In 8-connected, pixels connected diagonally, i.e. (x+1, y+1), (x+1, y-1), (x-1, y+1) and (x-1, y-1), are also considered.
Two objects A and B are connected in an image if for any two pixels A(x, y) and B(i, j), there is a path (or sequence) from A(x, y) to B(i, j), where each element of this path is 4connected or 8-connected to the next element.Thus, the connectivity between two objects with known positions can be verified by fixing one point in each of them and checking for connectivity between these two points.

METHOD OF CUTTING TIME MEASURE VIA COMPUTATIONAL APPROACH
The experiments were performed analyzing a video acquired in the laboratory using a 1.3 mega pixels webcam in order to evaluate the algorithm.The video was captured in RGB color system with a rate of 25 frames per second, each one with 352×240 pixels.The proposed algorithms were implemented in C/C++ language using OpenCV and Proeikon libraries (x,y-1)   (x-1,y) ( -1,y+1) (x,y+1) (x+1,y+1) [7][8].The proposed computer vision approach for measuring cutting time and passive times that occur during the machining process can be described as follows: in the first step, using a webcam, it is performed the acquisition of video from the machining process.In the second step, each frame originally in RGB color, is converted to binary (Figure 6) and then, it is verified if the components that represent the piece and the machining tool are connected using the procedure described in the section 2.3.The first point is fixed inside the piece (object touching the left margin of the image) and the second one is fixed in any point of the object touching the top of the image.

RESULTS AND DISCUSSIONS
The Figure 7 shows the four different moments or steps of a turning operation.The Figure 8 shows the measurement result of the cutting time and passive time obtained after analysis of the recorded video during the whole machining operation.The cutting time measured was 21.60 seconds and the passive time was 10.40 seconds.The sum of these times was 32.00 seconds.The cutting time is greater because the tool veloci-ty during the process occurrence is much lower than its velocity when the tool is approaching or moving away with respect to the workpiece.
Thus, even when the part geometry became more complex, it will be always possible to accurately measure the cutting time and passive time online with the process occurrence.In order to verify the efficiency and precision of computer vision method to measure the cutting time, several measures of the total processing time and the cutting time were made using a stopwatch.For total processing time the average value was 29.40 seconds.For active time was found 21.02 seconds.The passive time was not measured using a stopwatch because the movement is very fast and difficult to measure.The errors found when comparing the results of measurement from one and another method was: 8.96% for total processing time and 2.76% for cutting time.

FINAL CONSIDERATIONS
Although this work represents a first approach to the problem of image interpretation in order to measure the cutting time, it was observed that the proposed method and algorithm used were adequate.The results of the calculations by means equations to determine the cutting time or the use of a stopwatch present high difficulties in transferring data to SIAPU, such as developed by the authors.
Moreover, the measurement result using the method proposed here is much easier to be transferred.In order to look for the discrepancy between the proposed method used to measure cutting times and the use of a stopwatch, was observed that the percentage errors committed were less than 10%.However, it is important to take in account that to measure the time during cutting process using stopwatch is not very easy to be realized and its accuracy is likely to be more unreal than the result measuring these times by the proposed computer vision method.

Figure 1 .
Figure 1.Example of a workpiece, in which, all of the machining parameters, are constant.

Figure 3 .
Figure 3.Typical example which shows how difficult is to calculate and even measure the cutting time.(a) sphere rough operation at initial cut; (b) sphere finishing operation with the same tool.

Figure 4 .
Figure 4. SIMVICO and Communication Interfaces schemes to perform the machining optimization cycle automatically.

Figure 6 .
Figure 6.Image acquired in RGB mode and converted to binary.

Figure 7 .
Figure 7. Measurement of the times during the machining operation; (a) beginning of the cut; (b) and (c) intermediate moments of the cut, (d) end of the cut.

Figure 8 .
Figure 8. Result of processing video.