# Thruster Control Allocation --- ## About Me --- ## Biggest Lesson **Solving the interesting problem, not the actual problem** _Autonomous tractor safety system — Python GIL bottleneck_ | Built | Should Have Built | | -------------------------------- | ---------------------- | | Distributed architecture | Simple multiprocessing | | Rust processes + gRPC + protobuf | A few subprocesses | | "Cloud-native" on embedded | Boring and appropriate | **Worked on dev hardware. Collapsed on production ARM.** → _"What are the constraints here?"_ before _"What's the cleanest design?"_ --- ## Problem Statement **Thruster control algorithm which commands a set of 5 pulsed thrusters** | | | |---|---| | **Assumptions** | RW desat + maneuver pointing, *not* fine-pointing | | | Min on-time + 5s lockout; canted thrusters for roll | | **Inputs** | Body torque command, axial thrust command | | **Outputs** | Thruster on-times (5 values) | | **Parameters** | 5 × 10N thrusters at corners + center | --- ## Problem Statement (cont.) | | | |---|---| | **Performance Metrics** | Torque/force accuracy | | | Timing errors (dead-time) | | | Redundancy / fault tolerance | | **Parameter Tuning** | PID gains: linear analysis → sim tuning | | | Hardware specs from propulsion/thermal | --- ## Possible Algorithms for Thruster Allocation *
Pseudo-inverse
+ clipped output - Simplest to implement *
Bounded least-squares
(`scipy.optimize.lsq_linear`) - Gives results that already bounded to constraints ($x_l \leq x \leq x_u$) - More complicated compared to pseudo-inverse *
Simplex Optimizer
(fuel-optimal allocation) - Needs initial guess - Allocation could fail - More computationally complex - Likely overkill in this case --- ## Implementation The system is formulated as a linear allocation problem: $ \min\limits_{x(t)} ||A \cdot x - b ||_2$ - $A \in \mathbb{R}^{4×5}$ : Control authority matrix (maps on-times to impulses) - Each column corresponds to one thruster - First three rows give the torque generated by the thruster - Last row is force generated by thruster in Z direction - $b \in \mathbb{R}^4$ : Desired impulse. $\begin{bmatrix} M_x \Delta t & M_y \Delta t & M_z \Delta t & F_z \Delta t \end{bmatrix}$ - $x \in \mathbb{R}^5$ : Thruster on-times [seconds]
$\leftarrow$ Solve for this
- Remove the last row when in torque-only mode --- ## Thruster Failure Analysis
#### Single Thruster Failures | Config | Rank | σ | Effect | |--------|------|---|--------| | Nominal | 2/3 | 10, 10, 0 | No roll | | Corner | 2/3 | 10, 7, 0 | −30% | | Center | 2/3 | 10, 10, 0 | None | #### Two-Thruster Failures | Failed | Rank | Result | |--------|------|--------| | T1+T5 | 1/3 | 1-axis | | T2+T4 | 1/3 | 1-axis | | Other | 2/3 | OK |
Diagonal pairs (T1+T5, T2+T4) are critical. Center thruster = zero torque at CoM.
--- ## Controllability Demo
--- ## Live Demo
--- ## Simulator architecture
SimTiming
cluster_ctrl
25 Hz
cluster_dyn
100 Hz
pid
PID Controller
alloc
Allocator
pid->alloc
tif
Thruster
Interface
alloc->tif
tstate
Thruster
State
tif->tstate
ftau
Force
Torque
tstate->ftau
integ
6-DOF
Dynamics
ftau->integ
integ->pid
-
PID Controller
: Quaternion error → body torque command -
Thruster Interface
: Converts on-times to binary on/off states -
6-DOF Dynamics
: Euler + quaternion kinematics integration --- ## Live Demo
--- ## HITL/Sim testing?
* Flight Computer - Runs actual flight software - GNC with PID controller + allocator - Valve drivers output GPIO signals * Simulation PC - High-fidelity dynamics + environment - Sensor models output raw serial data - I/O card decodes GPIO/serial signals * Harnessing - Flight harness connects both systems - Serial lines carry sensor data - GPIO lines carry thruster commands
HITL
cluster_sim
Simulation PC
cluster_models
Models
cluster_actuators
Actuators
cluster_sensors
Sensors
cluster_io
I/O Card
cluster_harness
Avionics / Harnessing
cluster_fc
Flight Computer
sixdof
High-Fidelity
Dynamics
thruster
Thruster
sixdof->thruster
star
Star Tracker
sixdof->star
rw
Reaction
Wheels
gpio
GPIO Decoder
thruster->gpio
imu
IMU
serial
Serial Ports
star->serial
serial_bus
Serial Comms
↔
gpio_bus
GPIO Lines
←
valve_drv
Valve Drivers
serial_drv
Serial Driver
gnc
GNC
gnc->valve_drv
gnc->serial_drv
*HITL Simulation Architecture*
--- ## Cross-Team Inputs
| Team | Input Needed | Impact | |------|--------------|--------| | Propulsion | Thrust profiles, valve timing | Min pulse, lockout period | | Thermal | Thruster thermal limits | Duty cycle constraints | | Avionics | GPIO timing, voltage limits | Interface spec | | Structures/Mech | CoM location, inertia tensor | Control authority matrix | | Systems | Pointing/burn accuracy reqs | Controller gains, error budgets |
--- ## Conclusion