Observer Based Sliding Mode Attitude Control: Theoretical and Experimental Results

In this paper we present the design of a sliding mode controller for attitude control of spacecraft actuated by three orthogonal reaction wheels. The equilibrium of the closed loop system is proved to be asymptotically stable in the sense of Lyapunov. Due to cases where spacecraft do not have angular velocity measurements, an estimator for the generalized velocity is derived and asymptotic stability is proven for the observer. The approach is tested on an experimental platform with a sphere shaped Autonomous Underwater Vehicle SATellite: AUVSAT, developed at the Norwegian University of Science and Technology.


Introduction
The contribution of this paper is the design of an output feedback nonlinear attitude control scheme and its verification on the sphere shaped underwater satellite, AUVSAT (Krogstad et al., 2008;Krogstad, 2010).Several control schemes have been proposed for attitude control of satellites, ranging from linear control in (Parlos and Sunkel, 1992), H 2 and H ∞ in (Won, 1999), to the nonlinear control based on vectorial backstepping in (Bondhus et al., 2005).
The attitude of AUVSAT is actuated by means of reaction wheels.This is a popular and well proven attitude control method and it has been implemented for both small (Zee et al., 2002) and large satellites (Kia et al., 1997).A solution with three orthogonally mounted reaction wheels can be seen in (Nudehi et al., 2008), whereas a redundant solution with four reaction wheels can be seen in (Jin et al., 2008).In addition, (Ismail and Varatharajoo, 2010) present a comparison of several configurations based on three or four reaction wheel actuators.
The method proposed for controlling the angular velocity of the AUVSAT is a sliding mode (SM) con-troller.The SM controller is a well known nonlinear controller that has been applied to many practical systems (Ma and Boukas, 2009).It is considered to be very robust and thereby practical for systems affected by disturbances (Alfaro-Cid et al., 2005).
The problem of controlling motion of rigid body systems has been studied in great detail in the literature of aerospace, marine systems and robotics.However, most of these control techniques require knowledge of the actual angular velocity (Salcudean, 1991).Unfortunately, angular velocity measurement is often omitted due to cost or space restrictions and it is therefore important to estimate the angular velocity.Lizarralde and Wen (1996) and (Costic et al., 2000) present similar results for attitude stabilization control when angular velocity is not present using a velocity filter.Another solution is to estimate the angular velocity using an extended Kalman filter (Sunde, 2005) or a nonlinear observer (Bondhus et al., 2005;Krogstad et al., 2005).The latter solution is used in this paper.
The paper is completed with implementing the sliding mode controller and the observer in the submerged underwater satellite.The AUVSAT is equipped with a ballast system, making it naturally buoyant.The naturally buoyant system will make it possible to emulate a weightless state, similar to the conditions for a satellite in space.Short of launching a spacecraft, the AUVSAT should therefore provide an ideal vehicle for testing and demonstrating the proposed control method.

Modeling
In this section, the model of a satellite actuated by reaction wheels will be derived.

Kinematics
The attitude kinematics will be described using Euler parameters, due to the properties as a nonsingular and computational effective representation.The Euler parameters may be defined from the angle-axis parameters θ and k as and gathered in one attitude vector which has unit length and is called a unit quaternion.
According to (Egeland and Gravdahl, 2002), the rotation matrix corresponding to the quaternion (2) is given by where I ∈ R 3×3 is the identity matrix and S( • ) ∈ R 3×3 is the skew-symmetric vector cross product operator defined such that Note that the quaternion representation has an inherent redundancy and the quaternions q and −q represent the same physical orientation, but q is rotated 2π relative to −q about an arbitrary axis (Kristiansen et al., 2009).
Let {b} be a coordinate frame attached to a rigid spacecraft and {i} an inertial reference frame.(An illustration of the coordinate frames can be seen in Figure 1.) Then it can be seen that the kinematic differential equations can be expressed (Egeland and Gravdahl, 2002), as where ω b ib is the angular velocity of the body frame {b} relative the inertial frame {i} decomposed in the body frame, and R i b is the rotation matrix between the frames.For simplicity, R i b is denoted R throughout the paper.Using (2)-( 4) the kinematic differential equations can then be expressed as where E(q) = − T(q) and T(q) = ηI + S( ).

