Posture Dynamic Modeling and Stability Analysis of a Magnetic Driven Dual-Spin Spherical Capsule Robot

In order to realize the intervention operation in the unstructured and ample environments such as stomach and colon, a dual-spin spherical capsule robot (DSCR) driven by pure magnetic torque generated by the universal rotating magnetic field (URMF) is proposed. The coupled magnetic torque, the viscoelastic friction torque, and the gravity torque were analyzed. Furthermore, the posture dynamic model describing the electric-magnetic-mechanical-liquid coupling dynamic behavior of the DSCR in the gastrointestinal (GI) tract was established. This model is a second-order periodic variable coefficient dynamics equation, which should be regarded as an extension of the Lagrange case for the dual-spin body system under the fixed-point motion, since the external torques were applied. Based on the Floquet–Lyapunov theory, the stability domain of the DSCR for the asymptotically stable motion and periodic motion were obtained by investigating the influence of the angular velocity of the URMF, the magnetic induction intensity, and the centroid deviation. Research results show that the DSCR can realize three kinds of motion, which are asymptotically stable motion, periodic motion, and chaotic motion, according to the distribution of the system characteristic multipliers. Moreover, the posture stability of the DSCR can be improved by increasing the angular velocity of the URMF and reducing the magnetic induction intensity.


Introduction
Compared with traditional endoscopy, the wireless capsule endoscopy gastrointestinal examination is safe, comfortable, and non-invasive, and has obvious advantages in the diagnosis of gastrointestinal diseases, especially for small intestine diseases [1,2]. However, the existing capsule endoscopes lack the functions of active locomotion and position control, so it was also called the passive capsule. Its diagnostic and therapeutic effects are not only limited in three-dimensional ample environments such as stomach and colon [3], but also cannot achieve future functions such as drug delivery, biopsy, and minimally invasive surgery [4]. Therefore, it has become an urgent need to extend the scope of diagnosis and treatment of capsule endoscopes to the three-dimensional ample environment and achieve the active control. Taking the built-in micro-motor as the driving source, the researchers have proposed a variety of active capsules such as bionic type [5], screw type [6], leg type [7], propeller type [8], paddle type [9], and so on. Although the micro-motor-driven capsule can achieve many convenient operations, the power capacity and space in the capsule are limited. The external non-contact driven method is more attractive from the aspects of safety and energy supply. The external non-contact driven method of the microrobot include the acoustic field [10], the light field [11], the electric field [12], and the magnetic field [13]. Among all the methods mentioned above, the magnetic field actuation is the most promising one for in vivo applications, due to the advantages of high tissue penetration, good biocompatibility, and precise multi-degree-of-freedom control [14]. the research scope of double-spin body. (3) The posture stability domain of the DSCR for the asymptotically stable motion and periodic motion were obtained.
The rest of the paper is organized as follows. The structure and the working principle of the DSCR are introduced in Section 2. The posture dynamic modeling of the DSCR is presented in Section 3. In Section 4, the posture stability of the DSCR is analyzed, then, experiments are conducted for validation in Section 5. Finally, in Section 6, conclusions are drawn.

The Structure of the DSCR
The prototype and cross-sectional view of the DSCR are shown in Figure 1a,b, respectively. The DSCR is composed of the upper and lower hemispheres, in which the upper hemispherical shell, the sleeve, and the NdFeB permanent magnet are consolidated to form the upper hemisphere. The wireless image transmission module (WITM), the central axis, and the lower hemispherical shell are consolidated to the lower hemisphere. The upper and lower hemispheres are connected by the bearing, and they can rotate relative to each other around the central axis.
Micromachines 2021, 12, x FOR PEER REVIEW 3 of 20 magnetic force and magnetic torque of the magnetic-driven capsule robot. (2) The posture dynamics equation of the DSCR under complex torque was established, which expands the research scope of double-spin body. (3) The posture stability domain of the DSCR for the asymptotically stable motion and periodic motion were obtained. The rest of the paper is organized as follows. The structure and the working principle of the DSCR are introduced in Section 2. The posture dynamic modeling of the DSCR is presented in Section 3. In Section 4, the posture stability of the DSCR is analyzed, then, experiments are conducted for validation in Section 5. Finally, in Section 6, conclusions are drawn.

The Structure of the DSCR
The prototype and cross-sectional view of the DSCR are shown in Figure 1a,b, respectively. The DSCR is composed of the upper and lower hemispheres, in which the upper hemispherical shell, the sleeve, and the NdFeB permanent magnet are consolidated to form the upper hemisphere. The wireless image transmission module (WITM), the central axis, and the lower hemispherical shell are consolidated to the lower hemisphere. The upper and lower hemispheres are connected by the bearing, and they can rotate relative to each other around the central axis. The main structural parameters of the DSCR are listed in Table 1. The diameter and weight of the DSCR are 20 mm and 10 g, respectively. The brand of the radially magnetized NdFeB permanent magnet is N50 and the magnetic torque amplitude is 0.2 A.m 2 . The shell of the upper and lower hemispheres can be fabricated by additive manufacturing. Because the upper hemisphere is fixated with the NdFeB permanent magnet, it can rotate about the central axis under the action of the URMF generated by the tri-axial orthogonal square Helmholtz coils (TOSHC), and the lower hemisphere is under-actuated because of the lack of driving source. Since the upper and lower hemispheres form a co- The main structural parameters of the DSCR are listed in Table 1. The diameter and weight of the DSCR are 20 mm and 10 g, respectively. The brand of the radially magnetized NdFeB permanent magnet is N50 and the magnetic torque amplitude is 0.2 A.m 2 . The shell of the upper and lower hemispheres can be fabricated by additive manufacturing. Because the upper hemisphere is fixated with the NdFeB permanent magnet, it can rotate about the central axis under the action of the URMF generated by the tri-axial orthogonal square Helmholtz coils (TOSHC), and the lower hemisphere is under-actuated because of the lack of driving source. Since the upper and lower hemispheres form a coaxial body and have different rotation speed around the center axis, the coaxial body further constitutes a dual-spin body [30]. The rotation of the upper hemisphere makes the DSCR have the attribute of gyroscope, while the under-actuated lower hemisphere provides a stable platform for the WITM. Figure 2, the three-phase alternating current feeding into the TOSHC can generate the URMF after electromagnetic induction and the superposition polarization. The three-phase current superposition formula of the URMF can be expressed as [31]

