Comparison of PD and LQR Methods for Spacecraft Attitude Control Using Star
Trackers
Scott Beatty, University of New Mexico, United States,
scott.beatty@pangeatech.com
ABSTRACT
The work contained herein is a comparison of spacecraft attitude control methodologies that use
reaction wheels for torque actuation and star trackers to infer spacecraft orientation and angular
rate. A Kalman filter was used to estimate Euler angles and angular rate using the measurements
from three star trackers. Using the linearized equations of motion for a rigid body in space, the
linearized stability, effectiveness and robustness of a linear quadratic regulator (LQR) control
design were compared with that of a proportional-derivative (PD) control design. The goal of the
study was to determine the degree to which the optimal gains calculated with the LQR control
law improve the performance of a spacecraft attitude control system in comparison to the non-
optimal gains calculated with the PD control law.
INTRODUCTION
The orientation of an aerospace vehicle flying in the Earth’s atmosphere or orbiting the Earth
at extreme altitudes is referred to as attitude. In the case of a spacecraft; knowledge of its attitude
is a critical requirement when trying to control the direction that the spacecraft is pointing. A
typical spacecraft configuration will use rate gyros to provide continuous real-time measurements
of the spacecraft’s attitude and star trackers or a comparable instrument to provide accurate
attitude updates. The use of star trackers for attitude determination without rate gyros is an
interesting problem.
A basic Inertial Measurement Unit contains orthogonally placed gyroscopes for each body
axis that spin at high RPM to develop a gyroscopic stiffening effect. When an IMU is mounted to
a spacecraft body the spacecraft will essentially move around the gyros. The IMU will return
measurements from sensors attached to the gyros which determine the spacecraft’s angle and spin
rate about each body axis. The gyros in an IMU can provide continuous measurements, however
gyros have a tendency to drift and lose accuracy over time. A Star Tracker works with a
considerably different principal. A Star Tracker uses a CCD imager looking away from the Earth
at a star field to take an image of the star field; an onboard processor will that compare the images
and determine the spacecraft’s attitude based on the differences between the two images. Star
Trackers can provide attitude measurements that are much more accurate then IMU
measurements, however a star tracker cannot provide measurements continuously. A typical
implementation uses both an IMU and one or more star trackers; Star Tracker(s) are used to
determine the initial attitude and subsequent attitude updates for IMU measurements.
Simply put, a reaction wheel is a momentum exchange device. The reaction wheel spins at a
moderate RPM and as it accelerates to increase or decrease its angular velocity it gives
momentum to or takes momentum from one body axis of the spacecraft it is mounted to.
SPACE ENVIRONMENT & ORBITS
A Molniya orbit was selected for this simulation as it was for the previous work. The typical
disturbances at the simulation attitude include solar wind and gravity gradient effects. The orbit
period is approximately 12 hours and inclined at 63.5 degrees to reduce the rate or perigee
precession due to the J2 effect. Figures 1 and 2 show diagrams of the Molniya Orbit and its
period:
Figure 1: Molniya Orbit Diagram Figure 2: Molniya Orbit Period
The specified perigee and apogee radii of the orbit used in this work are 7378.15km and
42164.17km respectively. This gives approximate altitudes of 1000km at perigee and 35785km
at apogee. The eccentricity for this orbit is .7021. The perigee altitude is in the Low Earth Orbit
(LEO) region and the apogee altitude is in the Geosynchronous Earth Orbit (GEO) region. Solar
radiation pressure causes periodic variation in all of the orbital parameters of a spacecraft’s
prescribed orbit. The distance between perigee and apogee are insignificant compared to the
distance of the Earth from the Sun; therefore effect of the solar radiation flux is constant at
I=1350W/m2. The force imparted by solar radiation pressure is defined as:
IA
FINCIDENT =
c
(1)
IA
FREFLECTED =q
c
Where A is the exposed surface area of the spacecraft and c is the speed of light. The term q is
the fraction of radiation that is reflected. The total force is then defined as:
IA
FSP = FI + FR = (1 + q) (2)
c
And, the torque on the spacecraft is:
TSP = RCM 2CP × FSP (3)
The term RCM2CP is the distance from the center of mass of the spacecraft to the center of
pressure of the exposed surface of the spacecraft.
Gravity gradient effects on a spacecraft’s attitude can become significant if the
moments of inertia for each body axis of the spacecraft are not equal. The gravitational
effect on each spacecraft body axis is defined as:
G X = −3Ω(I Z − I Y )φ
GY = −3Ω(I X − I Z )θ (4)
GZ = 0
−μ
where Ω = is the orbital angular velocity, I X , I Y and, I Z are the spacecraft moments of
R3
inertia and φ , θ and,ψ are the spacecraft body Euler angles.
SPACECRAFT ATTITUDE EQUATIONS OF MOTION
To accurately simulate and control a spacecraft, rigorous knowledge of the spacecraft’s
attitude dynamics is required. Three reference frames play an important role in this simulation:
The body frame has its origin at the center of mass of the spacecraft and is fixed to the spacecraft
body, the orbital reference frame is also located at the center of mass of the spacecraft, however,
ˆ
this frame maintains a nadir pointing orientation with the Z O axis pointed at the Earth throughout
ˆ ˆ
the orbit, X O points along the orbital path and YO completes the right hand triad and points
normal to the orbital plane. The Euler angles between the body frame and the orbital frame
represent the spacecraft pointing error. The final reference frame is the inertial frame which is
ˆ
also located at the spacecraft center of mass. The inertial frame is defined as X I points towards
ˆ ˆ
the Earth’s Vernal Equinox, Z I is perpendicular to X I and normal to the Earth’s orbit plane
ˆ
around the Sun and YI completes the right handed triad. The Euler angles between the orbital
frame and the inertial frame represent the nadir pointing requirement for the spacecraft. The A
matrix for the spacecraft is given in (5) and is derived from the Euler moment equations.
(5)
⎡ 0 1 0 0 0 0 ⎤
⎢ − 4 ⋅ Ω 2 ( I y − I z ) + Ωhy − hz − Ω ( − I x + I y − I z ) + hy ⎥
⎢ 0 0 &
Ω ⎥
⎢ Ix Ix Ix ⎥
⎢ 0 0 0 1 0 0 ⎥
⎢ − Ωhy − hz − 3Ω 2 ( I x − I z) − Ωhz − hx ⎥
⎢ 0 ⎥
⎢ Iy Iy Iy Iy Iy ⎥
⎢ 0 0 0 0 0 1 ⎥
⎢ − Ω( I x − I y + I z ) − hy hx Ω 2 (− I x + I y ) + Ωhy ⎥
⎢ −Ω & 0 0 ⎥
⎢
⎣ Iz Iz Iz ⎥
⎦
The states correspond to roll, roll rate, pitch, pitch rate, yaw and yaw rate of the spacecraft
body with respect to the orbital frame since they were obtained by taking the derivative of the
total angular momentum with respect to the inertial frame.
CONTROL SYSTEM SPECIFICATIONS
The simulated spacecraft has three star sensors aligned with the body axes where one star
sensor captures and processes an image every 10 seconds. At each time step where an image is
taken by the star sensors and subsequently an attitude measurement is taken, the dynamics of the
spacecraft are frozen in time to simplify the system such that it is modeled as a linear time
invariant system. The roll and pitch inertias IX and IY are 25,000 kg-m2 and the yaw inertia IZ is
15,000 kg-m2 so that the spacecraft is gravity gradient friendly. In order to accurately compare
the PD and LQR control laws the same design criteria was chosen for the LQR as 0.1 degree.
The PD controller is based on:
x = Ax + Bu
& (6)
where A = A(t k ) = Ak and is the plant matrix frozen at time t k . A state tracking error is
introduced which represents the error between the desired attitude states and the actual attitude
states. The state tracking error is given as:
~ = x−x
x (7)
R
The control input torques is determined from six control gains and the six attitude states:
& &
h X = kVX φ + K X φ
& &
hY = kVY θ + K Y θ (8)
&
h =k ψ +K ψ
&
Z VZ Z
The final representation of equation (6) becomes:
&
~ = A~ + ( Ax − x ) + Bu
x x &R (9)
R c
Where x is the current state vector, x R is the state reference vector and the term ( Ak x R − x R )
&
& &
represents the error between the desired x R and actual x R . The terms B and uc are the control
and input matrices, respectively. The control loop is closed by measuring the angular
momentum of the reaction wheels and the current attitude states in terms of the Euler angles and
Euler angle rates. Then the augmented plant is determined by calculating Aaug k = ( Ak − BFk )
Where F is the gain matrix for the PD control
The linear quadratic regulator (LQR) calculates one step optimal gains for the control of the
dynamic system at each time step in the simulation. The linear quadratic regular is based on the
matrix Riccati equation [14] to minimize the cost function:
V = ~kT+1Qk ~k +1 + u k Rk u k
x x T
(10)
Where ~ is the state tracking error of the spacecraft, Q is the plant covariance matrix and R is the
x
sensor covariance matrix. For the one step optimization the const function becomes:
V = (Φ k x k + Γk u k ) ⋅ Qk ⋅ (Φ k x k + Γk u k ) + u k ⋅ R ⋅ u k
T T
(11)
where (Φ k x k + Γk u k ) = x k +1 and the optimal one step gain is defined as:
u k = −( R + ΓkT QΓk ) −1 ΓkT Qk Φ k x k (12)
The gains are calculated for the single step optimization using (12). The covariance matrix Q
is changing with time so it is expected that the optimal gains derived by the LQR control law will
reduce the magnitude of the torque commands to the reaction wheel resulting in a lower stored
angular momentum in each reaction wheel. Given that the state measurements for both control
laws are discrete and that each set of gains are calculated for a nominal plant matrix at the time
the measurement was taken; the gains must maintain the stability of the controlled system by
keeping the eigenvalues of the augmented plant matrix to the left of the jω axis until the next
state measurement is taken. The system with changes in orbital position is represented by:
&
~ = ( A + δA) x − x + Bu
x &R (13)
c
where δA represents the change in orbital position and attitude of the spacecraft between state
measurements. Therefore the orbital motion of the system between measurements must be
bounded such that the controlled system remains stable until the next state measurement is taken
and a new set of gains are calculated. Figure 8 shows a graphical representation of this
requirement.
Figure 3: Discrete Measurements and Disturbance Bound
Where t1 and t2 are two discrete measurements where a nominal plant matrix is calculated and the
control law gains are calculated. The term δAt n is the allowable bound for the spacecraft’s orbital
motion between state measurements.
RESULTS
Several simulations were executed with varied moments of inertia and sample time periods.
The orbit path for each simulation was divided into 5000 time steps where each step equated to
approximately 0.072 degrees of true anomaly. For the first set of simulations the moments of
inertia were increased for each run by an order of magnitude and maintained their symmetry from
IX=250, IY=250 and IZ=150 to IX=250000, IY=250000 and IZ=150000 in kg-m2; and for each
increase in the moments of inertia the sample times were increased in orders of magnitude from 1
second to 100 seconds. For the second set of simulations the x axis and y axis moments were
increased by percentages of +1.25%, +2.5%, +5% and +10%. Furthermore, the z axis was varied
by the same percentages on a third set of simulations. Varying the moments of inertia and the
sample times provided a good robustness analysis. The LQR control law produced a stable
system with every run. Each of the simulations, however, had maximum sample times; once the
maximum sample times were reached the LQR control law could no longer reach a solution.
The simulations also showed that the LQR control law generated gains that provided overall
improved control of the spacecraft. Throughout all of the simulations the pitch error from the
LQR controller was much the same as the error from the PD controller, however, the roll and yaw
errors were greatly reduced. Furthermore, the control torques to the reaction wheels were also
greatly reduced which lead to less angular momentum possessed by the reaction wheels. Each
simulation has a randomly selected point in the orbit where the plant and augmented plant models
were subjected to a step response analysis. In each case the LQR controlled step responses had
less overshoot and faster settling times then the PD controlled step responses.
CONCLUSION
The work herein implemented two control laws for spacecraft attitude control. A proportional-
derivative control law was shown to stabilize a linearized set of differential equations of motion
which formed a six degree of freedom simulation of a spacecraft orbiting the Earth in a Molniya
orbit and a linear quadratic regulator was implemented to control the same set of equations.
Simulations were conducted using numerical analysis to simulate a spacecraft equipped with
three star trackers where only one star tracker was randomly selected to provide a measurement
for each time step. A Kalman filter was implemented to estimate measurements of the other two
star trackers to determine the six states of the spacecraft’s attitude. The analysis used the
simulations to compare the stability, effectiveness and robustness of the two control laws. The
simulations varied the moments of inertia of the spacecraft symmetrically by increasing the
moments but maintaining the shape of the spacecraft body and non-symmetrically adjusting the
moments to make the shape of the spacecraft body more rectangular. The step response analyses
show that both control laws were able to stabilize the plant and dampen oscillations, however, the
LQR control law shifted the poles of the plant farther to the left of the j-w axis then the PD
control law. Effectiveness was analyzed by looking at step responses randomly executed during
each simulation and comparing the overshoot and settling times. Furthermore, a cost function
was evaluated to measure the pointing errors of the spacecraft while it propagated through its
orbit.
This work has shown that an optimal control law can outperform a PD control law using star
trackers as the only measurement source for attitude determination of a spacecraft. The
simulations also showed that with optimal gains came optimal torque commands which reduced
the total amount of angular momentum input into the spacecraft per time step. As a consequence
the reaction wheels for the spacecraft could be physically smaller if the LQR control law was
used instead of the PD control law. Finally, the simulations suggested that a sample time range
between 10 seconds and 30 seconds would be the most suitable for this spacecraft configuration
since sample times in that range had the best combination of pointing errors, settling times and
was reasonably far from the maximum sample time of the LQR control law.
REFERENCES
[1] Beatty, Scott M., “Comparison of PD and LQR Methods for Spacecraft Attitude Control
Using Star Trackers” Thesis, University of New Mexico, 2005