Attitude Determination & Control System For A 3U Cubesat - Project report - Figure 1: Flock 2e Cubesat orbiting the Earth. Student: Tommaso Mauriello 10803889 - 968434 Professor: Franco Bernelli Zazzera Course of Spacecraft Attitude Dyanamics Msc. in Space Engineering A.Y. 2020/21 Politecnico di Milano Contents 1 Objective of the study 2 2 Mathematical models 2 2.1 Spacecraft dynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 2.2 Spacecraft kinematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 2.3 Environmental torques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 2.3.1 Gravity gradient . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.3.2 Solar radiation pressure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.3.3 Magnetic torque . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2.3.4 Aerodynamic drag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 3 Mission layout 5 3.1 Estimation of disturbance torques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3.2 Estimation of control torques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3.2.1 Detumbling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3.2.2 Slew maneuver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3.3 Estimation of angular momentum requirements . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3.4 Spacecraft Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3.4.1 Sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3.4.2 Actuators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 4 ADCS Simulation 9 4.1 ADCS architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 4.2 Sensors modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 4.3 Actuators modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 4.4 Attitude determination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 4.4.1 Algebraic method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 4.4.2 Two measures algebraic method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 4.4.3 QUEST method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 4.4.4 Methods comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 4.5 Attitude control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 4.5.1 Detumbling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 4.5.2 Slew maneuver and Earth-pointing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 4.6 Inertia wheel desaturation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Nomenclature Acronyms ADCS Attitude Determination and Control Sys- tem B Body frame DCM Direction cosines matrix GG Gravity gradient ISS International Space Station IW Inertia wheel L LHLV frame LEO Low Earth Orbit LHLV Local Horizontal Local Vertical frame N Inertial Earth-centered frame RAAN Right ascension of the ascending node RW Reaction wheel S/C Spacecraft SRP Solar radiation pressure Other Symbols Ω Right ascension of the ascending node ω Argument of perigee θ True anomaly a Semimajor axis e Eccentricity i Inclination 1 I xx/yy/zz Moment of inertia around the principal body axis x/y/z R E Earth mean equatorial radius T x/y/z Torque component along the principal axis x/y/z w x/y/z Angular velocity component along the principal axis x/y/z A General DCM matrix. T c Control torque T d Disturbance torque n S/C mean motion r Magnitude of the S/C position vector in the N frame Physics Constants c Speed of light in a vacuum 1 Objective of the study The purpose of this study is to develop a suitable ADCS architecture for a LEO spacecraft. The goal of the control system is to achieve a) de-tumbling of the spacecraft after the release into orbit and b) Earth-pointing and subsequent 3-axis stabilization. This will modeled and analyzed by means of a SIMULINK simulation. 2 Mathematical models In this section the mathematical models used to describe the spacecraft motion and the perturbing environmental torques will be presented. 2.1 Spacecraft dynamics The spacecraft dynamics is computed by integration of the Euler equations for a rigid body: I xx ̇ ω x + ( I zz − I yy ) ω z ω y = T x I yy ̇ ω y + ( I xx − I zz ) ω x w z = T y I zz ̇ ω z + ( I yy − I xx ) ω y w x = T z (1) 2.2 Spacecraft kinematics The DCM attitude parametrization has been assigned for this study. The DCM kinematics can be studied by integrating: d A dt = − [ ω ∧ ] A ( t ) (2) The structure of A must be preserved after the numerical integration (i.e. its orthogonality must be guaranteed, since it is a rigid rotation matrix). For this purpose an orthogonalization is performed at each integration step using the following iterative procedure: A k +1 ( t ) = 3 2 A k − A k ( t ) A T k ( t ) A k ( t ) 2 (3) In the simulation a number of iterations k = 10 has been selected. 2.3 Environmental torques The spacecraft is subjected to several disturbance torques arising from the external environment. Four types of disturbances and their respective modelings are now presented. 2 2.3.1 Gravity gradient The gravity gradient disturbance is produced by a non-uniform gravity field over the spacecraft mass distribution. It can be modeled as: T GG x = 3 μ r 3 ( I zz − I yy ) c 3 c 2 T GG y = 3 μ r 3 ( I xx − I zz ) c 1 c 3 T GG z = 3 μ r 3 ( I yy − I xx ) c 2 c 1 (4) where c 1 , c 2 , c 3 depend on the relative orientation between the B and the LHLV frame, and they are computed as: c 1 c 2 c 3 = A B/L 1 0 0 (5) The A B/L is instead computed as: A B/L = A B/N A T L/N (6) The A L/N matrix represents the relative orientation of the LHLV frame with respect to the inertial one and it is computed by two consecutive rotations (of ω + θ around the z axis and of i around the x axis): A L/N = cos( θ + ω ) sin( θ + ω ) 0 − sin( θ + ω ) cos( θ + ω ) 0 0 0 1 1 0 0 0 cos( i ) sin( i ) 0 − sin( i ) cos( i ) (7) Finally, since θ is a function of time it is computed by integration of the following expression: ̇ θ = n (1 + e cos( θ )) 2 (1 + e 2 ) 3 / 2 (8) 2.3.2 Solar radiation pressure The solar radiation illuminating the outer surface of the S/C generates a pressure due to an exchange of momentum between the photons and the S/C itself. This pressure generates a force which, in turns, can generate a torque around the center of mass of the satellite. The average pressure due to radiation can be evaluated as: P = F e c (9) where F e is the power per unit surface generated by the incoming radiation, and c the speed of light. For the mission under study, which is described in section 3, F e = 2108 W m 2 by taking into account the overall contribution due to direct solar radiation and Earth reflected and emitted radiation. The resulting force on a flat panel of area A is: F = − P A [ ρ a ( ˆ S · ˆ n s ) ˆ S + 2 ρ s ( ˆ S · ˆ n s ) 2 ˆ n s + ρ d ( ˆ S · ˆ n s )( ˆ S + 2 3 ˆ n s )] (10) where ρ a , ρ s and ρ d are respectively the coefficients of absorption, specular reflection and diffused reflection of the illuminated surface. Their sum must be 1, so it’s enough to define just two of them. For this study ρ s = 0.5 and ρ d = 0.1 have been selected for the body surfaces, while ρ s = 0.8 and ρ d = 0.1 for the solar panels surfaces. Finally, the torque is obtained as: 3 T SRP = ∑ N i =1 r i ∧ F i if ˆ S B · ˆ n s > 0 0 if ˆ S B · ˆ n s < 0 (11) where N is the number of surfaces, ˆ n s is the unitary vector normal to the i-th surface, r i is the position of the center of pressure of the i-th flat surface with respect to the center of mass of the S/C, and ˆ S B is the unitary vectory of the Sun position as seen in the B frame. Clearly the SRP torque is zero when the S/C is not illuminated by the Sun, i.e. it is shadowed by the Earth. For this purpose the eclipse condition has been implemented from [2] (3-48), and it is formulated as follows: ρ p > arccos( ˆ P · ˆ X ) X > P (12) where ρ p is the angular radius of the Earth as seen from the Sun, ˆ P the unitary vector from the Sun to the planet, ˆ X the unitary vector from the Sun to the S/C and X , P their corresponding magnitudes. 2.3.3 Magnetic torque The magnetic disturbance torque is generated by the interaction between the Earth magnetic field B and the residual magnetic dipole m of the S/C, according to the general law: T M = m ∧ B (13) Thus a modeling of the Earth magnetic field is needed. For this purpose the general expression of the magnetic field potential in spherical coordinates has been used, from which the components of the magnetic field can be obtained by derivation. The following expressions have been used: b r = − ∂V ∂r = ∑ k n =1 ( R E r ) ( n +2) ∑ n m =0 ( g n,m cos( mφ ) + h n,m sin( mφ ) P n,m ( θ )) b θ = − 1 r ∂V ∂θ = − ∑ k n =1 ( R E r ) ( n +2) ∑ n m =0 ( g n,m cos( mφ ) + h n,m sin( mφ ) ∂P n,m ( θ ) ∂θ ) b ψ = − 1 r sin( θ ) ∂V ∂ψ = − 1 sin( θ ) ∑ k n =1 ( R E r ) ( n +2) ∑ n m =0 m ( − g n,m sin( mφ ) + h n,m cos( mφ ) P n,m ( θ )) (14) The coefficients g n,m and h n,m are computed as: g n,m = S n,m g nm h n,m = S n,m h nm (15) where g nm and h nm are tabulated coefficients (amplitudes of the shape functions of the potential field), while the coefficients S n,m and the polynomials P n,m can be computed recursively. The advantage of this formulation is that the terms of the expansion can be retained when increasing the order of the model (i.e. it’s not needed to compute them all again). The implementation of the model has been performed up to the 13th order taking [1] as a reference. Note that in the expression for T M both the residual magnetic dipole and the magnetic field intensity must be expressed in the B frame (in order to obtain a torque to be used as input for the Euler equations). The residual magnetic dipole for the S/C has been considered equal to [0.01 0.05 0.01] Am 2 2.3.4 Aerodynamic drag The interaction between the S/C and the upper layers of the Earth’s atmosphere generate aerody- namic forces, which in turn can generate a torque around the center of mass. The aerodynamic force on a flat surface is computed as: 4 F i = − 1 2 ρC D v rel 2 ˆ v b rel ( ˆ N b i · ˆ v b rel ) A i (16) This expression has the same mathematical form used for continuous fluids, even if at these altitudes the atmosphere cannot be actually considered continuous, so an ”equivalent” density is considered. For the mission under study ρ = 2.72e-10 kg/m 3 C D is the surface drag coefficient. For a flat panel a typical value of 2.2 has been considered. v rel is the magnitude of the relative velocity between the spacecraft and the the atmosphere, which can be computed assuming that the atmosphere moves with the same angular velocity as the Earth, so: v rel = ̇ x + w ⊕ y ̇ y − w ⊕ x ̇ z (17) where w ⊕ = 0.000072921 rad/sec and x, y and z are the components of the S/C position vector in the N frame. The torque is then obtained as: T DRAG = ∑ N i =1 r i ∧ F i if ˆ N b i · ˆ v rel > 0 0 if ˆ N b i · ˆ v rel < 0 (18) 3 Mission layout A Flock 2E cubesat deployed from the ISS as been used as a reference for this study. It’s a 3U cubesat with deployable solar panels, as shown in Fig. 2 along with the orientation of the principal axes. Its orbital parameters, which are the same as the ISS, are presented in the following table: a (km) e (-) i (deg) Ω (deg) ω (deg) θ (deg) 6778 0.0002356 51.6429 0 339.6273 0 Table 1: Initial keplerian elements. The true anomaly is assumed to be zero at the beginning of the simulation, which coincides with the spacecraft release from the ISS. The RAAN is also considered zero in order to simplify the expression of the rotation matrix A L/N (anyhow due to the nodal precession of the ISS orbit the zero-RAAN condition will be reached at some point). The orbit is assumed to be unperturbed, since orbital perturbations are irrelevant for the purpose of this study, and also because the simulation is run for only one full orbit period, i.e. too shortly for any relevant accumulation of effects due to orbital perturbations. The inertial properties of the spacecraft have been evaluated considering the inertia moments of a 3U cubesat (TigriSat) and then adding the contribution of the deployed solar panels (a single panel has a surface of 0.102 m 2 and a mass of 450 g ), obtaining: I xx = 0 0515 kg m 2 I yy = 0 1212 kg m 2 I zz = 0 1617 kg m 2 (19) With these inertial properties a passive stabilization around the pitch axis is obtained thanks to the GG. The spacecraft center of mass is assumed to be shifted from its geometrical center of 1.5 cm in the direction [-0.5, 0.5, -2] along the three principal axes. An imaging camera is located along the negative x-direction (yaw axis), which is required to point towards Earth at all times. Thus the nadir pointing of the camera must be achieved by the control system, with a prescribed accuracy of ± 1 ° In order to select appropriate actuators for the cubesat a preliminary estimation of the require- ments in terms of torques and angular momentum has been carried out. 5 Figure 2: Principal axes of the cubesat. 3.1 Estimation of disturbance torques Disturbance torques have been evaluated by running a single orbit period simulation with the S/C in the desired attitude ( w z = n ) but without feed-backing the disturbance torques back to the S/C dyanmics. Figure 3: Magnitude of the 4 types of disturbance torques during Earth pointing. From the plots in it can be noted that the dominant disturbance torque is the magnetic one, in the order of e-6. Also, as expected, when the S/C is in shadow the SRP goes to zero. The GG disturbance torque happens to be very small. This is due to the S/C being in the stable configuration with respect to GG disturbance. Also, it is known that for an Earth pointing mission the GG should be constant. The small oscillations (in the order of e-10) are to be associated to the small eccentricity of the S/C orbit, i.e. to the small oscillations of the magnitude of the S/C position vector. A simulation with a different initial condition on velocity has also been run (but still without the disturbance torques feedback), and the results in terms of GG are shown in Fig.4. In this case the max GG torque is 2.12e-07 N m , the same that results from: 6 Figure 4: Magnitude of the GG disturbance torque with an arbitrary S/C initial angular velocity. T GGmax = 3 2 n 2 | I max − I min | (20) The maximum disturbance torque that the actuator will have to deal with is thus in the order of 2.5e-3 mN m 3.2 Estimation of control torques 3.2.1 Detumbling A simple expression to compute the torque required for the S/C detumbling is: T detumbling = 1 2 ω 2 r I r θ max (21) Where ω r is the angular velocity at release, I r the moment of inertia of the axis around which the S/C is rotating and θ max the maximum allowed angle of rotation. In the simulation a release angular velocity with three components will be considered, but for a preliminary estimation we can consider ω r = 20 ° /s, I r = I xx and θ max = 360 ° , obtaining a control torque of 0.5 mNm. 3.2.2 Slew maneuver For a slew maneuver the required control torque can be estimated as: T slew = 4 θ man I r t man (22) Where θ man is the required angle of rotation of the S/C, I r is the moment of inertia of the axis around which the S/C must rotate and t man is the required time for the maneuver. θ man would be 90 ° in order to perform a slew maneuver to align the x-axis (which is in the direction of the S/C velocity at release) with the zenith direction. Considering a maneuvering time of 5 minutes (300 s) the required control torque is estimated as 2.5 mNm. 3.3 Estimation of angular momentum requirements Angular momentum requirements must be estimated for a proper selection of momentum exchange devices as torque actuators. The same simulation cited previously has been used to compute the angular momentum requirements over an orbit period in a nominal operating condition (Earth 7 pointing) by integration of the disturbance torques. The results, which are shown graphically in Fig.5, are: h req x h req y h req z 4.8 mNms -1mNms 0.3 mNms Instead, for a detumbling maneuver, considering the same values as for the control torque es- timation, a value of h detumbling = w x I xx = 18 mNms is obtained. Finally, for the slew maneuver, since the angular momentum before and after the maneuver is the same, no angular momentum requirement must be considered (still the momentum exchange devices shall not be saturated during the maneuver, i.e. the maneuver should slow enough). Figure 5: Angular momentum requirements over an orbit period in nominal state (Earth pointing). 3.4 Spacecraft Hardware 3.4.1 Sensors • Sun sensor: this was the assigned sensor type for this study. The SSOC-A60 2-Axis analog sun sensor (Solar MEMS Technologies) with an accuracy of 0.3 ° (3 σ ) was selected for this purpose. Clearly, more than one must be employed, such that at all times at least one sensor has the Sun its field of view. • Star sensor: the ST200 Star tracker (Hyperion technologies) has been selected, with an accu- racy of 30 arc-seconds (3 σ ). • Earth Horizon sensor: the CubeSense N (Cube Space), with an accuracy of 0.2 ° (3 σ ), was selected. • Magnetometer: the NMRM-Bn25o485 magnetometer (New Space System), with an accuracy of 1 ° (3 σ ), has been selected. This was not employed for attitude determination purposes (due to its poor accuracy in comparison to the other sensors), rather to have a magnetic field measurement to tune the magnetorquer control action. • Gyroscope: the STIM210 (Sensonor), characterized by Bias Stability 0.3 ° /h (RRW 3.16e-4 ° / h 3 / 2 ) and ARW 0.15 ° / √ h has been selected. An angular velocity measure is in fact needed in order to properly tune the detumbling and Earth pointing control action. 8 3.4.2 Actuators For this study one inertia wheel and two reaction wheels have been assigned. In order to exploit the dual spin stabilization it was decided to employ the inertia wheel on the z-axis, and the reaction wheels on the two remaining ones. Their choice has been done on the basis of the angular momentum and control torques requirements that have been carried out in sections 3.2 and 3.3. A magnetorquer has also been selected, which is going to be used for the wheels desaturation. • Inertia wheel: the RW-0.03 by Rocket Lab has been selected. It is characterized by a nominal angular momentum of 3 mNms, and a max torque of 2mNm at 20Nms and of 0.5mNm at 40Nms. • Reaction wheel: even if the x and y axis of the spacecraft have different angular momentum and control torque requirements it was chosen to select the same RW for both the axes. This is reasonably what would have been done in a real application. The CubeWheel L by Cube Space has been selected. It is characterized by a maximum angular momentum of 30.61 mNms, and a maximum torque of 2.3mNm. • Magnetorquer: the CubeTorquer by Cube Space, with a saturation dipole moment of 1.5 A m 2 , has been selected. 4 ADCS Simulation 4.1 ADCS architecture A simplified scheme of the ADCS architecture is shown in Fig.6. In order to simplify the scheme some block connections have not been reported (for example, the actuator block needs the magnetometer measure in order to tune the magnetorquer control action). Figure 6: ADCS block scheme. 9 4.2 Sensors modeling The sensors’ measures are modeled by multiplying the real direction (to be measured) in the body frame by an error matrix, which is a function of three error angles. These are modeled as white noises with zero mean value and with a variance that depends on the sensor accuracy. Instead for the gyroscope the two noise types (characterized by the sensor RRW and ARW) are simply added to the real angular velocity (the one computed by integration of the Euler equations). The sample time of all the white noises has been set to 0.1 s, in order to avoid too slow simulations, and low-pass filters have been used to remove the high-frequency components of the signal. For simplicity the star sensor is assumed to always measure the same inertial direction, chosen arbitrarily as [1, 2, -0.5]. Finally, the sampling time of the actual sensors has not been considered (i.e. continuous signal have been used). Once again, this has been done to decrease the required computational time. 4.3 Actuators modeling The IW and RWs have been modeled in the same way; the only difference lies in the initial angular momentum, which is different from zero for the IW and equal to the nominal one. For momentum exchange devices with fixed axis of rotation (in the body frame) the control torque is given by: T RW = − ω ∧ A h r − A ̇ h r (23) where in this case A represents the orientation of the RWs in the body frame (its columns are the directions of the wheels angular velocity in the B frame, so it is the identity matrix in this case). h r is a column vector containing the angular momentum of the RWs. The actuator torque must be equal to the required control torque T c , while the actual control input is the electric motor torque M e = ̇ h r , that can be computed from the previous equation as: ̇ h r = − A ∗ ( T c + ω ∧ A h r ) (24) A ∗ is the pseudoinverse of the A matrix, which is equal to the simple inverse in this case. Note that h r is known (the RWs have internal sensors measuring the spinning rate). Both the saturation on the maximum torque and on the maximum angular momentum have been modeled. For the magnetorquer the actuator torque is given by: T B = D ∧ B (25) where D is the magnetic dipole generated by the actuator coil. In particular D = μnSI (26) where μ is the magnetic permeability, n the number of windings of the coil, S its cross sectional area and I the vector of the current intensity (in the direction of the coil axis according to the right hand rule). The control action D must be computed such to generate the required control torque. In theory it could be obtained as: D = [ − B ∧ ] − 1 T c (27) Unfortunately [ − B ∧ ] is a singular matrix, so it cannot be inverted. A solution can be found requiring only some components of the control torque, and also assuming that the dipole moment is not generated in all the three directions. For the purpose of this study the magnoterquer has been used to model the desaturation of the IW (which, it’s recalled, is placed on the z-axis). So considering D y = 0 and D z = 0 the control action D x is obtained from the control torque T c z as: D x = T c z B y (28) Still, a magnetic torque is produced also on the y-axis and it’s equal to: 10 T mag y = − B z T x (29) So an equal and opposite control torque on the y-axis is requested from the RWs in order to compensate it. 4.4 Attitude determination Three attitude determination algorithms to compute A B/N (indicated simply as A in this section) from the sensor measures have been modeled and simulated. 4.4.1 Algebraic method Calling s i a generic measured direction in the body frame and v i its corresponding inertial direction, the following expression holds: s i = A v i (30) Collecting the measured directions in the matrix S = [ s 1 s 2 . . . s n ] and the inertial directions in the matrix V = [ v 1 v 2 . . . v n ] then the attitude matrix A can be computed as: A = SV T ( V V T ) − 1 (31) In the case of three measures the solution is simpler, since A can be computed as: A = SV − 1 (32) This is the first method that has been implemented, making use of the three measures obtained with the Sun sensor, star tracker and Earth horizon sensor. 4.4.2 Two measures algebraic method In case only two measures are available a modified algebraic method can still be used in order to determine the attitude. Calling the two measured directions in the body frame ˆ p and ˆ q and their corresponding directions in the inertial frame ˆ a and ˆ b , we can construct from them the three vectors s 1 , s 2 , s 3 and the three corresponding vectors v 1 , v 2 , v 3 as follows: s 1 = ˆ p s 2 = ˆ p ∧ ˆ q | ˆ p ∧ ˆ q | s 3 = ˆ p ∧ s 2 (33) v 1 = ˆ a v 2 = ˆ a ∧ ˆ b | ˆ a ∧ ˆ b | v 3 = ˆ a ∧ v 2 (34) Now these vectors can be normalized and used to assemble the matrices S and V , and the attitude can be computed with the three-measures algebraic method: A = SV − 1 (35) Note that the accuracy of this method is strongly dependent on the first association ( s 1 associated with ˆ p ), thus ˆ p should be measured with the greatest possible accuracy (i.e. with the star tracker in this case). This algorithm has been used in the simulation to determine the S/C attitude when the Sun sensor measure is unavailable (the S/C is in the shadowed region). 11 4.4.3 QUEST method The QUEST algorithm is one possible way of solving the Wahba’s problem, which is a statistical method of attitude determination consisting in the minimization of the following weighted error function: J = 1 2 N ∑ i =1 α i | s i − A v i | 2 (36) Where α i are the weights that influence the relative importance of the sensor measures, since we want the more precise sensors to affect more consistently the error function. The weights have been selected as the inverse of the accuracy of the sensors, and then normalized to 1. The QUEST method requires the assembly of the following matrix: K = [ s − σ I z z T σ ] (37) where: • B = ∑ N i =1 α i s i v iT = b ij • S = B T + B • z = [ b 23 - b 32 , b 31 - b 13 , b 12 - b 21 ] T • σ = tr ( B ) From a statistical point of view the optimal attitude (the one that minimizes J) is the eigenvector associated to the maximum eigenvalue of matrix K . This eigenvector is actually a quaternion, which will be then converted to the corresponding DCM. The direct power method has been implemented to find the maximum eigenvalue and corresponding eigenvector. At each time step the attitude quaternion computed at the previous time step has been used as first guess for the direct power method. As an additional note, once the attitude quaternion has been estimated, its time derivative can also be computed, and the S/C angular velocity estimated as: ω = 2 Q ∗ ̇ q (38) Where Q ∗ is the pseudo-inverse of the matrix: Q = q 4 − q 3 q 2 q 3 q 4 − q 1 − q 2 q 1 q 4 − q 1 q 2 − q 3 (39) However, this estimation proved to be inaccurate, so it was decided to implement a gyroscope in order to have a direct measure of the S/C angular velocity. 4.4.4 Methods comparison The accuracy of the three methods has been measured for a full orbit revolution in nominal condition (Earth pointing with active control). The estimation of the attitude determination error has been performed computing the following error matrix: E = A m A T ; (40) where A m is the attitude matrix measured with one of three algorithms, and A = A B/N is the real attitude (obtained from the kinematics block as presented in section 2.2). Then the 1-norm of the E matrix has then been computed, and this value has been selected as the performance parameter for evaluating the accuracy of the algorithms. The results are shown in Fig.7. 12 Figure 7: 1-norm of the error matrix of the three attitude determination algorithms. The 1-norm associated to the error matrix of the three measures algebraic method shows a very high peak (it’s actually much higher than 0.1, but it has been cut in order to improve the plot readability). This is due to the singularity condition that occurs when the Sun direction and the Earth zenith direction happen to be parallel one to each other (in that case the matrix V becomes singular and cannot be inverted, i.e. the algebraic method cannot be used). Note that the x-axis of the two measures algebraic method covers only the simulation time span for which the S/C is shadowed (in the same time span both the three measures algebraic method and the QUEST method show no data, since they are not employed). A statistical analysis of these results has been carried out in terms of mean values μ and standard deviations σ of the 1-norm for the three methods along the time ranges of interest (for the first plot a time span that does not include the singularity condition has been selected). These are shown in Table 2. Algebraic 3 mes. Algebraic 2 mes. QUEST μ 4.452e-3 2.022e-3 2.148e-3 σ 2.245e-3 0.463e-3 0.412e-3 Table 2: Statistical analysis on the attitude detrmination errors. The 3 measures algebraic method is clearly the least accurate, while the 2 measures algebraic method appears to be in the same accuracy range as the QUEST method. This can be associated to the good first measure association (with the Star tracker) and to the fact that the singularity condition is nowhere close. In the end it was decided to use the QUEST method when all the three measures are available, and the two measures algebraic method during the shadow condition. 4.5 Attitude control 4.5.1 Detumbling For the detumbling phase the following simple control law has been implemented: T c = − kω (41) The value of k has been selected equal to 10e-3 Nms by taking into account what is the maximum available torque for the selected actuators, and also analyzing the corresponding control performance. 13 The initial condition for the simulation has been set to [20 -8 5] ° /s. The maximum angular velocity component is ω x since this is assumed to be the release direction. The result of the simulation is shown in Fig.8. Figure 8: S/C angular velocity during the detumbling. Note that the control action starts at t = 20 s, while the previous oscillations in the angular velocity are solely due to the spacecraft dynamics (and the disturbance torques, but those don’t affect too much the S/C dynamics in this short time range). This delay has been imposed in order to have a stable reading from the sensors. The settling time is about 100 s. A statistical analysis has been carried out on the components of the angular velocity after the settling time. The results, in terms of mean values μ and standard deviations σ , are shown in Table 3. ω x [rad/s] ω y [rad/s] ω z [rad/s] μ -5.379e-6 4.193e-6 -0.109e-3 σ 0.205e-9 0.114e-9 0.149e-9 Table 3: Statistical analysis on the S/C angular velocity With these values the S/C can be considered detumbled effectively, proving the correct choice of control gain and the effectiveness of the control law. The torque provided by the RWs and IW is shown in Fig.9. Note that the IW and a RW exert their maximum torque at certain instants. 4.5.2 Slew maneuver and Earth-pointing It was chosen to use a nonlinear control method for the tracking control. The following Lyapunov function can be used: V = 1 2 ω eT J ω e + k 2 tr ( I − A e ) (42) where: • J is the S/C inertia matrix. • A e the attitude error, measured as AA T d , where A d is the desired attitude, which in this case corresponds to A B/L = I (S/C axes aligned with LHLV frame). 14 Figure 9: Torques provided by the RWs and IW during the detumbling. • ω e is the angular velocity error, measured as ω e = ω - A e ω d ( ω d is the desired angular velocity, equal to [0, 0, n] in this case). The resulting control torque is computed as: T c = − k 1 ω e − k 2 ( A e T − A e ) V + ω ∧ J ω − ω e ∧ A e ω d (43) The ( · ) V symbol indicates the inverse-hat operator, which maps a skew symmetric matrix to its corresponding vector. The control gains have been selected as k 1 = 31.5 mNms and k 2 = 3 mNms, mostly by a trial and error procedure and after taking into account the maximum torque that can be produced by the actuators. As stated previously, the slew maneuver is intended to rotate the S/C from its release condition (x-axis aligned with the velocity vector, z-axis normal to the orbital plane) to the Earth pointing state. Thus the initial attitude in the LHLV frame is: A B/L 0 = 0 1 0 − 1 0 0 0 0 1 (44) Also, an initial angular velocity of 1e-3[1, 1, 1] rad/s has been considered. The results of the simulation for the slew maneuver are shown in Fig.10 and 11. Figure 10: S/C angular velocity during the slew-maneuver. Again, the control action starts at t = 20 s. A large oscillation in the ω z component can be noted. This is due to the slew maneuver rotation taking place right around this axis. The settling 15 Figure 11: S/C angular velocity during the slew-maneuver after the settling time. time is approximately 150 s. Fig. 12 shows the torques provided by the RWs and IW during the slew maneuver. Note the IW torque reaches the maximum for a large part of the slew maneuver. Figure 12: Torques provided by the RWs and (mainly) by the IW during the slew maneuver. For the Earth pointing phase the initial attitude in the LHLV frame is the identity matrix (desired attitude), and the initial angular velocity is again selected as 1e-3[1, 1, 1] rad/s. This simulation is run for a full orbit period, 5553 s. Fig.13 show the S/C angular velocity. An in initial peak can be noted, due to the control action correcting the initial angular velocity, which is different from the desired one. A statistical analysis on these results has been carried out, obtaining the mean values μ and standard deviations σ shown in Table 4. ω x [rad/s] ω y [rad/s] ω z [rad/s] μ 1.069e-5 -2.785e-6 1.135e-3 σ 2.178e-4 1.111e-4 1.222e-4 Table 4: Statistical analysis on the S/C angular velocity The mean value of the angular velocity on the x and y axis is very small, such to be considered null. Instead the mean value of the angular velocity on the z axis is very close to the desired one ( n = √ μ 6778 3 = 1.131e-3 rad/s). Taking into account the standard deviation, the w z component will differ from the desired one at most of ± 0.371e-3 rad/s in a confidence interval of 99.7% (3 σ ). In order to evaluate more in detail the achieved pointing accuracy, the angles θ x , θ y and θ z between the body axes and their desired orientations have been computed. The results are shown 16 Figure 13: S/C angular velocity during Earth pointing for a full orbit period. in Fig.14. The first 50 s of the simulation have been discarded in order to consider only the steady state operation. A statistical analysis of these three performance parameters has also been carried out, and the results are shown in Table 5. θ x [deg] θ y [deg] θ z [deg] μ 5.017e-2 5.024e-2 3.367e-2 σ 2.932e-2 2.905e-2 1.842e-2 Table 5: Statistical analysis on the pointing accuracy Since the maximum pointing error for the x axis is 0.2 ° , the required nadir pointing accuracy of the imaging camera ( ± 1 ° ) has been largely fulfilled. Figure 14: S/C pointing accuracy during a full orbit period. The RWs and IW stored angular momentum during a full orbit period with active Earth pointing control is shown in Fig.15. The two peaks in the h y plot correspond to the two peaks in the magnetic disturbance torque: in these instants more angular momentum needs to be stored in order to counteract the external disturbance. As a comparison, the S/C angular velocity has also been computed for an orbit period in the uncontrolled case, with null initial conditions and S/C initially aligned with the LHLV frame. The results are shown in Fig.16 and 17. It is evident that the pointing requirements are completely unfulfilled in the uncontrolled case (for all the three axes the pointing error reaches more than 100 ° ). This in turns proves the effectiveness of the control action. 17 Figure 15: Angular momentum stored in the RWs and IW during a full orbit period with Earth pointing active control. Figure 16: S/C angular velocity during a full orbit period in the uncontrolled case. As a final remark, the full orbit period simulation of the Earth pointing active control has required (only) 10 minutes, mainly thanks to the small sampling time selected for the sensors white noises. 18 Figure 17: S/C angular pointing accuracy during a full orbit period in the uncontrolled case. 4.6 Inertia wheel desaturation The inertia wheel has a certain nominal angular momentum. When the angular momentum is too distant from this nominal condition a torque is applied to the IW (by its own electric motor) in order to recover the nominal state. The change in the IW angular momentum will produce a torque on the S/C. This is estimated and an equal and opposite torque is exerted with the magnetorquer in order to counteract it. An example of IW desaturation is shown in Fig.18; the IW has an initial angular momentum of 5mNms, and it’s decreased back near the nominal condition of 3 mNms. The corresponding counteracting magnetorquer torque is shown in Fig.19. Figure 18: IW stored angular momentum during the desaturation process. 19