## 2 Motion Planning of XXY Stage Using the ANN
### Motion Planning Using ANN
\[\gamma_{j}=f(\sum_{i}w_{ij}X_{i}-\theta_{j}) \tag{3}\]  
where \(X_{i}\) is the \(i\)-th input, \(Y_{j}\) is the \(j\)-th output, \(w_{ij}\) is the weight from the jth hidden neuron to the kth output neuron and \(\theta_{j}\) is the threshold value. The activation function \(f(\cdot)\) reflects the weighted sum to the results of the output element, and it is designed as the Sigmoid function in this study. The relationship between the input layer and the \(j\)-th neuron \(Y_{j}\) can be described as follows. \[Y_{j}=f(Net_{j})=\frac{1}{1+e^{-Net_{j}}} \tag{4}\]  
In order to obtain a suitable mapping of the proposed image-servo system, the training data of the ANN is designed according to the follow steps. 1. Select 25 training motor commands [\(dx1\ dx2\ dy\)]\({}^{T}\) randomly in the permissible zone and use the training motor commands to drive the XYY stage. After the motion is finished, the two positioning marks are captured by the two vision systems and the coordinates (\(x1,y1\)) and (\(x2,y2\)) in the image frames are obtained by the image processing and pattern recognition. Then, the 25 training pairs of [\(dx1\ dx2\ dy\)]\({}^{T}\) and [\(x_{1}\ x_{2}\ x_{3}\ x_{4}\)]\({}^{T}\) are stored in an ANN training database. 2. Based on the kinematic relationship, which will be discussed in the next section, the XYY stage position and orientation [ \(\delta_{x}\) \(\delta_{y}\) \(\delta_{\theta}\) ]\({}^{T}\) can be obtained using the two coordinates (\(x1,y1\)) and (\(x2,y2\)). 3. Then, apply [\(\delta x\ Sy\ \delta\)]\({}^{T}\) as the input and [\(dx1\ dx2\ dy\)]\({}^{T}\) as the output to train the ANN. In this case, the training is computed off-line using as a multi-layered feedforward with back-propagation. The parameters of the ANN are as follows: learning rate: 0.1, the number of node in the hidden layers is 15 and there are two hidden layers. 4. After the training process is finished, the ANN can be used to compute the necessary commands [\(dx1\ dx2\ dy\)]\({}^{T}\) if the desired XYY stage's position and orientation [ \(\delta_{x}\) \(\delta_{y}\) \(\delta_{\theta}\) ]\({}^{T}\) is known. Once the ANNs are trained with the required range, this mapping relationship can be easily and effectively used to compute on-line implementation. To compare the performance of the proposed ANN-based motion planning with the linear approximated method, 100 positioning experiments are performed and the displacement and the orientation are randomly chosen in the working place. Figures 5 and 6 show the experimental results of the positioning error of \(\sqrt{E_{x}{}^{2}+E_{y}{}^{2}}\) and \(E_{\theta}\) using the linear approximated method and the ANN-based motion planning. Table 6 compares the positioning error and execution time of the proposed method  
Figure 4: Structure of artificial neural network (ANN). from the linear approximated method. The experimental results show that the proposed ANN-based has a rotational error of 0.0066 (degree) and a positioning error of 19.92 \(\upmu\)m within the average execution time of 3.4 (s). The second alignment (fine movement) can be performed to improve the alignment accuracy of the proposed controller; the rotational error and the positioning error can be reduced to 0.0066 (degree) and 6.8069 \(\upmu\)m in a short execution time of 0.735 s. From the experimental results, the proposed ANN-based motion planning has a smaller positioning error than the linear approximated method.