Dynamics
Assuming that the satellite is a rigid body with the origin of the body frame placed coinciding with the center of gravity (CG), we may use Euler's second axiom to express the momentum for the wheels and the complete system (Hall, 1995).The momentum of the wheels can be written as where J w is the inertia matrix of the wheels and Ω = Ω 1 Ω 2 Ω 3 is the angular velocity of each reaction wheel.The complete angular momentum of the vehicle is expressed as where J is the total moment of inertia of the rigid body including the reaction wheels.Differentiating ( 6)-( 7) with respect to time and using Euler's second axiom, one may write the dynamic equation for the satellite actuated by means of three orthogonal reaction wheels as (Jin et al., 2008): where J s = J − J w is the inertia matrix for the system without wheels, τ b ex is the external torque applied to the system and τ b u is the commanded torque to the motors and thereby the manipulative variable.

Control design
The control objective is to control the angular velocity of the satellite to a desired time-varying angular velocity reference ω i id (t), from now on written ω i d (t) for short.From (5) it can be seen that the corresponding time-varying desired attitude q d (t) can be expressed as where R(q d ) is the rotation matrix from the desired to the inertial frame.

Error dynamics
We may define the angular velocity error as where the desired angular velocity is given in the inertial frame and ω = ω b ib .It is also assumed throughout the paper that angular velocities without superscript are decomposed in the body frame.
The relative attitude error is defined using the quaternion product as where q d and q are the desired and actual attitude, respectively.q −1 d is called the complex conjugate of q d and it can be seen that q −1 d = η d − d .⊗ denotes the quaternion product, which is defined between the two quaternions q 1 = η 1 1 and q 2 = η 2 2 as It can be seen from ( 11)-( 12) and the inherent redundancy of the quaternion parameterization that q e = ±1 0 when the attitude of the satellite is aligned with the desired attitude.0 denotes the 3 × 1 zerovector.
Using ( 8)-( 11) it can be seen that the error dynamics may be written as where the fact that Ṙ ω i d = −S(ω e )R ω i d has been used.

Sliding mode controller
In this section a sliding mode controller will be proposed to control the angular velocity of the satellite.The SM controller is inspired by (Fossen, 2002;Wang et al., 2003), while modifications are carried out in order to adapt it to the sphere shaped satellite.The derivation of the SM controller consists of two parts: making every trajectory converge to the sliding manifold (s = 0) and then making sure that the trajectories reach the desired equilibrium.
Let the sliding variable s ∈ R 3×1 be defined as where If ( 14) is differentiated with respect to time and premultiplied with J s we get where ( 8a) and ( 10) have been used in addition to the fact that Ṙ ω i d = −S(ω e )R ω i d .Choose the control variable τ u to cancel all the nonlinear terms in (15) and include tuning parameters by adding the terms Dsgn(s) and Ps, where D, P ∈ R 3×3 are positive definite.Note that ˙ e can be calculated from the relationship in (13a), avoiding time differentiation of e .sgn(s) is the sign function defined in (16) performed on each element in s.
Remark 1 It is not possible to claim any global stability for the closed-loop system due to the well known issue related to a dual equilibria obtained through the use of quaternions for attitude representation.However, the two quaternions, 1 q = ±1 0 , corresponds to the same physical orientation, and it is therefore important to make a choice of which equilibrium point to stabilize, depending on the given initial condition (Kristiansen et al., 2009).An effective choice in order to minimize the path length, is by choosing Alternative approaches to this problem can be to chose the positive equilibrium while restricting initial values as done in (Caccavale and Villani, 1999) or using hybrid feedback as in (Mayhew et al., 2009).
Remark 2 Note that the external torque τ ex is assumed known.
Proof: Consider the radially unbounded Lyapunov function candidate: and differentiating it with respect to time along the trajectory we get According to (Shevitz and Paden, 1994), this proves that the non-smooth s-system is AS, thus every trajectory will converge to the sliding manifold.In fact, one can guaranty finite time convergence (Perruquetti and Barbot, 2002), since where ϑ = √ 2λ min (D) > 0 and λ min (D) is the smallest eigenvalue of D. From (20), we get This shows that the system will converge to the sliding manifold with the finite convergence time T c , upper bounded according to Given that we are in sliding mode, s = 0, we may write We then introduce the second Lyapunov function candidate: which is a positive definite function since −1 ≤ η e ≤ 1 ∀ t.
Remark 3 Notice that the Lyapunov function may also be seen as a function of e since η 2 e + e e ≡ 1.We will however look at the Lyapunov function as a function of η e since the calculations will be somewhat simpler.
The time derivative of V 2 along the solution then becomes V2 = −2 ηe = e ω e = − e K e (25a) < 0 ∀ q e = ±1 0 , where λ min (K) > 0 is the smallest eigenvalue of K and (13a) and ( 23) have been used, in addition to the unit-length property of q e .Since V 2 is positive definite, and V2 is negative definite, thus, η e → ±1 as times goes to infinity and e → 0. The error attitude q e will thereby converge to 1 q as stated in Proposition 1. Further, it is seen that ω e will converge to 0 since ω e = −K e in sliding mode, and when e → 0 so will ω e .We can then conclude that the equilibrium of the system, with the given controller, is asymptotically stable.

