# Fully Automated Dispensing System Based on Machine Vision
## 3 Vision Dispensing Camera Calibration and Path Planning
### Experimental Verification of Multi-Point Glue Object Path Planning and Analysis  
The conventional paths are arranged according to the calibration order of the image acquisition. The dispensing path planning is carried out directly after coordinating conversion, as shown in Figure 23a, and then the MATLAB software is used for effective path planning of the collected dispensing and positioning information. The initial condition parameters are set as shown in Table 3. After the parameters are set, the coordinates of the center point of the area to be dispensed are obtained by visual recognition, and the program operation of path planning is completed. This experimental verification first uses the five-point location (five PCB boards) to verify the optimization of the path, as shown in Figure 23b. From Figure 23, it can be seen that the five-point path planning does not differ much in the overall path length because the number of reference points is small, the use of a \begin{table}
\begin{tabular}{c c c} \hline \hline \multirow{2}{*}{**Number**} & \multirow{2}{*}{**Pixel Coordinates (X/Y)**} & **Actual Dispensing Position Coordinates** \\  & & **(X/Y)** \\ \hline
1 & (706.8, 433.9) & (31, 19) \\
2 & (1874.5, 548.2) & (82, 24) \\
3 & (1095.4, 1120.1) & (48, 49) \\
4 & (2098.5, 2056.5) & (92, 90) \\
5 & (526.3, 1599.5) & (23, 70) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Dispensing coordinate point conversion table. Figure 23: Comparison of paths before and after path optimization. Note: (**a**) Five-point conventional dispensing path; (**b**) five-point optimized dispensing path; 1–5 indicates the numbering of the 5 PCB boards. \begin{table}
\begin{tabular}{c c} \hline \hline \multicolumn{1}{c}{**Parameters**} & \multicolumn{1}{c}{**Numerical Value**} \\ \hline Initial temperature (t0) & 1000 \\ Cooling factor (\(\Delta t\)) & 0.98 \\ Number of iterations (N) & 500 \\ Temperature value after annealing (eps) & \(-\)11.28 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Simulated annealing algorithm parameter settings. simulated annealing algorithm shows there is not much path change, the algorithm cannot converge well, and it does not reflect the advantages of optimization. Before and after the path optimization can only be seen more clearly in the figure, but its further depth of more points for dispensing has a good reference value. Based on the 5-point path optimization, to increase the dispensing efficiency and further verify the optimization of this algorithm on the dispensing path, 20 points (20 PCBs) are used for experimental verification of the traditional dispensing path and the optimized path length comparison, as shown in Figure 24 for the 20-point traditional path planning diagram. The optimized dispensing path is shown in Figure 25, combining image acquisition recognition and path planning. According to the calculation of the paths optimized by the traditional path and the simulation algorithm, it is obvious that: the traditional dispensing path is messy, and the paths repeat alternately, with a total path of 1670.2 mm and a path planning time of 4.3 s; after the dispensing path optimization, the dispensing trajectory is clear and definite, with  
Figure 24: Traditional path planning diagram. Note: (**a**) Twenty points before optimization path-1; (**b**) twenty points before optimization path-2. Figure 25: Path optimization based on simulated annealing algorithm. a total path of 946.8 mm and a path planning time of 23 s. It can be seen that the difference between the paths before and after the optimization is obvious, and the optimized path is 723.4 mm less than the conventional dispensing path, which shows that path optimization has a positive effect on improving the dispensing efficiency. The accuracy of data extraction is related to the number of experimental validations; this experiment uses a total of 20 PCB boards placed randomly, and the path based on the simulated annealing algorithm is collected 30 times in three groups.