As shown in
where, I 0 is the amplitude of the applied electrical current. cosa, cosb, and cosc are the direction cosines of the normal vector n B of the URMF. φ x , φ y are the phase angles, and φ x = arctan (cosc*cosa/cosb), φ y = arctan (cosc*cosb/cosa).
where, I0 is the amplitude of the applied electrical current. cosa, cosb, and cosc are the direction cosines of the normal vector nB of the URMF. ϕx, ϕy are the phase angles, and ϕx = arctan (cosc*cosa/cosb), ϕy = arctan (cosc*cosb/cosa). Figure 2 shows the overall medical application scenario of the DSCR inside the stomach. The whole system mainly consists of three parts: (1) the DSCR (A); (2) the TOSHC (B); and (3) the control unit of the URMF (C, D, E).

Working Principle of the DSCR
The implementation scheme is as follows: after the DSCR is swallowed and entered the A1 position of the stomach cavity, the doctor adjusts the normal vector of the URMF nB to the horizontal position n1 by manipulating the joystick (D) of the controller (C) according to the real-time image transmitted by the WITM. Under the action of the magnetic torque follow-up effect [32], the axis nf of the DSCR can follow n1 to reach the horizontal position, and then the DSCR works in the active mode, which can realize rolling locomotion on the surface of the stomach.   Figure 2 shows the overall medical application scenario of the DSCR inside the stomach. The whole system mainly consists of three parts: (1) the DSCR (A); (2) the TOSHC (B); and (3) the control unit of the URMF (C, D, E).

Working Principle of the DSCR
The implementation scheme is as follows: after the DSCR is swallowed and entered the A 1 position of the stomach cavity, the doctor adjusts the normal vector of the URMF n B to the horizontal position n 1 by manipulating the joystick (D) of the controller (C) according to the real-time image transmitted by the WITM. Under the action of the magnetic torque follow-up effect [32], the axis n f of the DSCR can follow n 1 to reach the horizontal position, and then the DSCR works in the active mode, which can realize rolling locomotion on the surface of the stomach.
When the DSCR reaches the position A 2 , n B is adjusted from the horizontal position to the non-horizontal position, and the conversion of the DSCR from the active mode to the passive mode can be realized. When n B is adjusted to the orientations of n 2 , n 3 , and n 4 , the axis n f of the DSCR can be adjusted to n f2 , n f3 , n f4 in sequence following n B . Therefore, the fixed-point panoramic observation can be achieved with the help of the DSCR vision. If the next region needs to be observed, n B can be adjusted again to the horizontal position, as shown by n 5 in Figure 2. After the DSCR rolls to the position A 3 , the above inspection operation process can be repeated.
In summary, the DSCR with the dual-spin structure not only can realize posture control arbitrarily, but can also realize the separation and mutual conversion of the fixed-point posture adjustment and the rolling locomotion.

Posture Dynamic Modeling
Since the fixed-point posture adjustment function in the passive mode is the key to the conversion of the dual mode, this paper only studies the passive mode of the DSCR.

The Description of the Posture
As shown in Figure 3, the posture of the DSCR can be described by the orientation of the oz 2 axis of the coordinate system ox 2 y 2 z 2 , which is connected to the lower hemisphere of the DSCR, and the oz 2 axis is coincident with the axis n f . The coordinate system ox 2 y 2 z 2 can be obtained by rotating the fixed coordinate system oxyz around the oy axis by angle α (altitude angle), and then around the ox 2 axis by angle β (azimuth angle). Since the rotation along the oz 2 axis does not affect the orientation of the DSCR, the posture of the DSCR can be represented by the altitude angle α and the azimuth angle β, and ox 2 y 2 z 2 is the résal coordinate system. Considering that the DSCR is an axisymmetric structure and the résal coordinate system ox 2 y 2 z 2 is the principal axis coordinate system, then the axis n f is the polar axis.
When the DSCR reaches the position A2, nB is adjusted from the horizontal position to the non-horizontal position, and the conversion of the DSCR from the active mode to the passive mode can be realized. When nB is adjusted to the orientations of n2, n3, and n4, the axis nf of the DSCR can be adjusted to nf2, nf3, nf4 in sequence following nB. Therefore, the fixed-point panoramic observation can be achieved with the help of the DSCR vision. If the next region needs to be observed, nB can be adjusted again to the horizontal position, as shown by n5 in Figure 2. After the DSCR rolls to the position A3, the above inspection operation process can be repeated.
In summary, the DSCR with the dual-spin structure not only can realize posture control arbitrarily, but can also realize the separation and mutual conversion of the fixed-point posture adjustment and the rolling locomotion.

