This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
The Pennsylvania State University
The Graduate School
College of Engineering
RIGID BODY SATELLITE TIME-OPTIMAL ATTITUDE CONTROL USING
α azimuth component of rotation vector (kinematic variable represented by B-Spline generatedby P1 to Pnk )(eg. for nk=6 P1 to P6)
β elevation component of rotation vector (kinematic variable represented by B-Spline generatedby Pnk+1 to P2nk )(eg. for nk=6 P7 to P12)
BL,P k particle position lower bound
BU,P k particle position upper bound
BL,V k particle velocity lower bound
BU,V k particle velocity upper bound
C DCM (Direction Cosine Matrix)
cC cognitive weighting coefficient
cI inertial weighting coefficient
cS social weighting coefficient
εi Euler parameters (i=1, . . . , 4)
gBest global best particle
GG J value associated with global best particle
I Satellite inertia tensor
J objective (or cost) function
J objective function with penalty terms, also referred to as the performance index or fitnessfunction
λi rotation vector component (i=1, . . . , 3)
Mmax maximum torque constraint
ix
Mi torque component (i=1, . . . , 3)
nk number of kinematic points used to evaluate B-Spline. (eg. nk=6)
N number of particles
NIT number of iterations
θ rotation about rotation vector (kinematic variable represented by B-Spline generated byP2nk+1 to P3nk )(eg. for nk=6, P13 to P18)
pBest particle’s best position
Pn(N) swarm where (n=1, . . . , 19 when nk=6) and (N=1, . . . , 30 when N=30)
Pn single particle containing n elements(n=1, . . . , 19 when nk=6)
σi satellite sensor orientation vector component (σ is aligned with b1-axis and used to measureits orientation with the inertial axis)
tf final time of maneuver (Generated by P3nk+1)(eg. for nk=6, P19)
ui control torque (i=1, . . . , 3)
Vn single particle’s velocity containing n elements(n=1, . . . , 19 when nk=6)
ωi body rate (i=1, . . . , 3)
x
Acknowledgments
I would like to acknowledge people who made contribution to writing my dissertation. First of
all, I would like to thank my adviser, Dr. Robert G. Melton, for his continuous help and support
throughout my graduate studies. This dissertation research was an enjoyable process because of his
guidance and advice. Dr Melton was also my teaching mentor during my teaching fellowship at the
Pennsylvania State University. I would also like to thank Dr. David B. Spencer as my secondary
adviser helping me tremendously with this subject material. Drs. Joseph P. Cusumano, and Joseph
F. Horn have taught me some great courses as well as allowing me to audit other courses that have
provided a firm foundation for my research endeavors.
Additionally, acknowledgments have to be given to Vidullan Surendran and Ghanghoon Paik
who have made numerous contributions during my studies and have also been good friends. Vidullan
Surrendran was invaluable with programming related issues and was a great teaching instructor for
his subject as well other areas within the field. Ghanghoon Paik has been great to collaborate with
and has been very helpful during my research work. Kirk Heller assisted with access to the high
performance computing cluster facility with the associated guidance.
Finally, I would like to thank my parents and brother who have done more than enough. This
work could never be finished without their support. My studies to this date would not be possible
without their help and assistance.
xi
Chapter 1 |
Introduction
The subject of interest in this dissertation is the time-optimal reorientation of a rigid body
spacecraft with path constraints. There is a class of problems in satellite attitude dynamics that
deals with a combination of time and fuel optimization. There are other problems that deal with fuel
optimization alone, including a zero-propellant maneuver of the ISS (International Space Station)
conducted in 2006 by NASA [1]. The first set of time optimal maneuvers conducted for a spacecraft
was part of the TRACE Mission in August 10th,2010 [2]. The objective was to acquire telemetry
data (i.e snapshots at numerous terrestrial locations) in a series of attitude maneuvers over the
shortest possible time. This resulted in a similar result to the classical Brachistochrone problem
where a longer path was taken to achieve the time-optimal solution. In this case, the path length
was characterized by the accumulated arc lengths of each angular rotation.
The time optimal solution in the TRACE mission was conducted offline [3]. That is, the problem
was prescribed and solved using ground-based computing facilities and resources and then uploaded
to the spacecraft via a datalink for a future slew operation. The reason for this is that these time
optimal solutions are difficult to find, even approximately, and require significant time to solve
completely. Required solution times were greater than 20 minutes during this milestone of the first
time optimal maneuver. Feasible solutions, that is local optimal solutions, can be obtained faster
but looking through the entire control space for global optimal solutions requires more time and a
1
different approach than what was used for the TRACE mission.
The spacecraft mission that inspired this research is the Swift Gamma Burst spacecraft mission
[4].The purpose of this mission is to detect GRBs (gamma-ray bursts) which are powerful explosions
in the universe. They occur usually once a day and are brief, with Swift detecting about 100 bursts a
year. The BAT (Burst Alert Telescope) detects the GRB using a wide field of view. The instruments
are shown in Figs (1.1) [3]. With the position detected the spacecraft swiftly slews the spacecraft to
align the XRT (X-Ray Telescope) and the UVOT (Ultra-Violet/Optical Telescope) within 90-180
seconds. All three telescopes acquire critical data from the rapidly fading afterglow from the GRB.
Figure 1.1: Swift Instruments
An example of a maneuver for Swift is shown in Fig (1.2) where the initial orientation of the
telescope axis as represented by a dashed green line. It has to terminate its re-orientation in the
direction of the solid red line,the next GRB target, while avoiding the bright yellow sun cone, blue
Earth cone and the grey moon cone as those optical sources could damage the delicate light-sensitive
telescope. Presently, Swift computes a slewing maneuver primarily designed to make the telescope
axis avoid entering the “keep-out” cones, but without trying to minimize the slew time.
The focus of this dissertation is to develop techniques that can aide in obtaining possible global
2
21
0
Path Constraint Cones
-11
0.50
-0.5
0
-0.5
-1
0.5
1
Earth Keep Out Cone
Moon KeepOut Cone
Sun KeepOut Cone
Inital Starting Sensor Orientation
Final Sensor Orientation
Figure 1.2: Path Constraint Cones
minimum-time solutions and reduce the computation time such that the computing can be conducted
on-board the spacecraft in real-time, that is RTOC (Real Time Optimal Control). In order to seek a
global solution the research employs the method of PSO (Particle Swarm Optimization). The heart
of the research examines techniques to speed up the computation time, including the development
of the Inversion Method. Once this method has been demonstrated, the PSO utilizing the inversion
method is then parallelized to speed up the calculation. A discussion of an architecture of a near
real time control system for attitude control of a spacecraft is considered.
3
Chapter 2 |
Literature Review
This chapter seeks to provide a broad survey of the literature pertaining to optimal attitude
maneuvers of rigid bodies. This chapter was presented at the AAS/AIAA Space Flight Mechanics
Conference in Williamsburg, Virginia, 2015 [5]. It is rather limited in breadth, given that papers
addressing flexibility effects or modeling multibody dynamics (e.g. gyroscopic devices) are not
included. Those constitute a vast body of work and, although clearly important to theoretical and
practical issues in spacecraft dynamics, lie beyond the manageable scope of this dissertation. An
earlier survey by Scrivener and Thompson [6] considers a variety of dynamical models, all pertaining
to the time-optimal reorientation maneuvers but it pre-dates the development of global search
methods, such as the one used in this dissertation.
The papers surveyed here could be divided by problem type or method of solution, with many
combinations of categories. Instead, we begin with a discussion of features that are common to
nearly all of the work, and focus later on specific aspects of current interest. Nearly all of the papers
surveyed here employ some method of optimal control theory, using either a classical indirect method
(calculus of variations and Pontryagin’s Minimum Principle) or a direct method. A concise history
of the problem is shown in Fig.(2.1).
4
Figure 2.1: History of Time Optimal Attitude Problems.
Unconstrained Paths
All of the papers surveyed here include some constraints on the initial and final states, with the
rest-to-rest maneuver being most commonly addressed. Problems that include path constraints, i.e.,
restrictions on the orientation of one or more body axes during the maneuver, will be addressed in a
later section.
5
The earliest work in the open literature, by Dixon et al [7], examines the problem of minimizing
fuel usage when only two impulsive control torques are employed. The kinematic formulation uses
Euler angles, and although large-angle maneuvers are considered, the potential for encountering a
singularity is not addressed. D’Amario and Stubbs [8] develop a closed-loop controller that executes
an eigenaxis maneuver (rotation about a single axis that is fixed in both the inertial and body fixed
frames) between two rest states of a spacecraft.
Bilimoria and Wie’s seminal paper [9] considers the time-optimal rest-to-rest maneuver of a
spherically symmetric1 spacecraft, with independent control torques of equal maximum authority
for each axis. The problem requiring a time optimal 180 deg. rotation about the z-axis with no
path constraints is shown in Fig.(2.2) [9] with the path traversed and body rates of the optimal
solution. The solution is bang-bang2, with the number of control switches between extreme torque
values depending upon the magnitude of the reorientation angle. For cases where the equivalent
eigenaxis rotation would have been less than or equal to 72 deg, seven switches are required; for
reorientations greater than 72 deg., only five switches are required. These results are shown in
Fig.(2.3) [9]. Interestingly, the time-optimal solution is not a simple eigenaxis maneuver. The
optimal solution makes use of the fact that not all directions have the same maximum control torque
available, and the dynamics can include precessional motion to reach the final specified attitude
more rapidly than if a single axis were employed. These precessional components are resolved in in
Fig.(2.4) [9]. It can be seen in the uz component of the figure that the area A is greater than area B
which results in a greater net torque over the eigenaxis torque shown in dotted lines. The ux and uy1The symmetry refers to the mass distribution. In fact, the significant property is that all three principal moments
of inertia are equal.2Bang-bang has torque at either fully maximum or minimum.
6
component show a similarity between the two torque profiles. The authors use an indirect method,
solved numerically via a multiple shooting method.
Bilimorie and Wie 1993
Constrained Time-Optimal Slewing Maneuvers for Rigid Spacecraft
Figure 2.2: Unconstrained Path and Body Rate Solutions.
Seywald and Kumar [10] consider the possibility of singular control (with independent three-axis
controls) for spherically symmetric mass distributions, and for a variety of initial and final states.
They show that all three controls cannot be singular, i.e., one control torque must always be
saturated, that is fully maximum or minimum. In this thrust control,minimum control means
maximum thrust in the opposite direction. It is possible for one or two controls to be singular, with
finite or infinite order. Subsequently, Byers [11] showed that no singular control is possible for the
7
Time-Optimal Three-Axis Reorientation of a Rigid Spacecraft
Bilimorie and Wie 1993
Control Input for ø = 180 (5 switches) Control Input for ø = 30 (7 switches)
Figure 2.3: Unconstrained Torque Solutions.
case of a rest-to-rest maneuver for this problem.
Byers [12] developed an approximate analytic solution to the problem of time-optimal, rest-to-rest
maneuvers for asymmetric spacecraft. The solution uses a truncated Taylor series to represent the
state transition matrix, with the coefficients in the series generated recursively.
Shen and Tsiotras [13] consider an axisymmetric body with only two control torques available.
The vehicle is spin-stabilized about its unique symmetry axis, which must be reoriented to a specified
direction in minimum time. A special set of kinematic variables [14], valid only for axisymmetric
8
Bilimorie and Wie 1993
Time-Optimal Three-Axis Reorientation of a Rigid Spacecraft
Figure 2.4: Precessional components per axis.
bodies, is used.
Bai and Junkins [15] revisited the problem first considered by Bilimoria and Wie, and found that
there are multiple local minima, with some having six control switches when the reorientation is less
than or equal to 72 deg. They also found that if the total control torque magnitude is bounded, the
time-optimal solution is the eigenaxis maneuver. This is entirely consistent with the fact that such
a system is degenerate – every orientation of the body axes in the physical object will lead to the
same dynamics in a given problem, and the same maximum control torque is available about any
direction.
A different problem, considered by Molodenkov and Sapunkov [16] uses a performance index
9
that is a linear combination of time and control effort
J =∫ T
0(α1 + α2|u|) dt (2.1)
where α1, α2 are constant weighting factors, and the final time T is unspecified. The body has a
spherically-symmetric mass distribution and the components of the control torque u are independent
and bounded.
Li et al [17] examine the global stabilization problem (i.e., how to control a spacecraft from an
arbitrary set of initial conditions to some specified equilibrium point). They treat the problem in
terms of optimum tracking, with the performance index for the kinematics being quadratic in the
states (quaternions 3 and angular velocities); the controller then tracks the resulting optimal state
trajectories. The method can achieve global stability in the absence of external disturbances, and
can converge to a neighborhood of the desired equilibrium if disturbances are present.
The papers by Crassidis and Markley [18] and Crassidis et al [19] involve tracking problems,
wherein an optimal trajectory is first computed and then the controller must force the spacecraft to
follow it. Such requirements arise typically in spacecraft mission designs where a particular event
must be anticipated, for example, a high-speed planetary flyby in which the spacecraft must execute
a defined attitude maneuver in order to capture visual details of the planet’s surface. Other papers,
by Sharma and Tewari [20], Kim and Kim [21], and Krstic and Tsiotras [22] also treat the problem
as a tracking task.
Ioslovich [23] and Ioslovich et al [24] both consider asymmetric spacecraft maneuvering with3See Chapter 3 for an explanation of quaternions.
10
performance index of∫
Σ|ui| and∫|u| respectively, with tf unspecified. Liu and Singh [25] solve the
problem of combined time and fuel, assuming that the solution has bang-bang control structure.
They use a switching-time optimization algorithm to determine the optimum switching times that
satisfy the first-order necessary conditions.
Geometric control methods take advantage of known properties of the solution space – in the
case of attitude maneuvers, the motion from initial to final attitudes is an orthogonal transformation
that can be represented as motion on the manifold defined by the group SO(3). SO(3) is the group
of all rotations in the Euclidean space of dimension order of 3. Two papers that use geometric
control for this advantage are Spindler [26], which considers a rest-to-rest maneuver, using a system
that minimizes the kinetic energy of rotation over a fixed time-interval. The problem is formulated
in a way that avoids the use of costates, but instead introduces differential equations for the controls.
Biggs and Horri [27] use geometric control in the problem of a spin-stabilized spacecraft that must
be reoriented in a fixed time-interval, using a performance index that is quadratic in the control
torque.
In practice, attitude regulators generally operate in conditions where attitude errors resulting
from small disturbances must be corrected; however, in the event of a large disturbance or if initial
conditions place the spacecraft in an unanticipated attitude state, a regulator may need to perform a
large-angle maneuver. Tewari [28] develops a nonlinear feedback control for an attitude regulator for
an asymmetric spacecraft. The formulation uses Modified Rodriguez Parameters (MRP’s) for the
kinimatics 4 and a performance index that is quadratic in the control torques, but higher-order in the
states due to cross-coupling in the dynamics. Global stability is proven via Lyapunov analysis and4See Chapter 3 for an explanation of MRP’s.
11
the simulated performance shows rapid convergence. Tsiotras [29] examines the regulator problem for
an axisymmetric spacecraft. The performance index is quadratic in the states, and the formulation
uses the special kinematics [14] noted earlier for axisymmetric bodies. Mazenc and Akella [30]
consider the problem of attitude regulation when there is a delay in the input (e.g., a transport
delay due to signal propagation time from ground control to the spacecraft). For an asymmetric
spacecraft, they show that arbitrarily large reorientation maneuvers can be controlled without a
limit on the time delay.
Path Constraints
Path constraints, such as restrictions on the permissible direction that one or more axes of the
spacecraft can have during the maneuver, pose additional challenges. These constraints typically
arise from operational concerns, such as preventing intense sunlight from damaging an optical sensor.
These so-called keep-out constraints maintain a minimum angular distance αx between some specified
axis σ fixed in the spacecraft and the direction σX to the object X to be avoided.
Cx = σ · σx − cos(αx) ≤ 0 (2.2)
In the classical indirect method, one then augments the Hamiltonian with the term µxCx, where
the multiplier µx ≥ 0 if the constraint is active and µx = 0 otherwise. Furthermore, the so-called
tangency conditions [31] must also be applied (i.e., for any part of the trajectory on the boundary,
not only C, but also its first and second time derivatives must be zero).
12
Hablani [32] develops a control algorithm that prevents the boresight of an onboard telescope
from entering the keep-out cone of a bright object. The controller uses pitch and yaw commands to
execute the maneuver, and roll commands to maintain communication with a ground station. In the
event that the boresight encounters a keep-out cone boundary, the controller forces the spacecraft
to move such that the boresight slides along the constraint boundary until an exclusion-free zone
with a path to the target becomes available. Spindler [33] uses geometric control theory to solve
the path-constrained problem with a performance index that is quadratic in the angular velocities.
Such a formulation has practical merit for missions where structural considerations preclude the
use of high angular rates in the maneuver. Mengali and Quarta [34] also consider the problem of
reorientation when keep-out cones are present. Although their formulation is not cast as an optimal
control problem, the solution encompasses the use of both high-level control torques (e.g., from gas
jets) using discrete control laws, as well as low-thrust (field-effect electric propulsion) devices with
continuous control laws that can achieve high-precision attitude targeting. Melton [35] examines
the time-optimal problem for a spherically symmetric spacecraft where multiple keep-out cones are
present. Later work [36] shows that the time-optimal solutions do not include any trajectories that
cause the sensor axis to intersect the exclusion boundary either along a finite arc or at a point.
While keep-out cones and allowable sensor paths are easily visualized in physical space, the
permissible paths of the attitude parameters and how their relation to physical space pose an
interesting challenge. Recent work by Tanygin [37] combines a graph-search technique with a
mapping transformation that allows one to determine the minimum angular-length path and to
visualize that along with the alternative feasible solutions. Weiss et al [38] also use a graph-search
13
algorithm and then implement a controller that follows the minimum-angle path. Although these
methods are interesting, it must be remembered that the minimum-angle path is generally not the
time-optimal solution.
Use of Direct Methods
Unlike the classical approach to optimal control, the so-called direct methods do not make explicit
use of the necessary conditions [see Eqs (6.3)], but instead directly minimize the performance index,
subject to whatever state, control, and/or path constraints are present, plus other constraints that
are peculiar to the method. The more accurate direct methods use nonlinear programming to
calculate values of a finite set of parameters that are being used to model the control.
Direct collocation with nonlinear programming (DCNLP) became popular for use in orbital
trajectory optimization after Enright and Conway [39] demonstrated its efficacy in that type of
problem. DCNLP is characterized as a local method, since the solution is constructed piecewise
between discrete times (nodes) in the maneuver. Between any pair of nodes, each state is modeled
as a polynomial in time. At each node, the state value and its time-derivative are continuous.
An equality constraint is added for each state: the defect (the difference between the state’s time
derivative as calculated from the polynomial model and as calculated from the state equations) at
one or more collocation points between the nodes must equal zero. The result is an implicit solution
to each state equation. Scrivener and Thompson [40] employed DCNLP to solve the time-optimal
reorientation problem, showing that good approximations are possible by minimizing the magnitudes
of the defects but without requiring them to be identically zero.
14
Pseudospectral (PS) methods have grown in popularity, again with the initial applications being
in orbital trajectory optimization problems. Unlike DCNLP, the PS methods solve the collocation
problem globally, using a sum of orthogonal polynomials for each state and control that is valid
over the entire time-span of the motion. The collocation points are the nodes, which are required to
be the locations where the finite polynomial expansion exactly represents the function value (state
or control). In general, many fewer nodes are required for PS solutions (compared to DCNLP),
greatly reducing the computational burden. Fahroo and Ross [41] first developed a practical PS
method based upon Chebyshev polynomials, later implemented in the Dido software package [42]
using Legendre polynomials. Two other software implementations of PS methods, PSOPT [43] and
GPOPS-II [44], have found use in attitude maneuver problems [45,46].
Proulx and Ross [47] apply a Legendre PS method to solve the time-optimal reorientation
problem for an asymmetric spacecraft. Their hybrid method uses a genetic algorithm (GA) to
provide a coarse initial estimate of the states and controls as inputs to the PS algorithm; however,
the GA sometimes finds local minima that are far from optimal. Melton [48] compares two heuristic
algorithms known for their global search performance, particle swarm optimization (PSO) and
bacteria foraging optimization (BFO), for use as first-stage estimators for input to a Legendre PS
method. For either first-stage estimator, the overall computation time is significantly reduced as
compared to using just the PS method. Zhuang and Huang [49] use a hybrid PSO-PS method to
study the problem of time-optimal reorientation for an underactuated spacecraft (e.g., when one
control thruster pair has failed), finding superior computational performance to either the PSO or
PS method used individually.
15
Fleming et al [50] apply a PS method to the time-optimal maneuver for an asymmetric spacecraft
and then demonstrates high-fidelity performance when the control is implemented (in simulation) as
closed-loop. Such implementation is possible, in part, due to the rapid calculation that PS methods
afford. An example of optimal attitude control being implemented in an actual spacecraft is given
by Karpenko et al [51], which describes the first flight demonstration of a time-optimal maneuver,
performed in 2010 onboard NASA’s TRACE Space Telescope.
With the literature review, including the optimal time path unconstrained problem and the
preliminary path constraint problem, it is possible to now provide a formulation and method solution
in the next chapter to further investigate this problem.
16
Chapter 3 |
Problem Formulation and Method of Solution
3.1 Kinematic Formulation
For practical reasons, the dynamics are almost always modeled using Euler’s equations of rigid
body motion
I1ω1 + ω2ω3(I3 − I2) = u1
I2ω2 + ω3ω1(I1 − I3) = u2 (3.1)
I3ω3 + ω1ω2(I2 − I1) = u3
where the Ii are the principal moments of inertia, the ωi are the angular velocities (body rates)
about the principal axes, and the ui are the control torques. Onboard controllers generally use
inputs from sensors that directly measure (or estimate) the angular velocities ωi. Generally, some
additional representation of the spacecraft’s instantaneous attitude is needed, along with a way to
relate the body rates with how the attitude is changing, which is addressed in the next section.
17
Kinematic Formulations
For practical implementation where a controller needs only to regulate a spacecraft’s attitude in
some fixed orientation, it may be reasonable to employ Euler angles [52] to specify instantaneous
attitude; however, for large-angle reorientation maneuvers (so-called slew maneuvers), the transfor-
mation between body rates and Euler rates (time-derivatives of the Euler angles) will likely encounter
a singularity. Two other formulations, Euler parameters and Modified Rodrigues Parameters, avoid
that difficulty and are commonly used in attitude dynamics and control problems.
Euler Parameters (Quaternions)
If a = [a1, a2, a3]T and b = [b1, b2, b3]T are dextral, orthonormal basis vectors that define the
orientations of two coordinate systems A and B, the relationship between them can be defined
using a direction cosine matrix (DCM) CAB such that b = CABa. Each element Cij = bi · aj is the
cosine of the angle between the two corresponding unit vectors. The DCM can be generated via a
sequence of, at most, three simple rotations about unique directions (i.e., the standard Euler-angle
representation). Because a DCM is an orthogonal matrix, there must exist one eigenvector with unit
eigenvalue: CABλ = λ. Geometrically, rotating the set a about the direction λ through an angle
θ will bring system A into alignment with system B. Thus, a single rotation, called the eigenaxis
rotation describes the orientation of B with respect to A, replacing the sequence of Euler-angle
rotations. The information embodied in the set (λ, θ) is more practically represented in the Euler
18
parameters
ε1 = λ1 sin θ2 (3.2a)
ε2 = λ2 sin θ2 (3.2b)
ε3 = λ3 sin θ2 (3.2c)
ε4 = cos θ2 (3.2d)
The Euler parameters are frequently, and incorrectly, referred to as quaternions. Although the
two are closely related, quaternions obey the algebra of hyperimaginary numbers, a property that has
important benefits for reducing computation in systems where orientations are changing rapidly [53].
In fact, Euler parameters and quaternions embody identical information. The two names are used
interchangeably in the literature, and this dissertation follows that practice. Conversion between
Euler parameters and the related DCM is given by
C =
1− 2(ε22 + ε2
3) 2(ε1ε2 + ε3ε4) 2(ε1ε3 − ε2ε4)
2(ε2ε1 − ε3ε4) 1− 2(ε21 + ε2
3) 2(ε2ε3 + ε1ε4)
2(ε3ε1 + ε2ε4) 2(ε3ε2 − ε1ε4) 1− 2(ε21 + ε2
2)
(3.3)
ε4 = 12 (1 + trC)1/2 for 0 ≤ θ < π (3.4)
19
ε = 1ε4
C23 − C32
C31 − C13
C12 − C21
if ε4 6= 0 (3.5)
where ε = [ε1, ε2, ε3]T . The case of θ = π presents a practical problem for numerical calculations,
but Markley [54] provides an algorithm to address this. Unlike the kinematic relation between body
rates and Euler rates, the conversion [55] between body rates and Euler-parameter rates does not
contain any singularities
ε1
ε2
ε3
ε4
=
ε4 −ε3 ε2 ε1
ε3 ε4 −ε1 ε2
−ε4 ε1 ε4 ε3
−ε1 −ε2 −ε3 ε4
ω1
ω2
ω3
0
(3.6)
Modified Rodrigues Parameters
A more compact expression for the single-axis rotation simply divides each of the εi; i = 1 . . . 3
by ε4, giving
ρ = λ tan θ2 (3.7)
where ρ is called the Gibbs vector, and its components ρ1, ρ2, ρ3 the Rodrigues parameters [52].
There is still a singularity at θ = π. A modification that moves the singularity to θ = 2π is
σ = λ tan θ4 (3.8)
20
and the components σ1, σ2, σ3 are known as the Modified Rodrigues Parameters (MRP’s) [56]. The
relations between the MRP’s and the corresponding DCM are
σ = 1ζ(ζ + 2)
C23 − C32
C31 − C13
C12 − C21
(3.9)
C = I + 8σ2 − 4(1− σ2)σ(1 + σ2)2 (3.10)
where I is the identity matrix, σ = |σ|, ζ =√trC + 1 and
σ = CT −Cζ(ζ + 2) (3.11)
And the kinematic differential equation, also singularity-free, is
σ = 14[(1− σ2)I + 2σ + 2σσT
]ω (3.12)
Alternative Kinematic Forms
While these two preceding methods provide elegant and compact means for representing attitude,
they both suffer from a property of vector geometry, namely that a rotation specified by (λ, θ) is
physically equivalent to the pair (−λ, 2π − θ). This is particularly troublesome for attitude position
controllers, where a small rotation angle δ might suffice to correct an attitude error, but instead
the controller commands the larger rotation 2π − δ. This phenomenon, known as unwinding, can
21
be avoided in one of two ways. Sanyal [57], Lee et al [58] and Bloch et al [59] use a Lie-algebraic
formulation and rotation matrices (a general form of a DCM’s) that does not require specifying
coordinate systems and which is singularity free. They also make use of a geometric integrator,
which preserves the geometry of the flow, leading to greater numerical accuracy than the more
commonly used Runge-Kutta schemes.
Yet another method is to retain the use of Euler parameters or MRP’s for propagating the
attitude kinematics, but specify the desired final state in a form independent of the eigenaxis
direction. Following Melton [35], where only one axis (aligned with a telescope) has a specified final
orientation, one could employ the same method to specify the orientations of two of the body axes,
e.g., b1 and b2. A required final attitude b1 = b1,f , b2 = b2,f becomes b1 · b1,f = 1 and b2 · b2,f = 1.
Using Eq. (3.3) to represent the instantaneous orientation of the bi (denoted by superscript B) and
the desired final orientation of bj,f (denoted by superscript F ) in terms of an inertial frame N
b1 · b1,f = 1 =[1− 2
(εB2
2 + εB32)] [1− 2
(εF2
2 + εF32)]
+[2(εB1 ε
B2 + εB3 ε
B4
)] [2(εF1 ε
F2 + εF3 ε
F4
)](3.13)
+[2(εB1 ε
B3 − εB2 εB4
)] [2(εF1 ε
F3 − εF2 εF4
)]
which is invariant in the direction of the λ rotation. A similar expression can be written for the dot
product b2 · b2,f = 1. Schaub et al [60] present a universal attitude penalty function for use as part
of the performance index (see the next section) that is independent of the attitude representation.
22
3.2 Particle Swarm Optimization
Particle Swarm Optimization (PSO) is considered a heuristic computational method that mimics
the behavior of swarm of birds or insects as it searches for food. A swarm consists of k particles
each of which represents a possible candidate solution.Each particle consists of a set of n unknown
parameters that define the solution. The particles are initially assigned randomly generated values
within the range of the upper and lower bound B.:
BL,P k ≤ Pk ≤ BU,P k (k = 1, . . . , n) (3.14)
The current value of the i-th particle is called its position P(i), referring to its location in the
n-dimensional solution space. The swarm is represented by the matrix P.
P (i) , [P1(i) . . . Pn(i)]T (i = 1, . . . , N) (3.15)
Here N is the number of particles. Each particle has a velocity (rate of change over the iteration).
Each velocity vector component Vk(i) has bounds that are derived from the limits of position vector
components in Eq. (3.14). The range of the velocity vector components are defined as:
−(BU,P k −BL,P k) ≤ Vk ≤ (BU,P k −BL,P k) (3.16)
BL,V k ≤ Vk ≤ BU,V k (3.17)
23
In each iteration, the new position of a particle P (j+1)k (i) is determined by adding its velocity
(times one iteration) to its current position:
P(j+1)k = P
(j)k + V
(j)k (j = 1, . . . , NIT ) (3.18)
If an updated position exceeds the bounds of Eq. (3.14), the iterated position is set to that bound.
That is, it is set to the lower bound if a value is smaller than the lower limit, or upper bound if a
value is greater than the upper limit . In these extreme cases the velocity of the iteration is set to 0
as [61]:
P(j+1)k =
BL,Pk
if P(j+1)k < BL,Pk
BL,Pkif P
(j+1)k > BU,Pk
and V(j+1)k (i) = 0.
Each particle is evaluated to determine the corresponding values of the cost function J. Each
particle of the swarm has a particle best position (pBest) recorded throughout its own solution
history in terms of the cost function J.There is also a global best position (gBest) amongst all
particles. The global best position of the swarm is shared amongst all the particles in the swarm [62].
The objective function J (j)(i) for pBest of particle i at the j-th iteration is:
J (j)(i) = min J (1,...,j)(i) (3.19)
where (i=1, . . . , N ) then, pBest is determined as:
pBest(j)(i) = P (l)(i)(l = arg minp=1,...,j J
(p)(i))
(3.20)
24
Similarly, the globally best J among all the swarm is:
J(j)Best(i) = min J (1,...,j)(i) (3.21)
and the gBest is:
gBest(j) = pBest(j)(q)(q = arg mini=1,...,N J
(j)Best(i)
)(3.22)
The velocity vector is calculated as follows :
V(j+1)k (i) = cIV
(j)k (i) + cC
[pBest
(j)k (i)− P (j)
k (i)]
+ cS[gBest
(j)k − P
(j)k (i)
](3.23)
where the coefficients of the various components of the vectors are given by :
cI = 1 + r1(0, 1)2 cC = 1.49445r2(0, 1) cs = 1.49445r3(0, 1) (3.24)
where r1(0,1), r2(0,1), and r3(0,1) are random numbers uniformly distributed between 0 and 1. The
numerical values used are commonly used weightings that were determined experimentally by early
researchers to give the best performance for a wide class of problems. The subscripts I, C and S
stand for inertial, cognitive and social. The value of cI determines how much the new velocity for
the i-th particle continues in the same direction as the current velocity. The value of cC determines
how much the new velocity is directed toward the best position ever reached by that particle. And
the value of cS determines how much the new velocity is directed toward the best posiiton ever
25
reached by any particle in the swarm.
A well known problem with PSO (and other heuristic methods as well) is that of stagnation,
in which the swarm collects at some point in the n-dimensional solution space and does not move
for many iterations. In order to help avoid stagnation, the PSO algorithm (shown below) contains
a unique modification for this research. An additional step is added after each iteration to check
the progress of the value of J for the global-best particle. If J has not decreased by a specified
percentage over the previous nr iterations (a value chosen by the user), then some specified fraction
of the particles is reset: those particles are assigned random values within the allowed bounds and
the iterative process continues; however, the value of gBest is retained. This has proven to work
very well in preventing stagnation, although it sometimes requires a number of resets to move the
swarm away from the stagnation point.
Algorithm 1 Particle Swarm OptimizationInitialize a population of particles with random values positions and velocities from n dimensionsin the search spacefor Number of Iterations NIT do
for Each particle i doAdapt velocity of the particle using Equation 3.23Update the position of the particle using Equation 3.18Evaluate the Cost Function J((P )i)Update pBest using Equation 3.20Update gBest using Equation3.22
end forend for
26
3.3 The B-Spline
The kinematic variables (quaternions) can be represented by B-Splines. The particle parameters
of the PSO provide the control points of the B-Splines in the algorithms used in this dissertation.
The B-splines generated will represent the variable α, β and θ as defined by Fig.(4.1) and their
associated derivatives are shown to be used in equations (4.16) and (4.23), that is, the first derivatives
and the second derivatives of the B-splines.
The use of Bezier curves are sufficient approximations for the kinematics variable α, β and θ, but
the more general B-Spline was used in this implementation. Bezier curves use Bernstein polynomials
whose algorithm implementations are much simpler to implement and have a global property where
a single change in a control point affects the entire curve. The Berstein polynomials generate the
basis functions which are then affected by control points. The more general B-Spline has a local
property in that, depending on the degree of the polynomial fit, only the local region is affected
by any changes in a control point and as such only the basis functions around the control point of
interest have to be recalculated. The algorithm used in the dissertation calculates the entire B-Spline
each time a particle is updated. Fig.(3.1) shows an update of the α kinematic spline being updated
by a PSO iteration. Similarly the β and θ kinematic splines would be updated in a similar manner
with the goal of minimizing the tf (the final element of the particle) which is shared amongst all
three kinematic splines.
The α kinematic component shown in Fig.(3.1) is the B-spline and is defined in terms of control
points Pi and coefficients Ni,p. which are determined by the basis functions hence the name B-spline.
27
Figure 3.1: B-Spline Formulation with PSO update.
The α in terms of some parameter τ is
α(τ) =n+1∑i=1
Ni,p(τ)Pi (3.25)
Shene [63] provides the mathematical background to the B-Spline implementation and Melton
provides a Matlab implementation in Appendix E.
28
3.4 Overall Flowchart
Fig.(3.2) shows a flowchart that implements the methods already described in this dissertation,
that is the workflow between Sections 3-6. The workflow shown in Fig.(3.2) between (Section
3.2)Update Particle connected to Operate on Single Particle connected to (Section 3.3) Generate
B-Spline, represents Fig.(3.1).
α, β, and θ
α β θ
Figure 3.2: Overall Flowchart
29
Chapter 4 |
Application
4.1 Application
This chapter looks at the indirect Particle Swarm Optimization, that is, via inverse dynamics,
and compares it to that of direct Particle Swarm Optimization. With the inverse dynamics method
the PSO is applied to the kinematics as opposed to the control torques. This chapter, originally
presented at the AAS/AIAA Astrodynamics Specialist Conference in Vail Colorado, 2015 [64],
has been expanded for completeness. Use of MRPs in [65] made it possible to convert between
the kinematic variables (MRPs) and the angular velocity components, however,quaternions and
not MRPs are the standard kinematic representation used in satellite attitude control systems.
Conversion between quaternion and angular velocity components is accomplished analytically,avoiding
numerical matrix inversion proposed by the the author in [65]. Although this now permits the use
of quaternions in the inverse dynamic formulation, the additional constraint of quaternion normality
(ε21 + ε2
2 + ε23 + ε2
4 = 1) must be exactly incorporated, as explained later in this chapter. The inversion
method has previously been applied to the kinematics using Modified Rodrigues Parameters (MRPs)
by Spiller et al, [65] however the formulation used here makes use of quaternions. In the inverse
dynamics solution, each candidate solution consists of a history of a rotation axis vector and an
associated rotation which is then converted to a quaternion history q(t) and its associated final
30
time tf . The rotation axis vector orientation prescribed by α and β and an associated rotation θ are
approximated by a set of basis splines (B-splines) such that the constraints at the initial and final
times are exactly satisfied. A PSO is then employed to determine coefficients of the B-splines such
that a rotational path satisfies the path and torque magnitude constraints, and which minimizes
tf . The inverse dynamics can then evaluate the body rates and required torque history from the
kinematics and Euler’s equations of motion.
A major consequence of the inverse dynamics is that no integration is required of the governing
equations of motion. The path q(t) and angular velocity ω(t) are found in terms of the B-spline
solutions. As with previous optimization using heuristic methods, the path and control constraints
are included via penalty functions.
4.2 Problem Statement
The physical problem is to minimize the final time tf , so the performance index
J = tf (4.1)
The boundary constraints for the example presented here are
Case B: (keep-out cones included as shown in Fig. (4.8)). The iPSO algorithm found a solution
that takes the sensor axis around the Earth cone going the “long way,” which results in a final time
tf = 5, using 3000 swarm generations. This solution meets all the path constraints, but represents a
local-minimum solution. The kinematics, body rates and torques are shown in Figs. (4.9)-(4.11)
respectively.
Case C: (keep-out cones included, same as Case B). This solution also meets the kinematic
41
0 0.5 1 1.5 2 2.5 3 3.5 4−0.4
−0.2
0
0.2
0.4
0.6
0.8
1
1.2
1.4Body Rates
time
ω
1
ω2
ω3
Figure 4.3: Body Rates for Direct PSO.
constraints, but reveals a different sensor-axis path that goes between the Earth and Sun cones,
with a final time tf = 4.8. The sensor-axis path is shown in Fig. (4.12), and the kinematics and
body rates in Figs. (4.13) and (4.14), respectively. As seen in Fig. (4.15), the torques violate the
torque-limit constraint. This incomplete solution required 2.5 hours of CPU time, using 3000 swarm
generations. Continuing this computation for an additional 9000 generations (6 hours of additional
CPU time) led to the results shown in Figs. (4.16) - (4.19). This complete solution has final time
tf = 4.3 and satisfies all of the constraints.
42
0 0.5 1 1.5 2 2.5 3 3.5 4−1
−0.8
−0.6
−0.4
−0.2
0
0.2
0.4
0.6
0.8
1Torques
time
M
1
M2
M3
Figure 4.4: Torques for Direct PSO.
4.6 Interesting Cases
In Case D we see a path in which the particle swarm cost function is particularly low compared
to other feasible solutions and the result is a PSO solution attempting a path that splits the keep out
cones region minimally. This solution actually appears fairly frequently among all of the simulations
conducted in this research. The reason is that the Earth and Sun cones overlap by only 1.5 deg. A
solution with the sensor axis passing through this narrow intersecting zone results in a small penalty
function value. As a practical matter, this solution would be acceptable since the keep-out cones are
specified by the mission designers to be somewhat larger than necessary to provide a safety margin
43
0 0.5 1 1.5 2 2.5 30
0.5
1
1.5
2
2.5
3
3.5Kinematics
time
αβθ
Figure 4.5: Kinematics for Case A.
for the sensors. Increasing the penalty weight for the cone constraints tends to drive the solutions
toward feasible paths that are not minimum-time (for example, a path such as in Case B).
In Case E we see a PSO infeasible solution that is path-feasible but has torque violations and
initially performs a strange loop. With subsequent iterations the loop is eliminated, with the torque
violations getting minimized as more iterations take place. The presence of the unnecessary loop
in the early iterations is a useful reminder that the inverse-dynamics method always produces a
kinematically and dynamically feasible solution, but that the realistic constraints on the path and
control torques must be enforced by additional means. As seen in Fig. (4.22), that even after 12000
iterations the PSO has not found a path that is constrained to an upper time limit on tf = 5 with
44
0 0.5 1 1.5 2 2.5 3−0.2
0
0.2
0.4
0.6
0.8
1
1.2
time
Body Rates
ω
1
ω2
ω3
Figure 4.6: Body Rates for Case A.
satisfactory torque requirements. If we relax the PSO to allow an upper limit on tf = 6, then the
PSO swarms in on a solution to tf = 5.8528 as shown in Fig. (4.24), and the resulting torques are
within the limits of ±1DU.
45
0 0.5 1 1.5 2 2.5 3−1.5
−1
−0.5
0
0.5
1
1.5Torques
time
M
1
M2
M3
Figure 4.7: Torques for Case A.
46
Figure 4.8: Sensor-Axis Path for Case B.
47
0 1 2 3 4 5−0.5
0
0.5
1
1.5
2
2.5
3
3.5Kinematics
time
αβθ
Figure 4.9: Kinematics for Case B.
48
0 1 2 3 4 5−3
−2.5
−2
−1.5
−1
−0.5
0
0.5
1
1.5
time
Body Rates
ω
1
ω2
ω3
Figure 4.10: Body Rates for Case B.
49
0 1 2 3 4 5−4
−3
−2
−1
0
1
2
3
4
5
6Torques
time
M
1
M2
M3
Figure 4.11: Torques for Case B.
50
Figure 4.12: Sensor-Axis Path for Case C.
51
0 1 2 3 4 50
0.5
1
1.5
2
2.5
3
3.5Kinematics
time
αβθ
Figure 4.13: Kinematics for Case C.
52
0 1 2 3 4 5−1.5
−1
−0.5
0
0.5
1
1.5
time
Body Rates
ω
1
ω2
ω3
Figure 4.14: Body Rates for Case C.
53
0 1 2 3 4 5−3
−2.5
−2
−1.5
−1
−0.5
0
0.5
1
1.5
2Torques
time
M
1
M2
M3
Figure 4.15: Torques for Case C.
54
Figure 4.16: Sensor-Axis Path for Case C (additional 9000 generations).
55
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5−0.5
0
0.5
1
1.5
2
2.5Kinematics
time
αβθ
Figure 4.17: Kinematics for Case C. (additional 9000 generations)
56
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5−0.8
−0.6
−0.4
−0.2
0
0.2
0.4
0.6
0.8
1
1.2
time
Body Rates
ω
1
ω2
ω3
Figure 4.18: Body Rates for Case C. (additional 9000 generations)
57
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5−1.5
−1
−0.5
0
0.5
1
1.5Torques
time
M1
M2
M3
Figure 4.19: Torques for Case C. (additional 9000 generations)
58
Figure 4.20: Path for Case D. (Splitting the Keep Out Cones)59
time0 0.5 1 1.5 2 2.5 3 3.5 4 4.5
-1.5
-1
-0.5
0
0.5
1
1.5Torques
M1
M2
M3
Figure 4.21: Torques for Case D. (Splitting the Keep Out Cones)
60
3000 Iterations 6000 Iterations
9000 Iterations 12000 Iterations
Figure 4.22: Path for Case E. (Looping Path)
61
3000 Iterations 6000 Iterations
9000 Iterations 12000 Iterations
Figure 4.23: Torques for Case E.
62
1.51
0.50
-0.5-1-1
0
1
0.5
1
1.5
-1.5
-1
-0.5
0
2
(a)time
0 1 2 3 4 5 6-1.5
-1
-0.5
0
0.5
1
1.5Torques
M1
M2
M3
(b)
time0 1 2 3 4 5 6
-1
-0.5
0
0.5
1
1.5
2
2.5
3Kinematics
α
β
θ
(c)time
0 1 2 3 4 5 6-1.5
-1
-0.5
0
0.5
1Body Rates
ω1
ω2
ω3
(d)
Figure 4.24: Time relaxation Case E.
63
Table 4.3: Summary of PSO Runs
Num. of Particles Average Run Time No Viol. Minor Viol. Major Viol.30* 2.5 hrs 1/20 19/20 0/20500 68 secs 2/20 16/20 2/201000 134 secs 4/20 14/20 2/201500 197 secs 6/20 12/20 2/20
Table 4.4: Summary of Minor Violations
Num. of Part. Tot. Min. Viol. Torq. Viol. Path Viol. Combined Viol.30 19/20 2long path,0short path 4M and S Cone Split 13500 16/20 1long path,5short path 3M and S Cone Split 71000 14/20 2long path,3short path 3M and S Cone Split 61500 12/20 1long path,2short path 6M and S Cone Split 3
4.7 Summary of PSO
A summary of the PSO runs is given in Table 4.3. The individual run details can be found in
Appendix D. The values in Appendix D that are listed correct to two decimal places are runs that
had no violations, and as such the GG value (which represents the cost function(J ) associated with
the global best gBest value) (3.22) can be divided by 100 to obtain the time-optimal duration. Table
4.4 shows the break up of the minor violations column in Table 4.3. The M and S Cone Split means
that the path violates both the Moon and Sun keep out cones, an example of this scenario is shown
in Case D, Fig.(4.20) and as such is categorized under a path violation. A long path violation results
in a torque violation which is shown in Case E, Fig.(4.22) and Fig.(4.23).
64
4.8 PSO Verification
Fig.(4.25)(a) is an example of the PSO obtained body rate, while the PSO obtained torque
is shown in Fig.(4.25)(b). The PSO obtained torques are used as inputs into MATLAB® using
the ode45 Runga Kutta integrator to integrate Eq.(3.1) to obtain the body rates. When using an
absolute and relative tolerance of 1E-6 for the ode45 integrator we get body rates at the terminal
boundary orientation of a magnitude of the order 2.7E-3 (instead of the complete stop value of zero).
However when we use absolute and relative tolerance of 1E-12 we have an end condition for the
body rate at a much reduced magnitude of 6E-9. The reproduced integrated body rates for this
case are shown in Fig.(4.25)(c). The body rates as determined by inverse dynamics and by direct
integration of Eulers equations are identical, thus verifying the accuracy of the inverse PSO method.
65
time0 1 2 3 4 5 6
-1.5
-1
-0.5
0
0.5
1Body Rates
ω1
ω2
ω3
(a)time
0 1 2 3 4 5 6-1.5
-1
-0.5
0
0.5
1
1.5Torques
M1
M2
M3
(b)
time0 1 2 3 4 5 6
-1.5
-1
-0.5
0
0.5
1REPRODUCED body rates
ω 1ω 2ω 3
(c)
Figure 4.25: Reproduction of Body Rates using PSO Torque Values
66
Chapter 5 |
Parallelization
The goal of performing real time computations for this optimal control problem can be aided
by the parallelizing of operations within calculations. Once a process can be performed in parallel
this can be embedded in a control system using parallel processors. The goal is to achieve real
time satellite maneuvers without the aide of ground control. A process that can be performed
in parallel is the PSO. The particle swarm is broken up into approximately even batches and
the expensive computational cost of evaluating the cost function is performed in parallel amongst
different processors. The issue of the global best particle, which is used as part of the velocity vector
amongst all particles, dictates the structure and nature of parallelization. In parallel computing the
concept of synchronization is an important concept and this needs to be considered when exchanging
values amongst particles.
The initial PSO calculation was conducted in Matlab. For 10000 iterations and 100 particles,
the calculation took 8 hrs on an Intel Core i3 2.27GHz processor. The serial code was converted
to C code in a structure that was suitable for parallel processor operations. For a single processor
operation on the Pennsylvania State University lxcluster.tlt.psu.edu cluster it took 78 seconds to
execute and on the lionxf.cluster.psu.edu it took an average of 58.65 seconds. The complete table
for the lionxf cluster can be seen in Table 5.1.
Table 5.2 shows the result of the aracna.aero.psu.edu cluster, showing just the run-time vs the
Run# GG Comment1 2279 short2 3709 between moon and sun cone3 869 short4 563 short5 3383 infeasible M & S cone6 1549 short7 1619 short8 3316 long path containing a loop9 4186 infeasible M & S cone10 765 short11 1130 short12 576 short13 749 short14 1124 short15 598 short16 646 short17 493.6 short18 1626 long path19 1180 infeasible M & S cone20 994 short
108
Table D.2: (500 Particles, 3000 Iterations)
Run# GG Comment1 57766 infeasible2 2628 between moon and sun cone cone3 495.91 short4 2353 short5 472.39 long path6 499.93 between moon and sun cone7 457.86 short8 1049 short loop9 1113 short10 2289 short11 554 short12 989 short13 2657 short14 466.61 short15 823 short16 57848 infeasible17 2288 short18 436.23 short19 489.19 between moon and sun cone20 60783 infeasible
109
Table D.3: (1000 Particles, 3000 Iterations)
Run# GG Comment1 425.11 short2 1191 short cone3 1060 short4 2053 short5 935 long path6 496.06 between moon and sun cone7 533 short8 1313 short loop9 431.94 short10 560 short11 476.42 between moon and sun cone12 30777 infeasible13 13762 short14 2120 long path15 840 between moon and sun cone16 57825 infeasible17 1470 short18 415.71 short19 2733 short20 670 short
110
Table D.4: (1500 Particles, 3000 Iterations)
Run# GG Comment1 2629 short2 57851 infeasible cone3 447.97 between moon and sun cone4 475.09 between moon and sun cone5 1101 short6 1342 long path7 494.37 between moon and sun cone8 6618 short loop9 422.94 short10 482.55 between moon and sun cone11 473.31 short12 57792 infeasible13 772 short14 437.41 short15 436.09 short16 1977 short17 491.36 between moon and sun cone18 42407 short19 494.16 between moon and sun cone20 1140 short
111
Appendix E|
BSpline Implementation
E.1 BSplines by Shene
B-splines are defined in terms of control points Pi and coefficients Ni,p. The basic definition for
a function Z in terms of some parameter τ is
Z(τ) =n+1∑i=1
Ni,p(τ)Pi
The n+ 1 control points are 2-dimensional, with the 1-axis usually corresponding to time t (or
some other independent variable), and the 2-axis corresponding to some dependent variable, such as
a kinematic variable or a control input. Note that t and τ are not the same; this distinction leads to
a complication later when we need to compute derivatives of Z.
The parameter p defines the order of the spline, which is composed of a linear combination
of polynomials in τ , with the highest-power given by p. Construction of the spline begins with
a knot-string composed of non-descending values of τ : τ1, τ2, . . . , τm+1, where m = n + p + 1. In
most treatments of B-splines, the knot-string is defined to lie on the domain [0, 1]; however, larger
upper values are possible so long as numerical values for the higher powers in the polynomials do
not become a problem. For inverse-dynamics problems, where the initial and final values of the
kinematic variables are fixed, it is useful to employ a clamped B-spline, which requires a special
112
structure of the knot-string. In this case, the values of the knots are given by
τi =
0, 1 ≤ i ≤ p+ 1
(i−p−1n−p+1
)tf , p+ 2 ≤ i ≤ n+ 1
tf , n+ 2 ≤ i ≤ m+ 1
For a clamped B-spline, making the ordinate values of the first two control points equal, and doing
the same for the last two control points, forces the first derivative of the ordinate variable to be
zero at the end points. (This is not required in every problem, but for the rest-to-rest time-optimal
reorientation problem, we know that the initial and final derivatives of the kinematic variables are
all zero; this will also make the body rates zero at the end points.)
Shene gives a useful algorithm for calculating the values of the coefficients for a given value of τ
and given control points Pi. The following triangle algorithm is taken from Shene, with the indices
modified to start at 1 rather than 0.
Triangle Algorithm:
Shene notes that this algorithm is not efficient; however, in practice, it is sufficiently fast.
Computing derivatives of Z(τ) with respect to τ is fairly straightforward, but remember that τ
and t are different! For the derivative dZ/dτ , one forms a new knot-string τ (1) by deleting the first
113
Algorithm 2 B-SplineInput: n, p,m, u, and m+1 clamped knots [ τ1, ..., τm+1 ]
Output: Coefficients N1,p(τ), N2,p(τ), . . . , Nn+1,p(τ) in N [1], N [2], . . . , N [n+ 1]
Initialize N [1 . . . n+ 1] to 0;if τ = τ1 then // rule out special cases
N [1] = 1.0;return
elseif τ = τm+1 then
N[n+1] = 1.0;return
end ifend if// now τ is between τ1 and τm+1Let τ be in knot-span [τk, τk+1);N [k] := 1.0 // degree 0 coefficientfor d :=1 to p do // degree d goes from 1 to p
N [k − d] = τk+1−ττk+1−τ(k−d)+1
N [(k − d) + 1]; // right (south-west corner) term onlyfor i := k − d+ 1 to k − 1 do // compute internal terms
N [i] := τ−τi
τi+d−τiN [i] + τi+d+1−τ
τi+d+1−τi+1N [i+ 1];
end forN [k] = τ−τk
τk+d−τkN [k]; // left (north-west corner) term only
end for// array N [1 . . . n+ 1] has the coefficients.
and last knots from the original string, resulting in
τ (1) = (τ2, . . . , τm)
One also forms a new set of n control points Qi defined by
Qi = p
τ(1)i+p − τ
(1)i
(Pi+1 − Pi), i = 1 . . . n (E.1)
The derivative with respect to τ isdZdτ
=n∑i=1
Ni,p−1(τ)Qi (E.2)
114
where the coefficients Ni,p−1 are computed using the knot-string τ (1) and the value p− 1 in place of
p in the triangle algorithm.
For the second-derivative, d2Z/dτ 2, the above steps are repeated, with a new knot-string τ (2)
formed by deleting the first and last knots in the string τ (1), resulting in a new knot-string
τ (2) = (τ (1)2 , . . . , τ
(1)m−1)
and a new set of control points
Ri = p− 1τ
(2)i+p−1 − τ
(2)i
(Qi+1 −Qi), i = 1 . . . n− 1
and the second-derivative with respect to τ is then
d2Zdτ 2 =
n−1∑i=1
Ni,p−2(τ)Ri (E.3)
where the coefficients Ni,p−2 are computed using the knot-string τ (2) and the value p− 2 in place of
p in the triangle algorithm.
Recall that each spline Z consists of two coordinates. Let the first coordinate g represent time
t, and let the second coordinate f represent the variable being modeled (for example, a kinematic
variable). The spline curve Z(τ) can now be written as Z = (g(τ), f(τ)) or equivalently Z = (x, y)
where x = g(τ) is the actual time t, plotted on the abscissa axis, and y = f(τ) is the variable being
modeled, plotted on the ordinate axis. To determine the derivatives of Z with respect to time t, use
the rules for differentiation:dy
dt= df
dτ
dτ
dt= df/dτ
dg/dτ
and the values of df/dτ and dg/dτ are the components of the derivative dZ/dτ calculated using Eq
115
(E.2), i.e., dZ/dτ is the vector [dg/dτ, df/dτ ]
Calculation of the second-derivative again requires application of the rules for differentiation:
d2y
dt2= d
dt
(dy
dt
)= d
dt
(df/dτ
dg/dτ
)= d
dτ
(df/dτ
dg/dτ
)dτ
dt
=dgdτ
d2fdτ2 − df
dτd2gdτ2(
dgdτ
)2dτdg
=dgdτ
d2fdτ2 − df
dτd2gdτ2(
dgdτ
)3 (E.4)
and the second-derivatives with respect to τ are calculated using Eq. (E.3), i.e. d2Z/dτ 2 =
[d2g/dτ 2, d2f/dτ 2].
E.2 Matlab Code
%% B_Spline Implementation
% By Robert Melton
% May 10th 2016
function [f,f_dot,f_ddot,tx] = B_spline(CP,knots,t)
% inputs are the control points (CP), knots, time
% outputs are the approxiimated function's value f, and it's derivatives
% f_dot, f_ddot
%% CP is a 2D array, with each row containing 2 elements (time, f)
//Zero a l l va lue s o f r e s u l t . Length o f r e s u l t = Order o f d e r i v a t e s + 1 f o r eva l
o f s p l i n e
f o r ( i =0; i<nDeriv+1; i++)
{
r e s u l t [ i ]=0;
}
gs l_bsp l ine_eva l (x ,B,bw) ;
//Evaluate b−s p l i n e at x
f o r ( i =0; i<nCtr lPts ; i++)
{
r e s u l t [0]+= c t r lP t s [ i ]∗ gs l_vector_get (B, i ) ;
}
//Evaluate d e r i v a t e s
gs l_bsp l ine_der iv_eva l (x , nDeriv ,X,bw) ;
f o r ( i =1; i<nDeriv+1; i++)
{
f o r ( j =0; j<nCtr lPts ; j++)
150
{
r e s u l t [ i ]+=c t r lP t s [ j ]∗ gsl_matrix_get (X, j , i ) ;
}
}
gs l_matr ix_free (X) ;
}
151
References
[1] Bedrossian, N., S. Bhatt, M. Lammers, L. Nguyen, and Y. Zhang (2007) “First everflight demonstration of zero propellant manueverTM attitude control concept,” in Guidance,Navigation, and Control Conference, vol. AIAA-2007-6734,(Hilton Head, South Carolina), pp.1–12.
[2] Karpenko, M., S. Bhatt, N. Bedrossian, A. Fleming, and I. Ross (2012) “First flightresults on time-optimal spacecraft slews,” Journal of Guidance, Control, and Dynamics, 35(2),pp. 367–376.
[3] Aeronautics, N. and S. Administration (1998-2010), “TRACE,” .URL http://www.swift.gsfc.nasa.gov
[4] Center, G. S. F. (2004-2016), “The Swift Gamma-Ray Burst Mission,” .URL http://www.swift.gsfc.nasa.gov
[5] Basu, K. and R. G. Melton (2015) “Survey of Optimal Rigid Body Attitude Maneuvers,”Advances in the Astronautical Sciences, 411, pp. 1–11.
[6] Scrivener, S. L. and R. C. Thompson (1994) “Survey of time-optimal attitude maneuvers,”Journal of Guidance, Control, and Dynamics, 17(2), pp. 225–233.
[7] Dixon, M., T. Edelbaum, J. Potter, and W. Vandervelde (1970) “Fuel optimalreorientation of axisymmetric spacecraft,” Journal of Spacecraft and Rockets, 7(11), pp. 1345–1351.
[8] D’Amario, L. and G. Stubbs (1979) “A New Single-Rotation-Axis Autopilot for RapidSpacecraft Attitude Maneuvers,” Journal of Guidance and Control, 2(4), pp. 339–346.
[9] Bilimoria, K. D. and B. Wie (1993) “Time-Optimal Three-Axis Reorientation of a RigidSpacecraft,” Journal of Guidance, Control, and Dynamics, 16(3), pp. 446–452.
[10] Seywald, H. and R. R. Kumar (1993) “Singular control in minimum time spacecraftreorientation,” Journal of Guidance, Control, and Dynamics, 16(4), pp. 686–694.
[11] Byers, R. M. (1995) “On singular controls in time optimal rigid body reorientation,” Advancesin the Astronautical Sciences, 89, pp. 603 – 603.
[12] Byers, R. (1996) “Time Optimal Attitude Control of Asymmetric Rigid Spacecraft,” Journalof Vibration and Control, 2(1), pp. 17–32.
[13] Shen, H. and P. Tsiotras (1999) “Time-optimal control of axisymmetric rigid spacecraftusing two controls,” Journal of Guidance, Control, and Dynamics, 22(5), pp. 682–694.
152
[14] Tsiotras, P. and J. M. Longuski (1995) “New parameterization of the attitude kinematics,”Journal of the Astronautical Sciences, 43(3), pp. 243 – 262.
[15] Bai, X. and J. L. Junkins (2009) “New results for time-optimal three-axis reorientation of arigid spacecraft,” Journal of Guidance, Control, and Dynamics, 32(4), pp. 1071–1076.
[16] Molodenkov, A. and Y. G. Sapunkov (2012) “A new class of analytic solutions in theoptimal turn problem for a spherically symmetric body,” Mechanics of Solids, 47(2), pp.167–177.
[17] Li, S., S. Ding, and Q. Li (2010) “Global set stabilization of the spacecraft attitude controlproblem based on quaternion,” International Journal of Robust and Nonlinear Control, 20(1),pp. 84–105.
[18] Crassidis, J. L. and F. L. Markley (1996) “Sliding mode control using modified Rodriguesparameters,” Journal of Guidance, Control, and Dynamics, 19(6), pp. 1381–1383.
[19] Crassidis, J. L., F. L. Markley, T. C. Anthony, and S. F. Andrews (1997) “Nonlinearpredictive control of spacecraft,” Journal of Guidance, Control, and Dynamics, 20(6), pp.1096–1103.
[20] Sharma, R. and A. Tewari (2004) “Optimal nonlinear tracking of spacecraft attitudemaneuvers,” Control Systems Technology, IEEE Transactions on, 12(5), pp. 677–682.
[21] Kim, K.-S. and Y. Kim (2003) “Robust backstepping control for slew maneuver using nonlineartracking function,” Control Systems Technology, IEEE Transactions on, 11(6), pp. 822–829.
[22] Krstic, M. and P. Tsiotras (1999) “Inverse optimal stabilization of a rigid spacecraft,”Automatic Control, IEEE Transactions on, 44(5), pp. 1042–1049.
[23] Ioslovich, I. (2003) “Arbitrary fuel-optimal attitude maneuvering of a non-symmetric spacevehicle in a vehicle-fixed coordinate frame,” Automatica, 39(3), pp. 557–562.
[24] Ioslovich, I., M. Borshchevsky, and P.-O. Gutman (2009) “Long time missions and thefuel-optimal attitude maneuvering in a swinging mode,” Mathematical Programming, 120(1),pp. 49–66.
[25] Liu, S.-W. and T. Singh (1997) “Fuel/time optimal control of spacecraft maneuvers,” Journalof Guidance, Control, and Dynamics, 20(2), pp. 394–397.
[26] Spindler, K. (1996) “Optimal attitude control of a rigid body,” Applied Mathematics andOptimization, 34(1), pp. 79–90.
[27] Biggs, J. D. and N. Horri (2012) “Optimal geometric motion planning for a spin-stabilizedspacecraft,” Systems & Control Letters, 61(4), pp. 609–616.
153
[28] Tewari, A. (2002) “Optimal nonlinear spacecraft attitude control through Hamilton-Jacobiformulation,” The Journal of the Astronautical Sciences, 50(1), pp. 99–112.
[29] Tsiotras, P. (1997) “Optimal Regulation and Passivity Results for Axisymmetric RigidBodies Using Two Controls,” Journal of Guidance, Control, and Dynamics, 20(3), pp. 457–463.
[30] Mazenc, F. and M. R. Akella (2014) “Quaternion-based stabilization of attitude dynamicssubject to pointwise delay in the input,” in Proceedings of the American Control Conference,pp. 4877 – 4882.
[31] Bryson, A. E. and Y.-C. Ho (1975) Applied Optimal Control: Optimization, Estimation andControl, Hemisphere Publishing Corp., New York, pp. 100-119.
[32] Hablani, H. B. (1999) “Attitude commands avoiding bright objects and maintaining com-munication with ground station,” Journal of Guidance, Control, and Dynamics, 22(6), pp.759–767.
[33] Spindler, K. (2002) “Attitude maneuvers which avoid a forbidden direction,” Journal ofDynamical and Control Systems, 8(1), pp. 1–22.
[34] Mengali, G. and A. A. Quarta (2004) “Spacecraft control with constrained fast reorientationand accurate pointing,” Aeronautical Journal, 108(1080), pp. 85–91.
[35] Melton, R. G. (2010) “Constrained Time-Optimal Slewing Maneuvers for Rigid Spacecraft,”Advances in the Astronautical Sciences, 135, pp. 107–126.
[36] Melton, R. (2010) “Boundary Points and Arcs in Constrained, Time-Optimal SatelliteReorientation Maneuvers,” in AIAA/AAS Astrodynamics Specialist Conference, AIAA, paperAIAA 2010-8376.
[37] Tanygin, S. (2014) “Three-Axis Constrained Attitude Pathfinding and Visualization: Chartinga Course on Higher-Dimensional Maps,” in AIAA/AAS Astrodynamics Specialist Conference,AIAA/AAS, paper AIAA 2014-4101.
[38] Weiss, A., F. Leve, M. Baldwin, J. R. Forbes, and I. Kolmanovsky (2014) “Spacecraftconstrained attitude control using positively invariant constraint admissible sets on SO (3)×R3,”in American Control Conference (ACC), 2014, IEEE, pp. 4955–4960.
[39] Enright, P. J. and B. A. Conway (1991) “Optimal Finite-Thrust Spacecraft TrajectoriesUsing Collocation and Nonlinear Programming,” Journal of Guidance, Control, and Dynamics,14(5), pp. 981–985.
[40] Scrivener, S. L. and R. C. Thompson (1994) “Time-Optimal Reorientation of a RigidSpacecraft Using Collocation and Nonlinear Programming,” Advances in the AstronauticalSciences, 85, pp. 1905–1924.
154
[41] Fahroo, F. and I. M. Ross (2002) “Direct Trajectory Optimization by a Chebyshev Pseu-dospectral Method,” Journal of Guidance, Control, and Dynamics, 25(1), pp. 160–166.
[42] Ross, I. M. (2007) A Beginner’s Guide to DIDO: A MATLAB Application Package for SolvingOptimal Control Problems, Elissar Global, Carmel, CA, rept. TR-711.
[43] Becerra, V. M. (2011) PSOPT: Optimal Control Solver User Manual, http://www.psopt.org.
[44] Patterson, M. A. and A. V. Rao (2014) GPOPS-II, Ver. 2.0, A General-Purpose MATLABSoftware for Solving Multiple-Phase Optimal Control Problems, http://www.gpops2.com.
[45] Caubet, A. and J. D. Biggs (2013) “Optimal Attitude Motion Planner for Large Slew Ma-neuvers Using a Shape-Based Method,” in AIAA Guidance, Navigation and Control Conference.
[46] Shang, M., T. Zhang, and J. Song (2013) “Optimal torque control constraint rigid spacecraftattitude maneuver with constraints,” in Control and Decision Conference (CCDC), 2013 25thChinese, IEEE, pp. 363–367.
[47] Proulx, R. J. and I. M. Ross (2002) “Time-Optimal Reorientation of Asymmetric RigidBodies,” Advances in the Astronautical Sciences, 109, part II, pp. 1207–1227.
[48] Melton, R. G. (2014) “Hybrid methods for determining time-optimal, constrained spacecraftreorientation maneuvers,” Acta Astronautica, 94(1), pp. 294–301.
[49] Zhuang, Y. and H. Huang (2014) “Time-optimal trajectory planning for underactuatedspacecraft using a hybrid particle swarm optimization algorithm,” Acta Astronautica, 94(2), pp.690 – 698.URL http://dx.doi.org/10.1016/j.actaastro.2013.06.023
[50] Fleming, A., P. Sekhavat, and I. M. Ross (2010) “Minimum-time reorientation of a rigidbody,” Journal of Guidance, Control, and Dynamics, 33(1), pp. 160–170.
[51] Karpenko, M., S. Bhatt, N. Bedrossian, and I. M. Ross (2014) “Flight Implementation ofShortest-Time Maneuvers for Imaging Satellites,” Journal of Guidance, Control, and Dynamics,pp. 1–11.
[52] Kane, T. R., P. W. Likins, and D. A. Levinson (1983) Spacecraft Dynamics, McGraw-Hill,New York, ch. 1.
[53] Wertz, J. R. (ed.) (1978) Spacecraft Attitude Determination and Control, Kluwer AcademicPublishers, Dordrecht, The Netherlands, app. D.
[54] Markley, F. (2008) “Unit quaternion from rotation matrix,” Journal of Guidance, Control,and Dynamics, 31(2), pp. 440 – 442.
[55] Wie, B. (1998) Space Vehicle Dynamics and Control, American Institute of Aeronautics andAstronautics, ch. 5.
155
[56] Schaub, H. and J. L. Junkins (2009) Analytical Mechanics for Spacecraft Systems, 2nd ed.,American Institute of Aerosnautics and Astronautics, Reston, VA, ch. 3.
[57] Sanyal, A., A. Fosbury, N. Chaturvedi, and D. S. Bernstein (2009) “Inertia-freespacecraft attitude trajectory tracking with internal-model-based disturbance rejection andalmost global stabilization,” in American Control Conference, 2009. ACC’09., IEEE, pp. 4830–4835.
[58] Lee, T., M. Leok, and N. H. McClamroch (2008) “Time optimal attitude control for arigid body,” in American Control Conference, 2008, IEEE, pp. 5210–5215.
[59] Bloch, A. M., I. I. Hussein, M. Leok, and A. K. Sanyal (2009) “Geometric structure-preserving optimal control of a rigid body,” Journal of Dynamical and Control Systems, 15(3),pp. 307–330.
[60] Schaub, H., J. Junkins, and R. Robinett (1997) “New Penalty Functions and OptimalControl Formulation for Spacecraft Attitude Control Problems,” Journal of Guidance, Control,and Dynamics, 20(3), pp. 428 – 434.
[61] Pontani, M. and B. A. Conway (2010) “Particle Swarm Optimization Applied to SpaceTrajectories,” Journal of Guidance, Control, and Dynamics, 33, pp. 1429 – 1441.
[62] Kennedy, J. and R. Eberhart (1995) “Particle Swarm Optimization,” in Proceedings ofICNN’95 - International Conference on Neural Networks, vol. 4, pp. 1942 – 1948.
[63] Shene, D. C.-K. (1997-2004), “CS3621 Introduction to Computing with Geometry Notes,” .URL http://www.cs.mtu.edu/ shene/COURSES/cs3621/NOTES/
[64] Basu, K. and R. G. Melton (2015) “Time-Optimal Reorientation via Inverse Dynamics: AQuaternion and Particle Swarm Formulation,” Advances in the Astronautical Sciences, 762, pp.1–14.
[65] Spiller, D., L. Ansalone, and F. Curti (2015) “Particle Swarm Optimization for Time-Optimal Spacecraft Reorientation with Keep-Out Cones,” Journal of Guidance, Control, andDynamics, 39(2), pp. 312–325.
[66] Ross, I. M. (2004) “User manual for DIDO: A MATLAB application package for solvingoptimal control problems,” Tomlab Optimization, Sweden.
[67] Basu, K., R. G. Melton, and S. Aguasvivas-Manzano (2017) “Time-Optimal Reorienta-tion using Neural Network and Particle Swarm Formulation,” Advances in the AstronauticalSciences, 816, pp. 1–20.
156
VitaKaushik Basu
EDUCATIONBA/MA Mathematics, West Chester University of Pennsylvania 2009ME Aerospace Engineering, Pennsylvania State University 2010Teaching Certificate, Pennsylvania State University 2016
PUBLICATIONS AND TECHNICAL PRESENTATIONSBasu,K.(FA), Fisher,Z., Bresler,J., Bender,B., Cowan,S., Young,L., and Newhart,T. A New
Beginning: Human Class Mars EDL; RASCAL-NIANET 2015 Forum @NASA/KSC, June 15-17,2015
Paik,G. and Basu,K. Thermal Modelling of Avionics Vault on Jupiter Orbiter ; TWAS 2015(Thermal and Fluids Analysis Workshop) @NASA/GSFC, August 3-7, 2015
Basu,K. and Melton,R.G. Survey of Optimal Rigid-Body Attitude Maneuvers; AAS/AIAA 15-411@ Williamsburg, Virginia. January 11-15, 2015
Basu,K. and Melton,R.G. Time-Optimal Reorientation via Inverse Dynamics: A Quaternionand Particle Swarm Formulaton; AAS/AIAA 15-762 @ Vail, Colorado, August 9-13, 2015
Marcucci,E.C., Hays,L., Holstein-Rathlou,C., Keane,J.T., Becerra,P., Basu,K. Davis,B., Fox,V.,Herman,J., Hughes,A., Mendez Ramos,E., Nelessen,A., Neveu,M., Parrish,N., Scheinberg,A., Wro-bel,J.S. Argus: An Io observer mission concept study from the 2014 NASA/JPL Planetary ScienceSummer School; LPI 2015(Lunar Planetary Institute) @The Woodlands, Texas. March 16-20.
Basu,K., Shaw,M. and Melton,R.G. Satellite Attitude Control Technology; DST 2017 (Directorateof Science and Technology) Summer Symposium @ CIA/Langley, Virginia June 5-6, 2017
Spiller,D. and Basu,K. Optimal Passive Formation Reconfiguration using Attitude Control andPerturbing Forces; IWSCFF 17-37 (International Workshop on Satellite Constellations and FormationFlying) @ UC Boulder, Colorado. June 21-24, 2017
Basu,K., Melton,R.G. and Aguasvivas-Manzano,S. Time-Optimal Reorientation using NeuralNetwork and Particle Swarm Formulation; AAS/AIAA 17-816 @ Stevenson, Washington August21-24, 2017
Spiller.D, and Basu,K. On the Optimal Passive Formation Reconfiguration by using AttitudeControl; Journal Acta Astronautica @ AA-2017-1167,Elsevier Dec, 2017