Development of Automated Liquid Filling System Based on the Interactive Design Approach

The automatic liquid filling system is used in different applications such as production of detergents, liquid soaps, fruit juices, milk products, bottled water, etc. The automatic bottle filling system is highly expensive. Where, the common filling systems required to complex changes in hardware and software in order to modify volume of liquid. There are many important variables in the filling process such as volume of liquid, the filling time, etc. This paper presents a new approach to develop an automatic liquid filling system. The new proposed system consists of a conveyor subsystem, filling stations, and camera to detect the level of the liquid at any instant during the filling process. The camera can detect accurately the level of liquid based on the imaging process technique (Edge Detection Approach). In order to achieve the aim of this work, Arduino board is used as the controller unit in the automatic operation of developed filling system. The developed automatic liquid filling system is designed to be not expensive compared to the other available filling systems on the markets. The system is also easy to operate and user-friendly,where only simple steps are required to operate the filling system or modify the working condition.It was found, based on results, that the Prewitt edge detection is the optimal method that should be applied to obtain high accuracy of results and quick response of developed system.


INTRODUCTION
The importance of the automation field in the industry sector is increasing day after day, where it is used in awide range of engineering applications. The automation can be used to reduce the human labor, control systems, telephone networks, stabilization of ships, etc. The industrial automation is based on automated machines that work with real-time for the automated inspection and the automated handling systems which are used to transfer products from one position to another such as conveyor belts and robots.
The automated liquid filling system is used in the modern industry sectors to reduce time consumption, waste liquid, get an equal quantity of fluid for each filling operation, and saving quality of the liquid.It can be easily monitored and controlled the changes of specifications in the filling system such as type of liquid, type of bottle, and any other setup that are needed. The packets produced by the automated liquid filling system do not need any type of further inspection. The control system has direct interaction with the physical surroundingsof the process. A typical control system consists of sensors and actuators that require specific parts to ensure they are compatible with the system to obtain an optimum response. When the laser sensor detects the bottle at the predefined position, the motor of the conveyor will be stopped automatically.
The automated bulk filling machine includes the fill station to fill the containers according to weight or volume [1]. There is another type of automated filling system that is used in the pharmacy field such as capsule filling which depends on the weight of these capsules [2][3]. PLC-based control in the fully automated bottling system was used to control the liquid level in bottles [4][5][6]. Kuhni et al [7] used another type of devices to fill the flexible container.
The mixing and filling system was designed for any percentages of fluids in real-time using SCADA and logical control based on the PLC [8]. It was developed new control unit of the filling systems that used PLC and real-time monitoring by SCADA. These systems can be used for multivariate liquid filling [9][10][11]. It was used PLC to design the automated filling tank that used for drinking water [12]. Automated bottle filling and capping systems werecontrolled by PLC and SCADA [13][14][15]. Implemented automated bottle filling system controlled by PLC SCADA system was deployed using LabVIEW [16]. The control of the automated bottle filling machine isdevelopedbased on PLC and PID controller. The PID controller is used to minimize the errorin the filling process. PLC was used to enhance the control processofthe automated liquid mixing and bottle filling system [17]. There are other researchers who have used radio frequencies to monitor the liquid level automatically [18]. Prima et al [19] used Arduino board in the filling system to control the ultrasonic sensor to detect the level of the fluid in tanks. In addition, there are many researchers investigated different types of the automated systems in order to enhance the results using the image processing approach [20][21][22][23][24][25][26].
In this paper, design and implementation of the automated liquid filling system to detect the level of liquid in the bottle based on the edge detection image processing approachwas achieved. Arduino microcontroller was used to control the developed system. Filter algorithm was applied to control the levels of liquid in the filling process. The bottle is stopping under the filling section by laser sensor, and the camera starts capturing many images to detect the level of the liquid. The developed design is based on the open-loop system which can control conveyor by laser sensor, and make sure that the bottle doesn't overflow, where the conveyor should be stopped as long as the filling process to the bottle is not finished.The task of the conveyor system is to specify the movement of the bottle that moves after the liquid reaches the required level. Light available materials were used to build the new automated filling system in order to reduce the total cost of the system. The development of the filling system in this work included applying and installing the hardware and software parts together to obtain an integrated system for filling and determining the level of liquid based on the image processing method.Finally, the matching analysis algorithm was applied to detect the matching between the new image with the template image that saved previously.

