# A New Rotor Position Measurement Method for Permanent Magnet Spherical Motors
## 3 Rotor Position Measurement for a PMSM
### The Principle of Camera Imaging Based on Pin-Hole Model  
A pin-hole model is often used to establish the mathematical model of images in machine vision, which is shown in Figure 6. \begin{table}
\begin{tabular}{c c c} \hline
**Maximum Resolution** & \multicolumn{2}{c}{2320 \(\times\) 1720} \\
**Pixel Size** & \multicolumn{2}{c}{7 \(\mu m\times 7\)\(\mu m\)} \\ \hline  & **Frame Rate** & **Resolution** \\  & 96 & 2320 \(\times\) 1720 \\ Frame rate & 180 & 1920 \(\times\) 1080 \\ (USB3.0 Interfaces) & 360 & 1024 \(\times\) 1024 \\  & 490 & 1080 \(\times\) 720 \\  & 1000 & 640 \(\times\) 480 \\  & 1400 & 512 \(\times\) 512 \\ \hline Dynamic Range & \multicolumn{2}{c}{60 dB} \\ Accuracy & \multicolumn{2}{c}{8 bit} \\ Sensitivity & \multicolumn{2}{c}{5200 DN/Lux.5, 550 nm} \\ Exposure time & \multicolumn{2}{c}{\(>\)2 uS} \\ Size & \multicolumn{2}{c}{82 \(mm\times 77\)\(mm\times 57.5\)\(mm\)} \\ \hline \end{tabular}
\end{table} 
Table 1: Parameters of the high-speed camera  
Figure 5: Images taken by a high-speed camera at different exposure times. In Figure 6, the point \(o_{c}\) represents the optical center of the camera, and \(o_{c}\), \(X_{C}\), \(Y_{C}\), and \(Z_{C}\) form the camera coordinate system (CCF). The ICF includes an imaging plane \(I\), the horizontal ordinates \(X_{C}\), and \(\alpha\), which are parallel and the vertical ordinates \(Y_{C}\) and \(\beta\), which are parallel too, and the optical axis of camera \(Z_{C}\), which is vertical to the imaging plane. The intersection of the optical axis and the imaging plane is the origin of the ICF, which is expressed as \(O_{\alpha\beta}\). The distance between \(o_{c}\) and \(O_{\alpha\beta}\) is \(f\), which is the focal length of the camera. A point \((u,v)\) in the imaging plane can be expressed as:  
\[\left( \begin{array}{c}u\\ v\\ 1\end{array} \right)=\left[ \begin{array}{ccc}\frac{1}{d_{\alpha}}&0&u_{0}\\ 0&\frac{1}{d_{\beta}}&v_{0}\\ 0&0&1\end{array} \right]\left( \begin{array}{c}\alpha\\ \beta\\ 1\end{array} \right) \tag{1}\]  
where \((u_{0},v_{0})\) is the coordinate values of \(O_{\alpha\beta}\), \(d_{\alpha}\) and \(d_{\beta}\) is the pixel size of the camera. We define a world coordinate frame (WCF) which constitutes \(X_{W}\), \(Y_{W}\), and \(Z_{W}\) to describe the position of the camera in the CCF. The transformation relationship between the WCF and CCF can be expressed as:  
\[\left( \begin{array}{c}X_{C}\\ Y_{C}\\ Z_{C}\\ 1\end{array} \right)=\left( \begin{array}{cc}&\stackrel{{\rightarrow} }{{R}}&\stackrel{{\rightarrow}}{{t}}\\ 0^{7}&1\end{array} \right)\left( \begin{array}{c}X_{W}\\ Y_{W}\\ Z_{W}\\ 1\end{array} \right)=\mathbf{M}_{b}\left( \begin{array}{c}X_{W}\\ Y_{W}\\ Z_{W}\\ 1\end{array} \right) \tag{2}\]  
where: \(\mathbf{R}\) is a rotation matrix of \(3\times 3\); \(\stackrel{{\rightarrow}}{{t}}\) is a translation vector of \(3\times 1\); \(\mathbf{M}_{b}\) is a external parameter matrix of \(4\times 4\). As observed from triangulation in Figure 6, we can get  
\[\left\{ \begin{array}{c}\alpha=\frac{fX_{C}}{Z_{C}}\\ \beta=\frac{fY_{C}}{Z_{C}}\end{array} \right. \tag{3}\]  
Figure 6: Pin-hole model in machine vision: (**a**) Camera pin-hole model; (**b**) Image coordinate system. Equation (3) can be expressed in the form of matrix as:  
\[Z_{\text{C}}\left( \begin{array}{c}\alpha\\ \beta\\ 1\end{array} \right)=\left( \begin{array}{cccc}f&0&0&0\\ 0&f&0&0\\ 0&0&1&0\end{array} \right)\left( \begin{array}{c}X_{\text{C}}\\ Y_{\text{C}}\\ Z_{\text{C}}\\ 1\end{array} \right) \tag{4}\]  
Substituting Equations (1) and (2) into Equation (4) leads to  
\[Z_{\text{C}}\left( \begin{array}{c}u\\ v\\ 1\end{array} \right)=\left( \begin{array}{cccc}a_{\alpha}&0&u_{0}&0\\ 0&a_{\beta}&v_{0}&0\\ 0&0&1&0\end{array} \right)\left( \begin{array}{c}\mathbf{R}&\overset{\rightarrow}{ t}\\ 0^{\text{T}}&1\end{array} \right)\left( \begin{array}{c}X_{W}\\ Y_{W}\\ Z_{W}\\ 1\end{array}