Get 20M+ Full-Text Papers For Less Than $1.50/day. Start a 14-Day Trial for You or Your Team.

Learn More →

Implementation and Hardware-In-The-Loop Simulation of a Magnetic Detumbling and Pointing Control Based on Three-Axis Magnetometer Data

Implementation and Hardware-In-The-Loop Simulation of a Magnetic Detumbling and Pointing Control... aerospace Article Implementation and Hardware-In-The-Loop Simulation of a Magnetic Detumbling and Pointing Control Based on Three-Axis Magnetometer Data y ,y y y M. Salim Farissi , Stefano Carletta * , Augusto Nascetti and Paolo Teofilatto School of Aerospace Engineering, Sapienza University of Rome, 00138 Rome, Italy; salim.farys@gmail.com (M.S.F.); augusto.nascetti@uniroma1.it (A.N.); paolo.teofilatto@uniroma1.it (P.T.) * Correspondence: stefano.carletta@uniroma1.it y These authors contributed equally to this work. Received: 31 October 2019; Accepted: 6 December 2019; Published: 11 December 2019 Abstract: The subject of this work is the implementation and experimental testing of a purely magnetic attitude control strategy, which can provide stabilization after the deployment and pointing of the spacecraft without any attitude information. In particular, the control produces the detumbling of the satellite and leads it to a desired attitude with respect to the direction of the Earth magnetic field, based on the only information provided by a three-axis magnetometer. The system is meant to be used as a backup solution, in case of failure of the primary strategy and is designed considering the constraints set on time of operations, power consumption, and peak electric current for a typical CubeSat mission. The detumbling and pointing algorithms are implemented on the FPGA core of a CubeSat on-board computer and tested by Hardware-in-the-loop simulations. The simulation setup includes a Helmholtz cage, recreating the magnetic environment along the orbit, the on-board computer, a MEMS three-axis magnetometer and Simulink software, on which the attitude dynamics is propagated. Test on the real system can provide useful information to select the parameters of the control, such as the gains, to estimate the limits of the system, the time of operations and prevent failures. Keywords: magnetic ADCS; hardware-in-the-loop; CubeSat; Helmholtz cage; B-dot; B-pointing 1. Introduction The Attitude Determination and Control System (ADCS) plays a vital role in spacecraft mission operations. It provides information regarding the spacecraft orientation (or attitude) in space and produces the control action necessary to modify its attitude, according to some input or prescribed control laws. The successful development of an ADCS starts from concept design and should include numerical and experimental validation of the algorithms and hardware, to confirm its performance and robustness in di erent operative scenarios. During the last decades, the introduction of the CubeSat standard gathered the attention of universities and small companies, because of the possibility to develop satellites and space missions with a limited budget [1,2]. The ADCS implemented under such a budget constraint are typically based on low-cost Components O -The-Shelf (COTS), thus sensors and devices which are not tailored for space applications and novel system architecture. For this reason, experimental testing should represent an essential part of the development process. It is known from statistical analysis that the majority of CubeSat mission end in failure right after the deployment. According to [3] the impact of ADCS failure on the number of “dead on arrival” CubeSats seems to be marginal, but a system-oriented interpretation of the results provides a clearer Aerospace 2019, 6, 133; doi:10.3390/aerospace6120133 www.mdpi.com/journal/aerospace Aerospace 2019, 6, 133 2 of 17 view on the issue. In fact, if ADCS failures may not a ect the functionality of the other on-board systems, they do not allow those systems to operate in the design conditions, jeopardizing the mission, eventually causing its failure. In the recent past, some strategies for low-cost Software-in-the-loop (SiL) or even Hardware-in-the-loop (HiL) testing of ADCS have been proposed. In SiL testing, the space environment, the satellite attitude dynamics, and the ADCS devices are all simulated, therefore the accuracy of the result depends on that of the model used for each one of the mentioned elements of the loop [4–6]. SiL simulations can be successfully applied to verify the ADCS system architecture and algorithms and are less complex than HiL simulations, in which the real attitude sensors and actuators are used, allowing a more accurate estimation of the ADCS performance. To adequately test the mentioned ADCS devices, some crucial features of the space environment must be recreated on-ground by the HiL setup. Some HiL setup include a Helmholtz cage [7–9], a device capable of reproducing the geomagnetic field vector on the satellite during its orbital motion, allowing the use of real magnetometers in the simulation loop. Spherical air-bearing testbeds are used to recreate the microgravity conditions [10–12], necessary to simulate the spacecraft attitude dynamics under the control of attitude actuators [13–18]. In this work, we propose the design of a purely magnetic ADCS, allowing CubeSat detumbling and pointing based on the only measurement data from a MEMS three-axis magnetometer. The system is developed considering constraints on time of operations, power consumption, and peak electric current set by common CubeSat on-board systems. The ADCS algorithms are designed to be implemented on the FPGA core of the CubeSat On-Board-Computer (OBC) ABACUS, designed by the School of Aerospace Engineering (SIA) and successfully flight proven [19]. The algorithms and part of the ADCS hardware (OBC and magnetometer) are tested by HiL simulations, using the Helmholtz cage available at SIA Flight Mechanics Laboratory “Michele D. Sirinian”. The configuration of the facility and calibration of the magnetometer are also part of this work and will be discussed in detail. The manuscript is organized as follows, the background on spacecraft attitude dynamics and magnetic control is provided in Section 2. In Section 3 the configuration and calibration of the test hardware is presented, indicating the solutions selected and the performance of the experimental setup. The results for some selected test cases are presented and commented in Section 4, producing a preliminary characterization of the ADCS. Final comments are reported in the Conclusions section. 2. Spacecraft Attitude Dynamics and Magnetic Attitude Control 2.1. Attitude Dynamics Attitude dynamics is modelled considering the spacecraft as a rigid body which is free to rotate about its center of mass. The principal moments of inertia are used to define the body frame F = [xˆ , yˆ , zˆ ] which rotates rigidly with the spacecraft. An inertial reference frameF = [xˆ , yˆ , zˆ ] is b b b b i i i i identified as well, here selected as the GeoCentric Inertial frame (GCI) [20], so that the Euler angles (',, ) transforming F into F can be used to describe the spacecraft attitude. Furthermore, the b i angular velocity at whichF rotates with respect toF represents the angular velocity of the spacecraft b i ! = [ ! ! ! ] . The two reference frames are sketched in Figure 1. x y z Based on this representation, the dynamic equations of attitude motion are represented by the following system [20]: Aerospace 2019, 6, 133 3 of 17 8 . > ' = ! + sin' tan! + cos' tan! x y z = cos'! sin'! y z sin'! cos' ! ( y z) cos . J J > y z (1) ! = ! ! +  + > x y z c,x d,x > J J J z x ! = ! ! +  + y x z c,y d,y > J . J J > x y : ! = ! ! +  + z x y c,z d,z where  and  are, respectively, the components of the control and disturbance torques acting on c,i d,i the satellite, described in detail in the following subsections. Aerospace 2019, 6, x FOR PEER REVIEW 3 of 17 Figure 1. Sketches of the GeoCentric Inertial frame (GCI) and body-fixed reference frames. Figure 1. Sketches of the GeoCentric Inertial frame (GCI) and body-fixed reference frames. 2.2. Magnetic Attitude Control Based on this representation, the dynamic equations of attitude motion are represented by the following system [20]: In the ADCS developed here, the control torque is produced by the interaction between the geomagnetic field surrounding the spacecraft (B ), measured by the three-axis magnetometer, and the 𝜑 =𝜔 +sin 𝜑 tan 𝜃 𝜔 + cos 𝜑 tan 𝜃 𝜔 magnetic dipole moment m = [ m m m ] generated by the magnetic coils (or magnetorquers) x y z 𝜃 = cos 𝜑 𝜔 −sin 𝜑 𝜔 installed on-board, representing the attitude control devices. The torque can be expressed by the ⎨ sin 𝜑 𝜔 − cos 𝜑 𝜔 following equation 𝜓 = cos 𝜃 = m B (2) c b 𝐽 −𝐽 ⎧ 𝜔 = 𝜔 𝜔 +𝜏 +𝜏 (1) , , In particular, the system consists of three mutually orthogonal magnetorquers, each one generating 𝐽 −𝐽 a magnetic dipole moment m along one of the dir ections ofF (see Figure 2) 𝜔 = 𝜔 𝜔 +𝜏 +𝜏 , , m = N A I i = x, y, z (3) i 𝐽 − i 𝐽 i i 𝜔 = 𝜔 𝜔 +𝜏 +𝜏 , , ⎩ 𝐽 where N and A are, respectively, the number of turns and the mean area of the coil along orthogonal i i where τc,i and τd,i are, respectively, the components of the control and disturbance torques acting on to the i-th body-frame direction, and I is the electric current in the wire of the coil. the satellite, described in detail in the following subsections. 2.2. Magnetic Attitude Control In the ADCS developed here, the control torque is produced by the interaction between the geomagnetic field surrounding the spacecraft (Bb), measured by the three-axis magnetometer, and 𝑚 𝑚 𝑚 the magnetic dipole moment 𝒎= [ ] generated by the magnetic coils (or magnetorquers) installed on-board, representing the attitude control devices. The torque can be expressed by the following equation 𝝉 =𝒎 × 𝑩 (2) 𝒄 𝒃 In particular, the system consists of three mutually orthogonal magnetorquers, each one generating a magnetic dipole moment mi along one of the directions of ℱ (see Figure 2) 𝑚 =𝑁 𝐴 𝐼 𝑖 = 𝑥, 𝑦, 𝑧 (3) where Ni and Ai are, respectively, the number of turns and the mean area of the coil along orthogonal to the i-th body-frame direction, and Ii is the electric current in the wire of the coil. Aerospace 2019, 6, 133 4 of 17 Aerospace 2019, 6, x FOR PEER REVIEW 4 of 17 Figure 2. Sketch of the magnetometer and magnetorquers position in the body-fixed reference frame. Figure 2. Sketch of the magnetometer and magnetorquers position in the body-fixed reference frame. The magnetorquers are controlled by regulating the intensity of I, which can be determined based The magnetorquers are controlled by regulating the intensity of I, which can be determined on that of the magnetic dipole moment necessary to produce the desired attitude motion. Two control based on that of the magnetic dipole moment necessary to produce the desired attitude motion. Two laws were implemented, one producing the spacecraft detumbling, or stabilization after deployment, control laws were implemented, one producing the spacecraft detumbling, or stabilization after and one setting the spacecraft attitude to some prescribed angle with respect the geomagnetic field deployment, and one setting the spacecraft attitude to some prescribed angle with respect the vector, hereafter referred to as B-pointing. geomagnetic field vector, hereafter referred to as B-pointing. Detumbling control has long been studied and is simply described by the following equation for Detumbling control has long been studied and is simply described by the following equation for the magnetic dipole moment [21]: the magnetic dipole moment [21]: m = K B (4) d d b (4) 𝒎 =−𝐾 𝑩 where K is the control gain and B is the time derivative of the geomagnetic field measured by the d b 𝒅 𝒃 on-board magnetometer. Indicating with f the sampling frequency of the ADCS and with k the sample, where Kd is the control gain and 𝑩 is the time derivative of the geomagnetic field measured by the the value of the derivative can be calculated as follows: on-board magnetometer. Indicating with fk the sampling frequency of the ADCS and with k the sample, the value of the derivative can be calculated as follows: (k) (k1) B = f B B (5) b k b b (𝒌) (𝒌𝟏) 𝑩 = 𝑓 −𝑩 (5) 𝒃 𝒃 B-pointing control represents an adaptation of the nadir-pointing control already implemented on TigriSat, B-p ao3U inting CubeSat control launched represen by ts the an ad SIA apin tation 2014 of [22 the nadir-po ]: inting control already implemented on TigriSat, a 3U CubeSat launched by the SIA in 2014 [22]: m = K B  rˆ B (6) p p b b 𝒎 =𝐾 𝑩 × 𝑟 ̂ ×𝐵 (6) 𝒑 𝒃 where K is the control gain, rˆ is the unit vector representing the target attitude of the spacecraft and B p b where Kp is the control gain, 𝑟 ̂ is the unit vector representing the target attitude of the spacecraft and is the direction of B . For a general case, rˆ should be provided by the attitude determination segment of 𝐵 is the direction of Bb. For a general case, 𝑟 ̂ should be provided by the attitude determination the ADCS, which is not examined here. In fact, the aim of the proposed solution is that of representing segment of the ADCS, which is not examined here. In fact, the aim of the proposed solution is that of an e ective and reliable alternative to be activated when attitude determination is not available. In representing an effective and reliable alternative to be activated when attitude determination is not such a scenario, rˆ will be set equal to a prescribed direction inF . The following two cases are examined available. In such a scenario, 𝑟 ̂ will be set equal to a prescribed direction in ℱ . The following two in Section 4: cases are examined in Section 4: (a) rˆ = [1 0 0], producing xˆ in the direction of B ; b b (a) 𝑟 ̂ = [1 0 0], producing 𝑥 in the direction of Bb; p p (b) rˆ = [0.5 2 0.5 2 0], setting yˆ and zˆ to an angle of 45 deg with respect to B . (b) 𝑟 ̂ =[0.5√2 0.5√2 0], setting 𝑦 and 𝑧 ̂ to an angle of 45 deg with respect to Bb. b b b Since a three-axis magnetometer can only resolve two out of three attitude angles, the B-pointing Since a three-axis magnetometer can only resolve two out of three attitude angles, the B-pointing algorithm can control the spacecraft attitude along one (a) or two (b) directions at most. Considering algorithm can control the spacecraft attitude along one (a) or two (b) directions at most. Considering for instance the case (b), the only attitude information available on third axis (𝑥 ) is that it will always for instance the case (b), the only attitude information available on third axis (xˆ ) is that it will always lay on a plane orthogonal to Bb. This result can be easily extended to case (a). It is worth to highlight lay on a plane orthogonal to B . This result can be easily extended to case (a). It is worth to highlight that similar configurations produce a predictable attitude motion of the satellite which, in case of 𝑩 Aerospace 2019, 6, 133 5 of 17 that similar configurations produce a predictable attitude motion of the satellite which, in case of failure of the primary attitude determination devices, improving the survivability of the mission and allowing to implement magnetometer-only attitude estimation strategies [23–31]. Equations (4) and (6) represent the control laws of the ADCS, producing the total magnetic dipole moment given below: m = m + m (7) Based on Equations (4), (6), and (7), the value of the electric current in the magnetorquers can be 3 2 determined once fixed the parameters N = 400 and A = 9.03  10 m for all the coils, which have max been selected in order to limit the power usage to P = 250 mW at a supply voltage of V = 3 V. drive max It follows that the limit value for the current is I = 83 mA, therefore the maximum value for the dipole moment which can be generated by each magnetorquer can be calculated from Equation (3) and max 2 is equal to m = 0.3 Am . 2.3. Disturbance Torques During the orbital motion of the satellite, a variety of external torque, beside the control one, act on it, producing a perturbation on the controlled attitude motion. The most relevant ones have been considered, caused by residual dipole moment ( ), gravity gradient  , and atmospheric drag ( ). m g a The total disturbance torque is calculated as follows =  +  +  (8) m g a 2.3.1. Residual Dipole Moment Torque The presence of magnetic materials or the electric currents in on-board electric devices can produce a residual magnetic dipole moment m on the satellite [32,33]. The interaction of m with the m m geomagnetic field B produces a torque on the satellite, which can be evaluated by Equation (2) = m  B (9) m m b The magnitude and direction of m depend on the final configuration of the satellite, therefore they cannot be determined a-priori and a guessed value should be considered as long as the final configuration of the satellite is not defined, to verify the e ectiveness of the control algorithms also in presence of such a perturbation. For the HiL simulations performed in Section 4, the magnitude jm j = 0.1 Am is selected, which is one order of magnitude higher than the values measured for similar CubeSat configurations [33,34], definitely representing a worst-case scenario. 2.3.2. Gravity Gradient Torque Satellite with an unsymmetrical mass distribution are subject to gravitational torque, produced by the Earth’s gravitational field. The torque can be modelled as follows [20]: = 3 rˆ [ J]rˆ (10) jrj 14 3 2 where r is the position vector of the satellite in GCI coordinates,  = 3.986 10 m /s is the gravitational parameter of the Earth, [J] is the tensor of inertia of the satellite and rˆ = r/jrj. The value ofjrj can be calculated from the polar equation for a Keplerian orbit: a 1 e jrj = (11) 1 + e cos# Aerospace 2019, 6, 133 6 of 17 where a and e indicate the semimajor axis and the eccentricity of the orbit and # is the true anomaly. The components of r in the GCI frame can be calculated applying the following rotation matrix, transforming a vector in the orbital plane to the GCI one [20]: 2 3 6 cosW cos(! + #) sinW cos i sin(! + #) cosW sin(! + #) sinW cos i cos(! + #) sinW sin i 7 6 7 6 7 6 7 6 7 [R ] = sinW cos(! + #) + cosW cos i sin(! + #) cosW cos i cos(! + #) sinW sin(! + #) cosW sin i (12) 6 7 o,i 6 7 6 7 4 5 sin i sin(! + #) cos(! + #) sin i cos i where W is the RAAN, ! is the argument of perigee and i is the inclination of the orbital plane. Based on matrix (12), r is defined by the transformation below: 2 3 6 jrj 7 6 7 6 7 6 7 6 7 r = [R ]6 0 7 (13) o,i 6 7 6 7 4 5 2.3.3. Aerodynamic Torque Aerodynamic torque arises from the aerodynamic drag produced by the interaction of the satellite surfaces with the residual atmosphere at high altitude, which is represented by the following equation [35]: D = SC V V (14) where  is the density of air, which can be modelled according to NRLMSISE-00 empirical model [36], S is the normal projection of the satellite area to the incident flow, C is the drag coecient of the satellite [37], and V is its orbital speed which can be determined as follows: 2 1 V =  (15) jrj a To calculate the aerodynamic torque, the unit vector V must be expressed inF , by applying the following coordinate transformation [20]: 2 3 6 0 7 6 7 6 7 6 7 ˆ 6 7 V = [R ][R ] (16) 6 1 7 o,i i,b 6 7 6 7 4 5 where the rotation matrix [R ] transformsF toF and is given below: i,b i b 2 3 6 cos cos cos sin + cos sin sin sin sin psi cos cos sin 7 6 7 6 7 6 7 6 7 [R ] = 6 cos sin cos cos sin sin sin cos sin + cos sin sin 7 (17) o,i 6 7 6 7 4 5 sin cos sin coscos The expression for the aerodynamic torque inF is reported below [35]: = l D (18) where l is the arm of the torque, corresponding to the distance between the satellite center of mass and the aerodynamic center, which is the point where the aerodynamic force is applied. Estimating the aerodynamic center of the satellite requires dedicated analyses which are beyond the aim of this work [35], therefore for the HiL simulation a worst case was considered, setting l equal to the half-length of each side of the satellite. Aerospace 2019, 6, 133 7 of 17 3. Configuration of the Hardware-In-The-Loop Simulation Hardware Aerospace 2019, 6, x FOR PEER REVIEW 7 of 17 A primary goal of this work is to verify the performance of the ADCS in producing the control laws proposed in Section 2. To achieve this result, the experimental setup for HiL simulations is configured. where 𝜇 is the permeability of free space, N = 54 and l = 1.24 m are, respectively, the number of turns and the half length of the side of the coils, β = 0.5445 is the ratio of the distance between the two coils 3.1. Helmholtz Cage Configuration −4 and I is the electric current in the coils. The facility was designed to operate in the range ±2 × 10 T along e A 3 ach d  3 i rection. 3 m Helmholtz cage is used to reproduce the geomagnetic field vector in F at any In addition to the Helmholtz cage, the system includes: orbital position of the spacecraft. The complete cage system is shown in Figures 3 and 4. The magnetic field generated by the Helmholtz cage is uniform in a volume of 30  30  30 cm at the center of • 3 power supplies, each one feeding one pair of coils, allowing the generation of a magnetic field the cage. Each pair of coils produces a constant magnetic field orthogonal to their surface, whose vector with desired intensity and direction; magnitude can be estimated by the following approximated relation: • a control computer, on which the orbital motion of the satellite is simulated, based on the input orbital parameters, and the corresponding value of Bi for each position of the satellite is 2 NI 0 i B = p i = x, y, z (19) calculated in real-time, usi ing the International Geomagnetic Reference Field (IGRF) model [38]; 2 2 (1 + ) 2 + • a calibrated three-axis magnetometer, measuring the magnetic field in the central and constant region of the Helmholtz cage. where  is the permeability of free space, N = 54 and l = 1.24 m are, respectively, the number of turns and the half length of the side of the coils, = 0.5445 is the ratio of the distance between the two coils All the mentioned elements form a closed-loop system which operates according to a control and I is the electric current in the coils. The facility was designed to operate in the range2 10 T code implemented in Matlab. A Proportional Integral Derivative (PID) controller allows generating along each direction. −7 a magnetic field with an error in the range ±1 × 10 T. Figure 3. Helmholtz cage at SIA flight mechanics laboratory. Figure 3. Helmholtz cage at SIA flight mechanics laboratory. Aerospace 2019, 6, 133 8 of 17 Aerospace 2019, 6, x FOR PEER REVIEW 8 of 17 magnetometer power supplies control computer Figure 4. Control system for the Helmholtz cage at SIA flight mechanics laboratory. Figure 4. Control system for the Helmholtz cage at SIA flight mechanics laboratory. In addition to the Helmholtz cage, the system includes: The list of the operations necessary to simulate the changing magnetic field during the orbital motion of the satellite is discussed hereafter. As a preliminary step, the desired orbital parameters 3 power supplies, each one feeding one pair of coils, allowing the generation of a magnetic field are introduced in the control code, written in Matlab, along with the total time and the time step for vector with desired intensity and direction; the simulation. In particular, the time step can be selected in the frequency range 1–10 Hz, therefore a control computer, on which the orbital motion of the satellite is simulated, based on the input allowing accelerated simulations up to a factor 10. It is worth noting that, to allow accelerated orbital parameters, and the corresponding value of B for each position of the satellite is calculated simulations, the sampling frequency of the ADCS must be compatible with that of the Helmholtz in real-time, using the International Geomagnetic Reference Field (IGRF) model [38]; cage, as discussed in detail in Section 3.2. Corresponding to each time step, the following cycle is a calibrated three-axis magnetometer, measuring the magnetic field in the central and constant repeated: region of the Helmholtz cage. 1. the orbital propagator updates the true anomaly and calculates the position r of the satellite in All the mentioned elements form a closed-loop system which operates according to a control ℱ , according to Equations (11)–(13); code implemented in Matlab. A Proportional Integral Derivative (PID) controller allows generating a 2. using a Matlab routine, the longitude (Lo), latitude (La), and altitude (h) of the satellite at any r magnetic field with an error in the range1 10 T. are calculated and the geomagnetic field Bi is computed from the IGRF model: The list of the operations necessary to simulate the changing magnetic field during the orbital motion of the satellite is discussed hereafter. As a pr 1eliminary 𝜕𝑉 step, the desired orbital parameters ⎧𝐵 = are introduced in the control code, written in Matlab, along with the total time and the time step for |𝒓 | 𝜕𝐿 the simulation. In particular, the time step can be selected in the frequency range 1–10 Hz, therefore 1 𝜕𝑉 allowing accelerated simulations up to a factor 10. It is worth noting that, to allow accelerated 𝐵 = (20) |𝒓 | 𝜕𝐿 simulations, the sampling frequency of the ADCS must be compatible with that of the Helmholtz cage, ⎪ 1 𝜕𝑉 as discussed in detail in Section 3.2. Corresponding to each time step, the following cycle is repeated: 𝐵 = ⎩ |𝒓 | 𝜕𝐿 1. the orbital propagator updates the true anomaly and calculates the position r of the satellite inF , where VB is the geomagnetic field scalar potential, reported below, whose parameters are according to Equations (11)–(13); defined in [38]: 2. using a Matlab routine, the longitude (L ), latitude (L ), and altitude (h) of the satellite at any r are o a calculated and the geomagnetic field B is computed from the IGRF model: 𝑉 =𝑅 [𝑔 (𝑡 ) cos(𝑚𝐿 ) +ℎ (𝑡 ) sin(𝑚𝐿 )]𝑃 cos 𝐿 (21) |𝒓 | @V > B B = > i,x jrj @L > a @V B = (20) 3. the value of the current to be provided to each p i,x air of coils of the Helmholtz cage is calculated jrj @L @V > 1 B based on Equation (19); B = i,x jrj @L 4. the power supplies are activated from Matlab script, changing the magnetic field inside the cage, which is measured by the facility magnetometer Bm; Aerospace 2019, 6, 133 9 of 17 where V is the geomagnetic field scalar potential, reported below, whose parameters are defined in [38]: N n X X n+1 m m m V = R [ g (t) cos(mL ) + h (t) sin(mL )]P cos L (21) B E o o a n n n jrj n=1 m=0 3. the value of the current to be provided to each pair of coils of the Helmholtz cage is calculated based on Equation (19); 4. the power supplies are activated from Matlab script, changing the magnetic field inside the cage, which is measured by the facility magnetometer B ; 5. the reading from the magnetometer is sent to the control computer and the error between the desired and the measured value of the magnetic field is calculated,  = B B ; 6. based on , a PID controller implemented in the code estimates the currents I to compensate c_i the error; 7. the loop repeats until the end of the simulation. 3.2. On-Board Magnetometer Configuration and Calibration The ABACUS OBC is equipped with a Honeywell HMR2300 three-axis magnetometer, operating 4 7 in the range1 10 T, with 12-bit measurement accuracy down to 1 10 T and sampling frequency selectable between 10 and 154 Hz [19]. The three-axis magnetometer is a MEMS sensor, and can be therefore a ected by some structural defects, related to the production technology, introducing non-isotropic measurement errors. The goal of the calibration process is to characterize the magnetic sensors, so the satellite can process accurate values for the magnetic field strength and direction, under di erent modes of operation. Calibration is achieved by subjecting the three-axis magnetometer to a known magnetic field B , ref generated by means of the Helmholtz cage, calculating the measurement error and compensating it by least square fitting method. The calibration starts calculating the o set B between the reference magnetic field B and the ref value read by the magnetometer B . Several measurements are repeated rotating the magnetometer about its center of mass. The o set values are stored and processed by ellipsoid fitting and linear least-squares method, which convert them into an ellipsoid representing the distribution in space of the o set. The semi-axes of the ellipsoid, indicated as R , R , and R , can then be collected in the matrix x y z [T], defined as follows: 2 3 6 R 0 0 7 6 7 6 7 6 7 6 7 [T] = 6 0 R 0 7 6 7 6 7 4 5 0 0 R After determining the 3 1 eigenvector v of [T], the compensated value B can be calculated as follows: B = v[T]B v B (22) c ref o At the end of the calibration, the semi-axes calculated by the ellipsoid fitting method should be equal one the other. An example is reported in Figure 5, showing the comparison between the measurements before (red) and after (blue) the calibration of the OBC magnetometer. Aerospace 2019, 6, x FOR PEER REVIEW 9 of 17 5. the reading from the magnetometer is sent to the control computer and the error between the desired and the measured value of the magnetic field is calculated, 𝝐=𝑩 −𝑩 ; 𝒎 𝒊 6. based on 𝝐, a PID controller implemented in the code estimates the currents Ic_i to compensate the error; 7. the loop repeats until the end of the simulation. 3.2. On-Board Magnetometer Configuration and Calibration The ABACUS OBC is equipped with a Honeywell HMR2300 three-axis magnetometer, −4 −7 operating in the range ±1 × 10 T, with 12-bit measurement accuracy down to 1 × 10 T and sampling frequency selectable between 10 and 154 Hz [19]. The three-axis magnetometer is a MEMS sensor, and can be therefore affected by some structural defects, related to the production technology, introducing non-isotropic measurement errors. The goal of the calibration process is to characterize the magnetic sensors, so the satellite can process accurate values for the magnetic field strength and direction, under different modes of operation. Calibration is achieved by subjecting the three-axis magnetometer to a known magnetic field Bref, generated by means of the Helmholtz cage, calculating the measurement error and compensating it by least square fitting method. The calibration starts calculating the offset Bo between the reference magnetic field Bref and the value read by the magnetometer Bm. Several measurements are repeated rotating the magnetometer about its center of mass. The offset values are stored and processed by ellipsoid fitting and linear least-squares method, which convert them into an ellipsoid representing the distribution in space of the offset. The semi-axes of the ellipsoid, indicated as Rx, Ry, and Rz, can then be collected in the matrix [T], defined as follows: 𝑅 00 [ ] 0𝑅 0 𝑇 = 00 𝑅 After determining the 3 × 1 eigenvector v of [T], the compensated value 𝑩 can be calculated as follows: (22) 𝑩 =𝒗 [𝑇 ]𝐁 𝒗 𝐁 𝒄 𝐟𝐫𝐞 𝐨 At the end of the calibration, the semi-axes calculated by the ellipsoid fitting method should be equal one the other. An example is reported in Figure 5, showing the comparison between the Aerospace 2019, 6, 133 10 of 17 measurements before (red) and after (blue) the calibration of the OBC magnetometer. Figure 5. Comparison between measurement by the magnetometer before (red) and after (blue) the Figure 5. Comparison between measurement by the magnetometer before (red) and after (blue) calibration. the calibration. 3.3. Hardware-In-The-Loop Platform Configuration 3.3. Hardware-In-The-Loop Platform Configuration Aerospace The2019 HiL , 6platform , x FOR PEER is RE configur VIEW ed as follows and represented in the block diagram in Figure10 of 6: 17 The HiL platform is configured as follows and represented in the block diagram in Figure 6: Helmholtz cage system, generating B based on the estimates of the orbital propagator running on • Helmholtz cage system, generating Bi based on the estimates of the orbital propagator running the facility control computer; on the facility control computer; on-board three-axis magnetometer (integrated to the OBC), measuring the magnetic field generated • on-board three-axis magnetometer (integrated to the OBC), measuring the magnetic field by the Helmholtz cage; generated by the Helmholtz cage; OBC, on which the control algorithms are implemented, producing the driving current to the • OBC, on which the control algorithms are implemented, producing the driving current to the magnetorquer and the magnetic control torque; magnetorquer and the magnetic control torque; control computer, propagating the orbital motion to calculate B , calculating the disturbance • control computer, propagating the orbital motion to calculate Bi, calculating the disturbance torques, and integrating the attitude dynamics equations to determine the Euler angles and torques, and integrating the attitude dynamics equations to determine the Euler angles and angular rates. angular rates. Figure 6. Block diagram of the Hardware-in-the-loop (HiL) setup. Figure 6. Block diagram of the Hardware-in-the-loop (HiL) setup. Attitude dynamics is simulated using Simulink fixed step ode8 integrator. The integration time Attitude dynamics is simulated using Simulink fixed step ode8 integrator. The integration time for the software is synchronized with that of the HiL simulations, which was selected to be 10 times for the software is synchronized with that of the HiL simulations, which was selected to be 10 times faster than real time. This corresponds to an operating frequency of 10 Hz for the Helmholtz cage, therefore, to avoid loss of information, the sampling frequency of the OBC magnetometer is set to 100 Hz. It is worth noting that, since the attitude motion of the spacecraft is just simulated, the magnetometer will not read values of the geomagnetic field in ℱ , but in ℱ instead. Therefore, the coordinate transformation from Bi to Bb is performed in Simulink, after calculating the Euler angles (φ,θ,ψ) from the integration of system (1) and based on the input (Bi) from the OBC three-axis magnetometer. The measured value of Bb is then processed by the OBC to calculate the magnetic dipole moment required to perform the detumbling and/or B-pointing control, according to Equations (4) and (6). Once determined m, the value of the current is calculated from the inverse of Equation (3) and sent to the power board, which feeds the magnetorquers. To avoid that the magnetic field generated by the magnetorquer interferes with the measurements of the magnetometer, a duty cycle is defined, such that the magnetorquers are activated only for the 90% of the cycle and the remaining 10% is dedicated to the measurements by the magnetometer. Once again, because of the simulated attitude dynamics, the values of the currents are converted to the torque components into the Simulink model, as they are needed to integrate system (1). Aerospace 2019, 6, 133 11 of 17 faster than real time. This corresponds to an operating frequency of 10 Hz for the Helmholtz cage, therefore, to avoid loss of information, the sampling frequency of the OBC magnetometer is set to 100 Hz. It is worth noting that, since the attitude motion of the spacecraft is just simulated, the magnetometer will not read values of the geomagnetic field in F , but in F instead. Therefore, the coordinate transformation from B to B is performed in Simulink, after calculating the Euler i b angles (',, ) from the integration of system (1) and based on the input (B ) from the OBC three-axis magnetometer. The measured value of B is then processed by the OBC to calculate the magnetic dipole moment required to perform the detumbling and/or B-pointing control, according to Equations (4) and (6). Once determined m, the value of the current is calculated from the inverse of Equation (3) and sent to the power board, which feeds the magnetorquers. To avoid that the magnetic field generated by the magnetorquer interferes with the measurements of the magnetometer, a duty cycle is defined, such that the magnetorquers are activated only for the 90% of the cycle and the remaining 10% is dedicated to the measurements by the magnetometer. Once again, because of the simulated attitude dynamics, the values of the currents are converted to the torque components into the Simulink model, as they are needed to integrate system (1). 4. Hardware-In-The-Loop Simulations The detumbling and B-pointing algorithms were tested through HiL simulations, considering the orbital and design parameters for TigriSat, a 3U CubeSat designed and launched by SIA in 2014 and equipped with ABACUS. The characteristic parameters of the disturbance torque were selected to represent realistic worst cases and are indicated, together with the previous ones, in Table 1. Table 1. Orbital parameters and satellite inertial properties for HiL simulations. Orbital Parameters Aerodynamic Properties h [km] 600 C 2.2 i [deg] 97.79 l [m] 1 10 e 0 l [m] 3.3 10 W [deg] 45 l [m] 3.3 10 Inertial Properties Residual Dipole Moment m [kg] 4 jm j [Am ] 0.1 2 3 2 2 J [kgm ] 6.5 10 m [Am ] 9.13 10 x m,x 2 2 2 2 J [kgm ] 4.09 10 m [Am ] 6.32 10 y m,y 2 2 2 3 J [kgm ] 4.09 10 m [Am ] 9.80 10 z m,z Geometric Properties Magnetorquers Properties 2 2 A [m ] 1 10 N 400 2 2 2 3 A [m ] 3.3 10 A [m ] 9.03 10 max 2 2 3 A [m ] 3.3 10 I [A] 8.3 10 The results of three Test Cases (TC) are presented and discussed. In TC1 the detumbling control is verified setting to zero the gain for the pointing control, and assuming the initial angular rates at the deployment reported in Table 2. The detumbling is simulated for a total time corresponding to 1.5 orbital periods and the satellite state (position, velocities and angular rates) at the end of the detumbling phase is assumed as the initial condition for TC2 and TC3, in which pointing control is tested for two di erent values of the target attitude. The simulation parameters are collected in Table 2. Aerospace 2019, 6, 133 12 of 17 Aerospace 2019, 6, x FOR PEER REVIEW 12 of 17 Table 2. Simulation parameters for the three Test Cases (TC). Parameter TC1 TC2 TC3 ', , [deg] 0, 0, 0 175.3,1.4, 51.7 175.3,1.4, 51.7 ! [deg/sec] [5 33] [8.5 4.1 4.2]/100 [8.5 4.1 4.2]/100 K 1000 300 500 K 0 25 30 p p rˆ [1 0 0] [0 0.5 2 0.5 2] The time behavior of the angular rates is reported in Figure 7, showing the e ectiveness of the control law (4) in producing the desired decrease of the angular rates along all the three directions. The mean value of the angular rates in the last 300 s (5%) of the detumbling phase is equal to Aerospace 2019, 6, x FOR PEER REVIEW 12 of 17 ! = [ 0.085 0.041 0.042 ] deg/ sec . Figure 7. Angular rates for the Test Case 1. Figures 8 and 9 show the behavior in time of the Euler angles for TC2 and TC3. The HiL simulations are performed for a total of 6.5 orbital periods, considering for the initial conditions the final state corresponding to TC1. It can be noticed that for both the test cases, the Euler angles settle about the target value (see 𝑟 ̂ in Table 2). The minimum, maximum, and mean error corresponding over the last orbital period are reported in Table 3. It is worth noting that the minimum error here represents the negative error with maximum absolute value. Table 3. Pointing error Test Cases (TC). Error TC2 TC3 Δ𝜑 [deg] 0.02 −3.25 Δ𝜑 [deg] 16.67 0.15 Figure 7. Angular rates for the Test Case 1. Figure 7. Angular rates for the Test Case 1. Δ𝜑 [deg] 4.76 −1.95 Δ𝜃 [deg] −13.26 −7.68 Figures 8 and 9 show the behavior in time of the Euler angles for TC2 and TC3. The HiL simulations Figures 8 and 9 show the behavior in time of the Euler angles for TC2 and TC3. The HiL Δ𝜃 [deg] 8.92 8.07 are performed for a total of 6.5 orbital periods, considering for the initial conditions the final state simulations are performed for a tota Δ𝜃 l of 6.5 orb [deg] it al pe −2.03 riods 0.02 , consid ering for the initial conditions the corresponding to TC1. It can be noticed that for both the test cases, the Euler angles settle about the Δ𝜓 [deg] −15.73 −8.06 final state corresponding to TC1. It can be noticed that for both the test cases, the Euler angles settle target value (see r in Table 2). The minimum, maximum, and mean error corresponding over the last Δ𝜓 [deg] 7.28 7.68 about the target value (see 𝑟 ̂ in Table 2). The minimum, maximum, and mean error corresponding orbital period are reported in Table 3. It is worth noting that the minimum error here represents the Δ𝜓 [deg] −2.29 0.01 over the last orbital period are reported in Table 3. It is worth noting that the minimum error here negative error with maximum absolute value. represents the negative error with maximum absolute value. Table 3. Pointing error Test Cases (TC). Error TC2 TC3 Δ𝜑 [deg] 0.02 −3.25 Δ𝜑 [deg] 16.67 0.15 Δ𝜑 [deg] 4.76 −1.95 Δ𝜃 [deg] −13.26 −7.68 Δ𝜃 [deg] 8.92 8.07 Δ𝜃 [deg] −2.03 0.02 Δ𝜓 [deg] −15.73 −8.06 Δ𝜓 [deg] 7.28 7.68 Δ𝜓 [deg] −2.29 0.01 Figure 8. Euler angles for the Test Case 2, rˆ = [1 0 0]. Figure 8. Euler angles for the Test Case 2, 𝑟 ̂ = [1 0 0]. [ ] Figure 8. Euler angles for the Test Case 2, 𝑟 ̂ = 1 0 0 . Aerospace 2019, 6, x FOR PEER REVIEW 13 of 17 Aerospace 2019, 6, 133 13 of 17 p p Figure 9. Euler angles for the Test Case 3, r = [0 0.5 2 0.5 2]. Figure 9. Euler angles for the Test Case 3, 𝑟 ̂ = 0 0.5 √2 0.5√2. Table 3. Pointing error Test Cases (TC). The values reported in Table 3 indicate that, despite the presence of perturbation torque, Error TC2 TC3 pointing control (6) is effective within an accuracy of, approximately ±10 deg on average and ±20 deg D' [deg] 0.02 3.25 min considering the maximum values. In particular, TC2 seems to be more challenging than TC3. In fact, D' [deg] 16.67 0.15 max [ ] D' [deg] 4.76 1.95 for 𝑟 ̂ = 1 0 0 the system will drive the sate mean llite if the magnetic field measured along 𝑦 and 𝑧 ̂ is not null, or equivalently if the component measured along 𝑥 is equal to the magnitude of the D [deg] 13.26 7.68 min D [deg] 8.92 8.07 magnetic field. Clearly, any component mea max sured at time t can never exceed the magnitude of the D [deg] 2.03 0.02 mean magnetic field |𝑩 (𝒕 )|, then the control shows aperiodic behavior, limiting its accuracy. Differently, when the magnitude of the magne D tic field [deg]is “sha red” by 15.73 two or more components, such as 8.06 𝑟 ̂ = min D [deg] 7.28 7.68 max 0 0.5 2 0.5 2, then the component measured along the directions 𝑦 and 𝑧 ̂ can, at different √ √ D [deg] 2.29 0.01 mean ( ) times, exceed the target value 0.5√2 |𝑩 𝒕 | and the behavior of the control is oscillatory about the target value. This can be proved by observing that the maximum and minimum error for TC3 are The values reported in Table 3 indicate that, despite the presence of perturbation torque, pointing (almost) equally distributed about the mean value. This is not the case for TC2, in which the control (6) is e ective within an accuracy of, approximately10 deg on average and20 deg considering maximum value is much larger in magnitude than the minimum one. the maximum values. In particular, TC2 seems to be more challenging than TC3. In fact, for rˆ = [1 0 0] It is worth noting that the maximum error on the Euler angles is measured when the satellite the system will drive the satellite if the magnetic field measured along yˆ and zˆ is not null, or crosses the poles. In this region the direction of the geomagnetic field vector changes suddenly and b b equivalently if the component measured along xˆ is equal to the magnitude of the magnetic field. in particular Bi points towards the North magnetic pole when the latitude is slightly lower than 90 Clearly, any component measured at time t can never exceed the magnitude of the magnetic field deg and outwards from the pole when the latitude is higher than 90 deg (similarly in the B (t) , then the control shows aperiodic behavior, limiting its accuracy. Di erently, when the neighborhood of the South pole). According to Equation (6), a marked variation of the direction of Bi p p produces magnitude a hi ofgh tor the magnetic que onto field the s is ate “shar llite, ed” incr by eatwo sing it ors mor angu e la components, r rates, there such fore as lon rˆg= er t[0 ime is 0.5 2 re0.5 quire 2d], to damp the angular oscillations and reduce their am ˆ plitude a ˆ bout the target attitude. then the component measured along the directions y and z can, at di erent times, exceed the target b b valueFig 0.5 ures 2 1B0 a(tn)d 11 andshow t the behavior he angof ula the r ra contr tes for TC ol is oscillatory 2 and TC3. It c aboutathe n btar e noticed get value. thaThis t when canth be e pointing phase starts, the angular rates increase, with higher intensity on the axes which are proved by observing that the maximum and minimum error for TC3 are (almost) equally distributed control about the led mean to the t value. arget a This ttitud is e not (i.e the ., 𝑥 case for for TC TC2, 2 and in 𝑦 which and the 𝑧 ̂ maximum for TC3). This value is a consequen is much larger ce o in f the control torque arising from mp. magnitude than the minimum one. It is worth noting that the maximum error on the Euler angles is measured when the satellite crosses the poles. In this region the direction of the geomagnetic field vector changes suddenly and in particular B points towards the North magnetic pole when the latitude is slightly lower than 90 deg and outwards from the pole when the latitude is higher than 90 deg (similarly in the neighborhood of the South pole). According to Equation (6), a marked variation of the direction of Bi produces a high torque onto the satellite, increasing its angular rates, therefore longer time is required to damp the angular oscillations and reduce their amplitude about the target attitude. Figures 10 and 11 show the angular rates for TC2 and TC3. It can be noticed that when the pointing phase starts, the angular rates increase, with higher intensity on the axes which are controlled Aerospace 2019, 6, 133 14 of 17 Aerospace 2019, 6, x FOR PEER REVIEW 14 of 17 to the target attitude (i.e., xˆ for TC2 and yˆ and zˆ for TC3). This is a consequence of the control torque b b b Aerospace 2019, 6, x FOR PEER REVIEW 14 of 17 arising from m . [ ] Figure 10. Angular rates for the Test Case 2, 𝑟 ̂ = 1 0 0 . Figure 10. Angular rates for the Test Case 2, rˆ = [1 0 0]. [ ] Figure 10. Angular rates for the Test Case 2, 𝑟 ̂ = 1 0 0 . p p Figure 11. Angular rates for the Test Case 3, rˆ = [0 0.5 2 0.5 2]. Figure 11. Angular rates for the Test Case 3, 𝑟 ̂ = 0 0.5 2 0.5 2. . √ √ 5. Discussion Figure 11. Angular rates for the Test Case 3, 𝑟 ̂ = 0 0.5 2 0.5 2. √ √ 5. Disc Inussion this section, some relevant features of the attitude control system, inferred from the HiL simulations, are briefly outlined: 5. Disc In t ussion his se ction, some relevant features of the attitude control system, inferred from the HiL the system can produce e ective detumbling and stabilization during the pointing phase; simulations, are briefly outlined: In this section, some relevant features of the attitude control system, inferred from the HiL the pointing accuracy of the system, though coarse, is acceptable for a backup mode of operations, • simu the lations, system c are br an produce iefly outlined: effective detumbling and stabilization during the pointing phase; and considering the lack of attitude information or sophisticate filtering methods (i.e., Extended • the pointing accuracy of the system, though coarse, is acceptable for a backup mode of • Kalman the system c Filter); an produce effective detumbling and stabilization during the pointing phase; operations, and considering the lack of attitude information or sophisticate filtering methods • the pointing accuracy of the system, though coarse, is acceptable for a backup mode of the achievement of some target attitude rˆ can be more challenging, or equivalently less accurate, (i.e., Extended Kalman Filter); operations, and considering the lack of attitude information or sophisticate filtering methods this is in particular the case for rˆ = [1 0 0]; • the achievement of some target attitude 𝑟 ̂ can be more challenging, or equivalently less (i.e., Extended Kalman Filter); the system is robust with respect to the noise of the calibrated magnetometer (1 10 T) and accurate, this is in particular the case for 𝑟 ̂ = [1 0 0]; • the achievement of some target attitude 𝑟 ̂ can be more challenging, or equivalently less the perturbation induced by residual dipole moment, gravity gradient and aerodynamic torques. −6 • the system is robust with respect to the noise of the calibrated magnetometer (±1 × 10 T) and accurate, this is in particular the case for 𝑟 ̂ = [1 0 0]; the perturbation induced by residual dipole moment, gravity gradient and aerodynamic −6 6. Conclusions • the system is robust with respect to the noise of the calibrated magnetometer (±1 × 10 T) and torques. the perturbation induced by residual dipole moment, gravity gradient and aerodynamic The implementation of a control strategy based on the only measurements data from a MEMS torques. three-axis magnetometer was presented. The strategy allows detumbling and pointing with respect 6. Conclusions 6. Con The impleme clusions ntation of a control strategy based on the only measurements data from a MEMS three-axis magnetometer was presented. The strategy allows detumbling and pointing with respect The implementation of a control strategy based on the only measurements data from a MEMS three-axis magnetometer was presented. The strategy allows detumbling and pointing with respect Aerospace 2019, 6, 133 15 of 17 to the geomagnetic field vector, it is tailored for CubeSat applications, requires limited power and is meant to be used as a backup solution, in case of failure of the attitude determination device. Hardware-in-the-loop simulations are performed to validate the strategy and its implementation on a real CubeSat OBC and a flight proven three-axis magnetometer. The satellite attitude dynamics is simulated, including the perturbation e ects of the residual dipole moment, gravity gradient, and aerodynamic torques. Experimental testing showed that the three-axis detumbling allows reducing the angular rates below 0.1 deg/sec, while the pointing strategy allows achieving the target attitude with an error below 20 deg. In particular, the pointing error increases significantly in the proximity of the magnetic poles, due to the rapid change in the direction of the geomagnetic field vector. This result indicates that the design of a pointing control mitigating this e ect would be worth the implementation, and this will be a field of research for the near future. Further applications of the Hardware-in-the-loop setup are envisioned for the development of the ADCS system designed for the 3U Astro Bio CubeSat (ABCS) and the 6P PocketQube Space Travelling Egg Controlled Catadioptric Object (STECCO) currently developed at the School of Aerospace Engineering. These will include the implementation of a spherical air bearing to simulate microgravity attitude motion of the satellite and testing of magnetometer-only attitude control algorithms. Author Contributions: Conceptualization and methodology, M.S.F., S.C., A.N., and P.T.; software, M.S.F.; validation, M.S.F. and S.C.; formal analysis, S.C.; investigation, M.S.F. and S.C.; data curation, M.S.F. and S.C.; writing—original draft preparation, S.C.; writing—review and editing, M.S.F., A.N., and P.T.; supervision, A.N. and P.T.; project administration, P.T.” Funding: This research received no external funding. Conflicts of Interest: The authors declare no conflict of interest. References 1. Swantwout, M. The First One Hundred CubeSats: A Statistical Look. J. Small Satel. 2013, 2, 213–233. 2. Wenschel, L.; Brown, J.; Toorian, A.; Coelbo, R.; Puig-Suari, J.; Twiggs, R. CubeSat Development in Education and into Industry. In Proceedings of the AIAA Space 2006 Conference, San Jose, CA, USA, 19 September 3. Langer, M.; Bouwmeester, J. Reliability of CubeSats–Statistical Data, Developers’ Beliefs and the Way Forward. In Proceedings of the AIAA/USU Conference on Small Satellites, SSC16-X-2, Logan, UT, USA, 6–11 August 4. Shou, H.-N. Microsatellite Attitude Determination and Control Subsystem Design and Implementation: Software-in-the-Loop Approach. In Proceedings of the 2014 International Symposium on Computer, Consumer and Control, Taichung, Taiwan, 10–12 June 2014. 5. Stesina, F.; Corpino, S.; Feruglio, L. An In-The-Loop Simulator for the Verification of Small Space Platforms. Int. Rev. Aerosp. Eng. 2017, 10, 50–60. [CrossRef] 6. Wegner, S.; Majd, E.; Taylor, L.; Thomas, R.; Egziabher, D.G. Methodology for Software-in-the-Loop Testing of Low-Cost Attitude Determination Systems, SSC17-WK-09. Available online: https://digitalcommons.usu. edu/smallsat/2017/all2017/5/ (accessed on 30 November 2019). 7. Klesh, A.; Seagraves, S.; Bennet, M.; Boone, D.; Cutler, J.; Bahcivan, H. Dynamically driven Helmholtz cage for experimental magnetic attitude determination. Adv. Astronaut. Sci. 2010, 135, 147–160. 8. Quadrino, M.K.S. Testing the Attitude Determination and Control of a CubeSat with Hardware-in-the-Loop. Master ’s Thesis, Department of Aeronautics and Astronautics, Massachusetts Institute of Technology, Cambridge, MA, USA, 2014. 9. Poppenk, F.M.; Amini, R.; Brouwer, G.F. Design and application of Helmholtz cage for testing nano-satellites. In Proceedings of the 6th International Symposium on Environmental Testing for Space Programmes, ESA Communication Production Oce, Noordwijk, The Netherlands, 12–14 June 2007. Aerospace 2019, 6, 133 16 of 17 10. Delabie, T.; Vandoren, B.; De Munter, W.; Raskin, G.; Vandenbussche, B.; Vandepitte, D. Testing and calibrating an advanced cubesat attitude determination and control system. In Proceedings of the Volume 10698, Space Telescopes and Instrumentation 2018: Optical, Infrared, and Millimeter Wave, SPIE Astronomical Telescopes and Instrumentation, Austin, TX, USA, 10–15 June 2018. 11. Gavrilovich, I.; Krut, S.; Gouttefarde, M.; Pierrot, F.; Dusseau, L. Test Bench for Nanosatellite Attitude Determination and Control System Ground Tests. In Proceedings of the 4S Symposium, Small Satellites Systems and Services 2014, Petro, Spain, 4–8 June 2014. 12. Schwartz, J.L.; Peck, M.A.; Halt, C.D. Historical Review of Air-Bearing Spacecraft Simulators. J. Guid. Control Dyn. 2003, 26, 513–522. [CrossRef] 13. Chesi, S.; Perez, O.; Romano, M. A Dynamic, Hardware-in-the-Loop, Three-Axis Simulator of Spacecraft Attitude Maneuvering with Nanosatellite Dimensions. J. Small Satell. 2015, 4, 315–328. 14. Kuyyakanont, A.; Kuntanapreeda, S.; Fuengwarodsakul, H. On verifying magnetic dipole moment of a magnetic torquer by experiments. In Proceedings of the IOP Conference Series: Materials Science and Engineering, Krasnoyarsk, Russia, 8 November 2018; Volume 297. 15. Lee, D.Y.; Park, H.; Romano, M.; Cutler, J. Development and Experimental Validation of a Multi-Algorithmic Hybrid Attitude Determination and Control System for a Small Satellite. Aerosp. Sci. Technol. 2018, 78, 494–509. [CrossRef] 16. Ousaloo, H.S.; Nodeh, M.T.; Mehrabian, R. Verification of Spin Magnetic Attitude Control System using air-bearing-based attitude control simulator. Acta Astronaut. 2016, 126, 546–553. [CrossRef] 17. Sternberg, D.C.; Pong, C.; Filipe, N.; Mohan, S.; Johnson, S.; Wilson, L.J. Jet Propulsion Laboratory Small Satellite Dynamics Testbed Simulation: On-Orbit Performance Model Validation. J. Spacecr. Rocket. 2018, 55, 322–334. [CrossRef] 18. Tapsawat, W.; Sangpet, T.; Kuntanapreeda, S. Development of a hardware-in-loop attitude control simulator for a CubeSat satellite. In Proceedings of the IOP Conference Series: Materials Science and Engineering, Krasnoyarsk, Krasnoyarsk, Russia, 8 November 2018; Volume 297. 19. Nascetti, A.; Pancorbo-D’Ammando, D.; Truglio, M. Abacus advanced board for active control of university satellites. In Proceedings of the 2nd IAA Conference on University Satellite Missions and Cubesat Workshop, International Academy of Astronautics, Roma, Italy, 3–9 February 2013. 20. Wertz, J.R. (Ed.) Spacecraft Attitude Determination and Control, 3rd ed.; Kluwer Academic Publisher: Dordrecht, The Netherlands, 1978. 21. de Ruiter, A.H.; Damaren, C.; Forbes, J.R. Spacecraft Dynamics and Control: An Introduction, 1st ed.; John Wiley & Sons. Ltd.: Chichester, UK, 2013. 22. Teofilatto, P.; Testani, P.; Celani, F.; Nascetti, A.; Truglio, M. A nadir-pointing magnetic attitude control system for TigriSat nanosatellite. In Proceedings of the International Astronautical Congress 2013, Beijing, China, 23–27 September 2013; Volume 6, pp. 4818–4829. 23. Natanson, G.A.; McLaughlin, S.F.; Nicklas, R.C. A method of determining attitude from magnetometer data only. In Proceedings of the NASA Goddard Space Flight Center, Flight Mechanics/Estimation Theory Symposium, Silver Spring, MD, USA, 1 December 1990; pp. 359–380. 24. Natanson, G.A.; Challa, J.; Deutschmann, J.; Baker, D.F. Magnetometer only attitude and rate determination for a gyro-less spacecraft. In Proceedings of the Third International Symposium on Space Mission Operations and Ground Data Systems, Greenbelt, MD, USA, 1 November 1994; pp. 791–798. 25. Ma, H.; Xu, S. Magnetomter-only attitude and angular velocity filtering estimation for attitude changing spacecraft. Acta Astronaut. 2014, 102, 89–102. [CrossRef] 26. Psiaki, M.L. Global Magnetomter-Based Spacecraft Attitude and Rate Estimation. J. Guid. Control Dyn. 2004, 27, 240–250. [CrossRef] 27. Hart, C. Satellite Attitude Determination Using Magnetometer Data Only. In Proceedings of the AIAA Aerospace Science Meeting Including the New Horizons Forum and Aerospace Exposition, Orlando, FL, USA, 5–9 January 2009. 28. Sugimura, N.; Kuwahara, T.; Yoshida, K. Attitude Determination and Control System for Nadir Pointing Using Magnetorquer and Magnetometer. In Proceedings of the 2016 IEEE Aerospace Conference, Big Sky, MT, USA, 5–12 March 2016. Aerospace 2019, 6, 133 17 of 17 29. Ma, G.F.; Jiang, X.Y. Unscented Kalman filter for spacecraft attitude estimation and calibration using magnetometer measurements. In Proceedings of the 2005 International Conference on Machine Learning and Cybernetics, Guangzhou, China, 18–21 August 2015. 30. Searcy, J.D.; Pernicka, H.J. Magnetometer-Only Attitude Determination Using Novel Two-Step Kalman Filter Approach. J. Guid. Control Dyn. 2012, 35, 1639–1701. [CrossRef] 31. Carletta, S.; Teofilatto, P. Design and Numerical Validation of an Algorithm for the Detumbling and Angular Rate Determination of a CubeSat Using Only Three-Axis Magnetometer Data. Int. J. Aerosp. Eng. 2018. [CrossRef] 32. Lassakeur, A.; Underwood, C.; Taylor, B. Enhanced Attitude Stability and Control for CubeSats by Real-Time On-Orbit Determination of Their Dynamic Magnetic Moment. In Proceedings of the 69th International Astronautical Congress, Bremen, Germany, 1–5 October 2018. 33. Springmann, J.C.; Cutler, J.W. Magnetic Sensor Calibration and Residual Dipole Characterization for Application to Nanosatellites. In Proceedings of the AIAA/AAS Astrodynamics Specialist Conference, Toronto, OT, Canada, 2–5 August 2010. AIAA-20110-7518. 34. Armstrong, J.; Casey, C.; Creamer, G.; Dutchover, G. Pointing Control for Low Altitude Triple CubeSat Space Darts. In Proceedings of the 23rd Annual AIAA/USU Conference on Small Satellites, Logan, UT, USA, 10–13 August 2009. 35. NASA SP-8058, Spacecraft Aerodynamic Torques; NASA: Washington, DC, USA, January 1971. 36. Picone, J.M.; Hedin, A.E.; Drob, D.P.; Aikin, A.C. NRLMSISE-00 empirical model of the atmosphere: Statistical comparisons and scientific issues. J. Geophys. Res. Space Phys. 2002, 107, A12. [CrossRef] 37. Reynerson, C. Aerodynamic Disturbance Force and Torque Estimation for Spacecraft and Simple Shapes Using Finite Plate Elements—Part I: Drag Coecient. Adv. Spacecr. Technol. 2011, 128. [CrossRef] 38. Thébault, E.; Finlay, C.C.; Beggan, C.D.; Alken, P.; Aubert, J.; Barrois, O.; Bertrand, F.; Bondar, T.; Boness, A.; Brocco, L.; et al. International Geomagnetic Reference Field: The 12th generation. EarthPlanets Space 2015, 67. [CrossRef] © 2019 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/). http://www.deepdyve.com/assets/images/DeepDyve-Logo-lg.png Aerospace Multidisciplinary Digital Publishing Institute

Implementation and Hardware-In-The-Loop Simulation of a Magnetic Detumbling and Pointing Control Based on Three-Axis Magnetometer Data

Loading next page...
 
/lp/multidisciplinary-digital-publishing-institute/implementation-and-hardware-in-the-loop-simulation-of-a-magnetic-yJZ63ekTAE

References

References for this paper are not available at this time. We will be adding them shortly, thank you for your patience.

Publisher
Multidisciplinary Digital Publishing Institute
Copyright
© 1996-2019 MDPI (Basel, Switzerland) unless otherwise stated Terms and Conditions Privacy Policy
ISSN
2226-4310
DOI
10.3390/aerospace6120133
Publisher site
See Article on Publisher Site

Abstract

aerospace Article Implementation and Hardware-In-The-Loop Simulation of a Magnetic Detumbling and Pointing Control Based on Three-Axis Magnetometer Data y ,y y y M. Salim Farissi , Stefano Carletta * , Augusto Nascetti and Paolo Teofilatto School of Aerospace Engineering, Sapienza University of Rome, 00138 Rome, Italy; salim.farys@gmail.com (M.S.F.); augusto.nascetti@uniroma1.it (A.N.); paolo.teofilatto@uniroma1.it (P.T.) * Correspondence: stefano.carletta@uniroma1.it y These authors contributed equally to this work. Received: 31 October 2019; Accepted: 6 December 2019; Published: 11 December 2019 Abstract: The subject of this work is the implementation and experimental testing of a purely magnetic attitude control strategy, which can provide stabilization after the deployment and pointing of the spacecraft without any attitude information. In particular, the control produces the detumbling of the satellite and leads it to a desired attitude with respect to the direction of the Earth magnetic field, based on the only information provided by a three-axis magnetometer. The system is meant to be used as a backup solution, in case of failure of the primary strategy and is designed considering the constraints set on time of operations, power consumption, and peak electric current for a typical CubeSat mission. The detumbling and pointing algorithms are implemented on the FPGA core of a CubeSat on-board computer and tested by Hardware-in-the-loop simulations. The simulation setup includes a Helmholtz cage, recreating the magnetic environment along the orbit, the on-board computer, a MEMS three-axis magnetometer and Simulink software, on which the attitude dynamics is propagated. Test on the real system can provide useful information to select the parameters of the control, such as the gains, to estimate the limits of the system, the time of operations and prevent failures. Keywords: magnetic ADCS; hardware-in-the-loop; CubeSat; Helmholtz cage; B-dot; B-pointing 1. Introduction The Attitude Determination and Control System (ADCS) plays a vital role in spacecraft mission operations. It provides information regarding the spacecraft orientation (or attitude) in space and produces the control action necessary to modify its attitude, according to some input or prescribed control laws. The successful development of an ADCS starts from concept design and should include numerical and experimental validation of the algorithms and hardware, to confirm its performance and robustness in di erent operative scenarios. During the last decades, the introduction of the CubeSat standard gathered the attention of universities and small companies, because of the possibility to develop satellites and space missions with a limited budget [1,2]. The ADCS implemented under such a budget constraint are typically based on low-cost Components O -The-Shelf (COTS), thus sensors and devices which are not tailored for space applications and novel system architecture. For this reason, experimental testing should represent an essential part of the development process. It is known from statistical analysis that the majority of CubeSat mission end in failure right after the deployment. According to [3] the impact of ADCS failure on the number of “dead on arrival” CubeSats seems to be marginal, but a system-oriented interpretation of the results provides a clearer Aerospace 2019, 6, 133; doi:10.3390/aerospace6120133 www.mdpi.com/journal/aerospace Aerospace 2019, 6, 133 2 of 17 view on the issue. In fact, if ADCS failures may not a ect the functionality of the other on-board systems, they do not allow those systems to operate in the design conditions, jeopardizing the mission, eventually causing its failure. In the recent past, some strategies for low-cost Software-in-the-loop (SiL) or even Hardware-in-the-loop (HiL) testing of ADCS have been proposed. In SiL testing, the space environment, the satellite attitude dynamics, and the ADCS devices are all simulated, therefore the accuracy of the result depends on that of the model used for each one of the mentioned elements of the loop [4–6]. SiL simulations can be successfully applied to verify the ADCS system architecture and algorithms and are less complex than HiL simulations, in which the real attitude sensors and actuators are used, allowing a more accurate estimation of the ADCS performance. To adequately test the mentioned ADCS devices, some crucial features of the space environment must be recreated on-ground by the HiL setup. Some HiL setup include a Helmholtz cage [7–9], a device capable of reproducing the geomagnetic field vector on the satellite during its orbital motion, allowing the use of real magnetometers in the simulation loop. Spherical air-bearing testbeds are used to recreate the microgravity conditions [10–12], necessary to simulate the spacecraft attitude dynamics under the control of attitude actuators [13–18]. In this work, we propose the design of a purely magnetic ADCS, allowing CubeSat detumbling and pointing based on the only measurement data from a MEMS three-axis magnetometer. The system is developed considering constraints on time of operations, power consumption, and peak electric current set by common CubeSat on-board systems. The ADCS algorithms are designed to be implemented on the FPGA core of the CubeSat On-Board-Computer (OBC) ABACUS, designed by the School of Aerospace Engineering (SIA) and successfully flight proven [19]. The algorithms and part of the ADCS hardware (OBC and magnetometer) are tested by HiL simulations, using the Helmholtz cage available at SIA Flight Mechanics Laboratory “Michele D. Sirinian”. The configuration of the facility and calibration of the magnetometer are also part of this work and will be discussed in detail. The manuscript is organized as follows, the background on spacecraft attitude dynamics and magnetic control is provided in Section 2. In Section 3 the configuration and calibration of the test hardware is presented, indicating the solutions selected and the performance of the experimental setup. The results for some selected test cases are presented and commented in Section 4, producing a preliminary characterization of the ADCS. Final comments are reported in the Conclusions section. 2. Spacecraft Attitude Dynamics and Magnetic Attitude Control 2.1. Attitude Dynamics Attitude dynamics is modelled considering the spacecraft as a rigid body which is free to rotate about its center of mass. The principal moments of inertia are used to define the body frame F = [xˆ , yˆ , zˆ ] which rotates rigidly with the spacecraft. An inertial reference frameF = [xˆ , yˆ , zˆ ] is b b b b i i i i identified as well, here selected as the GeoCentric Inertial frame (GCI) [20], so that the Euler angles (',, ) transforming F into F can be used to describe the spacecraft attitude. Furthermore, the b i angular velocity at whichF rotates with respect toF represents the angular velocity of the spacecraft b i ! = [ ! ! ! ] . The two reference frames are sketched in Figure 1. x y z Based on this representation, the dynamic equations of attitude motion are represented by the following system [20]: Aerospace 2019, 6, 133 3 of 17 8 . > ' = ! + sin' tan! + cos' tan! x y z = cos'! sin'! y z sin'! cos' ! ( y z) cos . J J > y z (1) ! = ! ! +  + > x y z c,x d,x > J J J z x ! = ! ! +  + y x z c,y d,y > J . J J > x y : ! = ! ! +  + z x y c,z d,z where  and  are, respectively, the components of the control and disturbance torques acting on c,i d,i the satellite, described in detail in the following subsections. Aerospace 2019, 6, x FOR PEER REVIEW 3 of 17 Figure 1. Sketches of the GeoCentric Inertial frame (GCI) and body-fixed reference frames. Figure 1. Sketches of the GeoCentric Inertial frame (GCI) and body-fixed reference frames. 2.2. Magnetic Attitude Control Based on this representation, the dynamic equations of attitude motion are represented by the following system [20]: In the ADCS developed here, the control torque is produced by the interaction between the geomagnetic field surrounding the spacecraft (B ), measured by the three-axis magnetometer, and the 𝜑 =𝜔 +sin 𝜑 tan 𝜃 𝜔 + cos 𝜑 tan 𝜃 𝜔 magnetic dipole moment m = [ m m m ] generated by the magnetic coils (or magnetorquers) x y z 𝜃 = cos 𝜑 𝜔 −sin 𝜑 𝜔 installed on-board, representing the attitude control devices. The torque can be expressed by the ⎨ sin 𝜑 𝜔 − cos 𝜑 𝜔 following equation 𝜓 = cos 𝜃 = m B (2) c b 𝐽 −𝐽 ⎧ 𝜔 = 𝜔 𝜔 +𝜏 +𝜏 (1) , , In particular, the system consists of three mutually orthogonal magnetorquers, each one generating 𝐽 −𝐽 a magnetic dipole moment m along one of the dir ections ofF (see Figure 2) 𝜔 = 𝜔 𝜔 +𝜏 +𝜏 , , m = N A I i = x, y, z (3) i 𝐽 − i 𝐽 i i 𝜔 = 𝜔 𝜔 +𝜏 +𝜏 , , ⎩ 𝐽 where N and A are, respectively, the number of turns and the mean area of the coil along orthogonal i i where τc,i and τd,i are, respectively, the components of the control and disturbance torques acting on to the i-th body-frame direction, and I is the electric current in the wire of the coil. the satellite, described in detail in the following subsections. 2.2. Magnetic Attitude Control In the ADCS developed here, the control torque is produced by the interaction between the geomagnetic field surrounding the spacecraft (Bb), measured by the three-axis magnetometer, and 𝑚 𝑚 𝑚 the magnetic dipole moment 𝒎= [ ] generated by the magnetic coils (or magnetorquers) installed on-board, representing the attitude control devices. The torque can be expressed by the following equation 𝝉 =𝒎 × 𝑩 (2) 𝒄 𝒃 In particular, the system consists of three mutually orthogonal magnetorquers, each one generating a magnetic dipole moment mi along one of the directions of ℱ (see Figure 2) 𝑚 =𝑁 𝐴 𝐼 𝑖 = 𝑥, 𝑦, 𝑧 (3) where Ni and Ai are, respectively, the number of turns and the mean area of the coil along orthogonal to the i-th body-frame direction, and Ii is the electric current in the wire of the coil. Aerospace 2019, 6, 133 4 of 17 Aerospace 2019, 6, x FOR PEER REVIEW 4 of 17 Figure 2. Sketch of the magnetometer and magnetorquers position in the body-fixed reference frame. Figure 2. Sketch of the magnetometer and magnetorquers position in the body-fixed reference frame. The magnetorquers are controlled by regulating the intensity of I, which can be determined based The magnetorquers are controlled by regulating the intensity of I, which can be determined on that of the magnetic dipole moment necessary to produce the desired attitude motion. Two control based on that of the magnetic dipole moment necessary to produce the desired attitude motion. Two laws were implemented, one producing the spacecraft detumbling, or stabilization after deployment, control laws were implemented, one producing the spacecraft detumbling, or stabilization after and one setting the spacecraft attitude to some prescribed angle with respect the geomagnetic field deployment, and one setting the spacecraft attitude to some prescribed angle with respect the vector, hereafter referred to as B-pointing. geomagnetic field vector, hereafter referred to as B-pointing. Detumbling control has long been studied and is simply described by the following equation for Detumbling control has long been studied and is simply described by the following equation for the magnetic dipole moment [21]: the magnetic dipole moment [21]: m = K B (4) d d b (4) 𝒎 =−𝐾 𝑩 where K is the control gain and B is the time derivative of the geomagnetic field measured by the d b 𝒅 𝒃 on-board magnetometer. Indicating with f the sampling frequency of the ADCS and with k the sample, where Kd is the control gain and 𝑩 is the time derivative of the geomagnetic field measured by the the value of the derivative can be calculated as follows: on-board magnetometer. Indicating with fk the sampling frequency of the ADCS and with k the sample, the value of the derivative can be calculated as follows: (k) (k1) B = f B B (5) b k b b (𝒌) (𝒌𝟏) 𝑩 = 𝑓 −𝑩 (5) 𝒃 𝒃 B-pointing control represents an adaptation of the nadir-pointing control already implemented on TigriSat, B-p ao3U inting CubeSat control launched represen by ts the an ad SIA apin tation 2014 of [22 the nadir-po ]: inting control already implemented on TigriSat, a 3U CubeSat launched by the SIA in 2014 [22]: m = K B  rˆ B (6) p p b b 𝒎 =𝐾 𝑩 × 𝑟 ̂ ×𝐵 (6) 𝒑 𝒃 where K is the control gain, rˆ is the unit vector representing the target attitude of the spacecraft and B p b where Kp is the control gain, 𝑟 ̂ is the unit vector representing the target attitude of the spacecraft and is the direction of B . For a general case, rˆ should be provided by the attitude determination segment of 𝐵 is the direction of Bb. For a general case, 𝑟 ̂ should be provided by the attitude determination the ADCS, which is not examined here. In fact, the aim of the proposed solution is that of representing segment of the ADCS, which is not examined here. In fact, the aim of the proposed solution is that of an e ective and reliable alternative to be activated when attitude determination is not available. In representing an effective and reliable alternative to be activated when attitude determination is not such a scenario, rˆ will be set equal to a prescribed direction inF . The following two cases are examined available. In such a scenario, 𝑟 ̂ will be set equal to a prescribed direction in ℱ . The following two in Section 4: cases are examined in Section 4: (a) rˆ = [1 0 0], producing xˆ in the direction of B ; b b (a) 𝑟 ̂ = [1 0 0], producing 𝑥 in the direction of Bb; p p (b) rˆ = [0.5 2 0.5 2 0], setting yˆ and zˆ to an angle of 45 deg with respect to B . (b) 𝑟 ̂ =[0.5√2 0.5√2 0], setting 𝑦 and 𝑧 ̂ to an angle of 45 deg with respect to Bb. b b b Since a three-axis magnetometer can only resolve two out of three attitude angles, the B-pointing Since a three-axis magnetometer can only resolve two out of three attitude angles, the B-pointing algorithm can control the spacecraft attitude along one (a) or two (b) directions at most. Considering algorithm can control the spacecraft attitude along one (a) or two (b) directions at most. Considering for instance the case (b), the only attitude information available on third axis (𝑥 ) is that it will always for instance the case (b), the only attitude information available on third axis (xˆ ) is that it will always lay on a plane orthogonal to Bb. This result can be easily extended to case (a). It is worth to highlight lay on a plane orthogonal to B . This result can be easily extended to case (a). It is worth to highlight that similar configurations produce a predictable attitude motion of the satellite which, in case of 𝑩 Aerospace 2019, 6, 133 5 of 17 that similar configurations produce a predictable attitude motion of the satellite which, in case of failure of the primary attitude determination devices, improving the survivability of the mission and allowing to implement magnetometer-only attitude estimation strategies [23–31]. Equations (4) and (6) represent the control laws of the ADCS, producing the total magnetic dipole moment given below: m = m + m (7) Based on Equations (4), (6), and (7), the value of the electric current in the magnetorquers can be 3 2 determined once fixed the parameters N = 400 and A = 9.03  10 m for all the coils, which have max been selected in order to limit the power usage to P = 250 mW at a supply voltage of V = 3 V. drive max It follows that the limit value for the current is I = 83 mA, therefore the maximum value for the dipole moment which can be generated by each magnetorquer can be calculated from Equation (3) and max 2 is equal to m = 0.3 Am . 2.3. Disturbance Torques During the orbital motion of the satellite, a variety of external torque, beside the control one, act on it, producing a perturbation on the controlled attitude motion. The most relevant ones have been considered, caused by residual dipole moment ( ), gravity gradient  , and atmospheric drag ( ). m g a The total disturbance torque is calculated as follows =  +  +  (8) m g a 2.3.1. Residual Dipole Moment Torque The presence of magnetic materials or the electric currents in on-board electric devices can produce a residual magnetic dipole moment m on the satellite [32,33]. The interaction of m with the m m geomagnetic field B produces a torque on the satellite, which can be evaluated by Equation (2) = m  B (9) m m b The magnitude and direction of m depend on the final configuration of the satellite, therefore they cannot be determined a-priori and a guessed value should be considered as long as the final configuration of the satellite is not defined, to verify the e ectiveness of the control algorithms also in presence of such a perturbation. For the HiL simulations performed in Section 4, the magnitude jm j = 0.1 Am is selected, which is one order of magnitude higher than the values measured for similar CubeSat configurations [33,34], definitely representing a worst-case scenario. 2.3.2. Gravity Gradient Torque Satellite with an unsymmetrical mass distribution are subject to gravitational torque, produced by the Earth’s gravitational field. The torque can be modelled as follows [20]: = 3 rˆ [ J]rˆ (10) jrj 14 3 2 where r is the position vector of the satellite in GCI coordinates,  = 3.986 10 m /s is the gravitational parameter of the Earth, [J] is the tensor of inertia of the satellite and rˆ = r/jrj. The value ofjrj can be calculated from the polar equation for a Keplerian orbit: a 1 e jrj = (11) 1 + e cos# Aerospace 2019, 6, 133 6 of 17 where a and e indicate the semimajor axis and the eccentricity of the orbit and # is the true anomaly. The components of r in the GCI frame can be calculated applying the following rotation matrix, transforming a vector in the orbital plane to the GCI one [20]: 2 3 6 cosW cos(! + #) sinW cos i sin(! + #) cosW sin(! + #) sinW cos i cos(! + #) sinW sin i 7 6 7 6 7 6 7 6 7 [R ] = sinW cos(! + #) + cosW cos i sin(! + #) cosW cos i cos(! + #) sinW sin(! + #) cosW sin i (12) 6 7 o,i 6 7 6 7 4 5 sin i sin(! + #) cos(! + #) sin i cos i where W is the RAAN, ! is the argument of perigee and i is the inclination of the orbital plane. Based on matrix (12), r is defined by the transformation below: 2 3 6 jrj 7 6 7 6 7 6 7 6 7 r = [R ]6 0 7 (13) o,i 6 7 6 7 4 5 2.3.3. Aerodynamic Torque Aerodynamic torque arises from the aerodynamic drag produced by the interaction of the satellite surfaces with the residual atmosphere at high altitude, which is represented by the following equation [35]: D = SC V V (14) where  is the density of air, which can be modelled according to NRLMSISE-00 empirical model [36], S is the normal projection of the satellite area to the incident flow, C is the drag coecient of the satellite [37], and V is its orbital speed which can be determined as follows: 2 1 V =  (15) jrj a To calculate the aerodynamic torque, the unit vector V must be expressed inF , by applying the following coordinate transformation [20]: 2 3 6 0 7 6 7 6 7 6 7 ˆ 6 7 V = [R ][R ] (16) 6 1 7 o,i i,b 6 7 6 7 4 5 where the rotation matrix [R ] transformsF toF and is given below: i,b i b 2 3 6 cos cos cos sin + cos sin sin sin sin psi cos cos sin 7 6 7 6 7 6 7 6 7 [R ] = 6 cos sin cos cos sin sin sin cos sin + cos sin sin 7 (17) o,i 6 7 6 7 4 5 sin cos sin coscos The expression for the aerodynamic torque inF is reported below [35]: = l D (18) where l is the arm of the torque, corresponding to the distance between the satellite center of mass and the aerodynamic center, which is the point where the aerodynamic force is applied. Estimating the aerodynamic center of the satellite requires dedicated analyses which are beyond the aim of this work [35], therefore for the HiL simulation a worst case was considered, setting l equal to the half-length of each side of the satellite. Aerospace 2019, 6, 133 7 of 17 3. Configuration of the Hardware-In-The-Loop Simulation Hardware Aerospace 2019, 6, x FOR PEER REVIEW 7 of 17 A primary goal of this work is to verify the performance of the ADCS in producing the control laws proposed in Section 2. To achieve this result, the experimental setup for HiL simulations is configured. where 𝜇 is the permeability of free space, N = 54 and l = 1.24 m are, respectively, the number of turns and the half length of the side of the coils, β = 0.5445 is the ratio of the distance between the two coils 3.1. Helmholtz Cage Configuration −4 and I is the electric current in the coils. The facility was designed to operate in the range ±2 × 10 T along e A 3 ach d  3 i rection. 3 m Helmholtz cage is used to reproduce the geomagnetic field vector in F at any In addition to the Helmholtz cage, the system includes: orbital position of the spacecraft. The complete cage system is shown in Figures 3 and 4. The magnetic field generated by the Helmholtz cage is uniform in a volume of 30  30  30 cm at the center of • 3 power supplies, each one feeding one pair of coils, allowing the generation of a magnetic field the cage. Each pair of coils produces a constant magnetic field orthogonal to their surface, whose vector with desired intensity and direction; magnitude can be estimated by the following approximated relation: • a control computer, on which the orbital motion of the satellite is simulated, based on the input orbital parameters, and the corresponding value of Bi for each position of the satellite is 2 NI 0 i B = p i = x, y, z (19) calculated in real-time, usi ing the International Geomagnetic Reference Field (IGRF) model [38]; 2 2 (1 + ) 2 + • a calibrated three-axis magnetometer, measuring the magnetic field in the central and constant region of the Helmholtz cage. where  is the permeability of free space, N = 54 and l = 1.24 m are, respectively, the number of turns and the half length of the side of the coils, = 0.5445 is the ratio of the distance between the two coils All the mentioned elements form a closed-loop system which operates according to a control and I is the electric current in the coils. The facility was designed to operate in the range2 10 T code implemented in Matlab. A Proportional Integral Derivative (PID) controller allows generating along each direction. −7 a magnetic field with an error in the range ±1 × 10 T. Figure 3. Helmholtz cage at SIA flight mechanics laboratory. Figure 3. Helmholtz cage at SIA flight mechanics laboratory. Aerospace 2019, 6, 133 8 of 17 Aerospace 2019, 6, x FOR PEER REVIEW 8 of 17 magnetometer power supplies control computer Figure 4. Control system for the Helmholtz cage at SIA flight mechanics laboratory. Figure 4. Control system for the Helmholtz cage at SIA flight mechanics laboratory. In addition to the Helmholtz cage, the system includes: The list of the operations necessary to simulate the changing magnetic field during the orbital motion of the satellite is discussed hereafter. As a preliminary step, the desired orbital parameters 3 power supplies, each one feeding one pair of coils, allowing the generation of a magnetic field are introduced in the control code, written in Matlab, along with the total time and the time step for vector with desired intensity and direction; the simulation. In particular, the time step can be selected in the frequency range 1–10 Hz, therefore a control computer, on which the orbital motion of the satellite is simulated, based on the input allowing accelerated simulations up to a factor 10. It is worth noting that, to allow accelerated orbital parameters, and the corresponding value of B for each position of the satellite is calculated simulations, the sampling frequency of the ADCS must be compatible with that of the Helmholtz in real-time, using the International Geomagnetic Reference Field (IGRF) model [38]; cage, as discussed in detail in Section 3.2. Corresponding to each time step, the following cycle is a calibrated three-axis magnetometer, measuring the magnetic field in the central and constant repeated: region of the Helmholtz cage. 1. the orbital propagator updates the true anomaly and calculates the position r of the satellite in All the mentioned elements form a closed-loop system which operates according to a control ℱ , according to Equations (11)–(13); code implemented in Matlab. A Proportional Integral Derivative (PID) controller allows generating a 2. using a Matlab routine, the longitude (Lo), latitude (La), and altitude (h) of the satellite at any r magnetic field with an error in the range1 10 T. are calculated and the geomagnetic field Bi is computed from the IGRF model: The list of the operations necessary to simulate the changing magnetic field during the orbital motion of the satellite is discussed hereafter. As a pr 1eliminary 𝜕𝑉 step, the desired orbital parameters ⎧𝐵 = are introduced in the control code, written in Matlab, along with the total time and the time step for |𝒓 | 𝜕𝐿 the simulation. In particular, the time step can be selected in the frequency range 1–10 Hz, therefore 1 𝜕𝑉 allowing accelerated simulations up to a factor 10. It is worth noting that, to allow accelerated 𝐵 = (20) |𝒓 | 𝜕𝐿 simulations, the sampling frequency of the ADCS must be compatible with that of the Helmholtz cage, ⎪ 1 𝜕𝑉 as discussed in detail in Section 3.2. Corresponding to each time step, the following cycle is repeated: 𝐵 = ⎩ |𝒓 | 𝜕𝐿 1. the orbital propagator updates the true anomaly and calculates the position r of the satellite inF , where VB is the geomagnetic field scalar potential, reported below, whose parameters are according to Equations (11)–(13); defined in [38]: 2. using a Matlab routine, the longitude (L ), latitude (L ), and altitude (h) of the satellite at any r are o a calculated and the geomagnetic field B is computed from the IGRF model: 𝑉 =𝑅 [𝑔 (𝑡 ) cos(𝑚𝐿 ) +ℎ (𝑡 ) sin(𝑚𝐿 )]𝑃 cos 𝐿 (21) |𝒓 | @V > B B = > i,x jrj @L > a @V B = (20) 3. the value of the current to be provided to each p i,x air of coils of the Helmholtz cage is calculated jrj @L @V > 1 B based on Equation (19); B = i,x jrj @L 4. the power supplies are activated from Matlab script, changing the magnetic field inside the cage, which is measured by the facility magnetometer Bm; Aerospace 2019, 6, 133 9 of 17 where V is the geomagnetic field scalar potential, reported below, whose parameters are defined in [38]: N n X X n+1 m m m V = R [ g (t) cos(mL ) + h (t) sin(mL )]P cos L (21) B E o o a n n n jrj n=1 m=0 3. the value of the current to be provided to each pair of coils of the Helmholtz cage is calculated based on Equation (19); 4. the power supplies are activated from Matlab script, changing the magnetic field inside the cage, which is measured by the facility magnetometer B ; 5. the reading from the magnetometer is sent to the control computer and the error between the desired and the measured value of the magnetic field is calculated,  = B B ; 6. based on , a PID controller implemented in the code estimates the currents I to compensate c_i the error; 7. the loop repeats until the end of the simulation. 3.2. On-Board Magnetometer Configuration and Calibration The ABACUS OBC is equipped with a Honeywell HMR2300 three-axis magnetometer, operating 4 7 in the range1 10 T, with 12-bit measurement accuracy down to 1 10 T and sampling frequency selectable between 10 and 154 Hz [19]. The three-axis magnetometer is a MEMS sensor, and can be therefore a ected by some structural defects, related to the production technology, introducing non-isotropic measurement errors. The goal of the calibration process is to characterize the magnetic sensors, so the satellite can process accurate values for the magnetic field strength and direction, under di erent modes of operation. Calibration is achieved by subjecting the three-axis magnetometer to a known magnetic field B , ref generated by means of the Helmholtz cage, calculating the measurement error and compensating it by least square fitting method. The calibration starts calculating the o set B between the reference magnetic field B and the ref value read by the magnetometer B . Several measurements are repeated rotating the magnetometer about its center of mass. The o set values are stored and processed by ellipsoid fitting and linear least-squares method, which convert them into an ellipsoid representing the distribution in space of the o set. The semi-axes of the ellipsoid, indicated as R , R , and R , can then be collected in the matrix x y z [T], defined as follows: 2 3 6 R 0 0 7 6 7 6 7 6 7 6 7 [T] = 6 0 R 0 7 6 7 6 7 4 5 0 0 R After determining the 3 1 eigenvector v of [T], the compensated value B can be calculated as follows: B = v[T]B v B (22) c ref o At the end of the calibration, the semi-axes calculated by the ellipsoid fitting method should be equal one the other. An example is reported in Figure 5, showing the comparison between the measurements before (red) and after (blue) the calibration of the OBC magnetometer. Aerospace 2019, 6, x FOR PEER REVIEW 9 of 17 5. the reading from the magnetometer is sent to the control computer and the error between the desired and the measured value of the magnetic field is calculated, 𝝐=𝑩 −𝑩 ; 𝒎 𝒊 6. based on 𝝐, a PID controller implemented in the code estimates the currents Ic_i to compensate the error; 7. the loop repeats until the end of the simulation. 3.2. On-Board Magnetometer Configuration and Calibration The ABACUS OBC is equipped with a Honeywell HMR2300 three-axis magnetometer, −4 −7 operating in the range ±1 × 10 T, with 12-bit measurement accuracy down to 1 × 10 T and sampling frequency selectable between 10 and 154 Hz [19]. The three-axis magnetometer is a MEMS sensor, and can be therefore affected by some structural defects, related to the production technology, introducing non-isotropic measurement errors. The goal of the calibration process is to characterize the magnetic sensors, so the satellite can process accurate values for the magnetic field strength and direction, under different modes of operation. Calibration is achieved by subjecting the three-axis magnetometer to a known magnetic field Bref, generated by means of the Helmholtz cage, calculating the measurement error and compensating it by least square fitting method. The calibration starts calculating the offset Bo between the reference magnetic field Bref and the value read by the magnetometer Bm. Several measurements are repeated rotating the magnetometer about its center of mass. The offset values are stored and processed by ellipsoid fitting and linear least-squares method, which convert them into an ellipsoid representing the distribution in space of the offset. The semi-axes of the ellipsoid, indicated as Rx, Ry, and Rz, can then be collected in the matrix [T], defined as follows: 𝑅 00 [ ] 0𝑅 0 𝑇 = 00 𝑅 After determining the 3 × 1 eigenvector v of [T], the compensated value 𝑩 can be calculated as follows: (22) 𝑩 =𝒗 [𝑇 ]𝐁 𝒗 𝐁 𝒄 𝐟𝐫𝐞 𝐨 At the end of the calibration, the semi-axes calculated by the ellipsoid fitting method should be equal one the other. An example is reported in Figure 5, showing the comparison between the Aerospace 2019, 6, 133 10 of 17 measurements before (red) and after (blue) the calibration of the OBC magnetometer. Figure 5. Comparison between measurement by the magnetometer before (red) and after (blue) the Figure 5. Comparison between measurement by the magnetometer before (red) and after (blue) calibration. the calibration. 3.3. Hardware-In-The-Loop Platform Configuration 3.3. Hardware-In-The-Loop Platform Configuration Aerospace The2019 HiL , 6platform , x FOR PEER is RE configur VIEW ed as follows and represented in the block diagram in Figure10 of 6: 17 The HiL platform is configured as follows and represented in the block diagram in Figure 6: Helmholtz cage system, generating B based on the estimates of the orbital propagator running on • Helmholtz cage system, generating Bi based on the estimates of the orbital propagator running the facility control computer; on the facility control computer; on-board three-axis magnetometer (integrated to the OBC), measuring the magnetic field generated • on-board three-axis magnetometer (integrated to the OBC), measuring the magnetic field by the Helmholtz cage; generated by the Helmholtz cage; OBC, on which the control algorithms are implemented, producing the driving current to the • OBC, on which the control algorithms are implemented, producing the driving current to the magnetorquer and the magnetic control torque; magnetorquer and the magnetic control torque; control computer, propagating the orbital motion to calculate B , calculating the disturbance • control computer, propagating the orbital motion to calculate Bi, calculating the disturbance torques, and integrating the attitude dynamics equations to determine the Euler angles and torques, and integrating the attitude dynamics equations to determine the Euler angles and angular rates. angular rates. Figure 6. Block diagram of the Hardware-in-the-loop (HiL) setup. Figure 6. Block diagram of the Hardware-in-the-loop (HiL) setup. Attitude dynamics is simulated using Simulink fixed step ode8 integrator. The integration time Attitude dynamics is simulated using Simulink fixed step ode8 integrator. The integration time for the software is synchronized with that of the HiL simulations, which was selected to be 10 times for the software is synchronized with that of the HiL simulations, which was selected to be 10 times faster than real time. This corresponds to an operating frequency of 10 Hz for the Helmholtz cage, therefore, to avoid loss of information, the sampling frequency of the OBC magnetometer is set to 100 Hz. It is worth noting that, since the attitude motion of the spacecraft is just simulated, the magnetometer will not read values of the geomagnetic field in ℱ , but in ℱ instead. Therefore, the coordinate transformation from Bi to Bb is performed in Simulink, after calculating the Euler angles (φ,θ,ψ) from the integration of system (1) and based on the input (Bi) from the OBC three-axis magnetometer. The measured value of Bb is then processed by the OBC to calculate the magnetic dipole moment required to perform the detumbling and/or B-pointing control, according to Equations (4) and (6). Once determined m, the value of the current is calculated from the inverse of Equation (3) and sent to the power board, which feeds the magnetorquers. To avoid that the magnetic field generated by the magnetorquer interferes with the measurements of the magnetometer, a duty cycle is defined, such that the magnetorquers are activated only for the 90% of the cycle and the remaining 10% is dedicated to the measurements by the magnetometer. Once again, because of the simulated attitude dynamics, the values of the currents are converted to the torque components into the Simulink model, as they are needed to integrate system (1). Aerospace 2019, 6, 133 11 of 17 faster than real time. This corresponds to an operating frequency of 10 Hz for the Helmholtz cage, therefore, to avoid loss of information, the sampling frequency of the OBC magnetometer is set to 100 Hz. It is worth noting that, since the attitude motion of the spacecraft is just simulated, the magnetometer will not read values of the geomagnetic field in F , but in F instead. Therefore, the coordinate transformation from B to B is performed in Simulink, after calculating the Euler i b angles (',, ) from the integration of system (1) and based on the input (B ) from the OBC three-axis magnetometer. The measured value of B is then processed by the OBC to calculate the magnetic dipole moment required to perform the detumbling and/or B-pointing control, according to Equations (4) and (6). Once determined m, the value of the current is calculated from the inverse of Equation (3) and sent to the power board, which feeds the magnetorquers. To avoid that the magnetic field generated by the magnetorquer interferes with the measurements of the magnetometer, a duty cycle is defined, such that the magnetorquers are activated only for the 90% of the cycle and the remaining 10% is dedicated to the measurements by the magnetometer. Once again, because of the simulated attitude dynamics, the values of the currents are converted to the torque components into the Simulink model, as they are needed to integrate system (1). 4. Hardware-In-The-Loop Simulations The detumbling and B-pointing algorithms were tested through HiL simulations, considering the orbital and design parameters for TigriSat, a 3U CubeSat designed and launched by SIA in 2014 and equipped with ABACUS. The characteristic parameters of the disturbance torque were selected to represent realistic worst cases and are indicated, together with the previous ones, in Table 1. Table 1. Orbital parameters and satellite inertial properties for HiL simulations. Orbital Parameters Aerodynamic Properties h [km] 600 C 2.2 i [deg] 97.79 l [m] 1 10 e 0 l [m] 3.3 10 W [deg] 45 l [m] 3.3 10 Inertial Properties Residual Dipole Moment m [kg] 4 jm j [Am ] 0.1 2 3 2 2 J [kgm ] 6.5 10 m [Am ] 9.13 10 x m,x 2 2 2 2 J [kgm ] 4.09 10 m [Am ] 6.32 10 y m,y 2 2 2 3 J [kgm ] 4.09 10 m [Am ] 9.80 10 z m,z Geometric Properties Magnetorquers Properties 2 2 A [m ] 1 10 N 400 2 2 2 3 A [m ] 3.3 10 A [m ] 9.03 10 max 2 2 3 A [m ] 3.3 10 I [A] 8.3 10 The results of three Test Cases (TC) are presented and discussed. In TC1 the detumbling control is verified setting to zero the gain for the pointing control, and assuming the initial angular rates at the deployment reported in Table 2. The detumbling is simulated for a total time corresponding to 1.5 orbital periods and the satellite state (position, velocities and angular rates) at the end of the detumbling phase is assumed as the initial condition for TC2 and TC3, in which pointing control is tested for two di erent values of the target attitude. The simulation parameters are collected in Table 2. Aerospace 2019, 6, 133 12 of 17 Aerospace 2019, 6, x FOR PEER REVIEW 12 of 17 Table 2. Simulation parameters for the three Test Cases (TC). Parameter TC1 TC2 TC3 ', , [deg] 0, 0, 0 175.3,1.4, 51.7 175.3,1.4, 51.7 ! [deg/sec] [5 33] [8.5 4.1 4.2]/100 [8.5 4.1 4.2]/100 K 1000 300 500 K 0 25 30 p p rˆ [1 0 0] [0 0.5 2 0.5 2] The time behavior of the angular rates is reported in Figure 7, showing the e ectiveness of the control law (4) in producing the desired decrease of the angular rates along all the three directions. The mean value of the angular rates in the last 300 s (5%) of the detumbling phase is equal to Aerospace 2019, 6, x FOR PEER REVIEW 12 of 17 ! = [ 0.085 0.041 0.042 ] deg/ sec . Figure 7. Angular rates for the Test Case 1. Figures 8 and 9 show the behavior in time of the Euler angles for TC2 and TC3. The HiL simulations are performed for a total of 6.5 orbital periods, considering for the initial conditions the final state corresponding to TC1. It can be noticed that for both the test cases, the Euler angles settle about the target value (see 𝑟 ̂ in Table 2). The minimum, maximum, and mean error corresponding over the last orbital period are reported in Table 3. It is worth noting that the minimum error here represents the negative error with maximum absolute value. Table 3. Pointing error Test Cases (TC). Error TC2 TC3 Δ𝜑 [deg] 0.02 −3.25 Δ𝜑 [deg] 16.67 0.15 Figure 7. Angular rates for the Test Case 1. Figure 7. Angular rates for the Test Case 1. Δ𝜑 [deg] 4.76 −1.95 Δ𝜃 [deg] −13.26 −7.68 Figures 8 and 9 show the behavior in time of the Euler angles for TC2 and TC3. The HiL simulations Figures 8 and 9 show the behavior in time of the Euler angles for TC2 and TC3. The HiL Δ𝜃 [deg] 8.92 8.07 are performed for a total of 6.5 orbital periods, considering for the initial conditions the final state simulations are performed for a tota Δ𝜃 l of 6.5 orb [deg] it al pe −2.03 riods 0.02 , consid ering for the initial conditions the corresponding to TC1. It can be noticed that for both the test cases, the Euler angles settle about the Δ𝜓 [deg] −15.73 −8.06 final state corresponding to TC1. It can be noticed that for both the test cases, the Euler angles settle target value (see r in Table 2). The minimum, maximum, and mean error corresponding over the last Δ𝜓 [deg] 7.28 7.68 about the target value (see 𝑟 ̂ in Table 2). The minimum, maximum, and mean error corresponding orbital period are reported in Table 3. It is worth noting that the minimum error here represents the Δ𝜓 [deg] −2.29 0.01 over the last orbital period are reported in Table 3. It is worth noting that the minimum error here negative error with maximum absolute value. represents the negative error with maximum absolute value. Table 3. Pointing error Test Cases (TC). Error TC2 TC3 Δ𝜑 [deg] 0.02 −3.25 Δ𝜑 [deg] 16.67 0.15 Δ𝜑 [deg] 4.76 −1.95 Δ𝜃 [deg] −13.26 −7.68 Δ𝜃 [deg] 8.92 8.07 Δ𝜃 [deg] −2.03 0.02 Δ𝜓 [deg] −15.73 −8.06 Δ𝜓 [deg] 7.28 7.68 Δ𝜓 [deg] −2.29 0.01 Figure 8. Euler angles for the Test Case 2, rˆ = [1 0 0]. Figure 8. Euler angles for the Test Case 2, 𝑟 ̂ = [1 0 0]. [ ] Figure 8. Euler angles for the Test Case 2, 𝑟 ̂ = 1 0 0 . Aerospace 2019, 6, x FOR PEER REVIEW 13 of 17 Aerospace 2019, 6, 133 13 of 17 p p Figure 9. Euler angles for the Test Case 3, r = [0 0.5 2 0.5 2]. Figure 9. Euler angles for the Test Case 3, 𝑟 ̂ = 0 0.5 √2 0.5√2. Table 3. Pointing error Test Cases (TC). The values reported in Table 3 indicate that, despite the presence of perturbation torque, Error TC2 TC3 pointing control (6) is effective within an accuracy of, approximately ±10 deg on average and ±20 deg D' [deg] 0.02 3.25 min considering the maximum values. In particular, TC2 seems to be more challenging than TC3. In fact, D' [deg] 16.67 0.15 max [ ] D' [deg] 4.76 1.95 for 𝑟 ̂ = 1 0 0 the system will drive the sate mean llite if the magnetic field measured along 𝑦 and 𝑧 ̂ is not null, or equivalently if the component measured along 𝑥 is equal to the magnitude of the D [deg] 13.26 7.68 min D [deg] 8.92 8.07 magnetic field. Clearly, any component mea max sured at time t can never exceed the magnitude of the D [deg] 2.03 0.02 mean magnetic field |𝑩 (𝒕 )|, then the control shows aperiodic behavior, limiting its accuracy. Differently, when the magnitude of the magne D tic field [deg]is “sha red” by 15.73 two or more components, such as 8.06 𝑟 ̂ = min D [deg] 7.28 7.68 max 0 0.5 2 0.5 2, then the component measured along the directions 𝑦 and 𝑧 ̂ can, at different √ √ D [deg] 2.29 0.01 mean ( ) times, exceed the target value 0.5√2 |𝑩 𝒕 | and the behavior of the control is oscillatory about the target value. This can be proved by observing that the maximum and minimum error for TC3 are The values reported in Table 3 indicate that, despite the presence of perturbation torque, pointing (almost) equally distributed about the mean value. This is not the case for TC2, in which the control (6) is e ective within an accuracy of, approximately10 deg on average and20 deg considering maximum value is much larger in magnitude than the minimum one. the maximum values. In particular, TC2 seems to be more challenging than TC3. In fact, for rˆ = [1 0 0] It is worth noting that the maximum error on the Euler angles is measured when the satellite the system will drive the satellite if the magnetic field measured along yˆ and zˆ is not null, or crosses the poles. In this region the direction of the geomagnetic field vector changes suddenly and b b equivalently if the component measured along xˆ is equal to the magnitude of the magnetic field. in particular Bi points towards the North magnetic pole when the latitude is slightly lower than 90 Clearly, any component measured at time t can never exceed the magnitude of the magnetic field deg and outwards from the pole when the latitude is higher than 90 deg (similarly in the B (t) , then the control shows aperiodic behavior, limiting its accuracy. Di erently, when the neighborhood of the South pole). According to Equation (6), a marked variation of the direction of Bi p p produces magnitude a hi ofgh tor the magnetic que onto field the s is ate “shar llite, ed” incr by eatwo sing it ors mor angu e la components, r rates, there such fore as lon rˆg= er t[0 ime is 0.5 2 re0.5 quire 2d], to damp the angular oscillations and reduce their am ˆ plitude a ˆ bout the target attitude. then the component measured along the directions y and z can, at di erent times, exceed the target b b valueFig 0.5 ures 2 1B0 a(tn)d 11 andshow t the behavior he angof ula the r ra contr tes for TC ol is oscillatory 2 and TC3. It c aboutathe n btar e noticed get value. thaThis t when canth be e pointing phase starts, the angular rates increase, with higher intensity on the axes which are proved by observing that the maximum and minimum error for TC3 are (almost) equally distributed control about the led mean to the t value. arget a This ttitud is e not (i.e the ., 𝑥 case for for TC TC2, 2 and in 𝑦 which and the 𝑧 ̂ maximum for TC3). This value is a consequen is much larger ce o in f the control torque arising from mp. magnitude than the minimum one. It is worth noting that the maximum error on the Euler angles is measured when the satellite crosses the poles. In this region the direction of the geomagnetic field vector changes suddenly and in particular B points towards the North magnetic pole when the latitude is slightly lower than 90 deg and outwards from the pole when the latitude is higher than 90 deg (similarly in the neighborhood of the South pole). According to Equation (6), a marked variation of the direction of Bi produces a high torque onto the satellite, increasing its angular rates, therefore longer time is required to damp the angular oscillations and reduce their amplitude about the target attitude. Figures 10 and 11 show the angular rates for TC2 and TC3. It can be noticed that when the pointing phase starts, the angular rates increase, with higher intensity on the axes which are controlled Aerospace 2019, 6, 133 14 of 17 Aerospace 2019, 6, x FOR PEER REVIEW 14 of 17 to the target attitude (i.e., xˆ for TC2 and yˆ and zˆ for TC3). This is a consequence of the control torque b b b Aerospace 2019, 6, x FOR PEER REVIEW 14 of 17 arising from m . [ ] Figure 10. Angular rates for the Test Case 2, 𝑟 ̂ = 1 0 0 . Figure 10. Angular rates for the Test Case 2, rˆ = [1 0 0]. [ ] Figure 10. Angular rates for the Test Case 2, 𝑟 ̂ = 1 0 0 . p p Figure 11. Angular rates for the Test Case 3, rˆ = [0 0.5 2 0.5 2]. Figure 11. Angular rates for the Test Case 3, 𝑟 ̂ = 0 0.5 2 0.5 2. . √ √ 5. Discussion Figure 11. Angular rates for the Test Case 3, 𝑟 ̂ = 0 0.5 2 0.5 2. √ √ 5. Disc Inussion this section, some relevant features of the attitude control system, inferred from the HiL simulations, are briefly outlined: 5. Disc In t ussion his se ction, some relevant features of the attitude control system, inferred from the HiL the system can produce e ective detumbling and stabilization during the pointing phase; simulations, are briefly outlined: In this section, some relevant features of the attitude control system, inferred from the HiL the pointing accuracy of the system, though coarse, is acceptable for a backup mode of operations, • simu the lations, system c are br an produce iefly outlined: effective detumbling and stabilization during the pointing phase; and considering the lack of attitude information or sophisticate filtering methods (i.e., Extended • the pointing accuracy of the system, though coarse, is acceptable for a backup mode of • Kalman the system c Filter); an produce effective detumbling and stabilization during the pointing phase; operations, and considering the lack of attitude information or sophisticate filtering methods • the pointing accuracy of the system, though coarse, is acceptable for a backup mode of the achievement of some target attitude rˆ can be more challenging, or equivalently less accurate, (i.e., Extended Kalman Filter); operations, and considering the lack of attitude information or sophisticate filtering methods this is in particular the case for rˆ = [1 0 0]; • the achievement of some target attitude 𝑟 ̂ can be more challenging, or equivalently less (i.e., Extended Kalman Filter); the system is robust with respect to the noise of the calibrated magnetometer (1 10 T) and accurate, this is in particular the case for 𝑟 ̂ = [1 0 0]; • the achievement of some target attitude 𝑟 ̂ can be more challenging, or equivalently less the perturbation induced by residual dipole moment, gravity gradient and aerodynamic torques. −6 • the system is robust with respect to the noise of the calibrated magnetometer (±1 × 10 T) and accurate, this is in particular the case for 𝑟 ̂ = [1 0 0]; the perturbation induced by residual dipole moment, gravity gradient and aerodynamic −6 6. Conclusions • the system is robust with respect to the noise of the calibrated magnetometer (±1 × 10 T) and torques. the perturbation induced by residual dipole moment, gravity gradient and aerodynamic The implementation of a control strategy based on the only measurements data from a MEMS torques. three-axis magnetometer was presented. The strategy allows detumbling and pointing with respect 6. Conclusions 6. Con The impleme clusions ntation of a control strategy based on the only measurements data from a MEMS three-axis magnetometer was presented. The strategy allows detumbling and pointing with respect The implementation of a control strategy based on the only measurements data from a MEMS three-axis magnetometer was presented. The strategy allows detumbling and pointing with respect Aerospace 2019, 6, 133 15 of 17 to the geomagnetic field vector, it is tailored for CubeSat applications, requires limited power and is meant to be used as a backup solution, in case of failure of the attitude determination device. Hardware-in-the-loop simulations are performed to validate the strategy and its implementation on a real CubeSat OBC and a flight proven three-axis magnetometer. The satellite attitude dynamics is simulated, including the perturbation e ects of the residual dipole moment, gravity gradient, and aerodynamic torques. Experimental testing showed that the three-axis detumbling allows reducing the angular rates below 0.1 deg/sec, while the pointing strategy allows achieving the target attitude with an error below 20 deg. In particular, the pointing error increases significantly in the proximity of the magnetic poles, due to the rapid change in the direction of the geomagnetic field vector. This result indicates that the design of a pointing control mitigating this e ect would be worth the implementation, and this will be a field of research for the near future. Further applications of the Hardware-in-the-loop setup are envisioned for the development of the ADCS system designed for the 3U Astro Bio CubeSat (ABCS) and the 6P PocketQube Space Travelling Egg Controlled Catadioptric Object (STECCO) currently developed at the School of Aerospace Engineering. These will include the implementation of a spherical air bearing to simulate microgravity attitude motion of the satellite and testing of magnetometer-only attitude control algorithms. Author Contributions: Conceptualization and methodology, M.S.F., S.C., A.N., and P.T.; software, M.S.F.; validation, M.S.F. and S.C.; formal analysis, S.C.; investigation, M.S.F. and S.C.; data curation, M.S.F. and S.C.; writing—original draft preparation, S.C.; writing—review and editing, M.S.F., A.N., and P.T.; supervision, A.N. and P.T.; project administration, P.T.” Funding: This research received no external funding. Conflicts of Interest: The authors declare no conflict of interest. References 1. Swantwout, M. The First One Hundred CubeSats: A Statistical Look. J. Small Satel. 2013, 2, 213–233. 2. Wenschel, L.; Brown, J.; Toorian, A.; Coelbo, R.; Puig-Suari, J.; Twiggs, R. CubeSat Development in Education and into Industry. In Proceedings of the AIAA Space 2006 Conference, San Jose, CA, USA, 19 September 3. Langer, M.; Bouwmeester, J. Reliability of CubeSats–Statistical Data, Developers’ Beliefs and the Way Forward. In Proceedings of the AIAA/USU Conference on Small Satellites, SSC16-X-2, Logan, UT, USA, 6–11 August 4. Shou, H.-N. Microsatellite Attitude Determination and Control Subsystem Design and Implementation: Software-in-the-Loop Approach. In Proceedings of the 2014 International Symposium on Computer, Consumer and Control, Taichung, Taiwan, 10–12 June 2014. 5. Stesina, F.; Corpino, S.; Feruglio, L. An In-The-Loop Simulator for the Verification of Small Space Platforms. Int. Rev. Aerosp. Eng. 2017, 10, 50–60. [CrossRef] 6. Wegner, S.; Majd, E.; Taylor, L.; Thomas, R.; Egziabher, D.G. Methodology for Software-in-the-Loop Testing of Low-Cost Attitude Determination Systems, SSC17-WK-09. Available online: https://digitalcommons.usu. edu/smallsat/2017/all2017/5/ (accessed on 30 November 2019). 7. Klesh, A.; Seagraves, S.; Bennet, M.; Boone, D.; Cutler, J.; Bahcivan, H. Dynamically driven Helmholtz cage for experimental magnetic attitude determination. Adv. Astronaut. Sci. 2010, 135, 147–160. 8. Quadrino, M.K.S. Testing the Attitude Determination and Control of a CubeSat with Hardware-in-the-Loop. Master ’s Thesis, Department of Aeronautics and Astronautics, Massachusetts Institute of Technology, Cambridge, MA, USA, 2014. 9. Poppenk, F.M.; Amini, R.; Brouwer, G.F. Design and application of Helmholtz cage for testing nano-satellites. In Proceedings of the 6th International Symposium on Environmental Testing for Space Programmes, ESA Communication Production Oce, Noordwijk, The Netherlands, 12–14 June 2007. Aerospace 2019, 6, 133 16 of 17 10. Delabie, T.; Vandoren, B.; De Munter, W.; Raskin, G.; Vandenbussche, B.; Vandepitte, D. Testing and calibrating an advanced cubesat attitude determination and control system. In Proceedings of the Volume 10698, Space Telescopes and Instrumentation 2018: Optical, Infrared, and Millimeter Wave, SPIE Astronomical Telescopes and Instrumentation, Austin, TX, USA, 10–15 June 2018. 11. Gavrilovich, I.; Krut, S.; Gouttefarde, M.; Pierrot, F.; Dusseau, L. Test Bench for Nanosatellite Attitude Determination and Control System Ground Tests. In Proceedings of the 4S Symposium, Small Satellites Systems and Services 2014, Petro, Spain, 4–8 June 2014. 12. Schwartz, J.L.; Peck, M.A.; Halt, C.D. Historical Review of Air-Bearing Spacecraft Simulators. J. Guid. Control Dyn. 2003, 26, 513–522. [CrossRef] 13. Chesi, S.; Perez, O.; Romano, M. A Dynamic, Hardware-in-the-Loop, Three-Axis Simulator of Spacecraft Attitude Maneuvering with Nanosatellite Dimensions. J. Small Satell. 2015, 4, 315–328. 14. Kuyyakanont, A.; Kuntanapreeda, S.; Fuengwarodsakul, H. On verifying magnetic dipole moment of a magnetic torquer by experiments. In Proceedings of the IOP Conference Series: Materials Science and Engineering, Krasnoyarsk, Russia, 8 November 2018; Volume 297. 15. Lee, D.Y.; Park, H.; Romano, M.; Cutler, J. Development and Experimental Validation of a Multi-Algorithmic Hybrid Attitude Determination and Control System for a Small Satellite. Aerosp. Sci. Technol. 2018, 78, 494–509. [CrossRef] 16. Ousaloo, H.S.; Nodeh, M.T.; Mehrabian, R. Verification of Spin Magnetic Attitude Control System using air-bearing-based attitude control simulator. Acta Astronaut. 2016, 126, 546–553. [CrossRef] 17. Sternberg, D.C.; Pong, C.; Filipe, N.; Mohan, S.; Johnson, S.; Wilson, L.J. Jet Propulsion Laboratory Small Satellite Dynamics Testbed Simulation: On-Orbit Performance Model Validation. J. Spacecr. Rocket. 2018, 55, 322–334. [CrossRef] 18. Tapsawat, W.; Sangpet, T.; Kuntanapreeda, S. Development of a hardware-in-loop attitude control simulator for a CubeSat satellite. In Proceedings of the IOP Conference Series: Materials Science and Engineering, Krasnoyarsk, Krasnoyarsk, Russia, 8 November 2018; Volume 297. 19. Nascetti, A.; Pancorbo-D’Ammando, D.; Truglio, M. Abacus advanced board for active control of university satellites. In Proceedings of the 2nd IAA Conference on University Satellite Missions and Cubesat Workshop, International Academy of Astronautics, Roma, Italy, 3–9 February 2013. 20. Wertz, J.R. (Ed.) Spacecraft Attitude Determination and Control, 3rd ed.; Kluwer Academic Publisher: Dordrecht, The Netherlands, 1978. 21. de Ruiter, A.H.; Damaren, C.; Forbes, J.R. Spacecraft Dynamics and Control: An Introduction, 1st ed.; John Wiley & Sons. Ltd.: Chichester, UK, 2013. 22. Teofilatto, P.; Testani, P.; Celani, F.; Nascetti, A.; Truglio, M. A nadir-pointing magnetic attitude control system for TigriSat nanosatellite. In Proceedings of the International Astronautical Congress 2013, Beijing, China, 23–27 September 2013; Volume 6, pp. 4818–4829. 23. Natanson, G.A.; McLaughlin, S.F.; Nicklas, R.C. A method of determining attitude from magnetometer data only. In Proceedings of the NASA Goddard Space Flight Center, Flight Mechanics/Estimation Theory Symposium, Silver Spring, MD, USA, 1 December 1990; pp. 359–380. 24. Natanson, G.A.; Challa, J.; Deutschmann, J.; Baker, D.F. Magnetometer only attitude and rate determination for a gyro-less spacecraft. In Proceedings of the Third International Symposium on Space Mission Operations and Ground Data Systems, Greenbelt, MD, USA, 1 November 1994; pp. 791–798. 25. Ma, H.; Xu, S. Magnetomter-only attitude and angular velocity filtering estimation for attitude changing spacecraft. Acta Astronaut. 2014, 102, 89–102. [CrossRef] 26. Psiaki, M.L. Global Magnetomter-Based Spacecraft Attitude and Rate Estimation. J. Guid. Control Dyn. 2004, 27, 240–250. [CrossRef] 27. Hart, C. Satellite Attitude Determination Using Magnetometer Data Only. In Proceedings of the AIAA Aerospace Science Meeting Including the New Horizons Forum and Aerospace Exposition, Orlando, FL, USA, 5–9 January 2009. 28. Sugimura, N.; Kuwahara, T.; Yoshida, K. Attitude Determination and Control System for Nadir Pointing Using Magnetorquer and Magnetometer. In Proceedings of the 2016 IEEE Aerospace Conference, Big Sky, MT, USA, 5–12 March 2016. Aerospace 2019, 6, 133 17 of 17 29. Ma, G.F.; Jiang, X.Y. Unscented Kalman filter for spacecraft attitude estimation and calibration using magnetometer measurements. In Proceedings of the 2005 International Conference on Machine Learning and Cybernetics, Guangzhou, China, 18–21 August 2015. 30. Searcy, J.D.; Pernicka, H.J. Magnetometer-Only Attitude Determination Using Novel Two-Step Kalman Filter Approach. J. Guid. Control Dyn. 2012, 35, 1639–1701. [CrossRef] 31. Carletta, S.; Teofilatto, P. Design and Numerical Validation of an Algorithm for the Detumbling and Angular Rate Determination of a CubeSat Using Only Three-Axis Magnetometer Data. Int. J. Aerosp. Eng. 2018. [CrossRef] 32. Lassakeur, A.; Underwood, C.; Taylor, B. Enhanced Attitude Stability and Control for CubeSats by Real-Time On-Orbit Determination of Their Dynamic Magnetic Moment. In Proceedings of the 69th International Astronautical Congress, Bremen, Germany, 1–5 October 2018. 33. Springmann, J.C.; Cutler, J.W. Magnetic Sensor Calibration and Residual Dipole Characterization for Application to Nanosatellites. In Proceedings of the AIAA/AAS Astrodynamics Specialist Conference, Toronto, OT, Canada, 2–5 August 2010. AIAA-20110-7518. 34. Armstrong, J.; Casey, C.; Creamer, G.; Dutchover, G. Pointing Control for Low Altitude Triple CubeSat Space Darts. In Proceedings of the 23rd Annual AIAA/USU Conference on Small Satellites, Logan, UT, USA, 10–13 August 2009. 35. NASA SP-8058, Spacecraft Aerodynamic Torques; NASA: Washington, DC, USA, January 1971. 36. Picone, J.M.; Hedin, A.E.; Drob, D.P.; Aikin, A.C. NRLMSISE-00 empirical model of the atmosphere: Statistical comparisons and scientific issues. J. Geophys. Res. Space Phys. 2002, 107, A12. [CrossRef] 37. Reynerson, C. Aerodynamic Disturbance Force and Torque Estimation for Spacecraft and Simple Shapes Using Finite Plate Elements—Part I: Drag Coecient. Adv. Spacecr. Technol. 2011, 128. [CrossRef] 38. Thébault, E.; Finlay, C.C.; Beggan, C.D.; Alken, P.; Aubert, J.; Barrois, O.; Bertrand, F.; Bondar, T.; Boness, A.; Brocco, L.; et al. International Geomagnetic Reference Field: The 12th generation. EarthPlanets Space 2015, 67. [CrossRef] © 2019 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

Journal

AerospaceMultidisciplinary Digital Publishing Institute

Published: Dec 11, 2019

References