DESCRIPTION AND PERFORMANCE OF AUTO-MATED LIQUID FILLING SYSTEM
The Automated liquid filling system consists of the conveyor system, stepper motor, pump, Arduinoboard, power supply, camera and laser sensor that are integrated together to build the complete developed prototype. The specifications of the transmitter laser sensor are: operating voltage = 5V, size = 15 x 24 mm, source wavelength = 650 nm, work voltage for receiver = 5V,the output high level when receiving laser signal, the output low level when not receive laser signal and PCB size of 1.52 x 2.22cm. Figure 1 shows the details of laser sensor boards. The liquid pump type is Konjoin that has the following specifications: voltage range= DC12V-24V, rated voltage =DC24V, current = 50 mA, weight = 85g, head lift = 2.5M, pump lift = 5m and water flow = 1.5L/min. Figure 2 illustrates the dimensions of the liquid pumpwith details. The conveyor belt moves the empty bottle to the fill section.Then, the laser sensor will stop the bottle at the specific point that is located under the fill pipe. After the bottle arrives at the filling site, the filling process begins, and the camera starts capturing images. Then immediately the image analysis is performed if the image matches the image template or not. This process will be a chain of capturing images, including the comparisons of matching until reaches the required ratio.The camera is fixed in the front of the filling section to capture the images that including all body of the bottle. Themain parts of the automated liquid filling system are shown in Figure 3.The laser sensor instructs the camera to start capturing theimages.Furthermore, the camera continuously captures the images until the level of fluid reaches the required level in the bottle.After filling the bottle, the camera gives a signal to the Arduino boardwhich in turn gives a signal to the conveyor belt to move on. The circuit blockdiagram of the connected parts of the automated liquid filling system is shown in Figure 4. The distance between the bottle and the next one is not important because the laser sensor iscontrolling the position of the bottle. This developed system is used to fill the transparent bottle withany kind of liquid.It can be seen the filling process of the Automated liquid filling system in Figures 5-7. Figure 8 shows the parts and circuits of the developed automated liquid filling system.

THE INTERACTIVE DESIGN OF AUTOMATED FILLING MACHINE
The interactive design is becoming an important approach in the modern industry sector in order to decrease time and cost. In the automated machine, the control in real-time represents the main target of the design. The work in real-time of the automated filling machine is an important parameter to obtainthe successful design. Where the reduction of the response time in the control unit of any system is one of main objectives to develop the design of any system.The interactive design approach is considered the fundamental key to find the most optimal solutions of different kind of engineering problems, and specifically for engineering configurations of the automated systems.The interaction design can be applied when accurate information about the automated system behaviour is available in order to improve performance for any planned automated process.
The interactive design in this research is an advance design that achieved in real-time using a vision sensor to obtain the optimal response.This sensor was chosen according to the interactive design approach andit was usedbased on a suitable method. It was built a new code based on the image processing theory to detect the liquid level accurately, and the interactive design approach was the criterion for this new design. Figure 9 represents the necessary steps to design the automated filling system based on the interactive design approach.
A high number of researchers [27][28][29][30][31][32][33] in different engineering fields applied the interactive design way to discover the most effective solution to improving the products or producing process.

THEORETICAL METHODOLOGY OF THE LIQUID LEVEL DETECTION
The automated liquid filling system was developed based on edge detection imaging process and the template matching method. The camera will receive the signal from the laser sensor which in turn announces the arrival of the bottle under the filling section. This signal is the start point to begin the capturing images that will continue until filling the bottle to required level. Each image will be processed by the edge detection method and then will be compared with the template image that saved earlier. Any captured image will be checked if matched with the template or not. In some researches, it was measured the level of liquid by setup the camera on the vessel where this method used low-resolution miniaturized camera to obtain the images [34]. It was developed different approach to measure the liquid level, where it was placed slanted metal strip in the liquid to find the inflection point on liquid interface to form the contour image to specify the level of liquid [35]. In this paper, the five edge detection methods was applied to detect the level of liquid. These methodsare Roberts, Prewitt, Laplacian of Gaussian, Sobel, and Canny. The optimalmethod that gave results with high accuracy is the Prewitt edge detection method. The edge detection represents one of the most important image processing for object detection [36].
The gradient is the measure of the change in a function at specific points. It can be assumed that the image as an array to describe the image intensity using of samples for some continuous function.The gradient is the twodimensional equivalent of the first derivative and it's defined as the "vector" [37], The gradient isassociated with two important properties: (

