Port-Hamiltonian Mathematical Model of a Fluid Ring Attitude System

: In this article, we propose a mathematical model using the port-Hamiltonian formalism for a satellite’s three-axis attitude system comprising ﬂuid rings. Fluid rings are an alternative to reaction wheels used for the same purpose, since, for the same mass, they can exert a greater torque than a reaction wheel as the ﬂuid can circulate the periphery of the satellite. The port-Hamiltonian representation lays the foundation for a posterior controller that is feasible, stable, and robust based on the interconnection of the system to energy shaping and/or damping injection components, and by adding energy routing controllers. The torques exerted by the ﬂuid rings are modeled using linear regression analysis on the experimental data got from a prototype of a ﬂuid ring. Since the dynamics of turbulent ﬂows is complex, the torques obtained by the prototype lead to a simpler ﬁrst approach, leaving its uncertainties to a controller. Thus, the attitude system model could be tested in a future prototype before considering a spatial environment.


Introduction
For the operation of an artificial satellite, it must be oriented with respect to other celestial bodies. For this, it is necessary to use devices that produce a torque on the satellite, and that continuously correct its attitude (spatial orientation). These devices are part of the attitude control system. The literature describes various attitude control systems integrated by different momentum exchange devices (torque generating devices). Among the latter, reaction wheels have a relatively simple construction and have been widely studied and used for a long time [1][2][3][4][5][6]. Reaction wheels allow for precise changes to be made in the attitude of the satellite and do not require the ejection of mass unlike the systems incorporating thrusters. Control momentum gyroscopes (CMG's) are more complex than the reaction wheels but, to exert a given torque onto a spacecraft, CMG's typically require less energy than reaction wheels. For the CMG's there is also a great quantity of information about law designs or problems with singular gimble angle configurations [7][8][9][10]. Some devices use the Earth's magnetic field to achieve attitude corrections [11][12][13], therefore, magnetic torquing is a good option for small satellites in low Earth orbits. These kinds of systems are lightweight, inexpensive, and require low power, but, as a limitation, the torque exerted is perpendicular to the local geomagnetic field vector.
Another momentum exchange device [14] uses the motion of a fluid in a circuit to exert a torque onto a spacecraft. In the literature, a round-shaped circuit is often used and it is usually called fluid ring. Since the mass of a fluid ring is concentrated in the periphery, it can exert a greater torque onto a satellite than a reaction wheel of similar mass. This idea has led to further investigation of this type of device. Varatharajoo in 2003 [15] suggested the coupling of existing spacecraft subsystems to decrease the system volume/mass and complexity. The proposed concept considers electrically conducting fluids in a closed-loop This work is organized as follows: Section 2 describes the set of Euler angles chosen as the attitude coordinates. Then, a dynamical model using Euler's equations of motion is developed. Lastly, from the Euler's equations and the Hamiltonian of the system, a model is written in the port-Hamilton form; Section 3 shows a comparison of the open-loop simulation between the port-Hamitonian system and Euler's equations of motion, showing that both representations describe the same dynamics. Also, the model of the torques obtained experimentally using linear regression analysis on the data collected from a fluid ring prototype is collected; the conclusions of the work are presented in Section 4; and finally, the inertia matrix of the fluid rings is presented in appendix A.

Materials and Methods
This section is divided into three parts; the first one introduces the attitude parameters that will be used to describe the orientation of the satellite. Then, its dynamical model is written using Euler's equations of motion. Lastly, the model is represented in a port-Hamiltonian form.

Euler Angles (Yaw, Pitch and Roll)
In celestial mechanics, as well as in the study of rigid body dynamics, Euler angles are frequently used to relate two coordinate systems [32]. Aircraft and spacecraft orientations are commonly described through the Euler angles: yaw (ψ), pitch (θ), and roll (φ) measured in radians. The transformation of a vector in an inertial frame (N ) into a reference frame (e.g., one fixed to a body, in this case, named B), defined by the unit vectorsb 1 ,b 2 , andb 3 , is realized through a sequence of Euler angle rotations. The reference axes are first rotated about theb 3 axis by the yaw angle ψ, then about theb 2 axis by the pitch angle θ, and finally about theb 1 axis by the roll angle φ. Thus, the standard yaw-pitch-roll (ψ, θ, φ) angles are the (3-2-1) set of Euler angles [33]. For a fixed frame B orbiting around another body at an angular velocity Ω, the kinematic differential equations can be written as in the following subsection.

Kinematic Differential Equations
The relation between the angular velocities in a body frame B and the Euler rates (ψ,θ,φ) using the (3-2-1) set of Euler angles is [33,34]: and the vector Bq s = [q s1 q s2 q s3 ] (rad/s) represents the angular velocity of the B frame respect to the N frame in terms of the B frame components (b 1 ,b 2 ,b 3 ). The angular velocity Ω is given by Kepler's equation: where G is the universal gravitational constant, M e is Earth's mass, and R c is the magnitude of an inertial position vector measured from Earth's center. Equation (1) shows the Euler rates as a function of the Euler angles, the angular velocity of the B frame, and Ω, and it is a subsystem of the complete model that describes the dynamics of a satellite's attitude system.

Dynamical Modeling
The proposed attitude system concerning three fluid rings can be seen in Figure 1, where the satellite is represented as a cube with a fluid ring on each of its three visible faces. Each ring's symmetry axis coincides with a satellite's principal axis (X, Y, and Z). The B frame is fixed to the satellite, and the unit vectorsb 1 ,b 2 ,b 3 are aligned with the satellite's principal axes. The matrices of inertia of the satellite and the fluid rings are presented in Section 2.2.1, and their angular velocities in Section 2.2.2. Section 2.2.3 describes the dynamics of the attitude system using Euler's equation of motion.

Inertia Matrices of the Satellite and the Fluid Rings
It is considered a body frame (B) attached to an artificial satellite, and the orientation of the axes (X, Y, Z) in the body is assumed to coincide with its principal axes of inertia. The origin of the body-fixed frame B coincides with the center of mass of the satellite, and it is defined through the unit vectorsb 1 ,b 2 , andb 3 . The inertia matrix of the satellite with respect to the body-fixed frame is: where I s1 , I s2 , and I s3 (kg · m 2 ) are the principal moments of inertia. The matrix B [I s ], aside from containing the satellite inertia terms, also contains the inertia components of the fluid rings because the fluid rings center of mass does not coincide with the satellite center of mass. For the fluid rings the obtaining of the inertia matrices is developed in Appendix A, thus the matrices of inertia for each fluid ring are written as: where, for the i − th fluid ring, I f is is the moment of inertia about its symmetric axis and I f it corresponds to the transverse axes.

Angular Velocity
The angular velocity of the frame B with respect to the inertial frame N ( Figure 1) is represented by: The relative angular velocities of the fluids inside the rings, with respect to the B frame, are written as: From (7), in the inertial frame N , fluids' angular velocities are: where the shorthand notation Bq s =q s , from here on, will be used for simplicity. Since the inertia matrices (5), and angular velocities (8) are identified, now they can be used in the Euler's equations of the following subsection in order to obtain the dynamics of the satellite.

Euler's Rotational Equations of Motion
Using the transport theorem, Euler's equation is expressed as [33]: where, for a rotating body, N is an inertial frame, B is a frame fixed to the body, [I] is the inertial matrix of the body in terms of the B frame,q s is the angular velocity of the B frame with respect to the N frame in terms of the B frame, and τ (N · m) is the vector of external torques experienced by the body. Therefore, Equation (9) To simplify Equation (10), the following matrix is introduced Clearly, the matrix (11) is diagonal, and its elements are: Using the moments of inertia from Equations (12) in (10), the total angular momentum is written in a more compact form as: where the relative angular momenta of the fluid rings, about their center of mass, are defined as [35]: From Euler's Equation (9), the time derivative of H is: (15) In Equation (15) do not appear explicitly the torques produced by the fluid rings. Then, the dynamics of each fluid ring can be isolated to represent their produced torques as follows [35]: where the corresponding torque of the i-th fluid ring is u i (N · m). To express Equation (15) in terms of the u i (16), new moments of inertia are defined as: Substituting (17) and then (16) in (15), results: The equation of motion (18) includes, explicitly, the torques produced by pumps of the fluid rings; therefore, the control laws can directly find the required fluid rings torques.
The vector of external torques τ in (18) is considered to be defined by the external gravity gradient torque. The gravity gradient torque vector acting on a rigid body, measured about its center of mass, is written as [33]:

Port-Hamiltonian Representation
The dynamics of the attitude system shown in Section 2.2 along with the Hamiltonian function will allow for writing a model in the port-Hamiltonian form. A general description of port-Hamiltnonian systems is presented in Section 2.3.1 and the modeling of the fluid ring attitude system in a port-Hamiltonian form is written in Section 2.3.2.

Port-Hamiltonian Systems
The port-Hamiltonian systems have a geometric structure that derives from the interconnection of its subsystems and offers a framework for analysis, control, and simulation of complex physical systems. A central notion in the port-Hamiltonian systems is the Dirac structure whose basic property is power conservation. The notion of Dirac structure enables one to define Hamiltonian systems with algebraic constraints, so that any powerconserving interconnection of port-Hamiltonian systems defines again a port-Hamiltonian system [36][37][38].
A generalization of Hamiltonian systems with collocated inputs and outputs is [37]: (20) where x is the vector of energy variables, H is the Hamiltonian, u, and y are the input and output corresponding to the control port, and the matrix [J(x)] is assumed to be skew-symmetric, this is:

Port-Hamiltonian Model for the Satellite-Fluid Rings System
The Hamiltonian is defined as [39]: where q is the vector of generalized coordinates, L is the Lagrangian, and the vector of generalized torques p is defined as: The Lagrangian is defined as [39]: where T and U are the kinetic and potential energy of the system, respectively. For the satellite, the angular kinetic energy is: and for the rings is written as: The sum of the Equations (25) and (26) is the kinetic energy of the satellite-fluid rings system, represented as: where [M] denotes the above matrix, and the vectorq ∈ R 6 is: As it was stated earlier, the attitude of the satellite is described by the Euler angles (ψ,θ,φ). Thus, a new vector of generalized coordinates is defined, and its time derivative is:q * s = ψθφ (29) Equation (1) relates the vectorsq s andq * s . Therefore: where a(q * s ) =   − sin θ sin ψ/ cos θ − cos θ cos ψ/ cos θ − sin ψ/ cos θ   Let U be a potential function dependent on the Euler-angles (q * s ), thus from (27) and (28), the Lagrangian (24) is written as: Substituting (32) into (22), the Hamiltonian is written as: where, from Equation (23) and (32), the generalized momentum vector is: The elements of the vectors p f ∈ R 3 are: and the elements of the vectors p s ∈ R 3 are: If the elements of the vector p f are substituted into the equation representing the torques exerted by the fluid rings (16), it can be written: If the elements of the vector p s are substituted into Euler's Equation (15), it results in: where the skew-symmetric tilde matrix for the p s vector is introduced as follows: Now, for the partial derivatives of the Hamiltonian (33).
from (34) If instead of q s , the vector q * s (Euler angles) is used, from (30) and (43) we can write: The Hamiltonian (33) does not depend on q f , thus: As the external gravity gradient torque (19) comes from a conservative force, we related it with the gradient of the Hamiltonian ∂H ∂q * s and, to keep the geometric structure of the port-Hamiltonian system, is written as: where, solving for ∂H ∂q * s , results: From Equations (37), (38), (44) and (46), we can represent the model of the system in the port-Hamiltonian form: [0 3 ] is a 3 × 3 null matrix, and [I 3 ] is the 3 × 3 identity matrix. The model (48) comprises two ports, the energy-storage and control port. The port variables corresponding to the energy-storage port are: while the variables of the control port are: The Dirac structure of the port-Hamiltonian systems satisfies the power balance [37]: where e s f s (e c f c ) equals the power corresponding to the storage (control) port. Thus, from (48), (50), and (52) the energy balance is written as: The port-Hamiltonian system (48) is defined with respect to the modulated Dirac structure D written as:

Results
The following subsections describe the results concerning the attitude model in port-Hamiltonian representation and the model for the torques of the fluid rings. For the port Hamiltonian system presented in this work, a simulation comparing the outputs (Euler angles) is given with those of Euler's equations, aiming to show that the two models are equivalent representations of the same physical system. Regarding the fluid rings torques, an experimental prototype of a fluid ring is presented, that is used to collect data and then implement linear regression analysis to model the torque of the fluid rings. These torques are to be substituted in the port-Hamiltonian system, thus completing the attitude model.

Comparing the Euler Equations and the Port-Hamiltonian System
In order to validate the port-Hamiltonian system (48), a comparison with Euler's Equations (18) Table 1 are used in the simulations.    The Euler angles simulated using Euler's equations are represented by continuous lines in the latter figures, and the dashed lines correspond to the same angles but are obtained from the port-Hamiltonian system. As can be seen in the figures, both models concur.

Fluid Rings' Torques from an Experimental Prototype
The torque inputs u f 1 , u f 2 , and u f 3 in Equation (48) depend on the flow in the fluid ring, which can be either laminar or turbulent. Fluid dynamics are complex, especially in turbulent flows. Therefore, as the flow near the fluid ring mechanical pump is presumably turbulent, it was considered a phenomenological approach to model the torque. Otherwise, it would have been needed to consider complex correlations involving fluid mechanics.
The prototype that is shown in Figure 5 was used to collect data on the volume flow rate as the supplied voltage to the pump is varied. This prototype comprises the following elements: There were several measurements collected, increasing the voltage 0.5 V each time. The average value of the volume flow rate and the electric current is shown in Table 2. Then, from the following equation for the torque: where τ p (N · m) is the torque generated by the pumped fluid in the ring, I p (kg· m 2 ) is the moment of inertia of the fluid ring about its symmetry axis, and ω p (rad/s) is the angular velocity of the fluid in the ring. Since the volume flow rate Q (m 3 /s) is equal to the velocity of the fluid v (m/s) times the cross-sectional area of the flow A c (m 2 ) [40], then: where the velocity of the fluid v is: Substituting Equation (58) in (57), and rearranging, results in: As the cross-sectional area and the radius are constant, then: Substituting Equation (60) in (56) allows us to write the torque (τ p ) as: From the data in Table 2, and using the method of least squares, the relation between the volume flow rate Q and the electric current i (A) is represented by the following linear equation: Q = 0.10437 × 10 −3 i + 0.03457 × 10 −3 (62) Figure 6 shows the plot of Equation (62). The time derivative of Q is defined by the chain rule as: From Equations (62) and (63), the Equation (61) is written as: Now the torque exerted by the fluid rings is described as a function of the varying electrical current.
The torque u f i in Equation (48) represents the torque produced by the fluid ring. The experimental torque of the fluid ring obtained with the prototype is τ p . Then if it is considered that all the fluid rings have the same dimensions as the one in the experiment (64), the torque produced by each fluid ring is represented as: where K f = I p A c r 0.10437 × 10 −3 and i i is the electrical current supplied by the pump of the i-th fluid ring.
Perhaps, due to limitations of the experimental equipment used and the concrete choice on the experimental electric current range, model (62) turned out to be a linear one. However, notice that even for a non-linear empirical relation Q = Q(i), obtained from regression analysis, it is still possible, from (64), to find an empirical formula for the pump torque as: without considering the complexities of the turbulent flow in the fluid ring system.

Conclusions
In this work, a dynamical model is developed for a fluid ring attitude system and the torques exerted by the fluid rings. Since the model for the attitude system is presented in a port-Hamiltonian form, it is possible to apply the powerful tools for analysis, control, and simulation, characteristically of such representation. Furthermore, because the powerconserving interconnection of port-Hamiltonian systems again defines a port-Hamiltonian system then, it is possible the developing a more complex system from the interconnection of simpler parts if the aim is to enrich the model in the future.
For the fluid rings, the dynamics are complex, hence the prediction of the flow and the exact calculation of energy losses are very difficult to achieve [41,42]. Therefore, in this work, we decided to use a simpler model that still yields satisfactory results. This model obtained by using linear regression analysis [43] is relatively simple and has reasonable accuracy. Nevertheless, the regression analysis could be applied to model different kinds of pumps and working fluids that yield nonlinear relations between the torque and the applied current. Since this model describes the overall torque exerted by each ring, it is unnecessary to consider head losses (as the frictional one), and consequently, there is no need to highlight if the flow is laminar or turbulent.

Conflicts of Interest:
The authors declare no conflict of interest.

Appendix A. Inertia Matrix of the Fluid Rings
For the fluid rings, it is considered a frame attached to each one (R i ) ( Figure A1). The 1-st fluid ring has attached the (R 1 ) frame, and its origin coincides with the center of mass of the ring. Figure A1. It is considered a frame attached to each fluid ring R 1 , R 2 , and R 3 .