Skip to content

SatelliteGNC Algorithm Description Document ​

1. System Overview ​

A 6-DOF satellite attitude guidance, navigation, and control (GNC) system for a CubeSat-class platform on low Earth orbit. The system performs 3-axis rest-to-rest slew maneuvers using bipropellant reaction jets, with angular velocity estimation from angle measurements only.

Architecture ​

[TrapezoidalProfile ×3]  angle_ref, rate_ref, accel_ref
         │
         ▼
[AttitudeController] ◄── ω̂x, ω̂y, ω̂z ── [LuenbergerObserver]
         │  τx_cmd, τy_cmd, τz_cmd              ▲
         ▼                                       │
[ThrusterAllocator]                              │
         │  cmd1 ... cmd8                        │
         ▼                                       │
[ReactionJet ×8] ── F, τ (summed) ──┐           │
                                     ▼           │
                              [SatelliteBody6DOF]┘
                                 ── φ, θ, ψ → Controller + Observer
                                 ── τ_applied → Observer

State Count ​

SubsystemDifferential StatesAlgebraic Variables
SatelliteBody6DOF120
LuenbergerObserver60
TrapezoidalProfile ×309
AttitudeController03
ThrusterAllocator016
ReactionJet ×8032
Total1860

2. SatelliteBody6DOF ​

2.1 Inputs and Outputs ​

Inputs:

SignalSymbolUnitsDescription
tau_xτ_xN·mBody-frame torque about x-axis
tau_yτ_yN·mBody-frame torque about y-axis
tau_zτ_zN·mBody-frame torque about z-axis
fxF_xNBody-frame force along x-axis
fyF_yNBody-frame force along y-axis
fzF_zNBody-frame force along z-axis

Outputs:

SignalSymbolUnitsDescription
phi_outφradRoll angle (Euler 3-2-1)
theta_outθradPitch angle (Euler 3-2-1)
psi_outψradYaw angle (Euler 3-2-1)
wx_outω_xrad/sBody-frame angular velocity about x
wy_outω_yrad/sBody-frame angular velocity about y
wz_outω_zrad/sBody-frame angular velocity about z
x_outxmECI position x-component
y_outymECI position y-component
z_outzmECI position z-component
vx_outv_xm/sECI velocity x-component
vy_outv_ym/sECI velocity y-component
vz_outv_zm/sECI velocity z-component

Parameters:

ParameterSymbolUnitsDefaultDescription
IxxI_xxkg·m²10.0Moment of inertia about x
IyyI_yykg·m²8.0Moment of inertia about y
IzzI_zzkg·m²6.0Moment of inertia about z
mmkg4.0Satellite mass
muμm³/s²3.986004418×10¹⁴Earth gravitational parameter

2.2 Algorithm Description ​

The satellite is modeled as a rigid body with coupled translational and rotational dynamics.

Translational dynamics (ECI frame):

where R(φ,θ,ψ) is the 3-2-1 (yaw-pitch-roll) rotation matrix from body frame to ECI:

