1. Introduction
The ability to formulate and formalize correctly is almost half of the solution of any problem. Formalization of the problem—that is, the translation from the “human” language into the language of mathematics—can be proposed in several ways. For example, in the construction and tracking of trajectories for robots, minimization problems utilize cost functions that describe the modulus of the position difference, integral difference characteristic, root-mean-square deviation, or more complicated ones, as in [
1,
2,
3,
4,
5]. These cost functions characterize the position error in different ways. It is important to establish which cost function in each specific task provides the best formalization, the best result, and why.
This paper utilizes an active magnetic attitude control system (MACS) to provide three-axis spacecraft (SC) stabilization. This problem was proposed in [
6,
7] and is widely considered today. The MACS has low power consumption and is easy to manufacture. It is well suited to reduce the cost of missions and makes SC hardware simpler and more reliable [
8,
9]. This is necessary due to the growth in the number of space-related scientific and applied problems in various industries, as well as educational and new technology demonstration projects. However, the MACS has a significant drawback: It is impossible to realize the component of the required control torque directed along the geomagnetic induction vector
. Many works combine the use of the magnetic control and other actuators and concepts to bypass this limitation. For example, [
10,
11] proposed a method for spacecraft attitude stabilization that simultaneously uses a magnetic attitude control system and the electrodynamic effect of the influence of the Lorentz forces.
However, as the satellite moves along the orbit, the vector
’s direction changes, so in general the system is controllable [
12,
13]. The Lyapunov feedback law is usually used when constructing a control using only an MACS. The main problem here is the correct choice of the control gains. The papers [
14,
15,
16,
17,
18] offer different solutions. However, even the most accurate selection of the control gains does not allow a simple feedback law to provide effective suppression of local disturbances. This results in a low stabilization accuracy, which is expected and flight-proven [
19] to be around 10–20 degrees.
In some papers, certain modes of motion that are fully controlled by the MACS are considered, and then the corresponding control law is constructed and its performance is proven. In [
20] the possibility of constructing an oscillatory control is studied so that a satellite with only an MACS can provide complete control along three axes, regardless of the position of the satellite. For this purpose, Lie-bracket-based controls are being considered. In [
21], a proof of global exponential stability is obtained for the magnetic control, which stabilizes the satellite in the desired rotation around the main axis of inertia. The paper [
22] presents a spin-stabilization algorithm for an axisymmetric spacecraft using only an MACS. It is shown that one magnetorquer that is perpendicular to the spin axis is enough to stabilize the satellite in the inertial space, and that the satellite’s motion remains stable even with control outages. The paper [
23] proposes a modification of the B-dot magnetic control strategy that allows the satellite to control the rotation rate. A Lyapunov function is used to prove the asymptotic stability in the spin acquisition phase. Analytical exact solutions of differential equations of the dual-spin spacecraft angular motion under the action of the magnetic restoring torque are obtained in [
24].
The paper [
25] proposes a method to construct a special reference angular trajectory by minimizing the root-mean-square deviation of the control torque projection onto the geomagnetic induction vector. When the projection is equal to zero, the trajectory is completely controllable, which minimizes the reference angular motion tracking errors. The construction of the trajectory in [
25] is performed in a simplified model; in particular, there are no disturbances, and the direct dipole model is used to describe the geomagnetic field. This adversely affects the attitude accuracy in the full model.
The paper [
26] describes an alternative approach of a reference trajectory construction. The quadratic programming problem is formulated for the trajectory coefficients under the condition that the projection of the control torque on the geomagnetic induction vector is equal to zero. The constraint is linearized assuming that the trajectory angles are small. In the case of linear systems, the resulting trajectory is the best, since it is completely controllable. However, its application for the nonlinear model provides worse results.
This paper proposes a number of alternative cost functions based on the analysis of a linearized model of the angular motion. In [
25], the cost functions were chosen empirically. The innovation of this article is a justification for the choice of cost functions using the Floquet theory. According to this procedure, new cost functions were derived, which resulted in better and more reliable results. In addition, the problem of optimal approximation of the geomagnetic field model for a given time interval is posed. These problems, similarly to [
25], are solved using the particle swarm optimization method (PSO) [
27,
28,
29]. This method is based on a decision-making model of particle motion in a search for the best solution to the optimization problem. Each particle computes the cost function value for its position in the search space of the problem parameters and receives the information about possible best solutions from its neighbors. This method effectively handles cost functions that cannot be represented explicitly and, therefore, cannot be optimized with gradient methods.
An extensive numerical simulation is carried out with various external disturbances in the full model, taking into account the inaccuracy of knowledge of the spacecraft’s inertia tensor. The statistical data of the attitude accuracy errors for different cost function combinations are analyzed in order to understand how external disturbances and inaccurate information about the parameters of the satellite affect the actuated motion.
3. Reference Trajectory Construction
Below, we briefly describe the PSO method and a two-stage approach proposed in [
25]. At the first stage, an algorithm for constructing a special angular trajectory is proposed. The projection of the control torque on the geomagnetic induction vector is minimal on this trajectory. Then, to ensure the asymptotic stability, the control torque (17) with optimal control gains in some sense is constructed. Both stages utilize the global optimization method PSO.
3.1. Particle Swarm Optimization Algorithm
PSO is an evolutionary optimization algorithm [
28,
29] based on a decision-making model of particles’ motion in a search for the best solution to the optimization problem. Each particle computes the cost function value for its position in the search space of the problem parameters and receives the information about possible best solutions from its neighbors.
The optimization problem for the swarm is
where
is the position of the particle
at iteration (generation)
which corresponds to the potential best value of the cost function, while
is the given search area.
At each iteration, the particles chose their motion direction on the next step based on their best position and the best position of the entire swarm (or some neighborhood of the particle)—that is, the best position ever found among all particles (or among the neighbors of the considered particle).
where
is the velocity of the particle
at iteration
.
The first term in (21) is the inertial velocity component. It is responsible for the desire of the particle to continue moving in the same direction as in the previous step. The second is the cognitive velocity component, which represents the particle’s tendency to return to its best position. The last one is the social velocity component. It shows the overall strive of the swarm or some part of the swarm to move to the best position ever found. The coefficients are set randomly in a certain range to vary the contribution of each component.
When all particles gather in the vicinity of the best position of the swarm, and the value of the cost function derivative is small for several iterations in a row, we can assume that the algorithm has found the optimal solution.
3.2. Trajectory Parametrization
The first stage of solving the problem is the construction of a reference trajectory. The control torque calculated by (18) should have a minimum projection on the geomagnetic induction vector during the spacecraft’s motion along the trajectory. This projection serves as the base for the cost function introduction for the optimization problem. The trajectory is the solution for the problem. However, trajectory parametrization should be established first. Its parameters serve as the particles’ coordinates in the PSO routine.
The reference trajectory is constructed in a simplified model of satellite motion. The unknown disturbance torque is zero, the geomagnetic field model is a direct dipole, and the aerodynamic torque (6) is constant in a small vicinity of the equilibrium position. This makes all torques on the right side of the first equation of system (2) periodic; consequently, the reference trajectory is also sought as a periodic function. In [
25], the reference trajectory is constructed in the following form:
where
is the argument of latitude, while
are 12 parameters of the reference angular trajectory. The angles
correspond to the direction cosine matrix
This parameterization uses two eigenfrequencies as a reasonable compromise between the accuracy and the computational complexity. The orbital frequency corresponds to the frequency of the gravitational torque variation. The double orbital frequency is used, since the geomagnetic induction vector in the direct dipole model is a π-periodic function [
32,
35]. The optimal trajectory coefficients
are found using the PSO with the cost function of the form
where
is the relative value of the control torque projection on the geomagnetic induction vector. It is calculated directly at each time step
, where
is the total number of steps.
3.3. Control Gains Searching
At this stage, the external disturbances and various model inaccuracies are also not taken into account. Moreover, it is assumed that at the initial moment the SC is already on the reference trajectory found in
Section 3.2—that is,
where
is the identity matrix, and
. Thus, the initial conditions of the spacecraft coincide with the initial parameters of the trajectory—that is,
—and the initial angular velocity
. The trajectory and the velocity are given by the parameters
and Expressions (3) and (22), respectively. The search for the optimal gains
and
in the Expression (17) for the control torque calculation is also performed by the PSO.
Here the control torque (17) depends on the phase variables (the state vector), so it cannot be calculated directly. The phase variables are obtained by the numerical integration of the equations of motion (2), while taking into account the control torque (19) implemented by the magnetic system.
The empirically selected cost function at this stage in [
25], which is a derivative of the cost function used at the first stage (Formula (17)), is
Although this cost function gives decent results, there was a lack of theoretical basis. In this paper, the choice of the cost functions is based on the Floquet theory and supported by massive numerical simulation.
4. Optimization Problems Statement
The reference trajectory in [
25] is constructed in a simplified satellite motion model. In particular, there are no perturbations, and the direct dipole model is used. In this paper, the same motion model is used, but a number of alternative cost functions are proposed to formalize the problem of “minimizing the projection of the control torque on the geomagnetic induction vector”. In this case, they are based on the analysis of the linearized model of the angular motion. Additionally, the problem of the optimal approximation of the geomagnetic field for a given time interval is solved.
The Euler’s dynamics Equation (11), taking into account (17) and (19), is
The linearized form of Equation (25) in the vicinity of the constructed reference motion is
where
;
is a
matrix,
is a
vector, and both are periodic. During the linearization in the vicinity of the reference motion, it is assumed that there are no unaccounted external disturbing torques, the geomagnetic field model is a direct dipole, and the aerodynamic torque is constant in a small neighborhood of the equilibrium position. This determines the period of
and
which is
.
The matrix
of System (26) consists of four
blocks
where
is the
identity matrix,
is a zero matrix, and the
matrices
and
are obtained by grouping the corresponding terms at
and
, respectively. Detailed expressions for them are given in [
25].
The expression for
includes terms that contain neither
nor
:
This is the control torque component along the geomagnetic induction vector.
The homogeneous system corresponding to (26) is
According to [
36], if the eigenvalues of the monodromy matrix (multipliers of System (29)) lie inside the unit circle
, then System (29) is asymptotically stable. This means that all of its solutions are asymptotically stable. It is also stated in [
36] that if a trivial solution
of a linear homogeneous system (29) is asymptotically stable for
then the corresponding linear inhomogeneous System (26) is asymptotically stable. In addition, if all multipliers of the monodromy matrix of (29) differ from unity
—which is true for the case of the asymptotically stable systems of differential equations—then (26) has a unique
T-periodic solution in the following form:
where
is the fundamental matrix of System (29) normalized at
. In the case when System (26) is asymptotically stable, all of its solutions are asymptotically stable. Then, the periodic solution is asymptotically stable too, and all other solutions converge to it. Thus, all solutions converge to Solution (30), which determines the motion in the steady state.
It can be seen that the oscillation amplitude in (30) depends on the inhomogeneous term , the fundamental matrix and, consequently, on the system matrix . The matrix depends on both the reference motion and the control gains, while the inhomogeneous term depends only on the reference motion. Thus, it is possible to set and solve two independent optimization problems: the first is the minimization of by selecting the optimal reference motion, and the second is the search for optimal control gains, taking into account the found reference angular trajectory.
4.1. Reference Trajectory Optimization Problem
It is necessary to reduce the oscillation amplitude of the resulting periodic solution (30) in order to minimize the tracking errors. So, the first task is the minimization of the value (28). This is the stage of the reference trajectory construction.
Table 1 shows three expressions for the cost functions that formalize this problem, where
is the Euclidian norm, and
is the infinity norm.
The optimization problems for this stage are
where
is the number of integration steps,
is a period, and
is a time step. Using the PSO with the cost functions given in
Table 1, we can find the optimal coefficients of the reference trajectory in the form (22). Recall that when constructing the trajectory, the direct dipole model is used and there are no external perturbations.
4.2. Control Gains Optimization Problem
Ensuring the asymptotic stability is the goal of the Lyapunov control (17). It is achieved by the proper selection of the control gains
. In order to find the optimal coefficients, we also use the PSO and formulate an optimization problem with the following cost function:
where
are the eigenvalues of the monodromy matrix of System (29). However, only those pairs of control gains
that lead to the condition
are suitable. In this case, the trivial Solution (30) will be asymptotically stable.
4.3. Ideal Case Numerical Simulation
Reference trajectories are found with each of the cost functions proposed in
Table 1 for two heights
and
. The density of the atmosphere at these altitudes differs by an order of magnitude. To evaluate the final attitude accuracy in steady state in the OF, which is determined by the amplitude of the periodic Solution (30), the initial conditions of the periodic solution are calculated by the following formula [
36]:
Thus, the spacecraft is “placed” directly on the trajectory, brushing aside the process of convergence onto it.
Figure 4 shows three found angular trajectories relative to the OF for each height. The final attitude accuracy in the case of an altitude of
for all three cost functions is approximately the same and is about
, and in the case of an altitude of
the best accuracy is obtained by optimizing with the third cost function
and equals
. Thus, the tracking accuracy of the reference trajectory is worse at higher atmospheric densities.
At this stage, it is impossible to establish which cost function is better for each height, since they all show similar final accuracy. However, their behavior can differ significantly when adding perturbations. The final accuracy is affected by unaccounted perturbations, such as inaccurate information about the satellite’s inertia tensor or uncertainty about the density of the Earth’s atmosphere. Therefore, before choosing one of the cost functions, it is necessary to analyze the sensitivity of the found reference trajectories to the unaccounted perturbations in each specific case.
5. The Influence of Disturbances
The Lyapunov-based control (17) constructed at the second stage provides the asymptotic stability only for the solutions of the unperturbed Equation (26). Therefore, an accuracy degradation in the full model is expected. This can be estimated using the linearized equations, which in this case have the form
where matrix
and vector
appear due to the disturbances. These disturbances include the inaccuracy of knowledge of the Earth’s atmosphere’s density and the spacecraft’s inertia tensor, geomagnetic field model
perturbation, and various other random disturbing torques
. It is not possible to take these perturbations into account at the trajectory construction and gains selection stages. Unfortunately, the reference trajectory tracking accuracy usually degrades due to
, and in some cases, instability occurs due to
. The second negative effect can be removed by shifting the obtained control gains “deeper” into the stability region. This means choosing the coefficients that are far away from the boundary of the stability region. Trajectory tracking error reduction is possible by choosing a description of the geomagnetic field that is closer to the inclined dipole and using it at the trajectory construction stage. The inclined dipole model, which is used in the numerical simulation, is considered to be the “real” field. The direct dipole model is used during the control construction process. It is considered to be the approximate simplified field representation. The difference between them affects the control performance. However, this effect can be minimized by adjusting the simplified dipole model and using it during the control construction. The deviation of the geomagnetic induction vector in the inclined dipole model
from the model used in the construction steps
is
Consider the expression for the right side of Equation (34), taking into account perturbations only from the inaccuracy of the magnetic field. By analogy with (27), the matrix
of the perturbed System (34) has a block form and includes terms for the corresponding components of the state vector
. The non-homogeneous part
does not contain these quantities; its first term coincides with (28), and the second one is
It depends only on the geomagnetic field model’s inaccuracy at the trajectory construction and search for control gains stages. In [
25], the direct dipole model is used at these stages—that is,
in (35).
It is not possible to ensure . The inclined dipole model cannot be used for the reference trajectory construction, since it is necessary to use only periodic field models. The direct dipole model is a natural choice for this purpose. However, we can minimize (36) if a new description of the magnetic field is used. It must simultaneously satisfy two requirements:
is a periodic function, with the same period as the direct dipole model;
The difference between and in a given time interval is in some sense less than the difference between and .
The index “oblique” means the new (desired) dipole model. Essentially, the oblique dipole is tilted relative to the Earth’s rotational axis but, in contrast to the inclined dipole, its attitude is fixed in the inertial space. This dipole may provide better approximation than the direct one by being closer to the “real” inclined dipole (
Figure 5). To describe the geomagnetic induction vector in the general dipole model, Expression (10) is used, which for the oblique dipole model takes the following form:
where
is the unit vector of the oblique dipole axis, specified using its attitude angles
relative to the IF.
The optimal values of these angles are found using the PSO with a cost function of the following form:
where the expressions for
are given in
Table 2,
, and
is the averaging interval expressed in the number of iterations of the numerical simulation of the equations of motion.
A correctly chosen interval
improves the approximation of the magnetic field compared to the direct dipole. The reference trajectory is constructed for one orbital revolution. Therefore, the minimum possible interval for the optimal approximation of the geomagnetic field is also equal to one revolution. That is, it is best to approximate the field for each consecutive orbit. This requires the trajectory coefficients (with a new field) and control gains (with a new trajectory) to be recalculated for each orbit (
Figure 6). This comes at significant computational costs of optimization problems, since all three optimization problems must be solved at each time interval to improve the final attitude accuracy. In addition, frequent changing of the reference trajectory leads to the inevitable transient processes. Moreover, the settling time allocated for each reference trajectory may not even be enough to achieve it before switching to the new reference trajectory. Therefore, the averaging interval should be more than one orbit and less than a 24 h interval, because the direct dipole model is an averaging of the inclined dipole over 24 h.
This paper considers the averaging intervals equal to six orbital revolutions
. The trajectories are constructed using the PSO for different sets of cost functions given in
Table 3. The cost function set № 1.2, for example, means that the cost function
is chosen to construct the reference trajectory and the cost function
is chosen for the approximation of the geomagnetic field dipole model. The cost function for the control gains optimization problem in all sets is the same
(32).
Figure 7 shows the resulting reference trajectories for each pair of optimization problems for an altitude of 650 km. Each curve shows the change in the worst tracking angle of the reference trajectory over a six-orbit interval for each optimization case. The perturbation in these examples is only the geomagnetic field model perturbation at the stage of the trajectory construction.
Figure 7 shows that it is not obvious which set of cost functions is the best, especially when numerically simulated in the full model. It is necessary to analyze the system behavior under various perturbations.
The inaccurate knowledge of the inertia tensor has the most significant role in the tracking errors of the reference trajectory and can even lead to instability. To compare the tracking accuracy of the reference trajectories in the steady state in numerical simulation, we consider different perturbations of the inertia tensor:
where
. Thus, the perturbed inertia tensor is
where
is the unperturbed spacecraft inertia tensor.
Almost 10,000 simulation runs were performed.
Figure 8 shows the distribution of the worst values of the reference trajectory tracking accuracy—that is, the maximum relative attitude deviation in all angles
for each
for the orbit height 650 km. The inaccurate knowledge of the inertia tensor greatly degrades the attitude accuracy fairly often. However, the sets of cost functions № 1.2 and № 1.4 demonstrate acceptable results. The final attitude accuracy remains about 3–5 degrees for any perturbations of the inertia tensor within 5% of the nominal values of the inertia moments.