Posture Dynamic Modeling
Since the fixed-point posture adjustment function in the passive mode is the key to the conversion of the dual mode, this paper only studies the passive mode of the DSCR.

The Description of the Posture
As shown in Figure 3, the posture of the DSCR can be described by the orientation of the oz2 axis of the coordinate system ox2y2z2, which is connected to the lower hemisphere of the DSCR, and the oz2 axis is coincident with the axis nf. The coordinate system ox2y2z2 can be obtained by rotating the fixed coordinate system oxyz around the oy axis by angle α (altitude angle), and then around the ox2 axis by angle β (azimuth angle). Since the rotation along the oz2 axis does not affect the orientation of the DSCR, the posture of the DSCR can be represented by the altitude angle α and the azimuth angle β, and ox2y2z2 is the résal coordinate system. Considering that the DSCR is an axisymmetric structure and the résal coordinate system ox2y2z2 is the principal axis coordinate system, then the axis nf is the polar axis. According to Figure 3, the homogeneous transformation matrix A1 from the résal coordinate system ox2y2z2 to the fixed coordinate system oxyz can be obtained as

Torque Analysis
The external torques acting on the DSCR include: the coupling magnetic torque of the URMF and the NdFeB permanent magnet, the viscoelastic friction torque between the According to Figure 3, the homogeneous transformation matrix A 1 from the résal coordinate system ox 2 y 2 z 2 to the fixed coordinate system oxyz can be obtained as

Torque Analysis
The external torques acting on the DSCR include: the coupling magnetic torque of the URMF and the NdFeB permanent magnet, the viscoelastic friction torque between the DSCR and the GI tract, and the gravity torque introduced by the deviation of the DSCR centroid.

The Coupled Magnetic Torque
To describe the basic unit of the URMF-the rotating magnetic vector B, the URMF coordinate system ox 3 y 3 z 3 is introduced with the DSCR spherical center o as the coordinate origin. Where, the oz 3 axis coincides with the normal vector of the URMF n B , the ox 3 , oy 3 axis are located in the rotation plane of the rotating magnetic vector B, and form a right-handed coordinate system with oz 3 axis, as shown in Figure 4.
DSCR and the GI tract, and the gravity torque introduced by the deviation of the DSCR centroid.

The Coupled Magnetic Torque
To describe the basic unit of the URMF-the rotating magnetic vector B, the URMF coordinate system ox3y3z3 is introduced with the DSCR spherical center o as the coordinate origin. Where, the oz3 axis coincides with the normal vector of the URMF nB, the ox3, oy3 axis are located in the rotation plane of the rotating magnetic vector B, and form a right-handed coordinate system with oz3 axis, as shown in Figure 4. Similar to the rotation relationship of Figure 3, ox3y3z3 can be obtained by rotating the fixed coordinate system oxyz about the oy axis by α1 firstly and then about the ox3 axis by β1, then the oz3 axis can be coincide with nB. Therefore, the orientation of the URMF can be expressed by the altitude angle α1 and the azimuth angle β1.
According to the Figure 4, the homogeneous transformation matrix A2 from the URMF coordinate system ox3y3z3 to the fixed coordinate system oxyz can be obtained as The orientation of the URMF can be expressed in the coordinate system ox3y3z3 as The orientation of the URMF can be expressed in the fixed coordinate system oxyz as cos cos n (5) where, a, b, and c are the angles between the nB and each coordinate axis of the fixed coordinate system oxyz.
Since nB and nB3 are all the orientations of the URMF, the following relationship are satisfied From the Equation (6), Equation (7) can be derived Similar to the rotation relationship of Figure 3, ox 3 y 3 z 3 can be obtained by rotating the fixed coordinate system oxyz about the oy axis by α 1 firstly and then about the ox 3 axis by β 1 , then the oz 3 axis can be coincide with n B . Therefore, the orientation of the URMF can be expressed by the altitude angle α 1 and the azimuth angle β 1 .
According to the Figure 4, the homogeneous transformation matrix A 2 from the URMF coordinate system ox 3 y 3 z 3 to the fixed coordinate system oxyz can be obtained as The orientation of the URMF can be expressed in the coordinate system ox 3 y 3 z 3 as The orientation of the URMF can be expressed in the fixed coordinate system oxyz as where, a, b, and c are the angles between the n B and each coordinate axis of the fixed coordinate system oxyz.
Since n B and n B3 are all the orientations of the URMF, the following relationship are satisfied From the Equation (6), Equation (7) can be derived The rotating magnetic vector B can be represented in the ox 3 y 3 z 3 as where, B is the magnetic induction intensity of the URMF, and ω is the angular velocity of the URMF. In order to represent the rotating magnetic vector in the résal coordinate system ox 2 y 2 z 2 , B 3 can be firstly transformed to the fixed coordinate system oxyz, then, transformed to the résal system ox 2 y 2 z 2 . Therefore, the rotating magnetic vector can be represented in ox 2 y 2 z 2 as where, the specific forms of E 1 , E 2 , E 3 , E 4 , E 5 and E 6 are following as E 1 = a 11 cos α − a 31 sin α, E 2 = a 12 cos α − a 32 sin α, E 3 = a 11 sin α sin β + a 31 cos α sin β E 4 = a 12 sin α sin β + a 22 cos β + a 32 cos α sin β, E 5 = a 11 sin α cos β + a 31 cos α cos β, E 6 = a 12 sin α cos β − a 22 sin β + a 32 cos α cos β a 11 = cos α 1 , a 12 = sin α 1 sin β 1 , a 13 = sin α 1 cos β 1 Since the symmetrical axis of NdFeB permanent magnet coincides with the polar axis n f , the magnetic dipole moment of the NdFeB magnet can be represented in the ox 2 y 2 z 2 as where m is the magnitude of the magnetic dipole moment. δ is the slip angle between the magnetic dipole moment and the rotating magnetic vector. Based on the magnetic coupling theory [33], the coupling magnetic torque of the URMF and the NdFeB permanent magnet can be expressed in the résal coordinate system ox 2 y 2 z 2 as where

