# Fully Automated Dispensing System Based on Machine Vision
## 3 Vision Dispensing Camera Calibration and Path Planning
### Dispensing Motion Path Planning
#### 3.2.1 Dispensing Motion Path Analysis  
In the process of the dispensing system for automatic continuous dispensing, to make the path taken by the dispensing needle in the dispensing system reach the optimal state, path planning is used to achieve a shorter dispensing path and improve the efficiency of the dispensing system, and also to analyze and study the dispensing path and dispensing posture of a single dispensing PCB board.  
\begin{table}
\begin{tabular}{c c c} \hline \hline \multirow{2}{*}{**Number**} & **Dispensing Area Center Coordinate** & \multirow{2}{*}{**Dispensing Area/Pixel**} \\  & **Point/Pixel** & \\ \hline
1 & (294, 235) & 2215 \\
2 & (352, 708) & 2235 \\
3 & (436, 483) & 2218 \\
4 & (707, 282) & 2230 \\
5 & (610, 413) & 2228 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Dispensing area location information extraction for five PCBs.  
Figure 11: Five PCB boards with dispensing area identification.  
Single dispensing object path analysis.  
According to the dispensing process, the dispensing target is a capacitor of length \(\times\) width (4 mm \(\times\) 2 mm); the size sketch is shown in Figure 12, and the boundary chamfer is left with 0.25 mm margin at the upper and lower edges, i.e., \(W_{1}\) = 3.5 mm, and 0.2 mm margin at the left and right edges, i.e., \(W_{2}\) = 1.6 mm. According to the above, the dispensing needle dispensing inner diameter \(\phi_{1}\) = 2.5 mm, and the constant spitting volume per second \(\delta\) = 1 mL/s. We set the dispensing width \(W_{3}\) = 2.5 mm, which in turn leads to linear dispensing on the dispensing target with the motion path shown in Figure 13, from point A to point B. And the moving speed \(v_{1}\) during dispensing:  
\[v_{1}=\frac{L-0.5}{t}. \tag{30}\]  
where \(L\) is dispensing object length; according to the dispensing index requirements of each PCB board, dispensing time does not exceed 4 s, and both can be derived from \(v_{1}\) = 0.9 mm/s.  
Multi-dispensing position path analysis.  
Combined with the dispensing requirements of the subject, two dispensing paths were initially analyzed. The traditional dispensing path is shown in Figure 15a. Traditional dispensing is performed by transferring the randomly marked dispensing position collected by the camera to the dispensing controller directly through coordinate transformation for dispensing, and the dispensing sequence is as follows: the dispensing needle starts from the zero point, dispenses the first object first, runs back to the origin after dispensing is completed, corrects the coordinates, then runs to the second point for dispensing, and so on until the fifth point returns to the origin after dispensing is completed. The control of this dispensing method is relatively simple, and the home point is revised after dispensing is completed, which has a long-running time and cannot meet the efficiency requirements; the running track is complicated.  
Figure 15b shows the dispensing sequence after the dispensing path optimization. The dispensing needle starts from the origin, runs to point 1 and then dispenses, and does not return to the origin after dispensing but goes directly to the target points such as 2 and 3, and finally returns to the origin after dispensing is completed. The whole dispensing path is clear and the dispensing efficiency can be greatly improved, after which the coordinate error can be revised to meet the accuracy requirements. Comparing the two path planning methods, the improvement meets the dispensing requirements simultaneously and satisfies the use of the path algorithm under the current general trend.