
A novel 4-DOF Lagrangian dynamics using unit quaternions subject to the norm constraint for attitude control is derivated, the basic energy-conservation property of the Lagrangian dynamics as well as the additional useful properties are established. Similar to the approach followed in [1]}, [2]}, [3]}, [4]}, the Lagrangian dynamics is derivated from the kinematic and dynamic equation of the rigid body. From the control design perspective, this approach is more suitable for derivation of control-orientated Lagrangian dynamics as compared to the approach of modeling the attitude using a Lagrangian function in conjunction with Lagrange multipliers [5]}, [6]}, [7]}, since it allows to explore the basic energy-conservation property and the additional properties of the Lagrangian dynamics, enabling to take full advantage of well developed control designs based on the energy-shaping methodology for a broad class of mechanical systems. To the best of the authors' knowledge these properties are not revealed before in the literature for the attitude dynamics.

The attitude tracking problem is then formulated on the Euclidean space \(\mathbb {R}^4\)  based on the 4-DOF Lagrangian system and solved using the energy-shaping methodology [8]}.
Given a desired attitude trajectory in terms of a quaternion, the spacecraft quaternion described by the 4-DOF Lagrangian dynamics evolves on the unit sphere \(\mathcal {S}^3\)  embedded in the space \(\mathbb {R}^4\) . The controller is designed to render the attitude tracking error, calculated as the Euclidean distance between the desired quaternion and the spacecraft quaternion, to converge to the origin of \(\mathbb {R}^4\) . The error quaternion, calculated as the quaternion product between the conjugate of the desired quaternion and the spacecraft quaternion, converges to the unit quaternion as the attitude tracking error converges to the origin of the space \(\mathbb {R}^4\) .

The basic full state-feedback controller design is extended to address several important practical issues, such as robustness to noise in quaternion measurements, unknown on-orbit torque disturbances, uncertainty in the inertial matrix, and lack of angular-velocity measurements, by designing progressively a hybrid state-feedback controller, an adaptive hybrid state-feedback controller, and an adaptive hybrid attitude-feedback controller. Global asymptotic stability is established for each controller. Since the controller is developed on the space \(\mathbb {R}^4\) , the resulting potential functions have a unique isolated minimum in the corresponding Euclidean space. The term in the potential functions for the attitude error is the same as that used in [9]} for attitude control designs in \(\mathcal {S}^3\) , and the switching is carried out when a simple switching condition is fulfilled. This is in contrast to the potential functions commonly used for hybrid controller designs in \(SO(3)\)  [10]}, [11]}, [12]} or \(\mathcal {S}^3\)  [13]}, where a set of more elaborated potential functions were employed.