The Viscoelastic Friction Torque
When the DSCR works in the GI tract, the deformation of the GI tract and the digestive fluid will exert a viscoelastic damping effect on the DSCR, as shown in Figure 5. It can be seen from the literature [34,35] that when the compression deformation ξ of the GI tract is small, the rolling speed V of the DSCR is much smaller than the speed of sound and the characteristic time ξ/V is much larger than the dissipation and relaxation time. Then, the torque of the viscoelastic frictional resistance to the sphere center o of the DSCR under the quasi-static state can be expressed as where R is the radius of the DSCR. F N is the positive pressure of the DSCR on the contact surface. ω D is the angular velocity of the DSCR. k 0 is the friction coefficient, which can be expressed as [30] where η 1 and η 2 are the viscosity coefficient of the DSCR and the GI tract, respectively. Y and ν are the Young's modulus and Poisson's ratio of the GI tract. This formula relates the friction coefficient to the viscous and elastic constants of the contact material.
From the Equations (12) and (13), the projection of the viscoelastic friction torque in the résal coordinate system ox 2 y 2 z 2 can be obtained as where k is the viscous damping coefficient, k = k 0 RFN . where k is the viscous damping coefficient, = 0 N k k RF . α  and β  are the angular velocity of the DSCR around the oy axis and ox2 axis, respectively.

The Gravity Torque
When the DSCR centroid o1 moves on the polar axis nf, its own gravity G will exert a torque on the sphere center o, as shown in Figure 5. The gravity torque can be expressed in the résal coordinate systemox2y2z2 as Gl G (15) where l is the modulus of the vector 1 oo . When l takes a positive value, the centroid is above the sphere center. When l takes a negative value, the centroid is below the sphere center. When l = 0, the centroid coincides with the sphere center.

The Gravity Torque
When the DSCR centroid o 1 moves on the polar axis n f , its own gravity G will exert a torque on the sphere center o, as shown in Figure 5. The gravity torque can be expressed in the résal coordinate systemox 2 y 2 z 2 as where l is the modulus of the vector oo 1 . When l takes a positive value, the centroid is above the sphere center. When l takes a negative value, the centroid is below the sphere center. When l = 0, the centroid coincides with the sphere center. According to Equations (11), (14) and (15), the combined external torque acting on the DSCR can be expressed in the résal coordinate system ox 2 y 2 z 2 as

Posture Dynamics Equation
Based on the theory of angular momentum change of the system in the arbitrary rotating coordinate system [36], the résal coordinate system ox 2 y 2 z 2 is selected as the rotating coordinate system. The Euler dynamic equation describing the fixed-point posture adjustment of the DSCR can be expressed as where J e is the equatorial moment of inertia of the DSCR. J 1 and J 2 are the polar inertia moment of the upper and lower hemisphere, respectively. {p, q, r} are the angular velocity of the lower hemisphere in ox 2 y 2 z 2 , and p = . β, q = . α cos β, r = − . α sin β. σ is the angular velocity of the upper hemisphere relative to the lower hemisphere. M x2 , M y2 , M z2 are the projections of the external torque in the ox 2 y 2 z 2 . M is the total external torque of the upper hemisphere along the polar axis n f (we assume M = 0) [36]. When the system reaches the steady state, the upper hemisphere rotates synchronously with the URMF, so it can be considered that the constant speed constraint condition is satisfied, that is, σ = ω. Considering that the resistance torque of the DSCR along the polar axis, n f can be compensated by the driving torque, that is, M z2 = 0. Therefore, the last two formulas of Equation (17) can be ignored.
Summing up, the posture dynamic equation describing the electric-magnetic-mecha nicalliquid coupling behaviour of the DSCR in the GI tract can be expressed as Equation (18). Moreover, this equation can be classified as an extension of the Lagrangian case for the coaxial bodies system-the fixed-point motion of the coaxial body under the external recovery/overturning moment.