Observer design
Assuming that only attitude of the vehicle and speed of the wheels are available for measurements, an observer is needed to estimate the angular velocity of the satellite.This can be done in different ways, including an extended Kalman filter and a nonlinear observer.In this paper the latter alternative is used and the observer scheme is inspired by (Bondhus et al., 2005;Krogstad, 2010).

Observer dynamic equations
As the calculations are less involved in the inertial frame, we express the momentum dynamics as Σ : We then define the observer system Σ as the copy of the dynamics with correction terms g 1 (q) and g 2 (q) as: Σ : where Ĥi and q are the estimated momentum and attitude, respectively.The correction terms g 1 (q) and g 2 (q) are to be determined later.

Error definition
The error variables between the real and estimated values for attitude, momentum and angular velocity, respectively, are defined as: The error between the estimated system Σ and the real system Σ is denoted Σ and can be derived by differentiating (28) with respect to time, resulting in Σ : Notice that ωb ib = R i b J −1 Hi , as can be seen using ( 26)-( 28).
Proposition 2 The observer Σ, defined in (27), with and k p k v > 0, will converge asymptotically towards the actual system Σ, seen in ( 26).This results in an asymptotic stable equilibrium ( ω, q) = (0, 1 q ) for the closed-loop observer.
Proof: To prove Proposition 2, we utilize (Shevitz and Paden, 1994, Th. 3.1).This theorem proves that ordinary smooth Lyapunov stability theory can be used for a class of non-smooth Lipschitz continuous Lyapunov functions and absolutely continuous state trajectories.In addition we apply Matrosov's theorem, which states four assumptions that must be met to conclude with asymptotic stability.(Matrosovs's theorem can be seen in Appendix A.) Define the state-vector x ∈ R 7 such that Satisfying Assumption 1: Consider the non-smooth Lyapunov function Notice that Remark 3 still apply, but η and ˜ correspond to η e and e , respectively.The time derivative of V o along trajectories then becomes: It is assumed that J is symmetric, meaning J = J, which is generally the case for satellites.Clearly, Vo is negative semidefinite, and one can thereby conclude that the equlilibrium of the observer is uniformly stable (US) and hence the system is bounded.Further, V o is positive definite and decrescent and thereby satisfying Assumption 1.
Satisfying Assumption 2: Choose the non-positive continuous time-independent function Satisfying Assumption 3: Since the origin is US, then Hi , ˜ , and η are bounded functions of time.We can therefore construct the auxiliary function W (x, t) as shown in (34).We choose and thereby satisfying Assumption 3 of the Matrosov's theorem.
Satisfying Assumption 4: The derivative Ẇ then becomes and on the set Inserting for ˙ , and using (28b), (30b) and the unitproperty, you get the following calculations: Therefore, the derivative Ẇ is definitely non-zero on the set N, and Assumption 4 is also satisfied.
Remark 4 This holds as long as η differs from zero.However, (Krogstad, 2010) states that if the US property of Assumption 1 is used in addition to the fact that η = 0 is an unstable equilibrium point, it can be seen that the conditions are met by requiring η = 0 initially.
Finally, all the assumptions of Matrosov's theorem are satisfied, and we may conclude that the errordynamics in ( 26) have an asymptotic stable equilibrium in ( ω, q) = (0, 1 q ) for the closed-loop observer.
Remark 5 In Sec. 3 it is proven that the system with the SM controller is asymptotically stable.This section on the other hand, shows that the proposed observer will converge asymptotically to the real angular velocity.However, this is not sufficient for concluding asymptotic stability for the combined observer-andcontroller system.Nevertheless, asymptotic stability of the system and observer separately is a good indication of overall system stability and experiments presented in the upcoming section strengthen this statement.

