Path: SC/Attitude
% Generate a reference quaternion for a variety of targets. There are six types of target: 'sun' - point a spacecraft vector (u) at the sun. The angle about the vector is ignored 'lvlh' - align the spacecraft with LVLH, with optional offset 'eci' - align with respect to ECI 'ulvlh' - align (u) with a unit vector (uTarget) defined in the lvlh frame 'ueci' - align (u) with a unit vector (uTarget) defined in the eci frame 'latlon' - point a spacecraft vector (u) at a specific latitude and longitude of the earth. The angle about the vector is ignored 'target' - align with a target spacecraft (at rTarget) The output is the target qECIToBody. This is compatible with PID3Axis data in which case the mode will be 'quat'. The target data t is required for 'target' or 'latlon' modes, otherwise the parameters from d will be used. If angle is nonzero than the axis rotation will be appended. -------------------------------------------------------------------------- Form: t = AttitudeTarget; % data structure [qTarget,d] = AttitudeTarget( type, s, t, d ) [qTarget,d] = AttitudeTarget( type, s, [], d ) -------------------------------------------------------------------------- ------ Inputs ------ type '' Type of target 'latlon' 'sun' 'lvlh' s (.) Data structure with spacecraft state information .qECIToBody (4,1) Current quaternion .rECI (3,1) ECI position vector .vECI (3,1) ECI velocity vector .jD (1,1) Julian date t (.) Data structure with target information .qOffset (4,1) Offset quaternion (lvlh and eci only) .u (3,1) Unit vector in the body frame .uTarget (3,1) Target vector in the reference frame .rTarget (3,1) Target ECI position vector .latitude (1,1) Geodetic latitude (rad) .longitude (1,1) Longitude (rad) d (.) Data for PID3Axis control function .q_desired_state (4,1) Offset quaternion .body_vector (3,1) Unit vector in body frame .eci_vector (3,1) Target vector .angle (1,1) Angle of rotation .axis (3,1) Axis of rotation ------- Outputs ------- qTarget (4,1) Target qECIToBody d (.) Updated PID3Axis data .q_desired_state (4,1) Target quaternion .mode, set to 'quat' -------------------------------------------------------------------------- See also: PID3Axis --------------------------------------------------------------------------
AerospaceUtils: Coord/LatLonToR AerospaceUtils: Coord/QLVLH SC: Ephem/SunV1 SC: Ephem/TruEarth Common: General/DeBlankLT Common: Quaternion/AU2Q Common: Quaternion/QForm Common: Quaternion/QMult Common: Quaternion/QTForm Common: Quaternion/QZero Common: Quaternion/U2Q Common: Time/JD2T Math: Linear/Unit
Back to the SC Module page