Content uploaded by Madhana MOHAN Kannan
Author content
All content in this area was uploaded by Madhana MOHAN Kannan on Nov 30, 2023
Content may be subject to copyright.
CubeSat attitude control by implementation of
PID controller using python
1st Madhana Mohan.K
Research Scholar
Department of Electronics and
Communication,
Sathyabama Institute of Science and
Technology,
Jeppiaar nagar,Rajiv Gandhi
Salai,Chennai-600119.
Kmm.madhan@gmail.com
2ndAnitha.U
Associate Professor,
Department of Electronics and
Communication,
Sathyabama Institute of Science and
Technology,
Jeppiaar nagar,Rajiv Gandhi
Salai,Chennai-600119
anithaumanath@gmail.com
3rdAnbumani.K
Associate Professor,
Department of Electronics and
Instrumentation,
Sri Sairam Engineering College,
Sai Leo nagar,
West Tambaram,Chennai-600044
anbumani.ei@sairam.edu.in
Abstract - Attitude of the satellite (i.e.) its orientation
about the three axis, will be of utmost importance in any
satellite mission. In detumbling maneuver of a CubeSat,
attitude control plays a vital role and the three axis
orientation determination and stabilization of the
orientation is highly required in a CubeSat. The three axis
of the CubeSat has to point as per the attitude
requirement so that the mission objective of the CubeSat is
satisfied. This paper reviews the work accomplished in the
domain of attitude control and gives an insight into the
dynamics of actuator and satellite under the influence of
various disturbance torques. This work aims at aptly
recognizing the internal dynamics of a CubeSat and
simulates the performance in the presence of disturbance
torques. The simulation performed here makes use of the
control library in the python to accomplish a PID based
control.
Keywords - CubeSat, attitude, control, actuator, and
disturbance torques.
I. INTRODUCTION
In the aerospace domain,CubeSat has become
indispensable owing to the fact thateven if one of the
CubeSat malfunctions, the rest of the CubeSat
accomplishes the mission objective when sent in droves.
The same cannot be achieved with a single large
satellite, if it fails during the mission. This important fact
has catapulted CubeSat is to be used a lot more these
days.Owing to its size, versatility and flexibility in its
configuration and possibility of building it with
commercial off the shelf elements has ensured that both
the space Industry as well as the educational institutions
use it for commercial purpose and educational purpose
respectively. The subsystem (ADCS) that determines the
attitude and controls it plays a major role in
CubeSatmission. It isensured that the CubeSat’s
orientation is as intended [2,5,7] for the mission. So that
the communication and imaging applications are
accomplished as desired.
Fig.1CubeSat
As shown in fig.1, CubeSat’s are very small artificial
satellites that orbit earth in the low earth orbit
(LEO).These satellites are made up of standardized
dimensions of 10*10*10 cm, which is equal to 1U (one
unit). CubeSat’s weigh less than 1.33 kg per unit and
this puts them in the category of nano satellites, which is
in the range of 1 kg to 10 kg.
II. ATTITUDE OF SATELLITE
A. Orientation of a satellite.
Attitude refers to the orientation of the CubeSatalong
the three axis as indicated in Fig.2.
Fig.1Roll, Pitch And Yaw
Roll is usually denoted by Φ and deals with regards to
the movement around x-axis. Pitchis usually denoted by
θ and deals with regards to the movement around y-axis.
Yawis usually denoted by ψ deals with regards to the
movement around z-axis. It is the ADCS module [1],
which plays a pivotal role in helping the CubeSat to
point in the desired axis.
B. Reference frame
The reference frame acts as a standard to which the
motion of an object is compared with in order to
ascertain the position, angular velocity and orientation
of the object. The measurement of orientation is done
regards a reference frame of axis and the various
reference frame include, the four reference frames that
are basis for attitude measurement includes,
2023 12th International Conference on Advanced Computing (ICoAC) | 979-8-3503-1821-0/23/$31.00 ©2023 IEEE | DOI: 10.1109/ICoAC59537.2023.10249887
Authorized licensed use limited to: Sri Sai Ram Engineering College. Downloaded on September 29,2023 at 06:15:17 UTC from IEEE Xplore. Restrictions apply.
i) ECI frame
ii) ECEF frame
iii) Orbital reference frame
iv) Satellite body frame
As indicated above the satellite body frame will be
compared with references in accordance with the
context of measurement, in order to have an idea of its
orientation and the orbital reference frame acts as a
reference for the satellite to know its position in the
orbit it rotates. The above mentioned reference frames
are shown in fig.3.
Fig.2Reference Frame
C. Attitude representation
Attitude is generally represented in three forms, which
are given below.
a) Direct cosine matrix(DCM):
DCM refers to the mapping from one co-ordinate frame
to the other and mapping between frame a and frame b is
given by (1).
=
()
b) Euler angles:
In this case the attaitude is parameterized by using a
three component rotation angle.A set of Euler angles
consisting ofΦ,θ and ψ is represented by
𝜙
()
c) Quaternions:
Here a unit quaternion is employed to parameterize the
attitude where q0 is the scalar part andq1, q2 and q3 are
the real components of the quaternion vector
components. The attitude can be represented as a
rotation axis (the vector part of the quaternion) while
the scalar part of the quaternion depicts angle around
the rotation axis.
=
()
III. ACTUATOR MATHEMATICAL MODEL
The DC Motor-Reaction wheel combination as shown
in fig.4, acts as an actuator [12] by generating the
required control torque so that the three axis angles are
matched with the required value. The DC motor plays a
major role in functioning of reaction wheel [15] and in
fact is the core component of actuators that use
momentum exchange as their underlying principle.
The DC motor generates the required torque, which in
turn ensures that the required momentum is provided
for the satellite to attain the required attitude. The
mathematical model of the DC motor. is given by
()
Where T stands for torque and in case the disturbance
torque is neglected, the transfer function of the DC
motor is given by
()
The values mentioned in TABLE 1 are obtained from
(23).The DC motor used can be in turn made use of
controlling the reaction wheel. The reaction wheel is a
momentum exchange device that is actuated by the DC
motor. The DC motor in conjunction with the reaction
wheel ensures that the attitude angle is corrected.
TABLE 1ACTUATOR MODEL PARAMETERS
Notation
Variable
Magnitude
K
Amplitude gain
10
Armature resistance
10 Ohm
Armature inductance
0.5 H
Inertia of motor
0.01 Kg.sqm
b
Friction coefficient
1.17 Nms
Fig.4 Dc Motor and Reaction Wheel Assembly
IV. DYNAMICS OF CUBESAT
The CubeSat can accomplish its mission objective
only by ensuring that the x-y-z axis orientation is in
accordance with the required attitude. The error in
Authorized licensed use limited to: Sri Sai Ram Engineering College. Downloaded on September 29,2023 at 06:15:17 UTC from IEEE Xplore. Restrictions apply.
attitude is compensated by the manipulated signal
generated by the actuator. The actuator ensures that the
control torque generated by it turns the orientation of the
CubeSat by the necessary angle so that the required
attitude is achieved.
The satellite dynamics [17,18,19] represented by the
equations below with the three equations representing
roll, pitch and yaw axis respectively with Td and Tc
representing the disturbance torque and control torque
respectively.
()
()
()
The transfer function [19] of the satellite is obtained
through the above set of equations and is given below
=
(9)
As indicated by the above equation the required change
in angle (s) to correct the error in attitude is obtained
from the torque T(s) generated by the actuator.
TABLE 2CUBESAT MODEL PARAMETERS
Notation
Variable
Magnitude
I
CubeSat inertia
2.22*10-3
Kg.m2
B
Friction or Drag coefficient
2.2
V. ANALYSIS OF THE OVERALL SYSTEM
DYNAMICS
The fig.5 below displays the various modules of the
CubeSat ADCSmodule. The various disturbance torques
that impact on the dynamics of the CubeSatgravitational
force variation, aerodynamic force and magnetic
torque.TABLE 3 corresponds to the magnitude of the
parameters associated with the CubeSat transfer function
. It is the actuator, which provides the additional torque
that cancels the negative effect arising out of the
disturbance torques.
Fig.5Block diagram of Adcs Module
This work makes use of the open source and user
friendly python to implement the traditional PID
controller as a novel approach.The coding for
implementation of the conventional PID controller
using python programming language by employing the
open source web application-jupyter notebook is
provided below. Initially the system is verified for its
stability by using the bode analysis which has been
plotted below.
Fig. 6 Bode Analysis of the system
The bode analysis clearly states that the stability of the
model considered here is achieved as clearly shown
inTABLE 3.The stability of the system is also
reinforced by the below shown pole-zero map of the
system.
TABLE 3FREQUENCY DOMAIN SPECIFICATIONS
Frequency-Domain Specifications
Magnitude
Gain cross over frequency
64.83 rad/s
Phase cross over frequency
368.62 rad/s
Gain Margin
24.48 db
Phase margin
72.64 deg
# Stability analysis using bode plot
Plt.figure(2)
Control. Bode(L,db,deg,margins)
# Z and P
Control.Pzmap(T)
P=control. Pole(T)
Z=control. Zero(T)
Print(‘poles=’p)
# Crossover freq and stability margins
Gm,pm,w180,wc=control, margin(l)
.
Authorized licensed use limited to: Sri Sai Ram Engineering College. Downloaded on September 29,2023 at 06:15:17 UTC from IEEE Xplore. Restrictions apply.
Fig.7 Pole-Zero Map of the System
The implementation process makes use of numpy,
matplotlib and control libraries. The control library is
made use of to analyze the loop transfer function that
contains the actuator (D.C motor) and CubeSat in series
along with the PID controller which is fed with the
tracking error signal.
The step response of the feedback system after
adjusting the tuning parameters of the PID control is
displayed by the graph below. It can be clearly seen that
the response settles with negligible oscillations to the
required value
Fig. 8 Step Response of Feedback System T(S)
With the output being analogous to critically damped it
can be justified that the system will return to steady
state more quickly than an over damped or under
dampedscenario. The oscillations in the output that are
present for a finite period of time are absent in critically
damped and unlike over damped response critically
damped response which was obtained here ensure that
the response hovers around steady state value more
quickly. Despite different scientific methods being
available for tuning the parameters in a PID control, one
of the widely used methods is trial and error. In our case
the trial and error method is used and it is ensured by
using this method that there are negligible process
oscillations around the steady state value after the
disturbance has been felt by the system The various
time domain specifications with regards to the above
step response is shown in the below TABLE 4
TABLE 4 TIME DOMAIN SPECIFICATIONS
Time-Domain Specifications
Magnitude
Rise Time
0.37129612220586333 Sec
Settling Time
1.0844204204107755 Sec
Overshoot
1.715231581888288
Peak Time
3.0410920485432618 Sec
The PID Controller tuning parameter which ensured
that the steady state has been obtained is mentioned in
the below TABLE 5
TABLE 4 PID CONTROL TUNING PARAMETERS
Tuning Parameters
Values
Proportional Gain
20
Integral Time
5
Derivative Time
0.5
A section of the code for implementation of the attitude
control of a CubeSat using PID controller is shown
below. As mentioned earlier the python code is
implemented using jupiter notebook. As shown below
the actuator and CubeSat being in series are controlled
by the PID controller
importnumpy as np
importmatplotlib.pyplot as plt
import control
# Actuator
num_act = np.array ([10])
den_act = np.array ([0.005,0.685,11.7])
Hpa = control.tf(num_a,den_a)
#print ('Hpa(s) =',Hpa')
# CubeSat
num_c = np.array ([1])
den_c= np.array ([0.00222,2.2,0])
Hpc = control.tf(num_c,den_c)
#print ('Hpc(s) =',Hpc')
Hp = control.series(Hpa,Hpc);
# Step response of feedback system
t,y = control.step_response(T)
plt.figure(1)
plt.plot(t,y)
plt.title("Step response of feedback system T(s)")
plt.grid()
# Time domain specification of the Step response
S = control. step info(T)
for v in S:
Authorized licensed use limited to: Sri Sai Ram Engineering College. Downloaded on September 29,2023 at 06:15:17 UTC from IEEE Xplore. Restrictions apply.
VI. RESULT AND CONCLUSION
Figure 4, 5 and 6represents the stability analysis using
bode plot, pole-zero graph and the closed loop response
for PID control of the system. The result clearly
indicates that the system has been stabilized in the
presence of the disturbance torque. The reduced
overshoot ensures that the system settles at the steady
state value in a reduced time. Moreover the positive
gain margin and phase margin values indicate that the
closed loop stability has been achieved.
This work has considered only a static disturbance and
complex dynamic situations can be analyzed by
providing dynamic and varying disturbance as input to
the process in future work.
This work having achieved its objective also provides
further scope for improvement.By having a hybrid form
of controller there is a huge possibility to overcome the
ambiguities that are present in the representation of
disturbance torque. A hybrid controller with a good
model of the disturbance torque can clearly aid a
feedback controller in its overall impact on the system.
REFERENCES
[1]Bak, T., Wisniewski, R., & Blanke, M. (1996, February).
Autonomous attitude determination and control system for the Orsted
satellite. In 1996 IEEE Aerospace Applications Conference.
Proceedings (Vol. 2, pp. 173-186). IEEE.
[2] Gaber, K., El_Mashade, M. B., & Aziz, G. A. A. (2020). Real-
time implementation of a robust simplified intelligent proportional–
integral control for CubeSat attitude determination system. Control
Engineering Practice, 98, 104377.
[3]Figueiredo, H., & Saotome, O. (2013, October). Design of a set of
reaction wheels for satellite attitude control simulation. In 22 nd
International Congress of Mechanical Engineering.
[4]Bello, A., Olfe, K. S., Rodríguez, J., Ezquerro, J. M., & Lapuerta,
V. (2023). Experimental verification and comparison of fuzzy and
PID controllers for attitude control of nanosatellites. Advances in
Space Research, 71(9), 3613-3630.
[5] Bello García, A., Olfe García, K. S., Ezquerro Navarro, J. M.,
Rodriguez Otero, J., & Lapuerta Gonzalez, M. V. (2019).
Experimental comparison of attitude controllers for nanosatellites.
[6]Chang, G., Xu, T., Wang, Q., Li, S., & Deng, K. (2017). GNSS
attitude determination method through vectorisation approach. IET
Radar, Sonar & Navigation, 11(10), 1477-1482.
[7]Peng, H., & Bai, X. (2018). Exploring capability of support vector
machine for improving satellite orbit prediction accuracy. Journal of
Aerospace Information Systems, 15(6), 366-381.
[8] Chen, S. M., & Dong, Y. F. (2011). Satellite attitude tracking
controller optimization based on particle swarm
optimization. Procedia Engineering, 15, 526-530.
[9]Markley, F. L., & Crassidis, J. L. (2014). Fundamentals of
spacecraft attitude determination and control (Vol. 1286). New York,
NY: Springer New York.
[10]Fritz, M., Shoer, J., Singh, L., Henderson, T., McGee, J., Rose,
R., & Ruf, C. (2015, March). Attitude determination and control
system design for the CYGNSS microsatellite. In 2015 IEEE
Aerospace Conference (pp. 1-12). IEEE.
[11] Vallado, D. A. (2001). Fundamentals of astrodynamics and
applications (Vol. 12). Springer Science & Business Media.
[12] Yang, Y. (2017). Spacecraft attitude and reaction wheel
desaturation combined control method. IEEE Transactions on
Aerospace and Electronic Systems, 53(1), 286-295.
[13]Priyambodo, T. K., Putra, A. E., Asvial, M., Poetro, R. E.,
Hendrantoro, G., Pitowarno, E.,& Nugroho, A. (2014, November).
IiNUSAT-1: The 1 st Indonesian inter-university nano-satellite for
research and education. In 2014 IEEE International Conference on
Aerospace Electronics and Remote Sensing Technology (pp. 114-
120). IEEE.
[14] Markley, F. L., & Crassidis, J. L. (2014). Fundamentals of
spacecraft attitude determination and control (Vol. 1286). New York,
NY: Springer New York.
[15] Taniwaki, S., & Ohkami, Y. (2003). Experimental and numerical
analysis of reaction wheel disturbances. JSME International Journal
Series C Mechanical Systems, Machine Elements and
Manufacturing, 46(2), 519-526.
[16] Mehrjardi, M. F., Sanusi, H., & Ali, M. A. M. (2015, August).
Developing a proposed satellite reaction wheel model with current
mode control. In 2015 International Conference on Space Science and
Communication (IconSpace) (pp. 410-413). IEEE.
[17] Li, J., Post, M., Wright, T., & Lee, R. (2013). Design of attitude
control systems for CubeSat-class nanosatellite. Journal of Control
Science and Engineering, 2013, 4-4.
[18]Lasemi, N., & Shaker, H. R. (2021). Spacecraft attitude control:
Application of fine trajectory linearization control. Advances in Space
Research, 68(9), 3663-3676.
[19] Molina, Juan.Carlos, Ayerdi, Victor, Zea and Luis “Attitude
control model for cubesats”, IAA-Acta astronautica journal, February
2016, pp.1-22.
[20] Krishna, N. S., Gosavi, S., Singh, S., Saxena, N., Kailaje, A.,
Datla, V., & Shah, P. (2018, March). Design and implementation of a
reaction wheel system for CubeSats. In 2018 IEEE Aerospace
Conference (pp. 1-7). IEEE.
[21] Chen, M., Zhang, S. J., Liu, F. H., & Zhang, Y. C. (2008,
December). Combined attitude control of small satellite using one
flywheel and magnetic torquers. In 2008 2nd International
Symposium on Systems and Control in Aerospace and
Astronautics (pp. 1-6). IEEE.
[22] Wang, P., & Shtessel, Y. B. (1998, June). Satellite attitude
control using only magnetorquers. In Proceedings of the 1998
American Control Conference. ACC (IEEE Cat. No.
98CH36207) (Vol. 1, pp. 222-226). IEEE.
[23] Afifa, L. N., Priyambodo, T. K., & Dharmawan, A. (2021,
November). Preliminary Modeling of a CubeSat Attitude Control
System Using a Reaction Wheel. In International Conference on
Innovation in Science and Technology (ICIST 2020) (pp. 90-94).
Atlantis Press.
Authorized licensed use limited to: Sri Sai Ram Engineering College. Downloaded on September 29,2023 at 06:15:17 UTC from IEEE Xplore. Restrictions apply.