# Robotic-Based Touch Panel Test System Using Pattern Recognition Methods
## 4 Control Scheme  
In most image processing applications, the camera that is used to capture the image has to be stationary. If the camera is moved, related coordinates must be calculated again. The test process will be disturbed in the factory and is very inefficient. In previous work, we used an improved back propagation (BP) neural network with the Levenberg-Marquardt Hidden-Layer Partition (LM-HLP) method [38]. The LM-HLP method is excellent for training the relation of characters and coordinates. Block cyclic data distribution combined the characteristic of block distribution and cyclic distribution. Block distribution distributes source element arrays by the block size that we set up. Cyclic distribution distributes source element arrays to each processor applied by the serial number of the processor. The distribution example is shown in Figure 14. The scheme, in this case, of LM-HLP is shown in Figure 15. Here, \(a_{i}\) is the data to be identified and \(p_{i}\) is the group number. The LM-HLP neural network uses block cyclic distribution on the parallel processing of the hidden layer. Input data are distributed in a block cyclic fashion to each processor for calculation. Each processor is a group, and the elements of each group are the same. This allows processors to calculate at same time, which reduces the learning time of LM-HLP. The flowchart is shown in Figure 16. Once training is completed, the system can handle most situations of error recognition. Figure 14: Example of block cyclic distribution. Figure 15: Scheme of Levenberg–Marquardt Hidden-Layer Partition (LM-HLP) neural network. However, the camera must be stationary. Our solution is to make SVM-HOG keep calculating. As mentioned in previous section, and shown in Figures 17 and 18, SVM-HOG does not require that the image be transformed from RGB color space to YUV color space, which is required with LM-HLP. The results of these two methods are almost the same. Further, SVM-HOG can recognize at least one square correctly and at most can recognize five squares correctly. This ensures that unexpected accidents will not disturb the process. We let the system execute SVM-HOG every 30 s, which keeps the robot arm from continuously pressing the wrong button. In addition to the camera being moved, the smartphone itself being moved has also been considered. As long as the smartphone is still in field of view of the camera, the proposed method is very useful. Figures 19 and 20 show the camera being moved, which causes the target picture to change. Figures 21 and 22 compare the changes between the original and latest coordinate information. Compare with [38]: its scheme is executed every 30 s and can also complete this task, but the proposed method only uses 25 s and is custom fit to a Chinese and Mandarin phonetic symbols environment. Figure 16: Flowchart of LM-HLP. Figure 19: Before moving the camera. Figure 17: RGB image. Figure 20: After moving the camera. Figure 18: Binary image. Fuzzy logic controllers have been utilized to control nonlinear systems successfully. Figure 23 shows the position control scheme with the D-H model and a fuzzy controller. The target coordinates obtained from the camera are normalized and sent into the D-H model to obtain five angles for each joint of the robot arm. Figure 24 shows the control sequence. Figure 15.0 Position control scheme with LM-HLP and fuzzy controller. Figure 15.1 The original coordinate information. Figure 15.2 The latest coordinate information. Fuzzy theory is used to reduce error between commanded and returned degrees of five servo motors. In a fuzzy system, the complex mathematical model of the robot arm is not required. Each layer has only one input and one output. Fuzzy rules are given as follows:  
Rule 1: If _Error_ is negative big, then \(M\) is NB. Rule 2: If _Error_ is negative small, then \(M\) is NS. Rule 3: If _Error_ is zero, then \(M\) is Z. Rule 4: If _Error_ is positive small, then \(M\) is PS. Rule 5: If _Error_ is positive big, then \(M\) is PB.