# Electromagnetically Driven Robot for Multipurpose Applications
## 3 Modelling and Kinematics
The electromagnetic field components \(B_{z}\) and \(B_{r}\) can be found using Equation (9) and Equation (10), respectively:  
\[B_{r}=-\frac{a\mu ni}{2\pi}\ \int_{0}^{\pi}\biggl{[}\frac{\cos\mathcal{O}\,d \mathcal{O}}{\sqrt{\xi^{2}+r^{2}+a^{2}-2 ar\ \cos\mathcal{O}}}\biggr{]}_{\xi_{-}}^{\xi_{+}} \tag{9}\]\[B_{z}=\frac{a\mu ni}{2\pi}\ \int_{0}^{\pi}\left[\frac{\xi(a-r\cos\varnothing)\ d \varnothing}{(r^{2}+a^{2}-2 ar\ \cos\varnothing)\sqrt{\xi^{2}+r^{2}+a^{2}-2 ar\ \cos\varnothing}}\right]_{\xi_{-}}^{\xi_{+}} \tag{10}\]  
Based on the above equations, the total electromagnetic field of each electromagnet is \(B_{T}=\sqrt{B_{z}^{2}+B_{T}^{2}}\) and the direction angle \(\theta\) is\(-\tan^{-1}\frac{B_{z}}{B_{z}}\). The electromagnetic field can then be calculated precisely at any chosen point \(P(r,z)\) by using the finite element method (FEM) or the above equations. However, it is important to know that the design is restricted to move only in the axial direction. Hence, the calculation for the magnetic field will be considered only for the axial component. Figure 5 shows the simulation of the magnetic field between electromagnet and PM whereas Figure 6 shows the magnetic field patterns on a permanent magnet with its magnitude and direction using the finite element method. It is more suitable to adopt the above equations due to the sudden changes in the parameters of the segment and in case of real-time implementation. A favourable way to eliminate the computation effort is to define the magnetic field produced by the electromagnet by means of the current running through as the relationship between them is linear. Nevertheless, in this system, an iron core is presented in order to enhance the magnetic field, which makes the relation between the magnetic field and the current nonlinear. Figure 5: Simulation of the magnetic field between electromagnet and PM. Figure 6: Magnetic field patterns on a permanent magnet. There are several mathematical methods to estimate the magnetization of the iron core; however, these methods are either imprecise or excessively complex. In this work, numerical data provided by the core manufacturer were used in an analytical approach as a lookup table combined with piecewise linear approximation to calculate the magnetization of the electromagnet core at any specified current. As shown in the 3D design, each segment can consist of four electromagnets. When bending the segment at any chosen angle, one of the electromagnets will produce an attractive force and the opposite electromagnet will produce a repulsive force. As a result, two main forces will contribute to the bending mechanism each time, such that \(\sum_{i=1}^{n}B_{z,n}\). In the case of the bending angle between two electromagnets, the contribution of each electromagnet depends on the bending angle \(\theta\), such that the total magnetic field will be shaped to the required direction. The resulting dynamic magnetic force can be found as the sum of the static field components applied to the PM, as illustrated below:  
\[\mathbf{F_{M}}=\mathbf{V}\cdot\
abla \begin{cases}M_{Z}(\sum_{i=1}^{n})\pm B_{ Z,n}),\mathbf{Attractive}\\ M_{Z}(\sum_{i=1}^{n})\pm B_{Z,n}),\mathbf{Repulsive}\end{cases}  \tag{11}\]  
where \(M_{z}\) is the magnetization component of the PM, and \(B_{z,n}\) is the axial magnetic field of the individual electromagnet applied to the PM. The other part of the force which achieves the balance and rotates the segment to the desired angle are the spring forces, as described in Equations (1) and (2). The spring repulsive and attractive forces can be represented by Equation (12); these springs are placed to stabilize the system and return it to the balancing phase.