The Floquet-Lyapunov Theory
Since the altitude angle α and the azimuth angle β are typically small, it can be approximated as sinϑ = ϑ, cosϑ = 1, (ϑ = α, β), and the high-order small amount αsinβ can be ignored. Introducing the dimensionless time scale τ = ωt, Equation (18) can be expressed in matrix form as where X = (α, β) T , X = dX/dτ, ε = mB, the matrices M, N, K, F are mass matrix, damping matrix, nonlinear stiffness matrix, and external excitation matrix respectively, and ,F = (sin α 1 cos τ − cos α 1 sin β 1 sin τ) cos(τ − δ) (− sin α 1 cos τ + cos α 1 sin β 1 sin τ) sin(τ − δ) K 11 = ε(cos α 1 cos τ + sin α 1 sin β 1 sin τ) cos(τ − δ) − Gl K 12 = −ε cos β 1 sin τ cos(τ − δ) Since the matrices K(τ) and F(τ) change periodically with τ, Equation (19) is a secondorder periodic variable coefficient dynamic equation. Because the stability of the nonhomogeneous periodic variable coefficient dynamic equation and the corresponding homogeneous equation have the same necessary and sufficient conditions, the homogeneous form of Equation (19) in the form of first order state variables can be expressed as where q = (X, X ) T , A = 0 I A 21 A 22 , 0 represents zero matrix, I is the second-order unit matrix, Since the matrices A(τ) change periodically with τ, Equation (20) is still a periodic variable coefficient dynamic system. According to the Floquet-Lyapunov theory, the stabil-ity of the periodic variable coefficient system can be studied according to the eigenvalue λ of its transition matrix P [37]: If the modulus of all eigenvalues of P are less than 1, the system is asymptotically stable. If P has an eigenvalue whose modulus is greater than 1, the system is unstable. If the modulus of the eigenvalues of P are less than or equal to 1, and at least one of them is equal to 1, the system is limit stable. The eigenvalues of the transition matrix are also called the characteristic multipliers [38]. Therefore, the stability of the dynamic system (20) can be determined by the distribution of the characteristic multipliers of the transition matrix P.
According to the method of C.S.Hu [39], the transition matrix P of the periodic system can be calculated as where I is the unit matrix, N k is the number of parts that divide the period T of the periodic system equally, and each average point is represented by k = 0, 1, 2, . . . N k . The kth interval (ψ k−1 , ψ k ) can be denoted by τ k and its size by ∆ k = ψ k − ψ k−1 . Within the interval τ k , the periodic coefficient matrix C i can be replaced by a constant coefficient matrix C k . And A is the periodic coefficient matrix of the periodic system. According to the Equations (20) and (21), the stable domain of the DSCR can be obtained. Usually, 60 < N k < 100, and J ≥ 2 [40]. Therefore, the period T of Equation (20) is divided into 100 parts, and J = 4. The other parameters of the DSCR are listed in Table 2.

Parameter Value
The polar inertia moment of the upper hemisphere

Three Stable Forms of the DSCR
The modulus of the system characteristic multiplier varies with the control parameters of the DSCR, and corresponds to three typical motion states of asymptotically stable motion, periodic motion, and chaotic motion.
Since the polar axis n f should follow n B to change its orientation, then n B can be thought as the target orientation. When the DSCR is in different motion state, the polar axis n f and the target orientation n B have different orientation relations, the angle θ between n f and n B is defined as the orientation error of the system, as shown in Figure 6, and θ = arccos n f n B / n f |n B | (22) where n f and n B represents the orientation of the polar axis n f and the URMF in the fixed coordinate system oxyz respectively, and n f = (sin α cos β, − sin β, cos α cos β) T n B = (sin α 1 cos β 1 , − sin β 1 , cos α 1 cos β 1 ) T where α and β are the altitude angle and the azimuth angle of the polar axis n f . α 1 and β 1 are the altitude angle and the azimuth angle of the target orientation n B .

Three Stable Forms of the DSCR
The modulus of the system characteristic multiplier varies with the control parameters of the DSCR, and corresponds to three typical motion states of asymptotically stable motion, periodic motion, and chaotic motion.
Since the polar axis nf should follow nB to change its orientation, then nB can be thought as the target orientation. When the DSCR is in different motion state, the polar axis nf and the target orientation nB have different orientation relations, the angle θ between nf and nB is defined as the orientation error of the system, as shown in Figure 6, and

Asymptotically Stable Motion
When the modulus of the characteristic multiplier is less than 1, the system phase diagram with the altitude angle α and the azimuth angle β as state variables is an asymp-

Asymptotically Stable Motion
When the modulus of the characteristic multiplier is less than 1, the system phase diagram with the altitude angle α and the azimuth angle β as state variables is an asymptotically stable curve, as shown in Figure 7a. When the system reaches the steady state, the polar axis n f and the target orientation n B coincide in the fixed coordinate system oxyz, as shown in Figure 7b.  When the angular velocity of the URMF ω and the magnetic induction intensity B vary widely, the variation law of the modulus of the system characteristic multipliers was obtained, as shown in Figure 8. When the angular velocity of the URMF ω and the magnetic induction intensity B vary widely, the variation law of the modulus of the system characteristic multipliers was obtained, as shown in Figure 8. Figure 8 shows that the modulus of the system characteristic multiplier decreases with ω and increases with B. The critical points of Figure 8, which satisfy the modulus of the system characteristic multipliers λ equal 1 was extracted, and the data was fitted by the least square method. Then, the stability domain of the system in the parameter space of ω and B can be obtained, as shown in Figure 9. When the angular velocity of the URMF ω and the magnetic induction intensity B vary widely, the variation law of the modulus of the system characteristic multipliers was obtained, as shown in Figure 8.  Figure 8 shows that the modulus of the system characteristic multiplier decreases with ω and increases with B. The critical points of Figure 8, which satisfy the modulus of the system characteristic multipliers λ equal 1 was extracted, and the data was fitted by the least square method. Then, the stability domain of the system in the parameter space of ω and B can be obtained, as shown in Figure 9.
In Figure 9, the stability domain is divided into two parts by the critical point of λ = 1 . In the upper region, λ > 1 , and the system is unstable. On the contrary, the DSCR can keep the posture stable in the lower region of λ < 1. Figure 9 shows that the posture stability of the DSCR can be improved by increasing the angular velocity of the URMF and decreasing the magnetic induction intensity. The reason is that when the rotational speed of the upper hemisphere increases with the URMF, the stability of the