1) The points of vector G [f(x, y)]in the pathof the highest rate of increasing the function f(x, y).
(2) The gradient magnitude can be determined as [37], Also the maximum rate of increasing off(x, y) per unit distance in the direction G can be found. It's the common practiceto determine the value of the gradient based on approximate absolute values [37] as, From the vector analysis, the directionof the gradient is defined as [24]: where the angle α is the angle thatbetween the vector and x-axis. Where, the gradient magnitude is independent on the edge'sdirection. It can be called the isotropic operatorsfor such operators. The Roberts method is the operation that provides a simple approximation to the gradient magnitude [37]: applying the convolution masks yield [24]: where G x and G y are computed using the following masks [24]: The Sobel method is the operation which appliedto compute the magnitude of the gradient as follows [37]: whereit can be calculated the partial derivatives as [37]: The Prewitt method operation uses the same equations as the Sobel method operation, except that the constant c = 1 [37] as following, The Laplacian is the two-dimensional equivalent of the second derivative. It can be written the equation of the Laplacian function f (x, y) as follows [37], The Canny method operation consists of six basic steps [38] which are: Step 1: Smooth with Gaussian. Applying 1D Gaussian for efficiency as follows: where D is Dimension, and G is the Gaussian.
Step 2: Derive the Gaussian to compute the gradient, where G is the Gaussian, and I is the image.
Step 3: Calculate the Magnitude by: Step 4: Calculate the orientation for each pixel as, Step 5: Apply the non-maximum suppression, where the magnitude of gradient at a maximum along the direction of the gradient.
Step 6: Apply the Hysteresis Thresholding [L, H], and uses two thresholds (low and high) that called double thresholding.
After finding the level of liquid, it willapplythe matching between the capturing images and the template image that was saved previously. The template was matchedusing the comparison according to the intensities of the pixel. It was used SAD (sum of absolute deference) in this process. Where the absolute difference measured as following [39]: where I c is the intensity of capturing images, and I t is the intensityof template image.They are the intensity or gray level of the image at the amplitude of a twodimensional function f(x,y) at any pair of coordinates (x,y). The lower difference gives the rating for the best situation of the template image within the capturing images.It can be calculated the SAD as follows [39]: The mathematical representation of looping through the pixels in the capturing image when translated the template at every pixel and takeSAD measure is [39]: where C rows and C cols are rows and columns of the capturingtheimage. T rows and T cols are rows and columns of the template image. The system has fully automatic control to perform the operations. Figure 10 shows the flowchart of the steps and details of operation process for the developed automated liquid filling system.

RESULTS AND DISCUSSION
In this section, the resultsare presentedof theautomated filling system that is developed based on edge detection and matching template methods. The optimal results were obtained by applying the Prewitt edge detection methodas shown in Table 1. The Sobel and Laplacian methods had less clearness for the edges of the glass bottle to detect the level of water.Thepercentage of succeeding experimentsfor both methods to detect theliquid level were approximately70% as shown in Table 1. Where, it can be seen the results based on these methods in Figures 11 and 12. The Canny method affected by the luster of glass that filled with water, therefore it cannot detect the level of water accurately. The detection level was less than 75%. Successful experiments asshown in Figure 13.
The Roberts method gave better results than the previous three methods. But the edges which it's detected are many, as shown in Figure 14, and the percentage of succeeded experiments were less than 85.This makes the matching process with the template is more difficult. Owing to this disadvantage, the Prewitt method is the most optimal method for such system. It succeeded to detect accurately the required level of water in the bottle. Where, the percentage of succeeding experiments were less than 97% as shown in Table 1. Figure 15 shows the results of both bottles based on Prewitt method.The developed system is suitable for any shape or size of the bottle and can be used for the transparent bottlesas well. In this paper, it was used two different volumes for bottles (both bottles made from glass).
When the edge detection is applied, the system is matching the base image with the image that is under processing. If the matching percentage is greater than 90%, the decision is to stop the filling process and move the conveyor belt to fill the next bottle. Table 1 lists the results of the experiments that achieved based on the five methods for edge detection, where it can be seen the percentage of succeeded experiments for each method.

CONCLUSIONS AND REMARKS
The control system is the main part in the concept of design the automatic liquid filling system.Generally, in the design of electrical systems, the main necessary stepsthat should be determined are the type of design coding and understanding the requirements of the control system to obtain the satisfied response, where using Arduino board is considered very useful to reduce the operation complexity of the translate ofthe machine sequence to ensure the enhancement of the system performance.
In this research paper, a new automated filling system with low cost is presented. In the presented process the edge detection and the matching template methods was applied. We succeeded to achieve all tasks of the filling system. Five different methods were examined to detect the level of liquid in the bottle at any time during the filling process based on the edge detection approach. Finally, it was concluded based on the obtained results that the optimal method is the Prewitt method.
The main advantages of the developed automated filling system are the high flexibility for filling any liquid with any type of bottle (different shape or/ and volume) without any change in the system setting. In the developed system, other important factors were taken into consideration, such as the conveyor speed and flow rate of liquid into the bottle. In the subsequent researches, the ways to enhance the efficiency and performance of the presented filling system will be investigated.