Parameters required for calculation of the orbital dynamics.
The attitude determination and control system (ADCS) for spacecraft is responsible for determining its orientation using sensor measurements and then applying actuation forces to change the orientation. This chapter details the different components required for a complete attitude determination and control system for satellites moving in elliptical orbits. Specifically, the chapter details the orbital mechanics; perturbations; controller design; actuation methods such as thrusters, reaction wheels, and magnetic torquers; actuation modulation methods such as bang-bang, pulse-width modulation, and pulse-width pulse-frequency; as well as attitude determination using vector measurements combined with mathematical models. In sum, the work describes in a tutorial manner how to put everything together to enable the design of a complete satellite simulator.
- attitude control
- attitude estimation
- reaction wheels
- magnetic torquers
- elliptical orbits
- Madgwick filter
- Sun vector model
- magnetic field model
- sliding surface control
- angular velocity
The problem of developing attitude determination and control systems (ADCS) has received much attention in the last century with general books such as [1, 2, 3, 4], as well as description of individual ADCS designs for different satellites in works such as [5, 6, 7, 8]. While Refs. [1, 2] can be considered excellent foundation books within the topic of spacecraft modeling and control, there is a need for a more concise presentation of the attitude control problem and how this can be modeled in a simple manner, both not only as a tutorial for new researchers but also to give insight into the different components required for ADCS design drawing on ideas and results from previous works as mentioned above.
This chapter is an extension of  and builds on much of the previous work, as well as the research done through the HiNCube project as presented in [10, 11, 12]. This work considers the problem of designing a complete ADCS system comprising all the required components. Figure 1 shows the control structure and the required signal paths, giving an overview of the contents in this chapter, as each block is described in detail to put the reader in position to design their own ADCS system. The required sensors for this system are a magnetometer to measure the Earth’s magnetic field, a gyro to measure the angular velocity of the satellite, as well as Sun sensors for measuring the direction toward the Sun. Further, the mathematical models used together with sensor measurements to determine the attitude of the satellite requires a real-time clock, as the time and date are required to know the direction toward the Sun as well as what the magnetic field looks like at a given day and time. Comparing the sensor measurements with the mathematical models allows for the determination of the attitude of the satellite, something that is done using the Madgwick filter as presented in . With an estimated attitude obtained using the Madgwick filter, the attitude can be controlled to point a sensor onboard the satellite in a desired direction, something that is solved in this chapter using a PD+ attitude controller, calculating the desired torques required in order to make the attitude and angular velocity errors go to zero. In order to create the desired moments, this chapter presents how this can be achieved using a number of different actuators, namely, magnetic torquers, reaction wheels, and thrusters. The orbital mechanics block describes how the satellite moves in its elliptical orbit, while the perturbing forces and moments block describe how the different perturbations affect the satellite. Simulations show the performance of the different methods and should put the reader in a position to simulate and design new attitude determination and control systems for satellites in elliptical orbits.
2. Mathematical modeling
This subsection is similar to the author’s previous works, e.g., [9, 14]. Let denote the time derivative of a vector, while the Euclidean length is defined as . Superscript denotes frame of reference for a given vector. The rotation matrix is denoted , which rotates a vector from frame to frame and where denotes the identity matrix. The inverse rotation is found by taking its transpose, such that . The angular velocity of frame relative to frame referenced in frame is denoted , and angular velocities can be added together as (cf. ). The derivative of the rotation matrix is defined as where denotes the cross product operator, which is defined such that for two vectors , , , , and .
Quaternions can be used to parameterize the rotation matrix, where denotes the quaternion representing a rotation from frame to frame through the angle of rotation around the axis of rotation . The inverse quaternion is defined as , also sometimes denoted as . A quaternion comprises a scalar and a vector part, where denotes the scalar part, while denotes the vector part. This allows the rotation matrix to be constructed using quaternions as . Composite quaternions can be found through quaternion multiplication as with
The use of the quaternion product ensures that the resulting quaternion maintains the unit length property. The quaternion kinematics is defined as
For attitude control, several different frames are needed:
Inertial: The Earth-centered inertial (ECI) has its origin in the center of the Earth, where the axis points toward the vernal equinox and the points through the North Pole, while completes the right-handed orthonormal frame. The inertial frame is denoted by .
Orbit: The orbit frame has its origin in the center of mass of the satellite (cf. , p. 479). The axis coincides with the radius vector , which goes from the center of the Earth to the center of mass in the satellite. The axis is parallel to the orbital angular momentum vector, pointing in the normal direction of the orbit. The completes the right-handed orthonormal frame where the vectors can be described as , , and where . The orbit frame is denoted by .
Body: The body frame has its origin in the center of mass of the satellite, where its axes coincide with the principal axes of inertia. The body frame is denoted by .
Desired: The desired frame can be defined arbitrarily to achieve any given objective (cf. ). The desired frame is denoted by .
2.2. Orbital mechanics
This section describes how the orbit frame can be related to the inertial frame through the six classical orbital parameters, and for more details, the reader is referred to . Specifically, the objective with this subsection is to find the radius, velocity, and acceleration vector of the orbit, as well as its angular velocity and acceleration. From well-known orbital mechanics, the six classical parameters can be defined as the semimajor axis , the eccentricity , the inclination , the right ascension of the ascending node , the argument of the perigee , and the mean anomaly . The distance to the apogee and perigee from the center of the Earth can be defined, respectively, as and , allowing the semimajor axis to be found as and the eccentricity of the orbit as , while the mean motion can be found from . Here, , where is the gravitational constant, while is the mass of the Earth. With knowledge of the mean motion, the mean anomaly can be found as where is the eccentric anomaly, is the time, and is the time when passing the perigee. To properly describe where in the orbit the satellite is located, the true anomaly can be found as , while its derivative can be found as (, p. 42). When running a simulation, it is desirable to have a continuously increasing true anomaly, while the direct method will map the angle between and . Instead, by integrating the derivative overtime, a smooth true anomaly can be found that increases continuously. The eccentric anomaly, however, cannot be found analytically, but can be found through an iterative algorithm as described in (, p. 26) , where is the iteration number. This algorithm is valid as long as , which holds for elliptical orbits. From these calculations, the rotation matrix from inertial frame to orbit frame can now be constructed as
The radius, velocity, and acceleration vector can be defined in the orbit frame, respectively, as (, pp. 26–27)
where is the length of the radius vector. Each of these vectors can be rotated to the inertial frame using Eq. (3), such that , , and . The angular velocity of the orbit frame relative to the inertial frame can be found as , while the angular acceleration can be found through differentiation as
In order to implement the orbital mechanics in, e.g., a Simulink framework, the required input to the subsystem would be the time (). Further, the orbital parameters must be defined as given in Table 1 and can be changed depending on the orbit. These constants allow for the calculations of the eccentricity (), the semimajor axis (), and mean motion (). With the mean motion, the mean anomaly () can be found and used to approximate the eccentric anomaly () using the iterative algorithm presented above. The rate of change of the true anomaly () can also be found and by integration enables the calculation of true anomaly (). All these values allow for calculating the rotation matrix from the orbit frame to the inertial frame (), the radius vector (), the velocity vector (), the acceleration vector (), angular velocity (), and angular acceleration vector (). Hence, all the outputs from this subsystem can easily be found following this procedure and will be used in several other subsystems.
3. Attitude dynamics and control
3.1. Attitude dynamics
The attitude dynamics can be derived with the basis in Euler’s moment Equation (, p. 95). The angular momentum of a rigid body in the body frame is given as
where is the inertia matrix, while is the angular velocity of the body frame relative to the inertial frame. The angular momentum can be found in the inertial frame as
The rate of change of angular momentum is equal to the total torque, such that . Hence, by differentiating Eq. (9), it is obtained that
which can be written in the body frame by using Eq. (8) as , where the inertia matrix is assumed to be constant. Decomposing the total torque into an actuation component and a perturbing component, , allows the rotational dynamics to be written as
where denotes the actuation torques (e.g., output from reaction wheels), while denotes the perturbing torques (e.g., gravity torque). Further, by using quaternion representation, the update law for the quaternion representing the attitude of the body frame relative to the inertial frame can be written as
Hence, Eqs. (11) and (12) serve as governing equations describing the attitude and angular velocity of the satellite. The inputs that affect these values are the perturbation and actuation torques, where the latter will be found in the following sections.
3.2. Error dynamics
From Euler’s moment equation, the angular acceleration is defined relative to the inertial frame. For attitude control, it is often more interesting controlling the attitude and angular velocity relative to the orbit frame. For that reason, the angular velocity of the body frame relative to the orbit frame can be found as , which can be differentiated as
giving a description of the attitude dynamics relative to the orbit frame. It is also possible to find the error dynamics, to enable tracking of a desired attitude and angular velocity. Let denote a desired quaternion, angular velocity, and acceleration; then, the quaternion and angular velocity error can be found as
with the kinematics as
The angular acceleration error can be found by differentiating Eq. (15) as
Hence, the control objective can be defined as that of making , which will make the satellite point in a desired direction and move with a desired angular velocity.
3.3. PD+ attitude controller
Takegaki and Arimoto  proposed in a simple method for position control of robots, something that was extended by  to enable trajectory tracking. The so-called PD+ controller has been applied for spacecraft by [21, 22] showing good results. The author has applied this method in previous works such as [23, 24].
A PD+ attitude control law can now be chosen as
where is another positive scalar gain and denotes the desired torque required to make the attitude and angular velocity errors go to zero. Assuming no actuator dynamics, i.e., , and then by inserting Eq. (20) into Eq. (19), it is obtained that , which is negative semidefinite. By applying the Matrosov theorem (cf. ), it can be shown that the origin () = () is uniformly asymptotically stable.
The inputs to the control law (Eq. 20) are the desired states , , and , which are to be defined by the reader, e.g., as part as a guidance block depending on the mission objective. The inertia matrix () is assumed to be known, while the angular velocity vector between the body frame and orbit frame () can be found as described above. The other angular velocities are found from the orbital mechanics, while the rotation matrices are found as composite rotations, e.g., , or by using the relationship between the quaternions and rotation matrices directly (cf. Section 2A). The error quaternion and angular velocity are found from Eqs. (14) and (15), while the perturbing torques will be described in the following section.
4. Perturbing torques
There are different kinds of perturbing torques, such as gravity torque, aerodynamic torque, magnetic field due to the electronics inside the satellite, as well as solar radiation torque. This section only considers the gravity torque. In , p. 147, the gravity torque is defined as
where the terms have previously been defined. As can be seen from this equation, non-diagonal inertia matrices will induce gravitational torques to align the satellite with the gravity field. This is also sometimes used for passive control, using e.g., a gravity boom to ensure that one side of the satellite is always facing the Earth. For this chapter, the perturbing toque is set equal to the gravity torque such that .
The control signal must be mapped to an actuator that must generate the desired torque. With limitations in actuation, the saturation must be modeled in order to obtain realistic results when simulating attitude control. This section considers three types of actuators commonly used for spacecraft attitude control: magnetic torquers, reaction wheels, and thrusters.
5.1. Magnetic torquers
Magnetic torquers operate by creating a local magnetic field that interacts with the Earth’s magnetic field. In simple terms, magnetic torques can be explained as that of a compass needle. By applying current through a coil, a local magnetic field is created, which will try to align itself with the Earth’s magnetic field. This allows the attitude of a spacecraft to be changed and is a very popular approach for small satellites, e.g., cubesats. One of the drawbacks or challenges with magnetic actuation lies in the fact that the Earth’s magnetic field goes from the North Pole to the South Pole as shown in Figure 2.1 As can be seen, when the satellite crosses the North Pole, there will be mainly a downward magnetic field component, reducing the possibility of actuation to only two axes, and similarly along the equator. This subsection is based on  and will describe how to model magnetic torquers and how it can be applied for attitude control. A magnetic torquer produces a magnetic torque by applying a current through a coil, which can be expressed as .
where is the induced magnetic field, is the number of turns of the coils, is the current around a given axis, and is the area of the coils. The Earth’s magnetic field is represented through the vector , meaning that to use magnetic actuation for attitude control, a good model of the Earth’s magnetic field is needed.
From a control point of view, the physical parameters and are defined when the spacecraft is designed, such that the controller needs to dictate which currents that must be sent to the torquers in order to get a desired torque. This means that Eq. (22) must be inverted with regard to , which is not straightforward due to the cross product, meaning that you obtain rank when inverting the right-hand side, losing information about one of the axes. To that end, an approximation to inverting this equation is given in .
enabling the currents to be found as
It is here assumed that all three torquers are identical, but depending on satellite configuration, there might be differences in the number of turns and areas. Hence, the desired torque can be used to find the magnetic moment in Eq. (23) and solved for the currents and applied resulting in the actuation torque in Eq. (22). Hence, the control law (Eq. 20) can be mapped to a desired magnetic moment (Eq. 23), which then can be used to find the desired current to each of the three coils. Then, the limits in current will dictate the maximum magnetic moment that can be generated.
Consider the HiNCube satellite as shown in Figure 3. The cubesat comprises three orthonormal magnetic torquers with an area mand with a maximum current of 47.27 mA and turns. This gives a maximum magnetic moment of mA. Hence, an implementation of using magnetic torquers for attitude control would encompass mapping the output from the control law to a desired magnetic moment using Eq. (23) and then imposing the maximum magnetic moment on each axis, before finding the resulting actuation torque using Eq. (22). Note that to ensure sign correctness due to the projection, the actuation torque can be found as
where , , and .
To show the performance of magnetic torquers, consider again the HiNCube satellite, which had an inertia matrix of kg m. Consider the problem of making rotating 90° from an initial quaternion to . The gains for the PD+ controller are set and , and the satellite is assumed to have an orbit of km and km, with inclination of . Figure 4 shows the attitude, angular velocity, and actuation torque. It is evident that magnetic torquers produce very low torque, such that it takes a very long time to change the attitude of the spacecraft (about h). To some extents, this can be improved by being in a lower orbit where the magnetic field is stronger or by using larger coils with higher currents. Also, note that the actuation signal varies in strength as a function of time, depending on the orbital position of the satellite.
5.2. Reaction wheels
Another way of changing the attitude of a satellite is through reaction wheels. Reaction wheels are based on the principle of Newton’s third law: When one body exerts a force on a second body, the second body simultaneously exerts a force equal in magnitude and opposite in direction on the first body. This means that by spinning a reaction wheel in one direction, the satellite will rotate in the other direction. Mounting three reaction wheels in an orthogonal configuration enables three-axis attitude control of spacecraft. From Newton’s third law, the momentum generated by the reaction wheels will have opposite sign of the momentum of the satellite, such that where is the momentum production by the reaction wheels, is the momentum acting on the satellite, and . By employing Euler’s moment equation similarly as in Section 3, the torque generated by the reaction wheels can be found by differentiating with where is the angular velocity of the reaction wheels and denotes their inertia. This gives
where is the torque generated by the reaction wheels. Now, consider a set of three orthonormal reaction wheels, where one produces torques around the -axis, one around the -axis, and one around the -axis of the body frame. Then, the PD+ control law dictates a desired torque, , which shall be achieved by the reaction wheels. To that end, the torque by the reaction wheel can be rewritten as , where must be bounded by the motor torque limit, while the angular momentum will be bounded as a function of maximum rotational speed. After imposing the torque and speed constraints, the angular momentum of the reaction wheels is found by integrating allowing the actuation torque to be calculated using Eq. (26).
Consider the HiNCube satellite again, where it is possible to use three small reaction wheels as described in  where the main idea is to place most of the mass away from the center as shown in Figure 5. The inertia of an individual reaction wheel was found to be kg m, and by assuming a maximum rotation speed of 13,700 rpm with maximum torque of Nm, the maximum momentum generated by the reaction wheels is found as . Now, consider the same simulation as when using the magnetic torquers, where the gains for the PD+ controller is changed to and the reaction wheels has the limits as defined above. Figure 6 shows the simulation results, where it is obvious that by using reaction wheels, the satellite is able to change its orientation after about s. To some extent, this can be credited to the higher gains, but it lies mainly with the better actuation system that is able to produce higher torque than the reaction wheels. From the figure, the reaction wheels quickly go into saturation of RPM, where the angular velocity also goes into saturation. As the quaternion error goes toward zero, the reaction wheel despin, reducing the angular velocity and the control objective, is completed.
The third kind of actuator that will be studied is using reaction control thrusters. This section presents how to map the control signal (Eq. 20) to four thrusters used for attitude control. Let the location of each thruster be denoted by , and let them have an azimuth and an elevation angle described by and . Then, the torque produced by a given thruster can be found as , p. 262
where denotes the total thrust from the ith thruster. Given the thruster configuration defined in Table 2, let the vector of thruster signals be denoted , and then the torque can be found as with
|Thruster||Elevation ()||Azimuth ()|
Given a desired torque from the PD+ control law, it must be mapped to the desired thruster firings, such that the combination of thrusters produces the desired torque. To that end, there are several different modulation methods that can be applied, ranging from a simple bang-bang modulation to more sophisticated pulse-width pulse-frequency modulation. This section will give an introduction to the different methods and detail how they can be implemented. In general the desired torque can be mapped to the desired thruster firings as where denotes the Moore-Penrose pseudoinverse and denotes the magnitude of each of the thrusters.
Bang-bang modulation: The easiest approach to thruster firings is bang-bang modulation, where the thruster is fully actuated as long as the ith signal of is above zero, such thatE29
where denotes the maximum available thrust from the ith thruster. After applying bang-bang modulation, the vector can be constructed allowing the actuator torque to be found as .
Bang-bang modulation with dead zone: One of the major drawbacks by using simple bang-bang modulation is when the tracking error has converged to zero, where the thruster firings will continue to maintain the desired attitude. Sensor noise is another source that leads to continuous firings, quickly spending all the propellant. To that end, bang-bang modulation can be augmented with a dead zone, giving
where denotes the dead zone. By properly selecting a suitable dead zone enables the thrusters to avoid firing when close to the equilibrium point.
Pulse-width modulation: Another approach that is often used for thruster firings is by using pulse-width modulation (PWM), where an analogue signal (desired torque) can be mapped to discrete signals using PWM. Instead of changing the thrust level, the duration of the pulses can be changed, leading to a pulse that is proportional to the torque command from the PD+ controller. A simple way of achieving this is by using the intersective technique, which uses a sawtooth signal that is compared to the control signal. When the sawtooth is less than the control signal, the PWM signal is in a high state and otherwise in a low state. This makes it possible to go from continuous control signal to a discrete representation which can be used for thruster firings. Figure 7 shows how to achieve the PWM signal, enabled through a simple comparison of the two signals.
Pulse-width pulse-frequency modulation: In addition to controlling the width of the pulse as in PWM, it is also possible to control the frequency of the pulse—something that is done through pulse-width pulse-frequency (PWPF) modulation (, p. 265) (Figure 8). The modulation approach comprises a lag filter and a Schmitt trigger as shown in Figure 9. As long as the input to the Schmitt trigger is below , the output is kept at zero and must be larger than to produce an output, where is a DC gain, is the time constant, and are the on and off limits for the Schmitt trigger, while is the maximum output. Much research has been performed on improving PWPF modulation, and in , the authors propose the following settings (cf. Figure 9): , , , , and .
Simulations of thruster modulations: Consider a satellite with an inertia matrix as
where the objective is to perform a yaw maneuver of using four thrusters with N force, with a specific impulse of s. Figure 10 shows the attitude and angular velocity vectors when using bang-bang modulation, where the satellite is able to make the errors go to zero. However, due to the modulation, the thrusters will continue firing as shown in Figure 11. To that end, consider the bang-bang modulation with dead zone. Let the dead zone be chosen as , and then the satellite obtains an accuracy as shown in Figure 12 where there is a small offset from the origin which is proportional to the dead zone. On the other hand, the thruster firings are much less prone to do continuous firings as shown in Figure 13.
Now, consider pulse-width modulation. Let the sawtooth signal have an amplitude of and a frequency of Hz. Then, the attitude and angular velocity error is obtained as shown in Figure 14, while the thruster firings are shown in Figure 15. It is possible to tune on sawtooth frequency to improve the performance.
The final scenario is using PWPF modulation, where the parameters are chosen as , , , and . Figure 15 shows the attitude and angular velocity, which go close to zero, while the thruster firings are shown in Figure 16, which is able to constrain the amount of thruster firings, and therefore propellant.
For satellite control using thrusters, propellant is a critical resource that must not be wasted. To that end it is desirable to limit the amount of propellant while at the same time obtain good pointing accuracy (Figure 17). With the basis in Tsiolkovsky’s rocket equation, the propellant consumption during thruster firings can be found as where is the force from one of the thrusters and is the specific impulse, while m/sis the acceleration due to gravity. Figure 18 shows a comparison between the different modulation methods, where it is evident that the PWPF method allows for the least amount of propellant while obtaining close to acceptable performance. The bang-bang modulation will continue spending propellant until running out of fuel but on the other hand obtains the best tracking performance.
6. Attitude determination
As a preliminary step before trying to estimate the attitude of the satellite, some knowledge of measurement vectors must be known, i.e., what is the direction toward the Sun and how does the magnetic field vector look like at a given position. There are several other quantities that can be measured to obtain the attitude, where star trackers are known to be the most accurate. For the reader to obtain insight into using multiple measurements and combine it to find the attitude, this work presents a Sun vector model and a simplified magnetic field model that can be used for simulation purposes.
6.1. Sun vector model
To find the direction toward the Sun, there are several models that can be applied. The simplest would be to divide a circle into days and have a vector always point toward the Sun. Then, by knowing which day it is, it is straightforward to find the direction toward the Sun. This approach would be coarse, such that more accurate models exist. For example, the Sun vector model in , pp. 281–282, has an accuracy of and is valid until 2050. First, the time and date must be converted into the Julian date as , p. 189.
where a real truncation is denoted by and the year, month, day, hour, minute, and second are denoted by . If the day contains a leap second, s should be used instead of . This gives the Sun vector model as
Here, the number of Julian centuries is denoted by , the mean longitude of the Sun is denoted by , the mean anomaly for the Sun is denoted by , the ecliptic longitude is denoted by , and the obliquity of the ecliptic is denoted by , while the Sun vector in orbit frame is denoted by .
6.2. Magnetic field model
Several different geomagnetic models can be applied for attitude determination in conjunction with a magnetometer. The most basic are simple dipole models , while more advanced are, e.g., the chaos model or the 12th generation IGRF model , which is the most commonly used model for attitude determination. This section presents the simple dipole model by , which can be described by the magnetic field vector in orbit frame as
where the time measured from passing the ascending node of the orbit relative to the geomagnetic equator is denoted by and the dipole strength is denoted Wb-m, while denotes the angular speed of the orbit. For a real application, the reader is recommended to apply the IGRF model, which is available in Simulink inside the Aerospace Toolbox, as C++ implementation2 or using Python.3
6.3. Attitude determination using the Madgwick filter
The objective of attitude determination is to find what direction the satellite is pointing. In its core, it mainly requires two vector measurements and two mathematical models that can be compared and used to find the attitude. There are several different kinds of filters applied for attitude estimation, such as the Triad method , the Kalman filter , or the Mahony filter . The Madgwick filter by  has shown good results in attitude estimation based on IMU measurements and is commonly applied in drone applications. The main idea by the filter is to use gradient descent in combination with the complementary filter to fuse sensor data together to produce an estimated quaternion. This section presents an application of the Madgwick filter by using measurements of the Sun vector and the magnetic field vector as well as the acceleration vector (gravity) and shows how to fuse that data together to estimate the attitude of a satellite in an elliptical orbit.
Let the quaternion estimate be denoted by . The measured acceleration, Sun vector, and magnetic field vectors can be defined, respectively, as , , and and can be combined with the mathematical models of the acceleration, Sun vector, and magnetic field vector given in Eqs. (6), (38), and (39) to estimate the attitude. Here, the current estimate is denoted by subscript , while the previous estimate is denoted by . Let the objective function be
where the objective is found in an estimated quaternion that minimizes this function, something that can be achieved by using gradient descent. The Jacobian matrix can be found as
and allows the gradient to be found as . Now, let a vector in the orbit frame obtained from a mathematical model be denoted by and a vector in the body frame obtained through measurement be denoted by . Then, the functions and are given by
Given the gyro measurement (relative to inertial frame), the angular velocity relative to orbit frame can be found as
where the rotation matrix from orbit to body frame is constructed using the estimated quaternion and denoted by . The Madgwick filter can now be presented as
where and are gains, the time step is denoted by , the estimated angular velocity based on vector measurements is denoted , and the estimated gyro bias is denoted by , while the angular velocity of the body frame relative to the orbit frame is denoted (expected output) and the estimated quaternion is denoted describing the body frame relative to the orbit frame. Note that the quaternion must be normalized to ensure unit length and that the first elements of are enforced to zero. To map the angular velocity from four to three elements, the projection matrix is defined as , which has a column vector of zeros followed by the identity matrix such that .
Let a satellite have the inertia matrix as given in Eq. (43), which contains non-diagonal terms which therefore will create perturbing moments due to the gravity. Furthermore, let the satellite have the following initial conditions: and with and . The desired quaternion can be chosen as , while . To model noise in the sensor measurements, the quaternion is converted into Euler angles, where noise is added to the different sensors. Then, creating the rotation matrix from the noisy Euler angles allows the Sun vector, acceleration, and magnetometer models in the orbit frame to be rotated to the body frame, where the measurements now contain noise. The step size of the simulation is , while the sensors are sampled every s.
The quaternion and angular velocity error of the satellite are shown in Figure 18. After about s, the objective of making the attitude error and angular velocity error go to zero is achieved. Since the attitude is not measured directly, the Madgwick filter is used for attitude estimation as shown in Figure 19. Both the quaternion error (estimated truth) and angular velocity error converge close to zero.
From the PD+ controller, the desired torque is mapped to the desired thrust firings using bang-bang modulation (Figure 20). Figure 21 shows the thruster firings required to maintain the attitude error close to zero.
This chapter has presented all the components required to create an attitude determination and control system for satellites in elliptical orbits. With this as basis, it is the hope by the author that the work can help in developing new results within attitude determination and control systems, ranging from nonlinear controllers to new understanding in orbital mechanics, attitude determination, new sensors, and new actuation methods and strategies.
- Figure created using the MATLAB script “international geomagnetic reference field (IGRF) model” by Drew Compston.