## 5 Dispensing Robot Experiment
### Comparison and Discussion  
We added three different laser adjustment strategies for comparison, as shown in Figure 15. The laser adjustment method that only considered dynamic mode, the laser adjustment method that only considered static working mode, and the Proportional Integral Derivative (PID) control were selected, and these algorithms were implemented on a FPGA by program.  
For the above different methods, we took the z direction stability, color adaptability, and step response tests, successively, under the same conditions (the measured object moved at the same speed). The measurement repeatability and dynamic response speed of each method were calculated. In addition, we defined the concept of positional noise density, \(\sigma\), to comprehensively evaluate the accuracy and response speed of measurement, as shown in Equation (10).  
\[\sigma=\sqrt{\frac{\sum\limits_{i=1}^{n}{(u_{i}-u)}^{2}}{w}} \tag{10}\]  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**No.**} & \multicolumn{3}{c}{**Metal Gauge Step**} & \multicolumn{3}{c}{**Ceramic Gauge Step**} \\ \cline{2-7}  & **Max (um)** & **Min (um)** & **R (um)** & **Max (um)** & **Min (um)** & **R (um)** \\ \hline
1 & 48.8753 & 48.8706 & 4.7 & 48.9579 & 48.9569 & 1 \\
2 & 48.8727 & 48.8707 & 2 & 48.9579 & 48.9565 & 1.4 \\
3 & 48.8721 & 48.8706 & 1.5 & 48.9575 & 48.9559 & 1.6 \\
4 & 48.8726 & 48.8703 & 2.3 & 48.9577 & 48.9558 & 1.9 \\
5 & 48.8735 & 48.8704 & 3.1 & 48.9586 & 48.9571 & 1.5 \\ Average & 48.8732 & 48.8705 & 2.7 & 48.9579 & 48.9564 & 1.48 \\ \hline \hline \end{tabular}
\end{table}
Table 4: Repeatability of measured position on the gauge block in the step dynamic reciprocating test.  
Figure 15: Different laser adjustment methods. (**a**) The method only considered dynamic mode; (**b**) The method only considered static mode; (**c**) PID laser adjustment method.  
where \(u\) is the average measured displacement, \(u_{i}\) is the \(i\)th measured displacement, \(n\) is the total measured data, and \(w\) is the dynamic response speed. The measurement results were compared with the method we proposed, as shown in Table 5.  
First, we discuss the necessity of working mode judgement. It was obvious that high measurement repeatability and fast dynamic response speed could not be achieved at the same time in the previous method. The dynamic mode only lead to low measurement accuracy, and the dynamic response speed in high precision static mode was very slow. Our new method combined the advantages of both static and dynamic mode by auto mode judgment. Its measurement accuracy was similar to the static mode, and it had the same response speed as the dynamic mode.  
In addition, compared with the relatively complex PID control algorithm, the linear adjustment method had better repeatability accuracy and faster response speed, which we considered to be caused by the operation consumption of PID algorithm on hardware.  
Finally, we discuss the positional noise density, \(\sigma\), for different methods. The method proposed in this paper had the lowest \(\sigma\), which also indicated that it had much better performance in both accuracy and speed.  
Therefore, the method proposed greatly improved the dynamic response speed while ensuring the measurement accuracy and it had good adaptability to the alternating static and dynamic working scenarios.