Stability of the Periodic Motion
When the modulus of the system characteristic multiplier is equal 1, the steady state phase diagram of the system with the altitude angle α and the azimuth angle β as state variables is a curve of periodic oscillation, as shown in Figure 10a, and the polar axis nf precesses near nB, as shown in Figure 10b. In order to explore the precession law of the polar axis nf, the angle θm between the equilibrium position of the polar axis nf and the target orientation nB is defined as the In Figure 9, the stability domain is divided into two parts by the critical point of |λ| = 1. In the upper region, |λ| > 1, and the system is unstable. On the contrary, the DSCR can keep the posture stable in the lower region of |λ| < 1. Figure 9 shows that the posture stability of the DSCR can be improved by increasing the angular velocity of the URMF and decreasing the magnetic induction intensity. The reason is that when the rotational speed of the upper hemisphere increases with the URMF, the stability of the system can be improved under the gyroscopic effect. While the torque balance of the system may be destroyed by increasing the magnetic induction intensity.

Stability of the Periodic Motion
When the modulus of the system characteristic multiplier is equal 1, the steady state phase diagram of the system with the altitude angle α and the azimuth angle β as state variables is a curve of periodic oscillation, as shown in Figure 10a, and the polar axis n f precesses near n B , as shown in Figure 10b.

Stability of the Periodic Motion
When the modulus of the system characteristic multiplier is equal 1, the steady state phase diagram of the system with the altitude angle α and the azimuth angle β as state variables is a curve of periodic oscillation, as shown in Figure 10a, and the polar axis nf precesses near nB, as shown in Figure 10b. In order to explore the precession law of the polar axis nf, the angle θm between the equilibrium position of the polar axis nf and the target orientation nB is defined as the mean orientation error of the system, and the swing angle γ of the polar axis nf is defined as the precession amplitude of the system, as shown in Figure 10b. Fix ω = 18π rad/s, B = 7 mT, the variation law of θm and γ with the centroid deviation l were obtained, as shown in Figure 11a,b, respectively. In order to explore the precession law of the polar axis n f , the angle θ m between the equilibrium position of the polar axis n f and the target orientation n B is defined as the mean orientation error of the system, and the swing angle γ of the polar axis n f is defined as the precession amplitude of the system, as shown in Figure 10b. Fix ω = 18π rad/s, B = 7 mT, the variation law of θ m and γ with the centroid deviation l were obtained, as shown in Figure 11a,b, respectively.  Figure 11 shows that when the centroid approaches the sphere center along the polar axis nf from below (l < 0), the mean orientation error and the precession amplitude of the system are both decreasing. When the centroid coincides with the sphere center (l = 0), the mean orientation error and the precession amplitude of the system are zeros. When the centroid deviates the sphere center along the polar axis nf from upwards (l > 0), the mean orientation error and the precession amplitude of the system both keep increasing. At the same time, compared with the upward deviation of the centroid along the polar axis nf, when the centroid is deviated downward, the mean orientation error and the precession amplitude of the system are smaller. Therefore, in the assembly and manufacturing process, the centroid of the DSCR should be coincident with the sphere center as far as possible.
When the angular velocity of the UMMF ω and the magnetic induction intensity B vary over a wide range, the variation law of mean orientation error θm and the precession amplitude γ with ω and B as the control variables are showed in Figure 12a,b, respectively.  Figure 11 shows that when the centroid approaches the sphere center along the polar axis n f from below (l < 0), the mean orientation error and the precession amplitude of the system are both decreasing. When the centroid coincides with the sphere center (l = 0), the mean orientation error and the precession amplitude of the system are zeros. When the centroid deviates the sphere center along the polar axis n f from upwards (l > 0), the mean orientation error and the precession amplitude of the system both keep increasing. At the same time, compared with the upward deviation of the centroid along the polar axis n f , when the centroid is deviated downward, the mean orientation error and the precession amplitude of the system are smaller. Therefore, in the assembly and manufacturing process, the centroid of the DSCR should be coincident with the sphere center as far as possible.
When the angular velocity of the UMMF ω and the magnetic induction intensity B vary over a wide range, the variation law of mean orientation error θ m and the precession amplitude γ with ω and B as the control variables are showed in Figure 12a,b, respectively. center as far as possible.
When the angular velocity of the UMMF ω and the magnetic induction intensity B vary over a wide range, the variation law of mean orientation error θm and the precession amplitude γ with ω and B as the control variables are showed in Figure 12a,b, respectively.  Figure 12a shows that the mean orientation error of the system can be reduced by increasing ω and B simultaneously. While Figure 12b shows that increasing ω and decreasing B can significantly reduce the precession amplitude of the system.  Figure 12a shows that the mean orientation error of the system can be reduced by increasing ω and B simultaneously. While Figure 12b shows that increasing ω and decreasing B can significantly reduce the precession amplitude of the system.
To explore the stability of the DSCR for the periodic motion, taking ω and B as the control parameters, the stability domain of the system under different centroid deviation is shown in Figure 13. The upper and lower areas of the curve represent the stable domain and unstable domain, respectively. Similar to Figure 9, Figure 13 shows that increasing the angular velocity of the URMF and decreasing the magnetic induction intensity can improve the stability of periodic motion of the system. To explore the stability of the DSCR for the periodic motion, taking ω and B as th control parameters, the stability domain of the system under different centroid deviation is shown in Figure 13. The upper and lower areas of the curve represent the stable do main and unstable domain, respectively. Similar to Figure 9, Figure 13 shows that in creasing the angular velocity of the URMF and decreasing the magnetic induction inten sity can improve the stability of periodic motion of the system.