Experiments
This section contains simulations and results from the experiments with AUVSAT.The sphere shaped satellite is equipped with small-size and low-cost IMU sensor for attitude and angular velocity measurements, and a PC/104 embedded computer board with 0.5 GHz Pentium processor, running QNX Neutrino OS.In addition to the satellite, a host computer is provided for a graphical communication interface, and Ethernet LAN is used between the host and the QNX target.The host is running Matlab Real-time workshop in combination with Simulink which enables a rapid implementation of control laws, in addition to graphically represent measurements and control signals in real-time.Pictures of AUVSAT are shown in Figure 2.
The first part of this section presents the results of the sliding mode controller.To avoid noisy signals to the controller, the measurements of the angular velocity is filtered with a standard first order filter.In the second part we implement the nonlinear observer.The estimated angular velocity from this observer is used by the same sliding mode controller.
The control objective is to track an angular velocity reference signal ω i d (t) given in the inertial coordinate frame.The reference signal is stated in (37b) and is a sequence of a square signal with a period of 50 s, and time-varying sinusoidal reference signal.In this way one can truly validate the performance of the controller.The experiment was sampled at 50 Hz for about 400 s with the gains shown in Table 1 and the parameters used for the satellite in Table 2.The plots from the case without observer can be seen in Figure 4, whereas the results with angular velocity estimation can be seen in Figure 5.Note that the desired trajectory signal is filtered by a second-order filter inside the "Reference"-block in Figure 3 and q d (t) is calculated using (9). Figure 4 shows the behavior of the system with the sliding mode controller.It can be seen that the system tracks the desired angular velocity quite well.There are almost no uncontrolled oscillations, as we have ω available for feedback.However, small adjustments can be made to make the performance even better.

Experiments with observer
Figure 5(a) shows the comparison between the estimated and the real angular velocity measurements.Plot number three shows the estimation of the angular velocity about the z-axis.It can be seen that the observer works satisfactorily when the sinusoidal signal is tracked.However, the observer seems to have difficulties with estimation of the maximum and minimum angular velocity of the sinusoidal signal.When the system is tracking the constant reference signal, stationary deviation, oscillations and drift can be seen.It thereby looks like the observer performs satisfactorily when there is enough excitation in the system.Some improvement may be achieved by finding better gains, but other observer strategies might also be considered as an alternative, e.g.extended Kalman filter.
In Figure 5(b) the reference angular velocity is compared with a filtered angular velocity measurement.(The filtered signal is selected as the comparison to facilitate the readability.)The behavior of the system is acceptable when the system is tracking the sinusoidal reference signal.However, the performance is clearly not as good as without the observer.
We can also see that the low performance of the observer in connection with the square signal still is present.

Conclusion
In this paper the topic of controlling the attitude of a spherical spacecraft actuated by three orthogonally reaction wheels has been studied.Using methods from nonlinear system theory a robust nonlinear sliding mode controller has been designed and implemented on the AUVSAT to control the attitude.When angular velocity measurements are not present in the spacecraft, a nonlinear observer is derived to estimate the velocity.
The various systems were tested in a lab setup where the AUVSAT is submerged in water and thereby emulating a gravity free environment.Experiments were carried out to evaluate the performance of the controller, observer, and the overall system.In each experiment the system is set to track a sequence of a square-shaped signal, in addition to a sinusoidal timevarying angular velocity reference signal.The results show that the sliding mode controller works satisfactorily throughout the experiment, whereas the performance of the overall system with observer and controller is lower when tracking the squared reference signal.Nevertheless, all aspects considered; the performance of the complete system is satisfactory.

Figure 1 :
Figure 1: Illustration of the AUVSAT where the inertial {i} and body {b} coordinate frames are shown as well as the reaction wheel rates Ω.

Figure 2 :Figure 3 :
Figure 2: AUVSAT.(a) shows when the top sphere is detached to expose the inner construction and (b) shows the submerged satellite during experiments.

Figure 4 :
Figure 4: Experiments without observer.Comparing the angular velocity against the desired generalized velocity.

Figure 5 :
Figure 5: Experiments with observer.(a) shows measured and estimated velocity about x, y and z axis.(b) compares the reference against the filtered angular velocity about the z-axis.

Table 1 :
SM controller and observer gains.