# Discrete-Time Design of Dual Internal Model-Based Repetitive Control Systems
## 3 Discrete-Time RC  
### A General Modified RC  
Suppose that the LTI system (1) is subject to the repetitive reference \(r(k)\) with no presence of disturbance \(v(k)\). Let the reference \(r(k)\) have a fundamental frequency of \(f_{r}\). This gives a basis reference period as \(T_{r}=1/f_{r}\). Based on the information of plant model \(P(z)\) and reference period \(T_{r}\), a general discrete-time RC can be constructed to accurately track the reference signal \(r(k)\). The general modified RC (GMRC) has a transfer function as follows:  
\[\frac{U_{g}(z)}{E(z)}=\bigg{[}\frac{q_{r}(z)z^{-N_{r}}}{1-q_{r}(z)z^{-N_{r}}} \bigg{]}F(z), \tag{4}\]  
where \(U_{g}(z)\) and \(E(z)\) are the control input and the tracking error in \(\mathcal{Z}\)-domain, respectively, \(q_{r}(z)\) is a zero-phase low pass filter used to cut off higher frequencies of reference \(r(k)\), \(F(z)\) is a stabilized controller used for stabilizing the RC-closed loop system, and \(N_{r}\) is an integer number of samples per reference period.  
An integer \(N_{r}\) in (4) is obtained from  
\[N_{r}=\frac{T_{r}}{T_{s}}=\frac{1}{f_{r}T_{s}}. \tag{5}\]  
Here, \(T_{r}\) is a reference period, and \(T_{s}\) is a sampling time. Equation (5) emphasizes that Assumption 2 is compulsory in the design of GMRC. The term modified in GMRC refers to the inclusion of q-filter \(q_{r}(z)\) to the time-delay \(z^{-N_{r}}\). The use of \(q_{r}(z)\) improves the robustness of RC against high-frequency components. In addition, the \(q_{r}(z)\) smooths the control signal generated by the traditional RC. The \(q_{r}(z)\) is generally designed as a zero-phase low-pass filter given by  
\[q_{r}(z)=\alpha_{0}+\sum_{i=1}^{h_{r}}\alpha_{i}\Big{(}z^{i}+z^{-i}\Big{)}. \tag{6}\]  
Note that \(h_{r}\) is the order of filter \(q_{r}(z)\), and the filter coefficients are chosen such that  
\[\alpha_{0}+2\sum_{i=1}^{h_{r}}\alpha_{i}=1. \tag{7}\]  
The condition (7) ensures the unity gain of the filter at the frequencies below the filter bandwidth (\(\omega_{q_{r}}\)); that is, \(|q_{r}(\omega)|=1\) for \(\omega<\omega_{q_{r}}\) (\(\omega_{q_{r}}=2\pi f_{q_{r}}\)). In addition, the q-filter (6) contributes zero-phase for all frequencies, i.e, \(\theta_{q_{r}}(\omega)=0^{o}\)\(\forall\)\(0<\omega<\pi/T_{s}\). Here, \(|q_{r}(\omega)|\) and \(\theta_{q_{r}}(\omega)\) correspond to the magnitude and phase responses of \(q_{r}(z)\), respectively.  
The \(F(z)\) in (4) is also a crucial part of RC. In addition to stabilizing the RC closed-loop system, the \(F(z)\) also determines the convergence rate of the tracking error \(e(k)\). The \(F(z)\) is often designed as an exact inverse of the stabilized plant model. This design requires that the stabilized plant is in a class of minimum-phase systems. To design \(F(z)\) for non-minimum phase systems, one can refer to a zero-phase error tracking controller (ZPETC) design proposed in [26].  
Next, we define an internal model of the controller (4) as follows:  
\[\mathcal{I}_{g}(z)=\frac{\mathcal{N}_{g}(z)}{\mathcal{D}_{g}(z)}=\frac{\big{[} q_{r}(z)z^{-N_{r}}\big{]}}{1-[q_{r}(z)z^{-N_{r}}]}, \tag{8}\]  
where \(\mathcal{N}_{g}(z)\) and \(\mathcal{D}_{g}(z)\) are the numerator and denominator parts of the general internal model. The denominator \(\mathcal{D}_{g}(z)\) in (8) is used later in the synthesis of the proposed controller.