## 2 Materials and Methods

Table 2: Comparison of the measured flowrate output and simulation result using the nominal plant model. Figure 6: Repetitive control system with a low-pass filter in the discrete-time domain. Figure 7: The measured flowrate output of the actual plant model, and the simulated flowrate output of the nominal plant model for the flowrate command of 100 cc/min. the poles are located in the unit circle). Note that a closed-loop system including the \(P\big{(}z^{-1}\big{)}\) and the repetitive controller (\(R\Big{(}z^{-1}\big{)}\)) is asymptotically stable if \(R\Big{(}z^{-1}\big{)}\) satisfies the following conditions [10]:  
\[R\Big{(}z^{-1}\big{)}=\ \frac{k_{r}Q\Big{(}z,z^{-1}\Big{)}z^{-N+1}A\Big{(}z^{-1} \Big{)}}{(1-Q(z,z^{-1}))z^{-N}B(z^{-1})} \tag{3}\]  
where N is the period of periodical disturbance. The closed-loop system containing the repetitive controller of Equation (3) is always asymptotically stable in \(0<\ k_{r}<2\)[10]. In this study, the repetitive controller factor (\(k_{r}\)) was set to 0.8 in order to ensure the stability. The transfer function \(Q\Big{(}z,z^{-1}\Big{)}\) in the form of a low-pass filter is defined as follows:  
\[Q\Big{(}z,z^{-1}\Big{)}=\ \frac{z^{-1}\ +\ 2\ +\ z}{4} \tag{4}\]  
The bandwidth of the \(Q\Big{(}z,z^{-1}\Big{)}\) is 181.7 Hz, including the output range, so the \(Q\Big{(}z,z^{-1}\Big{)}\) can act as a moving average filter, which effectively removes the measurement noise without reducing the system bandwidth. When the repetitive controller of Equation (3) is applied to the plant of Equation (2), Figure 8 shows the repetitive controller output (\(u(k)\)) at the steady state for flowrate commands of 100, 200, 300, and 400 cc/min. Figure 8 shows two characteristics of the controller output: (1) The controller output changes according to the motor's flowrate command, and (2) the controller output is synchronized according to the rotational angle of the motor. This means that periodic disturbance occurs depending on the angle and rotational speed of the motor. It is difficult to remove the disturbance only by the repetitive controller if the disturbance of various periods occurs for a wide range of flowrate commands. Therefore, this study proposes a compensation lookup table that removes disturbance according to the rotation angle and rotation speed of the motor. In this study, the compensation value of the controller output according to each flowrate command is defined as the mean value of the controller output during N samples in the steady state:  
\[\overline{u}_{i}=\frac{1}{N}\sum_{j=1}^{N}u_{i}(j), \tag{5}\]  
Figure 8: Repetitive controller output at the steady state for various references. where index \(i\) is the kind of constant flowrate i.e., \((i~{}=~{}1,~{}2,~{}\ldots,~{}M)\). For example, in Figure 8, \(M=4\), \(u_{1}=u_{\mid~{}r=100},~{}\text{and}~{}u_{4}=u_{\mid~{}r=400}\). Thus, Equation (5) gives the average of the controller outputs for N samples at each flowrate command. The sampling period of this study was 1 ms, and N = 10,000 was set to average the controller output for 10 s in the steady state. From Equation (5), the compensation values for the flowrate commands of 100, 200, 300, 400, and 500 cc/min were experimentally obtained, and the linear equation obtained by linear interpolation is expressed as follows:  
\[u_{r}=1.047r+0.0436, \tag{6}\]  
where \(u_{r}\) is the compensation value for the flowrate command, and \(r\) is the constant flowrate command. Figure 9 shows the experimental data and Equation (6). The compensation value according to the rotation angle of the motor is obtained by the following equation:  
\[u_{t}(\theta)=\frac{1}{M}\sum_{i=1}^{M}(u_{i}(\theta)-\overline{u}_{i}), \tag{7}\]  
where \(\overline{u}_{i}\) is the mean value during N samples of the controller output for the \(i\)-th flowrate command, as shown in Equation (5). Equation (7) first obtains the zero mean value signal (\(u_{i}(\theta)-\overline{u}_{i}\)) from the controller output for each constant flowrate command.