Skip to main content

Overview

mrpSteering implements a steering law that maps an MRP attitude error to a desired angular-rate command. It is designed to be the outer loop of a cascaded attitude control architecture, with its output consumed by a rate-tracking inner loop (e.g., a rate servo or reaction-wheel speed controller). The steering saturation function uses a proportional and a cubic term to smoothly bound the commanded rate.
from Basilisk.fswAlgorithms import mrpSteering

steering = mrpSteering.mrpSteering()
steering.ModelTag = "mrpSteering"

Configuration parameters

K1
double
Proportional gain applied to the MRP attitude error [rad/s].
steering.K1 = 0.05  # [rad/s]
K3
double
Cubic gain applied to the MRP error in the steering saturation function [rad/s]. Increases damping for large errors.
steering.K3 = 0.75  # [rad/s]
omega_max
double
Maximum angular-rate command magnitude [rad/s]. Acts as the saturation bound of the steering law.
steering.omega_max = 0.1  # [rad/s]
ignoreOuterLoopFeedforward
uint32_t
Boolean flag (0 or 1). When set to 1, the outer-loop feedforward term (reference angular acceleration) is excluded from the rate command. Default: 0.
steering.ignoreOuterLoopFeedforward = 0

Input messages

guidInMsg
AttGuidMsg_C
Attitude guidance input message. Provides the MRP error sigma_BR, angular-rate error omega_BR_B, reference rate omega_RN_B, and reference angular acceleration.
steering.guidInMsg.subscribeTo(attGuidMsg)

Output messages

rateCmdOutMsg
RateCmdMsg_C
Commanded body angular-rate vector [rad/s] to be tracked by the inner rate loop.

C-level functions

MRPSteeringLaw(configData, sigma_BR, omega_ast, omega_ast_p)
function
Core steering-law computation callable from C/C++.
MRPSteeringLaw(configData, sigma_BR, omega_ast, omega_ast_p);
Writes the commanded rate omega_ast and its derivative omega_ast_p given attitude error sigma_BR.

Full setup example

from Basilisk.fswAlgorithms import mrpSteering
from Basilisk.utilities import SimulationBaseClass, macros

scSim = SimulationBaseClass.SimBaseClass()
scSim.CreateNewProcess("fswProc")
scSim.CreateNewTask("fswTask", macros.sec2nano(0.5))

steering = mrpSteering.mrpSteering()
steering.ModelTag  = "mrpSteering"
steering.K1        = 0.05   # [rad/s]
steering.K3        = 0.75   # [rad/s]
steering.omega_max = 0.1    # [rad/s]

steering.guidInMsg.subscribeTo(attGuidMsg)
scSim.AddModelToTask("fswTask", steering)

# Connect rate output to an inner rate servo
# innerRateServo.rateRefInMsg.subscribeTo(steering.rateCmdOutMsg)

Build docs developers (and LLMs) love