## 2 Design Principle
### Magnetic Adhesive System  
We used the adhesive force of the permanent magnets for the vertical movement of the robot. In this subsection, the adhesive force of the permanent magnets is detailed and analyzed statically. According to [28], the magnetic force depends on the magnetic flux density (\(B\)), where the flux density is based on the distance between the magnet and the ferromagnetic object, the area of the magnetic pole (\(A_{g}\)), and the magnetic permeability of air or of a vacuum (\(\mu_{0}\)), which is equal to \(4\pi\times 10^{-7}\) H/m as presented in Equation (3).  
\[F_{magnet}=\frac{B^{2}A_{g}}{2\mu_{0}} \tag{3}\]  
Figure 6 shows the simulation results of the magnetic flux distribution using Finite Element Method Magnetics (FEMM4.2). At the same distance between the magnet and the ferromagnetic objects, the results reveal that a higher magnetic flux distribution when the magnet is inside the pipe (Figure 6a) compared to that in the flat plate (Figure 6b). Due to the curvature of the pipe surface, the maximum magnetic flux distribution occurs at the edge of the magnet.  
\begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Pipe Diameter (in)** & **5** & **6** & **7** & **8** & **9** & **10** & **11** & **Flat Plate** \\ \hline Shim Plate Thickness (mm) & 18 & 14 & 12 & 10 & 9 & 8 & 7 & 1 \\ \hline \end{tabular}
\end{table}
Table 1: The suitable thickness of the shim plate for various pipe sizes.  
Figure 6: The 2D simulation results of the magnetic flux distribution: (**a**) The magnet in the ferromagnetic pipe; (**b**) the magnet on the ferromagnetic flat plate.  
For vertical movement, the force analysis to prevent the robot from slipping is presented in Figure 7. The frictional forces at the driving wheels (\(F_{fric1}\), \(F_{fric2}\), \(F_{fric3}\), and \(F_{fric4}\)) are related to the normal forces (\(N_{1},\ N_{2},\ N_{3}\), and \(N_{4}\)) where the normal forces depend on the adhesive force of the permanent magnets (\(F_{mag1},\ F_{mag2}\), and \(F_{mag3}\)). The relationship can be expressed as:  
\[N_{1}=\frac{d_{1}}{l_{1}}F_{mag1} \tag{4}\]  
\[N_{4}=\frac{d_{2}}{l_{1}}F_{mag3} \tag{5}\]  
\[N_{2}=N_{3}=\frac{F_{mag2}}{2} \tag{6}\]  
where \(d_{1},\ \ l_{1},\ \ d_{2},\ \text{and}\ l_{2}\) are presented in Figure 7.  
In order to prevent the robot from slipping or falling from a vertical surface, the magnetic adhesive forces are calculated from the formula for frictional force given by \(F=\mu_{s}N\), where \(\mu_{s}\) is the coefficient of static friction between the robot's wheel and the ferromagnetic surface. The sufficient frictional force can be obtained as follows:  
\[F_{fric1}=\mu_{s}\frac{d_{1}}{l_{1}}F_{mag1} \tag{7}\]  
\[F_{fric2}=\mu_{s}\frac{d_{2}}{l_{2}}F_{mag3} \tag{8}\]  
\[F_{fric3}=F_{fric4}=\mu_{s}\frac{F_{mag2}}{2} \tag{9}\]  
Figure 7: The free body diagram and static force analysis of the in-pipe inspection robot.  
When the robot is in vertical motion, it is loaded by the robot's weight (\(G_{robot}\)) and the increment in the length of the control cable (\(G_{cable}\)). The gravitational force due to the control cable's weight can be expressed as:  
\[G_{cable}=9.8(A_{m}l+m_{sliping+connector}) \tag{10}\]  
where \(A_{m}\) is the ratio of the weight of the control cable per unit length, \(l\) is the length of the control cable from the robot to the ground, and \(m_{sliping+connector}\) is the mass of the slip ring and connector. Hence, the frictional force needed to oppose slipping or sliding along the contact surface is required to be greater than the loads of the robot and the control cable, which can be expressed as follows:  
\[\mu_{s}\frac{d_{1}}{l_{1}}F_{mag1}+\mu_{s}\frac{d_{2}}{l_{2}}F_{mag3}\geq(G_{ robot}+G_{cable})\sin\theta \tag{11}\]  
\[\mu_{s}F_{mag2}\geq G_{robot}\cos\theta \tag{12}\]