Rotational dynamics (body frame, Euler's equations on principal axes):

Gravity gradient torque (coupling orbit position to attitude):

where r_body = R^T · r is the satellite position expressed in body frame, and I is the diagonal inertia tensor.

3-2-1 Euler angle kinematics:

Note: singular at θ = ±90°. Valid for maneuvers with |θ| < 80°.

2.3 References ​

  • Wertz, J.R., Space Mission Engineering: The New SMAD, Microcosm Press, 2011, Ch. 19 (Attitude Dynamics).

  • Sidi, M.J., Spacecraft Dynamics and Control, Cambridge University Press, 1997, Ch. 4.

  • Markley, F.L. and Crassidis, J.L., Fundamentals of Spacecraft Attitude Determination and Control, Springer, 2014, Ch. 3.

2.4 Proposed Test Plan ​

TestConfigurationExpected ResultTolerance
Circular orbit propagationr₀ = [6771 km, 0, 0], v₀ = [0, 7672.6, 0] m/s, zero attitude/rates/forces, simulate one orbital period (5545 s)Position returns near initial; orbital energy ΔE/E < 10⁻¹⁰Position error < 100 m
Gravity gradient torqueSame orbit, satellite tilted 5° in pitch, zero external torquesLibration oscillation about y-axis at frequency √(3)·n where n = orbital rate; analytical torque τ_y = 3n²(I_xx − I_zz)sin(θ)cos(θ)Torque matches analytical to < 10⁻¹⁰ relative error
Open-loop single-axis torqueNo orbit (static position), constant τ_x = 0.1 N·m, 10 sω_x = τ_x·t/I_xx = 0.1 rad/s; φ = 0.5·τ_x·t²/I_xx = 0.5 rad< 0.1% error vs analytical

3. TrapezoidalProfile ​

3.1 Inputs and Outputs ​

Inputs: None (time-driven, parameterized).

Outputs:

SignalSymbolUnitsDescription
angle_refθ_refradReference angle
rate_refω_refrad/sReference angular rate
accel_refα_refrad/s²Reference angular acceleration

Parameters:

ParameterSymbolUnitsDefaultDescription
target_angleθ_targetrad0.35Total slew angle
w_maxω_maxrad/s0.035Maximum angular rate
a_maxα_maxrad/s²0.0087Maximum angular acceleration

3.2 Algorithm Description ​

Generates a rest-to-rest trapezoidal velocity profile with three phases:

Phase timing:

  • Ramp time: t_ramp = ω_max / α_max

  • Coast angle: θ_ramp = ω_max² / (2·α_max)

  • Coast time: t_coast = (θ_target − 2·θ_ramp) / ω_max

  • Total time: t_total = 2·t_ramp + t_coast

Phase 1 — Accelerate (0 ≤ t < t_ramp):

  • α_ref = +α_max

  • ω_ref = α_max · t

  • θ_ref = ½ · α_max · t²

Phase 2 — Coast (t_ramp ≤ t < t_ramp + t_coast):

  • α_ref = 0

  • ω_ref = ω_max

  • θ_ref = θ_ramp + ω_max · (t − t_ramp)

Phase 3 — Decelerate (t_ramp + t_coast ≤ t < t_total):

  • α_ref = −α_max

  • ω_ref = ω_max − α_max · (t − t_ramp − t_coast)

  • θ_ref = θ_ramp + ω_max · t_coast + ω_max · t_loc − ½ · α_max · t_loc²

where t_loc = t − t_ramp − t_coast.

Phase 4 — Hold (t ≥ t_total):

  • α_ref = 0, ω_ref = 0, θ_ref = θ_target

Assumes trapezoidal regime: θ_target > ω_max²/α_max (sufficient angle for full coast phase).

3.3 References ​

  • ESA ECSS-E-ST-60-30C, Space Engineering: Spacecraft Attitude and Orbit Control System (AOCS) Performance, 2013.

  • Wie, B., Space Vehicle Dynamics and Control, 2nd ed., AIAA, 2008, Ch. 7.4 (Rest-to-Rest Slew Maneuvers).

3.4 Proposed Test Plan ​

TestConfigurationExpected ResultTolerance
Timing verificationθ_target = 0.35 rad, ω_max = 0.035 rad/s, α_max = 0.0087 rad/s²t_ramp = 4.023 s, t_coast ≈ 5.954 s, t_total ≈ 14.0 s< 0.1 s
Final angleSame parameters, evaluate at t > t_totalθ_ref = θ_target exactly< 10⁻¹⁰ rad
Rate continuityEvaluate ω_ref at phase boundariesNo discontinuities in rate; rate peaks at ω_maxContinuous to solver tolerance
Acceleration profileEvaluate α_ref over timePiecewise constant: +α_max, 0, −α_max, 0Exact match at phase interiors

4. AttitudeController ​

4.1 Inputs and Outputs ​

Inputs:

SignalSymbolUnitsDescription
phi_refφ_refradReference roll angle
theta_refθ_refradReference pitch angle
psi_refψ_refradReference yaw angle
wx_refω_x,refrad/sReference roll rate
wy_refω_y,refrad/sReference pitch rate
wz_refω_z,refrad/sReference yaw rate
ax_ffα_x,refrad/s²Feedforward roll acceleration
ay_ffα_y,refrad/s²Feedforward pitch acceleration
az_ffα_z,refrad/s²Feedforward yaw acceleration
phi_measφ_measradMeasured roll angle
theta_measθ_measradMeasured pitch angle
psi_measψ_measradMeasured yaw angle
wx_measω̂_xrad/sMeasured/estimated roll rate
wy_measω̂_yrad/sMeasured/estimated pitch rate
wz_measω̂_zrad/sMeasured/estimated yaw rate

Outputs:

SignalSymbolUnitsDescription
tau_xτ_xN·mCommanded roll torque
tau_yτ_yN·mCommanded pitch torque
tau_zτ_zN·mCommanded yaw torque

Parameters:

ParameterSymbolUnitsDefaultDescription
Kp_x, Kp_y, Kp_zK_p,iN·m/rad5.0, 4.0, 3.0Proportional gains
Kd_x, Kd_y, Kd_zK_d,iN·m·s/rad20.0, 16.0, 12.0Derivative gains
Ixx_ff, Iyy_ff, Izz_ffI_i,ffkg·m²10.0, 8.0, 6.0Feedforward inertias

4.2 Algorithm Description ​

Per-axis PD control law with acceleration feedforward:

The three terms serve distinct roles:

  • Proportional (−K_p · e_θ): drives angle error to zero.

  • Derivative (−K_d · e_ω): damps rate error. Uses observer-estimated rates, not measured rates directly.

  • Feedforward (+I_ff · α_ref): applies the known inertia × commanded acceleration. Eliminates steady-state tracking lag during the coast phase of trapezoidal profiles.

Closed-loop characteristic equation (per axis, without feedforward, linearized):

  • Natural frequency: ω_n = √(K_p / I)

  • Damping ratio: ζ = K_d / (2√(K_p · I))

Default gains give ω_n = 0.707 rad/s and ζ = 1.41 (overdamped) on all axes.

Without feedforward, tracking a ramp rate reference produces steady-state error e_ss = K_d · ω_max / K_p. The feedforward term reduces this by providing the expected torque directly.

4.3 References ​

  • Franklin, G.F., Powell, J.D., and Emami-Naeini, A., Feedback Control of Dynamic Systems, 8th ed., Pearson, 2019, Ch. 7 (PD Control).

  • Wie, B., Space Vehicle Dynamics and Control, 2nd ed., AIAA, 2008, Ch. 7.3 (PD Attitude Control).

4.4 Proposed Test Plan ​

TestConfigurationExpected ResultTolerance
Step response (no feedforward)Step commands φ=10°, θ=5°, ψ=15°; ω_ref = 0, α_ref = 0Overdamped settling, no overshoot, settle within 12 s< 1% of target at t = 30 s
Feedforward trackingTrapezoidal profile with feedforward enabledPeak tracking error < 1° during coast phase< 1°
Steady-state accuracyAfter maneuver completes, all rates at zeroAngle errors < 0.01°< 0.01°

5. LuenbergerObserver ​

5.1 Inputs and Outputs ​

Inputs:

SignalSymbolUnitsDescription
phi_measφ_measradMeasured roll angle
theta_measθ_measradMeasured pitch angle
psi_measψ_measradMeasured yaw angle
tau_xτ_xN·mApplied roll torque (known)
tau_yτ_yN·mApplied pitch torque (known)
tau_zτ_zN·mApplied yaw torque (known)

Outputs:

SignalSymbolUnitsDescription
phi_hatφ̂radEstimated roll angle
theta_hatθ̂radEstimated pitch angle
psi_hatψ̂radEstimated yaw angle
wx_hatω̂_xrad/sEstimated roll rate
wy_hatω̂_yrad/sEstimated pitch rate
wz_hatω̂_zrad/sEstimated yaw rate

Parameters:

ParameterSymbolUnitsDefaultDescription
Ixx, Iyy, IzzI_ikg·m²10.0, 8.0, 6.0Plant inertias (must match)
pprad/s2.0Observer pole location
La_x, La_y, La_zL_a,i1/s4.0Angle correction gains
Lw_x, Lw_y, Lw_zL_ω,iN·m/rad40.0, 32.0, 24.0Rate correction gains

5.2 Algorithm Description ​

Per-axis Luenberger observer using a linearized copy of the single-axis dynamics with correction terms driven by angle measurement error:

The observer is a dynamic system with 6 differential states (3 estimated angles

  • 3 estimated rates).

Gain selection: For double observer poles at s = −p, the gains are:

This places the observer error dynamics at eigenvalues s = −p (repeated), giving a time constant of 1/p. At p = 2 rad/s, convergence occurs within approximately 3 seconds (3/p ≈ 1.5 s to 95%).

Separation principle: The observer pole p should be placed at 3–5× the controller closed-loop bandwidth to ensure the estimation error decays before the controller responds. With controller ω_n = 0.707 rad/s, the observer at p = 2.0 rad/s provides approximately 3× separation.

The observer uses a linearized model (no gyroscopic cross-coupling terms). This is valid for small angular velocities typical of the maneuver envelope (ω < 0.035 rad/s).

5.3 References ​

  • Luenberger, D.G., "Observing the State of a Linear System," IEEE Transactions on Military Electronics, Vol. 8, No. 2, 1964, pp. 74–80.

  • Sidi, M.J., Spacecraft Dynamics and Control, Cambridge University Press, 1997, Ch. 9.3 (State Estimation).

5.4 Proposed Test Plan ​

TestConfigurationExpected ResultTolerance
Convergence from zero ICObserver starts at zero, plant has initial ω_x = 0.01 rad/sEstimation error < 1% of initial within 3 s
Tracking during maneuverFull closed-loop with trapezoidal profileObserver tracks actual rates throughout; peak estimation error < 5% of ω_max< 0.002 rad/s
Steady-state estimationAfter maneuver settlesEstimation error < 10⁻⁵ rad/s< 10⁻⁵ rad/s

6. ReactionJet ​

6.1 Inputs and Outputs ​

Inputs:

SignalSymbolUnitsDescription
cmdu—Normalized thrust command (−1 to +1)

Outputs:

SignalSymbolUnitsDescription
fx_outF_xNBody-frame force x-component
fy_outF_yNBody-frame force y-component
fz_outF_zNBody-frame force z-component
tx_outτ_xN·mBody-frame torque x-component
ty_outτ_yN·mBody-frame torque y-component
tz_outτ_zN·mBody-frame torque z-component

Parameters:

ParameterSymbolUnitsDefaultDescription
rx, ry, rzr_x, r_y, r_zm0, 0, 0Mounting position from CoM
dx, dy, dzd_x, d_y, d_z—1, 0, 0Thrust direction (unit vector)
F_maxF_maxN0.1Maximum thrust magnitude

6.2 Algorithm Description ​

Models a single bipropellant (bidirectional) thruster:

Command clamping:

Force production:

where d̂ = (d_x, d_y, d_z) is the thrust direction vector.

Torque from offset mounting:

where r = (r_x, r_y, r_z) is the thruster position relative to the center of mass. Expanded:

A thruster at the center of mass (r = 0) produces force but no torque. A thruster offset from the CoM produces both force and torque simultaneously.

6.3 References ​

  • Wertz, J.R., Space Mission Engineering: The New SMAD, Microcosm Press, 2011, Ch. 17 (Propulsion).

  • Sutton, G.P. and Biblarz, O., Rocket Propulsion Elements, 9th ed., Wiley, 2017, Ch. 4.

6.4 Proposed Test Plan ​

TestConfigurationExpected ResultTolerance
Force only (CoM mounted)r = [0,0,0], d = [1,0,0], cmd = 0.5F = [0.05, 0, 0] N, τ = [0, 0, 0] N·mExact
Force + torque (offset)r = [0.15, 0.10, 0], d = [0,0,1], cmd = 0.5F = [0, 0, 0.05] N, τ = [0.005, −0.0075, 0] N·mExact
Positive saturationcmd = 2.0cmd_clamped = 1.0, F = F_max · d̂Exact
Negative commandcmd = −0.5F = −0.5 · F_max · d̂ (reverse thrust)Exact

7. ThrusterAllocator ​

7.1 Inputs and Outputs ​

Inputs:

SignalSymbolUnitsDescription
Fx_cmdF_x,cmdNCommanded body-frame x-force
Fy_cmdF_y,cmdNCommanded body-frame y-force
Fz_cmdF_z,cmdNCommanded body-frame z-force
tau_x_cmdτ_x,cmdN·mCommanded body-frame x-torque
tau_y_cmdτ_y,cmdN·mCommanded body-frame y-torque
tau_z_cmdτ_z,cmdN·mCommanded body-frame z-torque

Outputs:

SignalSymbolUnitsDescription
cmd1 ... cmd8u_1 ... u_8—Normalized jet commands (−1 to +1)

Parameters:

ParameterSymbolUnitsDefaultDescription
F_maxF_maxN0.1Maximum thrust per jet (for normalization)

7.2 Algorithm Description ​

Maps a 6-DOF force/torque command vector to 8 individual jet thrust commands using the Moore-Penrose pseudoinverse of the thruster configuration matrix.

Configuration matrix B (6×8):

The B matrix maps the thrust vector T = [T_1, ..., T_8]^T to the net force/torque vector w = [F_x, F_y, F_z, τ_x, τ_y, τ_z]^T:

Each column j of B is constructed from jet j's direction d_j and position r_j:

Pseudoinverse allocation:

where B⁺ = B^T(BB^T)⁻¹ is the Moore-Penrose pseudoinverse. This minimizes ||T||₂ (minimum-energy allocation) among all solutions that achieve the commanded force/torque.

Normalization:

The 8-jet configuration (4 z-firing + 2 y-firing + 2 x-firing on edges of a 0.3×0.2×0.1 m body) yields rank(B) = 6, confirming full 6-DOF controllability with 2 degrees of redundancy.

Note: The pseudoinverse may produce commands |u_j| > 1 if the commanded force/torque exceeds actuator capacity. The individual ReactionJet components clamp to [−1, 1], which introduces allocation error under saturation.

7.3 References ​

  • Durham, W.C., "Constrained Control Allocation," Journal of Guidance, Control, and Dynamics, Vol. 16, No. 4, 1993, pp. 717–725.

  • Wie, B., Space Vehicle Dynamics and Control, 2nd ed., AIAA, 2008, Ch. 7.6 (Thruster Control Allocation).

7.4 Proposed Test Plan ​

TestConfigurationExpected ResultTolerance
Pure yaw torqueτ_z = 0.01 N·m, all others zeroNet output: F = [0,0,0], τ = [0,0,0.01]; jets 1–4 off, jets 5–8 activeForce < 10⁻¹⁰ N, torque error < 10⁻¹⁰ N·m
Pure forceF_z = 0.1 N, all others zeroNet output: F = [0,0,0.1], τ = [0,0,0]; jets 1–4 each at cmd = 0.25/F_maxTorque < 10⁻¹⁰ N·m
Combined force + torqueF_x = 0.05, τ_y = 0.005Net output matches command< 10⁻⁸ relative error
Rank verificationCompute rank(B) from configurationrank = 6Exact

8. Integrated System (TestFullGNC6DOF) ​

8.1 Inputs and Outputs ​

System-level inputs (set as parameters):

ParameterValueUnitsDescription
φ_target0.3491 (20°)radTarget roll angle
θ_target0.1745 (10°)radTarget pitch angle
ψ_target0.5236 (30°)radTarget yaw angle
ω_max0.0349 (2°/s)rad/sMaximum slew rate
α_max0.00873 (0.5°/s²)rad/s²Maximum slew acceleration

Initial conditions:

StateValueUnitsDescription
pos_x6,771,000mLEO circular orbit radius
pos_y, pos_z0mOrbit plane
vel_y7672.6m/sCircular orbit velocity
vel_x, vel_z0m/s
φ, θ, ψ0radInitial attitude
ω_x, ω_y, ω_z0rad/sInitially at rest
Observer states0—Observer starts at zero

System-level outputs (monitored):

SignalDescription
sat.phi, sat.theta, sat.psiActual Euler angles
sat.wx, sat.wy, sat.wzActual angular velocities
sat.pos_x, sat.pos_y, sat.pos_zOrbital position
obs.wx_hat, obs.wy_hat, obs.wz_hatEstimated rates
alloc.cmd1 ... alloc.cmd8Jet commands

8.2 Algorithm Description ​

The integrated system executes a 3-axis attitude repointing maneuver on a CubeSat in 400 km LEO. The signal flow is:

  1. Guidance: Three independent TrapezoidalProfile instances generate per-axis angle, rate, and acceleration references.

  2. Navigation: The LuenbergerObserver estimates angular velocities from measured angles (star tracker) and known applied torques. Convergence within ~3 s.

  3. Control: The AttitudeController computes torque commands from angle error (measured), rate error (estimated), and acceleration feedforward.

  4. Allocation: The ThrusterAllocator maps the 3-axis torque command (plus zero force command) to 8 jet commands via pseudoinverse.

  5. Actuation: Eight ReactionJet instances produce body-frame forces and torques from the allocated commands, with saturation at ±F_max.

  6. Plant: The SatelliteBody6DOF integrates the net forces and torques, propagating both the orbit (Keplerian + thrust) and attitude (Euler's equations + gravity gradient).

  7. Feedback: Satellite angle measurements feed back to both the controller and observer. Applied torques feed to the observer.

The maneuver completes in ~19 s (longest axis: ψ = 30°) with all axes settling by t = 30 s. The orbit radius remains constant to km-level precision over the 40 s simulation.

8.3 References ​

All references from individual component sections apply. Additionally:

  • Fortescue, P., Swinerd, G., and Stark, J., Spacecraft Systems Engineering, 4th ed., Wiley, 2011, Ch. 9 (Attitude and Orbit Control).

  • ESA ECSS-E-ST-60-30C, Space Engineering: AOCS Performance, 2013.

8.4 Proposed Test Plan ​

TestConfigurationExpected ResultTolerance
Attitude settlingDefault parameters, simulate 40 sφ → 20°, θ → 10°, ψ → 30°< 0.01° error at t = 40 s
Orbit maintenanceMonitorrduring maneuver
Observer convergenceMonitor ω̂ − ω during maneuverError < 10⁻⁵ rad/s after t = 3 s< 10⁻⁵ rad/s
Peak tracking errorMonitor maxθ_ref − θ_measduring slew
Jet saturationVerify allcmd_j≤ 1 during maneuver
Energy conservation (orbit)Compare orbital energy at t = 0 and t = 40ΔE/E < 10⁻⁸ (thrust forces are small)< 10⁻⁸