Main Content

Attitude Profile

Calculate shortest quaternion rotation

  • Library:
  • Aerospace Blockset / Spacecraft / Spacecraft Dynamics

  • Attitude Profile (Nadir Pointing) block
  • Attitude Profile (Geographic Pointing) block
  • Attitude Profile (Sun Tracking) block

Description

The Attitude Profile block calculates the shortest quaternion rotation that aligns the primary alignment vector with the primary constraint vector. A quaternion is defined using the scalar-first convention. Aerospace Blockset™ uses quaternions that are defined using the scalar-first convention.

Provide the primary constraint as either a pointing mode:

  • Point at nadir

  • Point at celestial body

  • Point at LatLonAlt

Or via a custom constraint vector. The block then aligns secondary alignment and constraint vectors as much as possible without breaking primary alignment.

The library contains three versions of the Attitude Profile block preconfigured for these common attitude control modes:

  • Nadir Pointing — Point at nadir

  • Geographic Pointing — Point at LatLonAlt

  • Sun Tracking — Point at celestial body with Sun as the celestial target

For more information on the coordinate systems the Attitude Profile block uses, see Algorithms.

Ports

Input

expand all

Position state vector of spacecraft at time tutc.

Data Types: double

Velocity state vector of spacecraft at time tutc, specified as a 3-element vector.

Dependencies

To enable this port, set Constraint coordinate frame (CCF) to LVLH.

Data Types: double

Attitude of the spacecraft at tutc, represented as a quaternion from body frame to port coordinate frame, specified as a 4-element vector.

Data Types: double

Current date or time, specified as a scalar, as a Julian date.

Dependencies

To enable this port, perform one of these:

  • Set Pointing mode to Point at celestial body or Point at LatLonAlt

  • Select the Allow pointing mode change during run check box.

Data Types: double

Geodetic latitude and longitude (deg) of a terrestrial point of interest, specified as a 1-D array of size 2. This port is used together with altitude when Pointing mode is Point at LatLongAlt. This location is used as the primary constraint.

Dependencies

To enable this port, do one of these:

  • Set Pointing mode to LatLonAlt.

  • Select the Allow pointing mode change during run check box.

Data Types: double

Altitude of terrestrial point of interest, specified as a scalar. This port is used together with geodetic latitude and longitude when Pointing mode is Point at LatLongAlt. This location is used as the primary constraint.

Dependencies

To enable this port, do one of these:

  • Set Pointing mode to LatLonAlt.

  • Select the Allow pointing mode change during run check box.

Data Types: double

Primary alignment vector (in body frame), specified as a 3-element vector.

Dependencies

To enable this port, set Primary alignment (body-frame) to Port.

Data Types: double

Secondary alignment vector (in body frame), specified as a 3-element vector.

Dependencies

To enable this port, set Secondary alignment (Body-frame) to Port.

Data Types: double

Primary constraint vector, specified as a 3-element vector, in constraint coordinate frame.

Dependencies

To enable this port, set:

  • Pointing mode to Custom.

  • Primary constraint (CCF) to Port.

Data Types: double

Secondary constraint vector, specified as a 3-element vector.

Dependencies

To enable this port, set Secondary constraint (CCF) to Port.

Data Types: double

Output

expand all

Shortest quaternion by which to rotate from the spacecraft's current orientation to the desired orientation (in body frame), specified as a 3-element vector.

Data Types: double

Parameters

expand all

Coordinate frame for position, velocity, and attitude (q) ports. For more information about coordinate systems, see Algorithms.

Programmatic Use

Block Parameter: portFrame
Type: character vector
Values: 'ICRF' | 'Fixed-frame'
Default: 'ICRF'

Primary vector alignment pointing mode, specified as Point at nadir, Point at celestial body, Point at LatLonAlt, or Custom.

Programmatic Use

Block Parameter: pointingMode
Type: character vector
Values: 'Point at nadir' | 'Point at celestial body' | 'Point at LatLonAlt' | 'Custom'
Default: 'Point at nadir'