Chaotic Motion
As shown in Figure 14, when the modulus of the system characteristic multiplier i greater than 1, the system phase diagram with the altitude angle α and the azimuth an gle β as state variables is chaotic, and the posture of the DSCR is unstable, which corre sponding to the control condition of ω = 18π rad/s, B = 12 mT, l = 0 mm.

Chaotic Motion
As shown in Figure 14, when the modulus of the system characteristic multiplier is greater than 1, the system phase diagram with the altitude angle α and the azimuth angle β as state variables is chaotic, and the posture of the DSCR is unstable, which corresponding to the control condition of ω = 18π rad/s, B = 12 mT, l = 0 mm.

Chaotic Motion
As shown in Figure 14, when the modulus of the system characteristic multiplier is greater than 1, the system phase diagram with the altitude angle α and the azimuth angle β as state variables is chaotic, and the posture of the DSCR is unstable, which corresponding to the control condition of ω = 18π rad/s, B = 12 mT, l = 0 mm.

Experiment and Discussion
To verify the theoretical analysis results, an experiment platform as shown in Figure  15 was built. The platform consists of the host computer, the controller, the TOSHC, and the DSCR. When the angular velocity of the UMMF ω, the magnetic induction intensity B, and the orientation of the URMF nB are input to the host computer, the controller can generate three-phase electric power that meet the control requirements, and the URMF can be generated after the three-phase alternating current are fed into the TOSHC. Since

Experiment and Discussion
To verify the theoretical analysis results, an experiment platform as shown in Figure 15 was built. The platform consists of the host computer, the controller, the TOSHC, and the DSCR. When the angular velocity of the UMMF ω, the magnetic induction intensity B, and the orientation of the URMF n B are input to the host computer, the controller can generate three-phase electric power that meet the control requirements, and the URMF can be generated after the three-phase alternating current are fed into the TOSHC. Since the orientation of the URMF can be controlled by the direction cosine of n B , and the axis n f of the DSCR can follow n B to change its orientation, then the posture of the DSCR can be controlled by n B . In order to simulate the environment of the GI tract, the isolated porcine intestinal tissue was spread on the surface of the stomach model.

Principle of the Polar Axis Orientation Measurement
The schematic diagram and physical diagram of the orientation measuring device of the polar axis nf are shown in Figure 16a,b, respectively. As shown in Figure 16a, the unit sphere with the DSCR spherical center o as the coordinate origin, and the unit sphere is intersected with the oz axis of the fixed coordinate system oxyz at the point o'. The tangent plane (x′, y′) of the unit sphere is parallel to the plane (x, y). According to Figure ( When the polar axis nf moves in a small range near the oz axis, the second order small quantities of α, β are omitted, and the above equation can be simplified as Figure 15. The experiment platform of the control system of the URMF.

Principle of the Polar Axis Orientation Measurement
The schematic diagram and physical diagram of the orientation measuring device of the polar axis n f are shown in Figure 16a,b, respectively. As shown in Figure 16a, the unit sphere with the DSCR spherical center o as the coordinate origin, and the unit sphere is intersected with the oz axis of the fixed coordinate system oxyz at the point o'. The tangent plane (x , y ) of the unit sphere is parallel to the plane (x, y). According to Figure 3, the coordinates of the point p, which is the intersection point of the polar axis n f and the (x , y ) plane can be obtained as When the polar axis n f moves in a small range near the oz axis, the second order small quantities of α, β are omitted, and the above equation can be simplified as The x axis is called α axis, and the −y axis is called β axis, so the trajectory of the polar axis n f on the unit sphere can be approximately replaced by the trajectory on the (α, β) plane, that is, the plane pole trajectory. Moreover, the mean orientation error and the precession amplitude of the system are represent by the angles θ m and γ, respectively.
As shown in Figure 16b, the wireless image transmission module of the DSCR was replaced with a laser diode. The coordinate paper is placed at h = 100 mm above the sphere center of the DSCR. The bright spot of the laser diode on the coordinate paper can reflect the end motion trajectory of the polar axis n f in real time, and the trajectory can be recorded by the camera. The horizontal and vertical axes of the coordinate paper correspond to the altitude angle α and the azimuth angle β, respectively. Moreover, each scale on the coordinate paper represents 10 • . Figure 15. The experiment platform of the control system of the URMF.

Principle of the Polar Axis Orientation Measurement
The schematic diagram and physical diagram of the orientation measuring devic the polar axis nf are shown in Figure 16a,b, respectively. As shown in Figure 16a, the sphere with the DSCR spherical center o as the coordinate origin, and the unit spher intersected with the oz axis of the fixed coordinate system oxyz at the point o'. The gent plane (x′, y′) of the unit sphere is parallel to the plane (x, y). According to Figure the coordinates of the point p, which is the intersection point of the polar axis nf and (x′, y′) plane can be obtained as sec tan x y When the polar axis nf moves in a small range near the oz axis, the second o small quantities of α, β are omitted, and the above equation can be simplified as The x′ axis is called α axis, and the −y′ axis is called β axis, so the trajectory of polar axis nf on the unit sphere can be approximately replaced by the trajectory on (α, β) plane, that is, the plane pole trajectory. Moreover, the mean orientation error the precession amplitude of the system are represent by the angles θm and γ, respectiv

