## 2 Materials and Methods
Figure 3: Block diagram of the fluid gear pump-based painting system. For a closed-loop system in the discrete-time domain given a flowrate command and a plant model, the repetitive controller can be implemented as a block diagram, as shown in Figure 6. In Figure 6, \(r(k)\), \(y(k)\), and \(d(k)\) denote the reference, output, and disturbance, respectively, and \(P\!\left(z^{-1}\right)\), \(R\!\left(z^{-1}\right)\), \(F\!\left(z^{-1}\right)\) and \(Q\!\left(z,z^{-1}\right)\) are the plant model, the repetitive controller, the dynamic compensator, and the low-pass filter, respectively. If \(N\) is a period of the repetitive disturbance, \(N_{1}\) and \(N_{2}\) satisfy \(N_{1}+N_{2}=N\) as delay counts. If the plant model satisfies \(P\!\left(z^{-1}\right)=z^{-d}B\!\left(z^{-1}\right)/A\!\left(z^{-1}\right)\) and all of the poles of the \(P\!\left(z^{-1}\right)\) are in the unit circle, \(N_{2}=d\) and \(F\!\left(z^{-1}\right)=A\!\left(z^{-1}\right)/B\!\left(z^{-1}\right)\) are established. To design a repetitive controller for periodic disturbances, the nominal model of the plant (\(P(s)\)) in Figure 3 was experimentally obtained, and expressed in the second-order system in the continuous-time domain as follows:  
\[P(s)=\ \frac{29.71}{s^{2}+9.719s+31.12}, \tag{1}\]  
The poles of P(s) are \(-4.8595\ \pm 2.7396i\) in the left-half of the plane, and the stability of the nominal plant model is guaranteed. \(P\!\left(z^{-1}\right)\) is the discrete-time transfer function obtained by using the zero-order hold equivalent in P(s) of Equation (1) at the sampling period of 1 msec, and it is expressed as follows:  
\[P\!\left(z^{-1}\right)=\frac{z^{-1}\!\left(1.4810e^{-5}+\ 1.4760e^{-5}z^{-1} \right)}{1-1.9900z^{-1}-0.9966z^{-2}}, \tag{2}\] \begin{table}
\begin{tabular}{c c} \hline
**Flowrate Command [cc/min]** & **Measured Peak Frequency [Hz]** \\ \hline
100 & 3.972 \\
200 & 7.875 \\
300 & 11.630 \\
400 & 15.500 \\
500 & 19.500 \\ \hline \end{tabular}
\end{table} 
Table 1: Peak frequency of measured flowrate output. Figure 5: Fast Fourier transform (FFT) of flowrate; (a) 400 cc/min flowrate command; (b) 100 cc/min flowrate command. Since the poles of \(P\!\left(z^{-1}\right)\) are \(0.9950\pm 0.0166i\) and the zero of \(P\!\left(z^{-1}\right)\) is \(-0.9966\), all of the poles and zeros of \(P\!\left(z^{-1}\right)\) exist inside of the unit circle. To verify the similarity between the actual plant model and the nominal plant model in Equation (2), the step response for the flowrate command of 100 cc/min is analyzed, as shown in Figure 7. MATLAB (2018b, Mathworks) was used for the simulation of the nominal plant model. After 2 s in Figure 7, the mean square error (MSE) between the simulation and experimental results is 2.134 cc/min, and the correlation between the results from 0 to 4 s is \(R^{2}\)= 0.9384. For the flowrate commands of 100, 200, 300, 400, and 500 cc/min, the simulation results using the nominal plant model are compared with the experimental results in Table 1, and listed in Table 2. For the five flowrate commands, all of the MSEs were less than 2.5, and all \(R^{2}\) were above 0.9. In Table 2, the MSE was relatively large in the low-frequency range of 100 and 200 cc/min due to the influence of the gear shape and frictions. In conclusion, the nominal plant model of Equation (2) is a transfer function expressing the actual plant model and that can be used for designing repetitive controllers. To design the repetitive controller, the nominal plant model of Equation (1) can be represented as \(P\!\left(z^{-1}\right)=z^{-1}\!\left.B\!\left(z^{-1}\right)\!/A\!\left(z^{-1}\right)\!\right.\), and \(B\!\left(z^{-1}\right)\) and \(A\!\left(z^{-1}\right)\) are asymptotically stable polynomial (i.e., all of \begin{table}
\begin{tabular}{c c c} \hline \hline
**Flowrate Command [cc/min]** & **Mean Square Error [cc/min]** & **R\({}^{2}\)** \\ \hline
100 & 2.134 & 0.9384 \\
200 & 2.494 & 0.9127 \\
300 & 0.951 & 0.9137 \\
400 & 1.44 & 0.9016 \\
500 & 1.285 & 0.9072 \\ \hline \hline \end{tabular}
\end{table}