## 2 Controller Design
### Add-on-Type ILC for Mechanical Dynamics  
The PM stepper motor model (1) with the electrical controller (4) is shown in Figure 1. In Figure 1, the transfer function \(P(s)\) from \(i_{q}\) to \(\theta\) is defined as  
\[\Theta(s)=\underbrace{\frac{K_{m}}{s(Js+B)}}_{P(s)}(I_{q_{d}}(s)+D(s)) \tag{9}\]  
where \(\Theta(s)\), \(I_{q_{d}}(s)\), and \(D(s)\) are the Laplace transforms of \(\theta\), \(i_{q_{d}}\), and \(d\), respectively. For the position tracking control in (9), the PI controller \(C(s)\) is designed as  
\[ \begin{array}{rcl}i_{q_{d}}&=&C(s)e_{\theta}\\ &=&(k_{p}+k_{i}\frac{1}{s})e_{\theta},\end{array}  \tag{10}\]  
where \(e_{\theta}=\theta_{d}-\theta\) is the position tracking error, \(\theta_{d}\) is the desired position, \(k_{p}\) is the proportional gain, \(k_{i}\) is the integral gain, and PI controller gains are designed to stabilize the closed-loop system. The add-on-type ILC is designed to improve the position tracking performance. For the ILC design, the desired position is the periodic signal used in the systems which operate repeatedly. For a fast convergence rate, the current-error-based ILC is designed as shown in Figure 2. From Figure 2, we have  
\[u_{j+1}=Q(s)[u_{j}+L(s)e_{\theta_{j}}]+C(s)e_{\theta_{j+1}}, \tag{11}\]  
where \(j\) is the iteration index, \(L(s)\) is the learning function, and \(Q(s)\) is the Q-filter. Figure 1: Permanent-magnet (PM) stepper motor with the electrical controller (4). Figure 2: Current error-based iterative learning controller (ILC). **Theorem 2**. : _Suppose that the ILC (11) is applied to \(P(s)\) (9) with the condition_  
\[\|((1+CP)^{-1}Q(1-LP))\|<1. \tag{12}\]  
_Then, \(u_{j}\) converges to \(u^{*}=(1+CP)^{-1}(QL+C)(\omega^{d}-Pd).\)_  
Proof. : As \(\theta_{d}\) and \(d\) are repetitive signals, \(\theta_{d}\) and \(d\) can be regarded as constant in the view point of the iteration domain. In Figure 2, \(e_{\theta_{j}}=\theta_{d}-P(u_{j}+d)\). Thus,  
\[ \begin{split} u_{j+1}=& Qu_{j}+QLe_{\theta_{j}}+ Ce_{\theta_{j+1}}\\ =& Qu_{j}+QL(\theta_{d}-P(u_{j}+d))\\ &+C(\theta_{d}-P(u_{j+1}+d)).\end{split}  \tag{13}\]  
From (13),  
\[ \begin{array}{rcl}u_{j+1}&=&(1+CP)^{-1}Q(1-LP)u_{j}\\ &&+(1+CP)^{-1}(QL+C)(\omega^{d}-Pd)\end{array}  \tag{14}\]  
Therefore if condition (12) is satisfied,  
\[ \begin{array}{rcl}\lim_{j\to\infty}u_{j}&=&(1+CP)^{-1}(QL+C)(\omega^{d}-Pd) \\ &=&u^{*}.\end{array}  \tag{15}\]  
\(L\) is designed to satisfy condition (12) via the plant inversion method such that \(L(s)\approx P^{-1}(s)\) for the operation frequency area. Ideally, if \(L(s)=P^{-1}(s)\), the convergence rate \((1+CP)^{-1}Q(1-LP)\) in (12) becomes 0. Thus, \(u_{j}\) converges to \(u^{*}\) in just one iteration. **Theorem 3**. : _If \(u_{j}\) converges to \(u^{*}\) and \(L(s)\approx P^{-1}(s)\) for the operation frequency area, then_  
\[\|e^{*}\|_{2}\leq\|1-P(1+CP)^{-1}(QL+C)\|_{2}\|(\omega^{d}-Pd)\|_{2}. \tag{16}\]  
Proof. : After \(u_{j}\) converges to \(u^{*}\), (14) can be rewritten as  
\[u^{*}=(1+CP)^{-1}Q(1-LP)u^{*}+(1+CP)^{-1}(QL+C)(\omega^{d}-Pd). \tag{17}\]  
Thus,  
\[ \begin{split} u^{*}=&(1-(1+CP)^{-1}Q(1-LP))^{-1}(1+ CP)^{-1}(QL+C)(\omega^{d}-Pd)\\ =&(1+CP-Q+QLP)(QL+C)(\omega^{d}-Pd).\end{split}  \tag{18}\]  
As \(L\) is the inverse plant,  
\[u^{*}=(1+CP)^{-1}(QL+C)(\omega^{d}-Pd). \tag{19}\]  
The steady state error \(e^{*}\) is \(\omega^{d}-P(u^{*}+d)\). Therefore,  
\[ \begin{split}\|e^{*}\|_{2}=&\|\omega^{d}-P(u^{*}+d )\|_{2}\\ =&\|\omega^{d}-P((I+CP)^{-1}(QL+C)(\omega^{d}-Pd)+d) \|_{2}\\ \leq&\|1-P(1+CP)^{-1}(QL+C)\|_{2}\|(\omega^{d}-Pd)\| _{2}.\end{split}  \tag{20}\]  
\(\Box\)  
**Remark 1**. : _If \(Q(s)=1\), \(L(s)=P^{-1}(s)\), and the system is asymptotically stable, \(e^{*}\) becomes zero as follows:_  
\[\|e^{*}\|_{2}\leq \|1-P(1+CP)^{-1}(QL+C)\|_{2}\|(\omega^{d}-Pd)\|_{2} \tag{21}\] \[= 0.\]  
_Generally, \(Q(s)\) is designed to be in the low-pass filter. Thus, it is guaranteed that \(Q(s)\approx 1\) for the bandwidth frequency.