The Posture Stability Experiment
To verify the posture stability of the DSCR, three groups of cross experiments were designed as shown in Table 3, and the DSCR with no centroid deviation was used. Set the target orientation n B = (0 • , −20 • ), when ω and B are controlled to change in turn, the end motion trajectories of the polar axis n f are shown in Figure 17a-c, respectively.  Figure 17a shows that the end motion trajectory of the polar axis n f is a fixed point when ω = 18π rad/s, B = 7 mT, which indicates that the system is asymptotically stable and the polar axis n f coincides with the target orientation n B . While Figure 17b shows that the end motion trajectory of the polar axis n f is a curve of the periodic motion when ω = 14π rad/s, B = 7 mT, which indicates that the polar axis n f makes the precession motion around the target orientation n B . Moreover, the end motion trajectory of the polar axis n f in Figure 17c is an irregular curve, indicating the chaotic motion of the system for the control parameters of ω = 18π rad/s, B = 12 mT. The above three groups of experiment results are consistent with the results in Figure 9.
reflect the end motion trajectory of the polar axis nf in real time, and the trajectory can be recorded by the camera. The horizontal and vertical axes of the coordinate paper correspond to the altitude angle α and the azimuth angle β, respectively. Moreover, each scale on the coordinate paper represents 10°.

The Posture Stability Experiment
To verify the posture stability of the DSCR, three groups of cross experiments were designed as shown in Table 3, and the DSCR with no centroid deviation was used. Set the target orientation nB = (0°, −20°), when ω and B are controlled to change in turn, the end motion trajectories of the polar axis nf are shown in Figure 17a-c, respectively.

The Magnetic Induction Intensity B/(mT)
The Motion Law of the DSCR (a) 18π 7 Asymptotically stable (b) 14π 7 Period motion (c) 18π 12 Chaotic motion Figure 17a shows that the end motion trajectory of the polar axis nf is a fixed point when ω = 18π rad/s, B = 7 mT, which indicates that the system is asymptotically stable and the polar axis nf coincides with the target orientation nB. While Figure 17b shows that the end motion trajectory of the polar axis nf is a curve of the periodic motion when ω = 14π rad/s, B = 7 mT, which indicates that the polar axis nf makes the precession motion around the target orientation nB. Moreover, the end motion trajectory of the polar axis nf in Figure 17c is an irregular curve, indicating the chaotic motion of the system for the control parameters of ω = 18π rad/s, B = 12 mT. The above three groups of experiment results are consistent with the results in Figure 9.

The Precession Experiment
To verify the precession characteristics of the polar axis nf when the DSCR makes the period motion, four DSCR models as shown in Figure 18 were 3D printed and assembled. The four DSCR models have the same weight and size except the centroid deviation, and the centroid deviation along the polar axis nf is 4 mm, 2 mm, −2 mm, −4 mm, respectively.

The Precession Experiment
To verify the precession characteristics of the polar axis n f when the DSCR makes the period motion, four DSCR models as shown in Figure 18 were 3D printed and assembled. The four DSCR models have the same weight and size except the centroid deviation, and the centroid deviation along the polar axis n f is 4 mm, 2 mm, −2 mm, −4 mm, respectively. Set ω = 18π rad/s, B = 7 mT, and the target orientation nB = (0°, −20°), the end motion trajectories of the polar axis nf of the centroid deviation l = −4 mm is shown in Figure 19. From the equilibrium position and the end motion trajectory of the polar axis nf, the mean orientation error θm and the precession amplitude γ as shown in Figure 16a can be obtained. Table 4 shows the precession results of the polar axis nf for the four DSCR models of Figure 18.   Set ω = 18π rad/s, B = 7 mT, and the target orientation n B = (0 • , −20 • ), the end motion trajectories of the polar axis n f of the centroid deviation l = −4 mm is shown in Figure 19. From the equilibrium position and the end motion trajectory of the polar axis n f , the mean orientation error θ m and the precession amplitude γ as shown in Figure 16a can be obtained. Table 4 shows the precession results of the polar axis n f for the four DSCR models of Figure 18. Set ω = 18π rad/s, B = 7 mT, and the target orientation nB = (0°, −20°), the end motion trajectories of the polar axis nf of the centroid deviation l = −4 mm is shown in Figure 19. From the equilibrium position and the end motion trajectory of the polar axis nf, the mean orientation error θm and the precession amplitude γ as shown in Figure 16a can be obtained. Table 4 shows the precession results of the polar axis nf for the four DSCR models of Figure 18.     Table 4 shows that when the centroid approaches the sphere center from above or below, the mean orientation error and the precession amplitude of the system both gradually decreases. When the centroid is deviated up or down the same distance along the polar axis n f , the mean orientation error and the precession amplitude are smaller when the centroid moves down. The experiment results are consistent with the simulation results of Figure 11. The error of theoretical calculation and experimental data may be caused by the manufacturing and assembly errors of the DSCR and the system error of the orientation measuring device of the polar axis n f .

Conclusions
The DSCR with a dual-spin structure driven by the URMF was proposed, which can realize the fixed-point posture adjustment in the passive mode and the rolling locomotion in the active mode. The posture dynamics equation of the DSCR and the stability domain for the asymptotically stable motion and the periodic motion based on the Floquet-Lyapunov theory were obtained.
In general, we conclude that the DSCR makes the asymptotically stable motion, the periodic motion, the chaotic motion respectively, when the system characteristic multipliers less than 1, equal to 1, and greater than 1 are satisfied. In detail, increasing the angular velocity of the URMF and reducing the magnetic induction intensity can improve the posture stability of the DSCR. Decreasing the centroid deviation, increasing the angular velocity of the URMF can reduce the mean orientation error and the precession amplitude of the system. At the same time, compared with the upward deviation of the centroid along the polar axis, when the centroid is deviated downward, the orientation error and the precession amplitude of the system are smaller.
This research has laid a solid foundation for the structural improvement and the posture control of the DSCR.