Optimizer Settings Reference#
This page is the central reference for the SALTRO optimizer knobs exposed by
PlannerSettings in include/saltro/pybind/plannersettings.h.
The settings are organized by the same structs used in code:
PlannerSettings
├── constraints
├── disturbances
├── init_traj
├── tvlqr
├── num_passes
└── passes[p]
├── cost
├── auglag
├── ilqr
├── reg
├── linesearch
└── dt
At a high level, each pass solves a constrained trajectory optimization problem with an augmented Lagrangian outer loop and an iLQR/DDP-style inner loop:
Validation ranges are enforced in
src/validation/validate_plannersettings.cpp. When a range matters for
practical tuning, it is called out below.
PlannerSettings#
Field |
Default |
Meaning |
|---|---|---|
|
|
Number of active optimization passes. Must satisfy |
|
struct |
Global actuator, rate, and pointing constraints shared across passes. |
|
struct |
Disturbance models included in rollout, linearization, and cost evaluation. |
|
struct |
Initialization policy used to generate the first trajectory guess. |
|
struct |
Settings for post-optimization TVLQR gain generation. |
|
array |
Per-pass tuning for cost, AL, iLQR, regularization, line search, and timestep. |
InitTrajConfig#
Field |
Default |
Meaning |
|---|---|---|
|
|
Integer selector for the warm-start strategy used to build the initial trajectory before optimization. Must be nonnegative. |
ConstraintConfig#
The optimizer enforces hard bounds and pointing constraints through the
constraint vector c(x,u) used in the augmented Lagrangian:
Examples include control saturation, reaction-wheel momentum bounds, angular rate limits, and sun-angle exclusion constraints.
Field |
Default |
Meaning |
|---|---|---|
|
|
Margin applied to actuator limits. Effective optimizer bound is |
|
|
Margin on reaction-wheel momentum constraints. Effective bound is |
|
unset |
Per-actuator control limits. Must be nonempty and elementwise finite and nonnegative. |
|
|
Maximum allowed angular-velocity magnitude used in rate constraints. Must be positive. |
|
|
Minimum allowed angle to the sun vector for sun-avoidance constraints. Must lie in |
DisturbanceConfig#
If enabled, disturbance torques are folded into the dynamics model:
The booleans decide which disturbance terms contribute to
\tau_{\text{disturbance}}.
Field |
Default |
Meaning |
|---|---|---|
|
|
Include aerodynamic disturbance modeling. |
|
|
Include constant propulsion torque disturbance. |
|
|
Include solar-radiation-pressure disturbance. |
|
|
Include gravity-gradient torque. |
|
|
Include generic external disturbance torque. |
|
|
Include residual magnetic dipole disturbance. |
|
|
SRP model coefficients. |
|
|
Aerodynamic drag model coefficients. |
|
|
Number of disturbance coefficients used by the disturbance model. Must be nonnegative. |
|
|
Residual dipole vector. |
|
|
Constant propulsion torque vector. |
|
|
Generic constant disturbance torque vector. |
|
|
Inertia estimate used when evaluating disturbance terms. |
TVLQRSettings#
These settings control gain generation after a nominal trajectory is already optimized.
Field |
Default |
Meaning |
|---|---|---|
|
|
TVLQR discretization step. Current SALTRO usage keeps this at |
|
|
Duration, in seconds, of each gain-computation chunk. Must be positive. |
|
|
Overlap, in seconds, between adjacent TVLQR chunks. Must be finite and nonnegative. |
PassConfig#
Each active pass passes[p] defines one full ALTRO/iLQR solve at a specific
discretization:
Field |
Default |
Meaning |
|---|---|---|
|
|
Timestep used for dynamics rollout, Jacobians, Hessians, and line search in this pass. Must be positive. |
|
struct |
Stage and terminal objective weights and cost-model options. |
|
struct |
Augmented-Lagrangian outer-loop settings. |
|
struct |
Inner iLQR stopping and safety settings. |
|
struct |
Riccati regularization and optional second-order stabilizers. |
|
struct |
Forward-pass backtracking parameters. |
CostConfig#
The stage cost is composed of attitude error, angular-velocity penalties, control effort, and reaction-wheel penalties:
Terminal cost uses the corresponding *_N weights:
Quaternion-goal mode uses one of these scalar attitude-error shapes with
d = |q_{\text{goal}}^\top q| after hemisphere alignment:
Vector-pointing mode uses the same shape family, but with
d = c = b_s^\top R(q)^\top \hat{r}.
The implemented set is {0,1,3,5}. Type 2 (raw acos) and type
4 were removed and are not reused.
Base angular-velocity cost:
In vector-pointing mode, ang_vel_roll_ratio reduces the penalty along the
boresight axis:
Optional direction-error crossterm:
where beta = ang_vel_err_dir_ratio. The implementation keeps this
quadratic block PSD by requiring 0 <= beta < 2 conceptually, although the
current validator does not enforce that range.
Control effort is normalized by each actuator limit:
Reaction-wheel momentum soft cost (C1 everywhere): a gentle desat quadratic over the whole range plus a steep quadratic that turns on above the knee with zero value and zero slope there (no cliff, no gradient kink):
The hard ceiling deliberately does not live in this cost: the AL momentum
constraint enforces it (ConstraintConfig.rw_momentum_limit_scale) with its
own per-family penalty schedule — cost shapes, constraint enforces. Combined
with the stiction term below, the paired weighting
rw_stic_weight = rw_AM_weight * RWh_desat_mult * (h_stic/h_max)^2 parks the
wheel at the bias momentum \(h^* = h_{\text{stic}}/2\) (off the
zero-crossing stiction band without drifting toward saturation).
Field |
Default |
Meaning |
|---|---|---|
|
|
Stage weight on the attitude-error shape |
|
|
Stage weight on the quadratic angular-velocity penalty. Must be finite and nonnegative. |
|
|
Stage weight on magnetic-field-aligned angular-velocity magnitude. Present in cost and Jacobian code; Hessian support is intentionally incomplete, so the default stays zero. |
|
|
Legacy cross-term coefficient. In quaternion mode it activates the older |
|
|
Global multiplier applied to all actuator control-effort terms. Must be finite and nonnegative. |
|
|
Vector-pointing only. Relative penalty on roll about the boresight axis. |
|
|
New PSD-scaled direction-error cross-term coefficient |
|
|
Per-unit normalized magnetorquer control penalty. |
|
|
Per-unit normalized reaction-wheel torque penalty. |
|
|
Per-unit normalized control penalty for MAGIC actuators. |
|
|
Weight on the reaction-wheel momentum soft penalty near saturation. |
|
|
Weight on the reaction-wheel stiction-region penalty. |
|
|
Fraction of |
|
|
Weight multiplier of the gentle full-range desat quadratic (relative to
|
|
|
Fraction of |
|
|
Terminal attitude weight. Must be finite and nonnegative. |
|
|
Terminal angular-velocity weight. Must be finite and nonnegative. |
|
|
Terminal magnetic-field-aligned angular-velocity weight. |
|
|
Terminal legacy direction-error cross-term weight. |
|
|
Attitude-error shape selector. The implemented and validated set is |
|
|
Pseudo-Huber crossover angle δ (rad) for |
|
|
If true, use analytic state Hessians of the cost in the backward pass. If false, SALTRO keeps control curvature but drops potentially troublesome second-order state curvature. |
|
|
Vector-pointing only. When true, drops the exact chain-rule |
CostConfig::setTerminalEmphasis(k) is a convenience helper that preserves
stage-to-terminal ratios:
AugLagConfig#
The outer loop updates multipliers and penalties for constraints:
with a typical penalty growth rule of the form:
Field |
Default |
Meaning |
|---|---|---|
|
|
Maximum number of augmented-Lagrangian outer iterations. Must be nonnegative. |
|
|
Initial Lagrange multiplier value. Must satisfy |
|
|
Cap on Lagrange multiplier magnitude. Must be finite and nonnegative. |
|
|
Initial quadratic penalty coefficient. Must satisfy |
|
|
Maximum quadratic penalty coefficient. Must be positive. |
|
|
Multiplicative penalty increase between outer iterations. Must be greater than |
|
|
Convergence tolerance on constraint violation. Must be positive. |
|
|
Convergence tolerance on total augmented objective change. Must be positive. |
ILQRConfig#
The inner loop iteratively linearizes the dynamics and solves local LQR subproblems:
Field |
Default |
Meaning |
|---|---|---|
|
|
Maximum number of inner iLQR iterations. Must be nonnegative. |
|
|
Gradient-based convergence threshold on the maximum feedforward norm
|
|
|
Cost-improvement tolerance used to detect convergence or stagnation. Must be finite and nonnegative. |
|
|
Maximum allowed number of consecutive near-zero-improvement steps before declaring stagnation. Must be nonnegative. |
|
|
Line-search acceptance additionally requires a strict cost decrease
( |
|
|
Require ALL enabled convergence conditions (cost AND gradient) to hold
simultaneously, as in original ALTRO. Default (disjunctive): either
condition suffices. |
|
|
Carry regularization across iLQR iterations (ALTRO-style): decrease on
accepted steps (down to |
|
|
Safety abort threshold if the trajectory cost blows up. Must be positive. |
|
|
Safety bound on state magnitude during rollout. Must be positive. |
RegularizationConfig#
Backward-pass regularization stabilizes the control Hessian:
where rho is adapted from the regularization schedule.
If second-order DDP curvature is enabled, SALTRO can optionally PSD-project the
extra curvature blocks before assembling Q_{uu}. The newer
psd_clamp_lxx diagnostic knob instead projects the stage state Hessian
itself:
Warning
psd_clamp_lxx is intentionally a testing and diagnostic aid, not a
production tuning recommendation. It is useful to prove that an indefinite
cost Hessian is the failure source, but it adds an eigendecomposition per
knot and can hide model issues instead of fixing them.
Field |
Default |
Meaning |
|---|---|---|
|
|
Initial regularization magnitude |
|
|
Minimum allowed regularization. |
|
|
Maximum allowed regularization. Must be positive. |
|
|
Multiplicative factor used when adapting the regularization schedule. Must be greater than |
|
|
Additional increase factor used on failed backward/forward steps. Must be positive. |
|
|
Minimum conditioning threshold used in regularization logic. Must be nonnegative. |
|
|
Optional random diagonal perturbation ratio for robustness experiments. Must be finite and nonnegative. |
|
|
If true, include second derivatives of the dynamics in the DDP quadratic model. |
|
|
If true, include second derivatives of the constraints in the DDP quadratic model. |
|
|
If true, PSD-project the additional DDP curvature contributions before they are folded into the Riccati recursion. |
|
|
If true, eigen-clamp each stage cost Hessian |
LineSearchConfig#
The forward pass uses backtracking line search on the step size \alpha and
accepts a step when sufficient decrease is achieved:
The implementation also guards against excessive cost growth using
beta2.
Field |
Default |
Meaning |
|---|---|---|
|
|
Maximum number of line-search backtracking trials. Must be nonnegative. |
|
|
Armijo-style sufficient-decrease coefficient. Must lie in |
|
|
Additional allowable cost-growth bound used in forward-pass acceptance logic. Must be positive. |
Practical Notes#
ang_cost_func_type = 3 (the default) is usually the safest curvature choice
for pointing problems. The former type 2 (raw acos) was removed: its
curvature is concave in the alignment scalar (anti-PSD under Gauss-Newton) and
its gradient is singular at both poles, including perfect alignment. Use type
3 (Taylor-protected acos²) or type 0 (linear) instead.
ang_cost_func_type = 5 (pseudo-Huber, crossover ang_cost_huber_delta)
keeps type 3’s quadratic basin near the goal but caps the large-angle gradient
at δ, so a large initial error does not translate into a proportionally large
commanded correction. Consider it when large-slew scenarios over-command the
actuators under type 3, or when the running-angle weight must be raised well
above the terminal-matched band.
use_cost_hess, use_dynamics_hess, and use_constraint_hess are the
main switches that move SALTRO from a mostly Gauss-Newton-style model toward a
fuller second-order DDP model. That can improve convergence, but it also makes
Hessian definiteness much more important.
For terminal retuning, prefer setTerminalEmphasis(k) over editing
angle_N and ang_vel_N independently. It preserves the intended balance
between reaching the target and arriving without excessive angular velocity.