To allow pointing mode change during run, select this check box. Otherwise, clear this check box.

Programmatic Use

Block Parameter: tunablePointing
Type: character vector
Values: 'on' | 'off'
Default: 'on'

Celestial body with which to align primary alignment vector.

Dependencies

To enable this parameter, set Pointing mode to Point at celestial body.

Programmatic Use

Block Parameter: celestialTarget
Type: character vector
Values: 'Sun' | 'Mercury' | 'Venus' | 'Moon' | 'Mars' | 'Jupiter' | 'Saturn' | 'Uranus' | 'Neptune' | 'Pluto' | 'Solar' | 'Solar system barycenter' | 'Earth-Moon barycenter'
Default: 'Sun'

Primary alignment vector source, specified as Port or Dialog.

  • Port — Specify port alignment array through the A1b port.

  • Dialog — Specify port alignment 3-element vector in the accompanying text box (default value of [0 0 1]).

Dependencies

To specify the port alignment array in a text box, set this parameter to Dialog.

Programmatic Use

Block Parameter: primaryAlignmentSrc | when primaryAlignmentSrc is 'Dialog', use primaryAlignment to set the primary alignment vector
Type: character vector
Values: 'Port' | 'Dialog' | primary alignment vector, specified 3-element vector
Default: 'Dialog'

Secondary alignment vector source, specified as Port or Dialog.

  • Port — Specify port alignment array through the A2b port.

  • Dialog — Specify port alignment 3-element vector in the accompanying text box (default value of [1 0 0]).

Dependencies

To specify the port alignment array in a text box, set this parameter to Dialog.

Programmatic Use

Block Parameter: seconaryAlignmentSrc | when seconaryAlignmentSrc is 'Dialog', use secondaryAlignment to set the secondary alignment vector
Type: character vector
Values: 'Port' | 'Dialog' | secondary alignment vector, specified as a 3-element vector
Default: 'Dialog'

Coordinate frame in which constraint vectors are provided, specified as ICRF, Fixed-frame, LVLH, NED, or Body-fixed. For more information about coordinate systems, see Algorithms.

Programmatic Use

Block Parameter: constraintFrame
Type: character vector
Values: 'ICRF' | 'Fixed-frame' | 'LVLH' | 'NED' | 'Body-fixed'
Default: 'ICRF'

Primary constraint vector source, specified as Port or Dialog.

  • Port — Specify primary constraint array through the C1b port.

  • Dialog — Specify port constraint 3-element vector in the accompanying text box (default value of [1 0 0]).

Dependencies

  • To specify the port alignment array in a text box, set this parameter to Dialog.

  • This parameter is affected when Constraint coordinate frame (CCF) is set to Custom.

Programmatic Use

Block Parameter: primaryConstraintSrc | when primaryConstraintSrc is 'Dialog', use primaryConstraint to set the primary constraint vector
Type: character vector
Values: 'Port' | 'Dialog' | primary constraint vector, specified as a 3-element vector
Default: 'Dialog'

Secondary constraint vector source, specified as Port or Dialog.

  • Port — Specify secondary constraint array through the C1b port.

  • Dialog — Specify port constraint 3-element vector in the accompanying text box (default value of [0 1 0]).

After the primary alignment vector is aligned with the primary constraint vector, to fully define the rotation, the block attempts to align the secondary alignment vector with the rotation vector. The rotation vector should be the secondary constraint vector.

Whereas the primary constraint is enabled only for the custom pointing mode, the secondary constraint is always enabled.

Dependencies

To specify the port alignment array in a text box, set this parameter to Dialog.

Programmatic Use

Block Parameter: secondaryConstraintSrc | when secondaryConstraintSrc is 'Dialog', use secondaryConstraint to set the secondary constraint vector
Type: character vector
Values: 'Port' | 'Dialog' | secondary constraint vector, specified as a 3-element vector
Default: 'Dialog'

Algorithms

expand all

The Attitude Profile block uses Earth-centric and vehicle-centric coordinate systems.

Introduced in R2020b