# Observer-Based Rejection of Cogging Torque Disturbance for Permanent Magnet Motors
## 3 Observer Design and Analysis  
Defining \(x:=\omega\), \(u:=i_{a}\), and \(y:=x\), we have the state-space model of (1) as follows:  
\[\dot{x}(t) =-\frac{B_{m}}{J_{m}}x(t)+\frac{K_{m}}{J_{m}}u(t)-\frac{1}{J_{m}}d (t), \tag{3}\] \[y(t) =x(t).\]  
In order to concisely describe the cogging torque \(d(t)\), we suppose that there is a generator of the vector \(w=[w_{1},\cdots,w_{2n}]^{\top}\in\mathbb{R}^{2n}\), written as  
\[\dot{w}(t)=Sw(t) \tag{4}\]  
where  
\[S:= \begin{bmatrix}\sigma_{1}S_{o}&\cdots&0\\ \vdots&\ddots&\vdots\\ 0&\cdots&\sigma_{n}S_{o}\end{bmatrix} ,\quad S_{o}:= \begin{bmatrix}0&1\\ -1&0\end{bmatrix} ,\]  
in which, \(\sigma_{1}=\omega,\sigma_{2}=2\omega,\cdots,\sigma_{n}=n\omega\), the initial condition \(w(0)\) are unknown, but \([w_{2i-1}(0)\;\;w_{2i}(0)]^{\top}\) is nonzero for \(i=1,2,\cdots,n\). Then, the cogging torque \(d(t)\) can be written as  
\[d(t)=Hw(t) \tag{5}\]  
where \(H\in\mathbb{R}^{1\times 2n}\) is an unknown matrix and the pair \((S,H)\) is observable. Let \(\theta:=[\theta_{1},\theta_{2},\cdots,\theta_{n}]^{\top}\in\mathbb{R}^{n}\) where \(\theta_{1},\theta_{2},\cdots,\theta_{n}\) are selected such that  
\[\prod_{i=1}^{n}\bigl{(}s^{2}+\sigma_{i}^{2}\bigr{)}=s^{2n}+\theta_{1}s^{2(n-1 )}+\cdots+\theta_{n-1}s^{2}+\theta_{n}\]  
and let  
\[T_{e}:= \begin{bmatrix}1&0&0&\cdots&0&0&0\\ 0&1&0&\cdots&0&0&0\\ \theta_{1}&0&1&\cdots&0&0&0\\ \vdots&\vdots&\vdots&\ddots&\vdots&\vdots\\ 0&\theta_{n-2}&0&\cdots&1&0&0\\ \theta_{n-1}&0&\theta_{n-2}&\cdots&0&1&0\\ 0&\theta_{n-1}&0&\cdots&\theta_{1}&0&1\end{bmatrix}\begin{bmatrix}H\\ HS\\ HS^{2}\\ \vdots\\ HS^{2n-3}\\ HS^{2n-2}\\ HS^{2n-1}\end{bmatrix} \]  
Then, using the state transformation \(\varpi:=T_{e}w\), the systems (4) and (5) are transformed into an observable canonical form  
\[\dot{w}(t) =\bar{S}\varpi(t), \tag{6}\] \[d(t) =\bar{H}\varpi(t)\]  
where  
\[\bar{S}:= \begin{bmatrix}0&1&0&\cdots&0\\ -\theta_{1}&0&1&\cdots&0\\ \vdots&\vdots&\vdots&\ddots&\vdots\\ 0&0&0&\cdots&1\\ -\theta_{n}&0&0&\cdots&0\end{bmatrix} ,\quad\bar{H}:= \begin{bmatrix}1\\ 0\\ \vdots\\ 0\\ 0\end{bmatrix} ^{\top}.\]Then, the system (3) and (6) can be represented as follows:  
\[ \begin{bmatrix}\dot{x}\\ \dot{w}\end{bmatrix}  = \begin{bmatrix}-B_{m}/J_{m}&-(1/J_{m})\dot{H}\\ 0&\dot{S}\end{bmatrix}\begin{bmatrix}x\\ \dot{w}\end{bmatrix} + \begin{bmatrix}K_{m}/J_{m}\\ 0\end{bmatrix} u=:A \begin{bmatrix}x\\ \dot{w}\end{bmatrix} +Bu,\] \[y = \begin{bmatrix}1&0\end{bmatrix}\begin{bmatrix}x\\ \dot{w}\end{bmatrix} =:C \begin{bmatrix}x\\ \dot{w}\end{bmatrix} \]  
where \(y\) is the measurable motor angular velocity. Now, let  
\[T:= \begin{bmatrix}1&0&\cdots&0&0\\ \alpha_{1}&1&\cdots&0&0\\ \vdots&\vdots&\ddots&\vdots&\vdots\\ \alpha_{2n-1}&\alpha_{2n-2}&\cdots&1&0\\ \alpha_{2n}&\alpha_{2n-1}&\cdots&\alpha_{1}&1\end{bmatrix}\begin{bmatrix}C \\ CA\\ \vdots\\ CA^{2n-1}\\ CA^{2n}\end{bmatrix} \]  
where \(\alpha_{1},\alpha_{2},\cdots,\alpha_{2n}\) are the coefficients of the characteristic polynomial of \(A\) given by  
\[s^{2n+1}+\alpha_{1}s^{2n}+\cdots+\alpha_{2n}s =\det(sI+B_{m}/J_{m})\cdot\det(sI-S)\] \[=\left(s+\frac{B_{m}}{J_{m}}\right)\cdot\left(s^{2n}+\theta_{1}s^ {2(n-1)}+\cdots+\theta_{n-1}s^{2}+\theta_{n}\right).\]  
Then, by the similarity transformation \(\xi:=T[x^{\top},\bar{w}^{\top}]^{\top}\in\mathbb{R}^{2n+1}\), into its observable canonical form written as  
\[ \begin{split}\dot{\xi}&=A_{c}\xi+B_{c}u+\Psi(y,u)\theta,\\ y&=C_{c}\xi\end{split}  \tag{7}\]  
where  
\[A_{c}:= \begin{bmatrix}-B_{m}/J_{m}&1&0&\cdots&0\\ 0&0&1&\cdots&0\\ \vdots&\vdots&\vdots&\ddots&\vdots\\ 0&0&0&\cdots&1\\ 0&0&0&\cdots&0\end{bmatrix} ,\quad B_{c}:= \begin{bmatrix}K_{m}/J_{m}\\ 0\\ \vdots\\ 0\\ 0\end{bmatrix} ,\quad C_{c}:= \begin{bmatrix}1\\ 0\\ \vdots\\ 0\\ 0\end{bmatrix} ^{\top},\] \[\Psi(y,u):=- \begin{bmatrix}a[1]&a[2]&\cdots&a[n]\end{bmatrix} y+ \begin{bmatrix}b[1]&b[2]&\cdots&b[n]\end{bmatrix} u,\]  
in which, \(a[i]\in\mathbb{R}^{2n+1}\) and \(b[i]\in\mathbb{R}^{2n+1}\), \(i=1,2,\cdots,n\), are given by  
\[a[i] :=