Simulation of the Attitude Control System on a CubeSat U1 Using Magneto-Torquers ()
1. Introduction
Nowadays, the use of CubeSat promotes the development of aerospace projects as their requirements facilitate their design and manufacturing for easy access to components and software, reducing the cost and the standard size that they must meet, which must be composed in 10 × 10 × 10 cms. Modules and a weight of no more than 1.33 kgs. The CubeSat cannot be compared with a conventional satellite in terms of performance and behavior as they came up with the necessity of designing, building, and operating smaller and more affordable satellites, letting research institutes in developing countries get involved in outer space.
A CubeSat has different controlling systems depending on the mission to be fulfilled, such as the Attitude, which positions it in outer space. There are three types of controlling systems of attitude that are used for its operation: chemical & electrical propulsion, reaction wheels, and magneto-torques. The Functional Principle of Magneto-Torquer consists of applying electric current to coils to carry a magnetic torque, which, along with the Ambiental magnetic field, produces a torque to rotate the CubeSat. This work focuses on the development of this type of Attitude system.
Considering the different types of control using inertial wheel systems, Magneto-torque, and other methods, there are studies on Attitude Control Systems. For example, as shown in [1], attitude control for CubeSat orientation is implemented through inertial wheels. The study describes the use of a microcontroller adapted to the characteristics of the system. To calculate the angular velocity and the direction of rotation of the wheels, four methods are used, applying mechanical simulations to model the movements of the CubeSat on a test platform. In [2], the design of a reaction or inertial wheel system is presented, where the angular momentum generated can be transferred in a single direction. This is possible thanks to the Möbius strip, which, after some modifications, becomes a surface capable of allowing the necessary reorientation, along with a secondary actuator that performs the displacement. With the simulation of the response of the motor elements and applying PID controllers, it is demonstrated that the design is effective, as it successfully achieves proper attitude regulation in finite time across all scenarios. In [3], two types of attitude systems were designed, fabricated, and characterized based on magnetic coils and inertial wheels for a 3U CubeSat. Together with the mathematical model of the satellite, the required torques for stabilization were determined, considering the limitations of mass, volume, power, and tolerance. In the attitude control simulation, the physical responses of the prototypes were verified to ensure they were correct, with small errors observed in both. In [4], the concept of exo-vela for a CubeSat is proposed using a parachute with an exobreak for maneuvers. PD controller feedback, with carefully adjusted gains, was proposed to prevent exceeding the control torques induced by the allowed exo-sail. The proposed concept was successfully demonstrated through simulations from the CubeSat control response, measuring the time it takes to correct the errors. The results of the attitude control proposed, and the strategy using the exo-sail are feasible.
To obtain information about the operation of the attitude control systems in the mentioned studies, simulations are conducted. However, none of these uses MATLAB-based software specifically designed for CubeSat simulations under outer space conditions, which in this study are considered constant and free from external or internal disturbances. For this reason, this study is considered both important and significant.
2. Literature Review
2.1. Description of Magneto-Torque and Operation, Its Theoretical
Foundations
The Magneto-Torquer is a coil wound around with a conductor wire (usually copper) over some kind of support; this wire is coated with varnish to provide electrical insulation. This way of generating a magnetic field is known as an electromagnet, and the density generated due to the magnetic field may differ proportionally from the number of turns the coil might have and the quantity of current flowing through.
The coil is formed by fitting the core in the solenoid (Figure 1). Given that the iron has more permeability than the air, the lines of force can flow easily, and the magnetic field lines generated by the coil are concentrated in the core, producing a flow density increase inside the coil [5].
Figure 1. Representation of a current flowing through a solenoid and a coil and its lines of force.
2.2. Moment of Inertia a Solid
The moment of inertia of a solid is a scalar magnitude defined as [6]:
represents the distance from the axis of rotation and
as the masses.
Having said this, it can be deduced that the moment of inertia of a solid depends on the axis of rotation, and as mentioned before, when it is about a solid, the addition of the formula can be substituted by the following integral
where,
represents the mass element of the solid directly related to the solid density
and
is the distance from the axis of rotation.
Given the mass element of the solid
and the solid density
besides if this is homogeneous, it is possible to calculate the density of the integral when substituting
in the previous formula
where,
represents a solid volume and, to calculate a homogeneous solid’s inertia moment, it is necessary to solve the previous integral.
Taking the situation above into account, the variation per unit time is the linear velocity factor
and in case motion may take place along a radius circumference
the magnitude of the linear velocity will be the following [7],
(1)
where,
is the linear velocity,
is the angular velocity.
Therefore, the angular moment
applied to a rigid solid is obtained
(2)
it is known that a Magneto-Torquer operation is based on the ability to create a magnetic dipole; when a current flows through a coil, the equation of angular moment is obtained [8],
(3)
Remembering that the magnetic torque
applied to a coil exposed to an external magnetic field may be expressed as the vector product of dipole moment and external magnetic field [5] [9],
(4)
where,
is the dipole moment produced by the Magneto-torque,
is the external magnetic field in such a way that the modulus of the magnetic torque can be expressed [9],
(5)
where
is the angle that forms the axis of action of the magnetic force produced from the Magneto-Torquer and the desired angle. By saying this, it is possible to find the equation of motion of the system. To carry this on, it is necessary to apply the theorem of conservation of angular momentum. The law of conservation of angular momentum states if the net external torque is zero (it does not imply the external forces are zero, but it is an isolated system), the total angular momentum is conserved in other words, it is constant [6].
(6)
with
, it is the torque applied to the system.
However, the magnetic torque produced by the magneto-torque, Equation (5), is not the only one that interacts with the system; there is also a resistive torque produced by different factors. From Equation (6), it can be deduced that when applying a torque to a solid, it can create an angular acceleration about the axis around which the object rotates, leading to the motion equation for the Magneto-Torquer
(7)
where
, represents the resistive torque which opposes the motion. Besides, the operating principle of a Magneto-Torquer is based on the torque produced by the magnetic dipole moment. Thus, it can possibly be related to the current intensity flowing through the coils along the satellite movement.
And so, relating the Equations (5), (7) it may bring
(8)
the dipole moment produced by a coil is calculated as Equation (7) shows. The angular velocity function
is obtained as:
(9)
where,
represents the moment of inertia,
is the dipole moment,
is the external magnetic field,
is a resistive torque,
is the angle that forms the axis of action of the magnetic force produced by the Magneto-Torque, and the reference angle.
The inertia matrix is defined as a symmetric matrix whose elements are formed from the moment of inertia of three perpendicular axes and three inertia products. If
respect to an origin
, it may bring up [10] [11],
(10)
where,
.
Well, if the body’s coordinate system axes coincide with the main axes of inertia, that is, the principal frame of the satellite is chosen where the inertia matrix
is diagonal, just like it happens with most of the satellites, the matrix is reduced as [10] [11],
. (11)
Therefore, the satellite’s Attitude dynamics are expressed by applying Euler’s equation:
(12)
(13)
(14)
where,
is the angular velocity vector of the satellite and
is the torque vector performing on the system.
3. Disruptions to be Considered
The CubeSats are normally designated for low Earth orbit missions, and as the orientation of the satellites of low orbit defines (Low Earth Orbiters, LEO), they are vehicles located in nearly circular orbits with altitudes between 300 km and 1500 km, which is an advantage due to the low altitude it is required a less power to reach their orbits compared to the conventional satellite. However, because of their orbit, these satellites may be affected by some perturbations due to the constant changes in atmospheric conditions. These perturbations usually affect the orientation and the orbit, which is why such disruptions must be considered in the Attitude control.
3.1. Geomagnetic Field
The geomagnetic field is the magnetic field extending from the Earth’s core. The Earth’s magnetic field may be approximated as a dipole inclined to 15 degrees to the axis of rotation of the Earth creates a magnetic field; its magnitude on the Earth’s surface has an average from 25 to 65 μT (microteslas) being stronger at the poles and weaker at the magnetic equator.
Table 1 shows the characteristics of the Earth’s geomagnetic field according to [12].
Table 1. Characteristics of the geomagnetic field.
Dipole field intensity |
0.306 Gauss-Re3 |
Displacement of 3 dipoles |
0.076 Re |
Intensity of the Surface field (1 Re) |
0.24 - 0.66 Gauss |
Magnetic poles |
Model WMM2020 |
Geocentric dipole |
80.65 N, 72.68 O |
Magnetic North pole |
86.50 N, 164.04 E |
where Re, defines the radius of the Earth’s model as 6.378 km. The dipole intensity is the dipolar portion intensity of the planetarium magnetic field outside the planet. In Gauss-Re3, Re is in units of the planet’s radius. (Dividing by the distance Re3 yields the field in Gauss).
3.2. Atmospheric Conditions
The Earth’s atmosphere is the gaseous layer of the Earth, being the most outermost and the least dense of the planet. This layer is composed of several gases that vary as the pressure at different altitudes. This mixture of gases that compose the atmosphere is genuinely called air. 75% of the atmospheric mass is at the first 11 km of altitude above the sea level. The main gases that compose it are Oxygen (21%) and nitrogen (78%), followed by argon, carbon dioxide, and water vapor.
Table 2 and Table 3 point out the characteristics and composition of the Earth’s atmosphere according to [12].
Table 2. Characteristics of the atmosphere.
Surface pressure |
1014 mb |
Surface density |
1.217 kg/m2 |
Altitude scale |
8.5 km |
Atmosphere’s total mass |
5.18 ×10+18 |
Average of temperature |
288˚ k (15˚C) |
Daily temperature rate |
10˚C and 20˚C |
Wind speed |
0 and 100 m/seg |
Average molecular weight |
28.97 |
Table 3. Atmospheric composition (by fresh air volume).
Major gases |
78.08% Nitrogen (N2), 20.9% Oxygen (O2). |
Minor gases |
Argon (Ar) 9340, Carbon dioxide (CO2) 410, Neon (Ne) 18.18, Helium (He) 5.24, Hydrogen chloride (HCV4) 1.7, Krypton (Kr) 1.14, Hydrogen (H2) 0.55. |
4. Methodology
Below are some of the requirements and specifications a CubeSat model U1 must meet to be launched according to [13] the model mentioned above was selected for the simulations performed [14].
4.1. Mechanical Requirements
The CubeSats are cube-shaped satellites with the following specifications:
1) The coordinate system of a CubeSat 1U must coincide with the P-POD coordinate system (Poly Picosatellite Orbital Deployer), while integrated into the P-POD. The origin of the CubeSat system coordinates is located in the geometric center of the CubeSat.
2) The maximum mass of a CubeSat 1U is 1.33 kg.
3) The gravity center must be located no more than 2 cm. from the geometric origin in the X, Y & Z direction.
4.2. Electrical Requirements
1) The deployment switch must be operated all the time while it is integrated into the P-POD (Poly Picosatellite Orbital Deployer).
2) The CubeSat must have an RBF pin (Remove Before Flight).
3) The CubeSats will incorporate protection in the battery circuit to charge and discharge, thus avoiding unbalanced cell conditions.
5. PD Control
In this section, based on the position and angular velocity error a PD control system will be implemented.
Starting with the following equation
(15)
where
and
are Euler angles and axes, respectively, caused by a rotation given the matrix of attitude and the Euler axes.
is the orbital angular velocity with respect to the orbital system (angular velocity of the satellite). And
is the orbit angular velocity.
The PD control obtained is described as the following equation
(16)
This control law is based on the Reijneveld and Choukroun algorithm, which is valid only if the satellite’s angular velocity is superior 4 times the revolutions per orbit. Otherwise, there will be absolutely no control [12].
Starting from
, (17)
where
is the vector of generalized coordinates,
is the inertia matrix,
is the angular velocity vector, and
is the torque vector acting on the system.
It will use the structure of a PD defined as follows
(18)
is the position error,
is the desired position,
are the proportional and derivative gains.
The state variables (canonical form of the controller) obtained when substituting the PD control into the dynamic model are
Position error:
(19)
Note: When performing position control (with regulation), the desired position
is assumed to be constant.
Velocity error:
(20)
Acceleration error
. (21)
Afterwards, the equation is derived as follows
(22)
Once the equation homogenous
, the existence, uniqueness, and location of the equilibrium point are found out such that,
, implying the equilibrium point is
,
(23)
Stability
Stability can be tested with the Lyapunov function criterion [15]. Considering the following positive define function (Lyapunov candidate function),
(24)
the representation in terms of position and velocity errors is obtained by substituting the state variables in Equation (24), and the result is a positively defined function
(25)
when deriving Equation (25):
(26)
The state variable
in Equation (21) will give:
(27)
when substituting Equations (26), (27):
. (28)
By applying the antisymmetric matrix properties in Equation (28), we get:
(29)
When using the state variable
, Equation (19) will give:
(30)
And applying the properties of the transpose
(31)
(32)
considering that
is symmetric, as,
and with the described properties in Equations (31), (32), (30) can be modified as follows
(33)
Finally, the derivative of the function of Lyapunov is less or equal to zero; this is because when the error of the position is zero, this term becomes zero. In other words, it is indeed less or equal to zero. Concluding that the equilibrium point
located at the origin of the state space, is stable.
6. Simulation and Results
The Propat functions can be grouped into transformations of coordinates, time and ephemerides, transformations and propagation of Attitude, and environmental property conversions and orbit propagation. The sensors used for the Propat are magnetometers of 3 axes and coarse solar sensors along 3 orthogonal magnetic torsion coils set for Attitude control [16]. The main coordinated systems used by the Propat are the geocentric inertial system, the geocentric terrestrial system, and the orbital system. The satellites use sensors to define their location in space and their orientation. These sensors work based on the properties of the outer space environment, such as the Earth, Sun, Moon, stars, and the geomagnetic field, among others directions.
This is why it is important to always simulate these sensors, the Propat library currently includes 3 models: the Sun’s position in the geocentric inertial system, the Earth’s orientation at a given time, and the Earth’s magnetic field. Additionally, there is a function to demonstrate if the satellite is in the Earth’s shadow.
6.1. Variables for Simulation
For this case, the face X of the satellite is oriented in order to calculate the Attitude matrix between the satellite’s frame and the orbital system based on the Attitude vectors function of the Sun and the geomagnetic field measured by the sensors. In addition, a specific orbit over the State of Puebla was chosen.
Three sets of orthogonal magnetic torsion coils are used for the Attitude control, and for this case, it is used a NCTR-M002 Magneto-Torquer (see Table 4) whose characteristics make it particularly useful to be implemented for the CubeSat due to its low use of energy and its lightweight. Table 5 shows the simulation parameters used.
It was selected as a 1U CubeSat model as shown in Figure 2.
Table 4. NCTR-M002 magneto-torquer rod.
Magnetic moment |
>0.24 m2 |
Functionality Range |
−35˚C and 75˚C |
Power supply voltage |
5 V |
Mass |
<30 grs |
Table 5. Simulation parameters.
Initial Euler angles |
[30 50 10] |
Initial angular velocity |
[0.1 0 0.5] rad/seg |
Orbit |
Polar (90˚) |
Eccentricity |
0.0002 |
Altitude |
300 km |
Argument of perigee |
111.196˚ |
Average anomaly |
248.196˚ |
Ascending node longitude |
6.524 hrs |
Figure 2. Model of the 1U CubeSat selected.
With a mass equal to M = 1.2 kg and with an inertia matrix
(34)
6.2. Elements for the Simulation
The next Keplerian elements were taken into consideration for the simulation, such as the Earth’s radius, orbit, eccentricity, and the orbit’s inclination. For this case, a polar orbit was selected, and the rest of the elements, such as the perigee argument, average anomaly, and ascending node longitude, were selected.
The variation of the Keplerian elements is calculated according to the Earth’s shape. An initial Attitude (initial position) for the CubeSat in radians is proposed, and an angular velocity is given in radians per second.
The inertia matrix is symmetric as it is with most of the satellites, the coordinate system axes coincide with the principal inertia axes. The matrix values must be given in Kg.
Three magnetic torsion coils are used for the Attitude control, one for each axis, with a magnetic moment of 0.2 Am2.
The satellites usually use sensors to find out their location and orientation in orbit (Attitude). These sensors work based on the direction of the Earth, Sun, Moon, stars, the geomagnetic field, and among others. This is why it is important to keep the sensors mentioned during the simulation in mind. Propat offers distinct models that allow simulating the Sun’s position in the geocentric inertial system, the Earth’s orientation in a specific moment (Greenwich Sidereal Time), and the Earth’s magnetic field. The simulation code shows exactly the model used to test the sensors at a specific time.
The time propagation of the simulation is given in seconds. The time, angles, angular velocity, and the orbit vector start initializing. The control torque and the current of the magneto torques start initializing.
As a numeric integration is estimated, the precision is defined. With this, it is now possible to calculate the Orbit and Attitude propagation. Also, the propagation of the orbit and conversion of the Keplerian elements to a vector of state.
In this case, perturbations will not be considered. Therefore, the Attitude vector will be defined and initialized.
6.3. X Face of the Satellite Oriented towards the Earth
It is necessary to have knowledge of the direction and the intensity of the geomagnetic field to orient a Satellite’s face towards the Earth.
It is also recommended that the ODE45 numerical integrator be used for the propagation of the Attitude.
Additionally, it is necessary to know not only the position vector but also the Sun’s position vector in the Satellite’s frame.
The Gaussian was added to the Sun’s position vector and to the geomagnetic field since the data of the sensors is corrupted by the line noise before being processed, thus limiting the transmission distance.
The axes are adjusted so that the X axis aims at the Earth, the Y axis is orthogonal to the X axis in the orbital plane, and the Z axis is normal to the orbital plane.
Considering two reference systems, one belonging to the Earth and the other belonging to the satellite, the Attitude matrix is calculated for two pairs of vectors known in two different reference systems. If the two coordinate systems are the same, the matrix gets its identity back, as shown in Figure 3. At last, the orbital angular velocity is calculated. As was mentioned previously, the control is valid only if the satellite’s angular velocity is a minimum of four times the revolutions per orbit.
Figure 3. Coordinate system.
6.4. The Control Code in Use during the Simulation
The current supplied to the Magneto-Torquer is calculated considering the number of spins and the maximum current they can hold.
Current in the coils
EB = teta’.*earth_field;
K = 1e5;
MI = −k*(cross(EB, (w_ang-wo_b)));
N = I max;
xyzC = MI/(710*0.04);
xcurrent = xyzC(1);
ycurrent = xyzC(2);
zcurrent = xyzC(3);
Finally, the data is saved for plotting.
time = cat(2, time, t);
omeg = cat(2, omeg, w_ang);
euler = cat(2, euler, teta*180/pi);
corx = cat(2, corx, xcurrent);
cory = cat(2, cory, ycurrent);
corz = cat(2, corz, zcurrent).
6.4.1. Simulation Results of the PD Control and Discussions
According to the next expression of the control PD, we can say:
(35)
and
are Euler’s angle and axis, while
is the orbital angular velocity with respect to the orbital system and
is the orbital angular velocity. Meanwhile, the selection of the gain
and
was done based on the criteria of
since this is the way to prioritize the equilibrium point, however, if the value of the gains is reversed, the system reduces its angular velocity, making the system reach its equilibrium point in a longer period [16].
% Vangular-Vorbital
cont_torq = −0.00025*teta − 0.002*(w_ang-wo_b)
6.4.2. Simulation Graphics
Considering the gains of
&
and the characteristics of the satellite the following results are obtained, which represent the orientation measured in Euler angles, the angular velocity measured in rad/s, and finally, the variation of the current supplied to the Magneto-Torquer.
As Figure 4 shows, it can be observed that the satellite reached the desired position even after the position error was zero due to the line noise.
Figure 4. Position error.
In Figure 5, it can be clearly observed that when the satellite reaches the desired position, the angular velocity is equal to zero.
Figure 5. Angular velocity.
As it is shown in Figure 6, the current supplied does not exceed 0.03 A because the maximum current the Magneto-Torquer can handle is 0.04 A.
Figure 6. Current supplied to the Magneto-Torque.
7. Conclusions
The simulation carried out for the Attitude control of a CubeSat, using the control PD, provides significant information for the already mentioned mini-satellites development and the implementation of the control system. As we know, the development of this technology is based on high budgets, which, unfortunately, we may not be able to afford due to different circumstances. The simulation is a tool that does not require a high budget to obtain the study and analysis results.
The results that were obtained show us precisely the data gathered considering the conditions of the outer space the CubeSat was exposed to, the variables that must be kept in mind, and its consideration for the development and implementation, which could be sent to the outer space.
For the development of this knowledge applied to Satellite Technology, it is important to consider the national context, whether we are slightly or not supported, and notice the difference that exists in many countries for these applications and their importance for their development in every country. Another reason to consider the importance of the work is to recognize how many future projects will continue to keep this line of investigation in demand.