The NEAR Guidance and Control System JOHNS HOPKINS APL TECHNICAL DIGEST, VOLUME 19, pp 205-212, NUMBER 2 (1998) (Figures referenced in this text document are available in the ADOBE ACROBAT CDHS.PDF file in this directory.) Thomas E. Strikwerda, J. Courtney Ray, and David R. Haley The Near Earth Asteroid Rendezvous (NEAR) spacecraft guidance and control system supports all modes of pointing and control for the mission, including routine control during the long cruise to the asteroid Eros, high-frequency control of the propulsion subsystem thrusters during orbital corrections, precise pointing for science data collection, and spacecraft safety in emergencies. The attitude determination and control algorithms have been structured to provide the necessary capability, autonomy, high throughput, and relatively easy transitions among modes. The guidance and control system includes very few attitude sensors but achieves at least one level of redundancy for all reasonable failure modes. Its functions are divided between two redundant computers that are cross-strapped for maximum flexibility. (Keywords: Attitude determination, Guidance and control.) INTRODUCTION The Near Earth Asteroid Rendezvous (NEAR) guidance and control (G&C) system is responsible for all spacecraft attitude determination, guidance, and attitude control functions. Its tasks include pointing at the Sun for electrical power, performing trajectory correction maneuvers (TCMs), pointing the science instruments during various scenarios, orienting the spacecraft to transmit data to Earth, and managing angular momentum. This article summarizes the design, function, and operation of the NEAR G&C system. SYSTEM REQUIREMENTS Because the solar panels are fixed to the NEAR spacecraft, the G&C system must usually orient them toward the Sun to maintain a charge on the relatively small battery. Maneuvers slightly away from the Sun are required occasionally to point the high-gain antenna toward Earth for high-speed data transmission, or to point the thrusters in a desired direction when an orbit trajectory change is executed. While at Eros, the spacecraft must orbit the asteroid in a plane nearly perpendicular to the Sun-Eros vector to point the instruments, which are oriented 90o from the z axis, toward the asteroid. Attitude knowledge and control requirements are driven by both science and mission planning. During science data collection and TCMs (i.e., DV, or simply "burns"), attitude knowledge must be accurate to 50 mrad (about 10 arcsec), and control must be within 1.7 mrad or about 0.l deg of the commanded attitude for all three axes. Attitude requirements are slightly relaxed during large DV to 6 mrad for all three axes because science instruments will not be collecting data, and additional orbit corrections can be performed afterward using the fine velocity control thrusters. The control jitter specification when not performing burns is 50 mrad (10 arcsec) over 1 s ("jitter" here means total angular change of a vector, e.g., sensor axis, in a time interval). Propulsive maneuver requirements are split into two regimes: large burns and smaller burns. The requirement for large burns (DV > 1 m/s) is to achieve the specified DV direction to within 6 mrad and 0.2% in magnitude. For smaller burns, the magnitude must be within 2 mm/s. The smaller burn requirement is driven by the fine adjustments needed at Eros to change the plane of NEAR's orbit or gradually lower and raise the spacecraft's altitude. SYSTEM COMPONENTS: OVERVIEW The G&C system (Fig. 1) uses computers, sensors, and actuators to carry out its mission. The heart of the system is two sets of computers: flight computers (FCs) and the attitude interface units (AIUs), which are cross- connected for additional redundancy. The FCs perform most of the attitude determination, guidance, and control functions. The AIUs serve several roles. Their main functions are collecting data from various sensors and actuators, controlling the actuators, and managing communications between the command and telemetry processor (CTP) and the FCs. In addition, the AIUs contain algorithms to perform safe modes (modes to ensure spacecraft safety, which are detailed later in the article) and logic to detect problems with and reconfigure the inertial measurement unit (IMU) or alert the CTP of a problem via discrete signals. The sensor suite consists of the IMU, which contains four hemispherical resonator gyroscopes and four accelerometers; a star tracker; a digital solar aspect detector (DSAD) consisting of a set of five sensor heads; and a solar array current monitor. The system's four reaction wheels control the spacecraft attitude by changing speed in response to signals from the FCs or AIUs. The basic G&C technique relies on the gyros to accurately follow relative motion and the star tracker to provide an accurate reference to the inertial (star) coordinate system. Errors between the desired attitude and actual measurements are corrected by either the reaction wheels or the thrusters, depending on the mode of operation. Thrusters are divided into two sets: the A set has four fine velocity control thrusters with 22 N of force and two smaller thrusters with 4.5 N of force; the B set has five 4.5-N thrusters (Fig. 2). These 11 small monopropellent thrusters consume hydrazine (N2H4) via a catalytic process and are used for TCMs and momentum dumping. In addition, a large velocity adjustment thruster with 450-N thrust in the 1x direction is used only to make large trajectory changes once to send the spacecraft back to Earth for the gravity-assisted inclination change and several times for orbit insertion at Eros. Placement of the thrusters was carefully thought out to minimize plume impingement on solar arrays and yet provide redundancy or pure couple torques as much as possible. Because NEAR is solar powered and must be oriented nearly sunward at all times, trajectory corrections are usually broken into two legs, using x- or z-axis thrusters for each leg. The IMU, star tracker, and both AIUs and FCs are interconnected via a G&C- dedicated MIL-STD-1553 bus. This high-speed message bus is used to exchange all G&C data between the AIUs and FCs. The AIUs are also connected directly to the reaction wheels, DSAD, solar array current monitor, propulsion tank valves, and thruster relays. They are terminals on the separate command and data handling 1553 bus and receive commands and send telemetry by direction from the CTP. DATA COLLECTION AND DISTRIBUTION OPERATIONS Attitude Interface Units The AIUs are RTX-2010-based computers, designed and built by APL, with 64K words of 16-bit random access memory (RAM) and 64K words of electrically erasable programmable read-only memory (EEPROM). They contain specialized interface circuitry for the DSAD, reaction wheels, thruster and fuel tank valve controls, and solar array current monitor. As bus controllers on the G&C 1553 bus, they are responsible for all data transfers among themselves, the FCs, IMU, and star tracker. They route IMU data messages at 100 Hz to the FCs and collect these data for their own use as well. Star tracker data are routed at 5 Hz to the FCs. Messages from the AIUs to FCs at 1 and 25 Hz contain DSAD and reaction wheel speed data, respectively. Reaction wheel torques and thruster valve commands are received by the AIUs from the FCs at 25 Hz. Telemetry and commands are exchanged between FCs and AIUs at 1 Hz. Although most of the interaction with the CTP occurs via the 1553 bus, several important discrete logic lines are also used as an AIU heartbeat signal to the CTP and to signal safe-mode transitions by an AIU or CTP to the other units.The AIUs also serve as momentary backups during transitions from one FC to the other, or as longer-term backups if both FCs are powered off briefly because of a power problem or if the system enters an AIU-only state in Sun-safe mode. AIU control software must be simpler than the FC version because servicing all the interface functions leaves insufficient time to perform many complex attitude determination, guidance, and control functions. The AIU version of control algorithms can control the spacecraft via wheels to hold a commanded attitude or rate, using the gyros to guide it; unlike the FCs, however, the AIUs cannot estimate attitude from DSAD or star data. The control software is executed at 25 Hz and is similar to the FC control logic. The only thruster function supported, however, is thruster momentum dump, not DV. Flight Computers The FCs perform all G&C computations but rely on the AIUs to provide data collection and distribution services. The FCs are MIL-STD 1750a processors with 512K words of RAM and 256K words of EEPROM and include a 1553 interface for communication. Functions of the G&C are divided on the basis of timing requirements: foreground high-rate control processing at 25 Hz; background algorithms that finish each processing cycle in a variable length of time; and once-per-second command, telemetry, guidance, and attitude determination processing. The FC processing cycle is slaved to the AIU timing. Foreground Processing Thruster control requires high-rate foreground processing because these powerful actuators must be modulated frequently and accurately to maintain attitude control and deliver accurate DV for TCMs. The gyroscopes in the IMU are the key components in this processing since they can follow and report rapid vehicle motion. The AIUs coordinate the transfer of 100 IMU messages per second to the FCs, pick up the torque messages at 25 Hz, and distribute them to the wheels and thrusters. The FC control software processes four gyro measurements from each gyro every 40 ms. Each gyro measurement is the integrated angle (with rollover) of that gyro relative to its orientation at start-up. These measurements are supplied to the module that propagates the three-axis attitude state (inertial attitude and body angular rate) from the last frame via strap- down computations. Every 40 ms, the integrated state is compared with the commanded state to derive wheel torques or thruster commands to cause the spacecraft to follow the commanded state.Attitude is represented by four- element arrays called quaternions (Ref. 1).* Attitude control uses a discrete implementation of a linear quaternion feedback regulator, which was based on the design of the MSX (Midcourse Space Experiment) attitude control system, including the "bang-bang" minimum time slue and quaternion- error integral modes.2,3 Accelerometer processing is also performed at 25 Hz to derive the realized DV, which is compared with the commanded DV. The system supports three methods for DV: open loop (time duration cutoff), closed loop with magnitude cutoff, or closed loop with vector cutoff. Background Processing Background processing includes star identification and other functions that are not required to finish within the second. Because of the potentially long start-up operation, star identification was given its own background task with lower priority to decouple it from the other more time-critical operations. However, after finding a good star match, star identification is normally a rapid process that is restarted once per second and becomes an integral part of the precision attitude determination and control system. The G&C system relies on onboard star identification for its absolute inertial reference. The autonomous onboard star identification method has been discussed in the literature in some detail.4,5 Briefly, the method matches three to five star centroids for stars detected by the tracker in its 20 by 20 deg field of view with stars from the FC's onboard star catalog, which contains over 2000 stars for the NEAR tracker. After matching the stars, a best-fit estimate of current attitude, consisting of a quaternion, is calculated. To speed up the normal identification process, a subcatalog is extracted from the flight catalog. If stars have been identified in the previous second, which is normally the case, the software assumes that the same stars are still being tracked and checks for consistency with previous measurements, computes a new single-frame attitude, and passes the result to the attitude determination system. If the new measurements are inconsistent with the expected positions, however, the software attempts to find a new match with stars in the local area. Star identification is a separate background task in the normal G&C processing cycle because it may not finish in 1 s. In particular, after start-up or momentary loss of stars by the tracker, the software may require extra search time to identify stars. If the local search fails repeatedly, the software switches to a global search mode. In this mode, the software works its way through the entire catalog, if necessary, looking for a match with the measurements. This mode is entered rarely, usually only if an FC is reset or power-cycled, which causes information from previous identifications to be erased. Because the catalog may not contain all the stars that the tracker can detect, the FC algorithms use the commanded search capability of the tracker. As the spacecraft attitude changes, the tracker will lose stars as they drift out of the field of view. Normally the tracker will search for others on its own. The star identification software can intervene and command the tracker to look in a specific location in the field of view for a catalog star. Once-Per-Second Processing Attitude determination and guidance algorithms are called once per second to update the commanded state and to compute attitude based on star tracker, IMU, and DSAD measurements. Commands are processed and telemetry messages are generated every second as well. Attitude determination. Software for the attitude determination system executes once per second to derive a new, accurate estimate of the spacecraft's attitude and angular rate. The 100 gyro data samples from the previous 1-s interval are processed to propagate the estimated state forward 1 s. If a Sun vector measurement from the DSAD-based or star tracker-based attitude quaternion is available from that interval, the propagated state is updated via a Kalman filter update step. A star tracker quaternion takes precedence over a DSAD measurement because the former is much more accurate and provides full three-axis attitude (DSAD measurements are single vectors and thus provide no orientation information about the Sun line). The output of the attitude determination system is the filtered attitude state (quaternion and rate) at the end of the 1-s interval. This value is compared with the attitude state computed from gyro measurements by the high-rate strap-down algorithm. The quaternion difference is a correction that is returned to the foreground process for use in the subsequent second. Guidance. Guidance algorithms compute the commanded attitude quaternion and rate based on the current mode, time, and function of the spacecraft. The guidance software includes orbits for the spacecraft, Earth, Sun, and asteroid and uses current positions to compute spacecraft-commanded attitude and rates to carry out a planned scenario. Parameters can be uploaded to the FCs that describe various science maneuvers to point instruments at the asteroid and perform various offsets and geometric scan patterns. Several scenarios are predefined for ease of system operation:o Solar panels are pointed at the Sun while maintaining the fanbeam at Earth.o Solar panels are pointed slightly away from the Sun to use solar pressure to generate a body torque to dump angular momentum.o The high- gain antenna is pointed at Earth.o Sensors are pointed at asteroid nadir.The guidance code also implements algorithms in the high-rate loop for controlling TCMs. Parameters are uploaded to specify the attitude (an inertial hold state), expected DV magnitude, and safety limits for the maneuver. The algorithms will stop the maneuver when the correct velocity has been achieved or abort the maneuver if an off-nominal condition is detected and then signal the G&C system to switch to the Earth-safe mode. TCMs are performed relatively infrequently during the long cruise phase. At Eros they may be needed as often as once per week to maintain the proper orbit plane geometry for science and battery charging and for changing the orbit altitude. MODES, STATES, AND FUNCTIONS Several requirements dictated a matrix of modes and states to enable the G&C system to carry out its various functions. From the CTP perspective, the system has four modes: operational, Earth-safe, Sun-safe-rotate, and Sun-safe-freeze. In addition, from the G&C perspective, there are three states that define which computer system is in control of the actuators: AIU-only Sun-safe, AIU-control, and FC-override. Operational and Safe Modes In operational mode, the normal and most desirable mode, the FC is controlling the spacecraft, and all the software capability is available for science and spacecraft operations. The G&C system must be in this mode and in the FC-override state (discussed in the following section) to support the scientific objectives. Four basic functions occur in the operational mode: normal cruise attitude, TCMs, science maneuvering, and science data transmission to Earth via the high-gain antenna. For normal cruise attitude, which is being maintained during the multiyear flight to the asteroid, the solar arrays are pointed at the Sun, and the spacecraft is rolled about the Sun-spacecraft vector so that the fanbeam antenna points at the Earth. Various system fault conditions can trigger a transition to one of the safe modes. Both Sun- and Earth-safe modes ensure that the solar panels are pointed toward the Sun. In Earth-safe mode, the direction to the Earth is presumed to be known, enabling the G&C system to orient the spacecraft about the Sun line to point the fanbeam antenna toward the Earth for both uplink and downlink communication. If the G&C system does not know the Earth's location (a situation that arises, for example, after initial turn- on), or if the command system requests it, the mode is changed to Sun-safe- rotate. In that mode, the spacecraft is rotated about the Sun line, as measured by the DSAD, once every 3 h to sweep the fanbeam antenna past the Earth. A signal is broadcast via the fanbeam, sending out a "searchlight"- like beam. If the Earth receiving station detects this carrier, a stop- rotate command is sent to NEAR at the correct time during the next rotation to stop the spacecraft when the fanbeam is oriented at Earth (Sun-safe- freeze mode). Normal communications are then reestablished, and recovery is attempted. Safe modes may also affect other spacecraft functions such as telemetry rates, configurations, and heater or instrument power. After a fault is diagnosed and corrected via ground analysis, the G&C system is promoted back to operational mode. States States reflect which computer, AIU or FC, is controlling the spacecraft attitude. During normal operations, the FC is in control and the AIU acts as an interface unit, passing control signals to the wheels or thrusters. This is called the FC-override state because the FC control signals override the AIU-computed control signals. If the FC-to-AIU messages are missed momentarily for any reason, the AIU can propagate the last attitude state for a brief period on its own. This is called the AIU-control state because the AIU is controlling the spacecraft but using the last commanded attitude and rate information from the FC. When the condition clears, the state is automatically changed back to FC-override. However, if this condition persists for more than a few seconds, the mode is demoted to Earth-safe and stays in AIU-control (with the AIU retaining the last Earth-Sun geometry) until ground intervention reconfigures the system.During all operations the AIU monitors the Sun direction, and if it detects an "out-of-range" condition, i.e., a Sun-keep-in (SKI) violation, it will take action. The AIU first demotes the mode to Earth-safe, which halts any science maneuvers or TCMs currently executing, and should force the spacecraft to reorient toward the Sun. If the unsafe condition is not cleared quickly enough, the AIU demotes the mode to Sun-safe-rotate. In Sun-safe mode, the FC guidance process computes a commanded attitude based on the computed location of the spacecraft and Sun. If the SKI violation persists even in this mode, perhaps because of an incorrect spacecraft ephemeris or time in the FC, the AIU will take control of the G&C system (the AIU-Sun-safe state), and rotate the spacecraft about the measured Sun vector instead of the FC's computed Sun vector. All FC control signals are ignored until the ground intervenes, corrects the problem, and promotes the system to operational. Momentum Dumping Function The system angular momentum, which is monitored by the AIUs and FCs as well as the mission operations center, is a critical parameter on the spacecraft. Either the AIUs or FCs can request an autonomous momentum dump via thrusters while in any state or mode if they determine that the momentum is exceeding the safe level. Since autonomous momentum dumping should never occur under normal circumstances, any call for a dump by the G&C system will trigger a transition to a safe mode. COMPONENT AND FUNCTIONAL REDUNDANCY Redundancy was a key factor in the G&C system design, even though weight, power, and cost were significant constraints on purchasing additional backup hardware. The G&C system employs very few attitude sensors but incorporates at least one level of redundancy at either the G&C system level or spacecraft level to handle failures of any of the primary G&C components. The strongest redundancy is provided by having two AIUs and two FCs that are cross-strapped on the G&C 1553 bus. As mentioned previously, normally the FCs control the spacecraft while the AIUs distribute the control signals and collect and route sensor information. However, the AIUs can take over and handle the spacecraft in a limited way if, for example, one FC has failed and the other needs to be taken off-line to be reprogrammed. Only three reaction wheels are needed to control the vehicle, but a fourth wheel provides backup. The four reaction wheels are mounted with their axes in a splayed configuration, so that if any one wheel fails, the other three can still control the vehicle about all three axes and perform the nominal science mission. Both the AIUs and FCs have logic to detect simple failures and restrict the use of a questionable wheel. The IMU has built-in redundancy at the major component level. It contains two power supplies, two processors, four gyros, and four accelerometers that are configurable by relays controlled by the AIU. Autonomy logic included in the AIU software can detect component failures and reconfigure the IMU to a preselected state. If this fails, the FCs can still operate the spacecraft with star tracker data only; however, the baseline software will not permit thruster operation in this condition because the rate information derived from stellar attitude is inadequate for precise high rate control using thrusters. The DSAD system is not redundant, but four of the five sensor heads are mounted to have significant overlap in the z-axis direction. This configuration provides some protection against single head failure, which is very unlikely since the heads are very simple devices. Additional redundancy is provided by monitoring the solar array current. If the DSAD sensor heads were to fail, the system is designed to dither the spacecraft, thereby modulating the solar array current, from which an approximate Sun vector can be determined. Since the propulsion subsystem is critical, the two sets of fine velocity control thrusters mentioned earlier were included. Either set provides full three-axis attitude control. The AIUs and FCs are commanded to use one or the other or both sets of thrusters for any given thruster maneuver. Although there is no backup large velocity adjust thruster, the fine velocity control A-side thrusters can be used to achieve some of the required DV, provided a failure does not occur too early in the mission (in which case all the fuel for doing fine corrections and momentum dumping would be depleted). The star tracker is not redundant. A failure of this sensor will probably require dramatic changes in operation. Because star sightings are needed to provide the absolute pointing reference for the G&C system, a nonoptimal procedure has been designed. Images of star fields will be taken by the Multispectral Imager (MSI) and transmitted to Earth, where the stars will be identified and their attitudes determined. The attitude correction or offset will be sent to the spacecraft to update the FCs. In parallel, efforts probably will be initiated to modify the MSI flight software to compute star centroids and the FC software to identify stars using MSI images instead of star tracker images. PERFORMANCE Our analysis of in-flight data and performance has led to several improvements to the G&C algorithms. Two successful software uploads to the FCs took place during the first 14 months of operation. Analysis of the G&C telemetry resulted in enhancements to the simulation and then to improvements in the flight software. One of the most important changes involved the recoding of the thruster control logic in the FCs. Analysis showed that the thrusters did not behave as assumed in the original design and simulation. Thus, it would have been very difficult, maybe impossible, to achieve the DV performance required for the mission with the original code. Another change was to incorporate filtering of the IMU outputs, both gyros and accelerometers. Without gyro filtering, the pointing stability and accuracy could be compromised, and DV performance would be less accurate than desired. Our knowledge of the G&C system is improving with each special test and TCM.6 The first significant G&C event occurred immediately after separation. The system detumbled the spacecraft (Fig. 3) and, shortly thereafter, when the spacecraft emerged into the sunlight, oriented it to point the solar arrays toward the Sun. At separation from the launch vehicle, the spin rates exceeded the safety level for wheel control (and wheel control capability), and the G&C system automatically called for a momentum dump. A number of science maneuvers have also been tried. The first opportunity to collect important science data on a solar system object occurred on 27 June 1997 during the 10 km/s, 1200-km-altitude flyby of the asteroid Mathilde. One critical component in the maneuver design is the reaction wheels. Since they were sized for science maneuvers at Eros, the wheel torque capability was one limiting factor in performing the maneuver. Figure 4a shows the body x-, y-, and z-axis rates for the flyby. Figure 4b shows the pitch (rotation about z) and yaw (rotation about y) pointing residuals, determined by differencing the instantaneous commanded and instantaneous actual spacecraft attitudes. The predominant maneuver motion is about the z axis to raster-scan the imager (MSI) across the asteroid. The first scan begins at 2300 s. The turnarounds at the end of each scan leg, which demand the greatest spacecraft acceleration, are clearly seen, particularly in Fig. 4b, (at 2200, 2100, 70, and about 200 s). The large spikes in Fig. 4b reflect discontinuities in the commanded pointings, rather than noise or jumps in the reported attitude. During the 1000-s period shown, the spacecraft maneuvered approximately 153 inertially to keep its sensors pointed toward Mathilde. At about 250 s, the spacecraft was at its maximum acceleration capability and drifted slightly behind the smoothly varying commanded attitude sequence. During this time, however, the pointing residual never exceeded 0.2 . SUMMARY The NEAR G&C system was designed with redundancy and flexibility in mind, but also incorporates a minimum of hardware, consistent with this philosophy. Built-in autonomy or fail-safe logic will prevent loss of the mission by either switching to backup units or switching strategies to survive in lower-capability modes and states until problems are corrected by ground control. The system supports all science and mission objectives for pointing within 50 mrad with low jitter in a variety of science scenarios as well as TCMs using a combination of thrusters. REFERENCES 1 Wertz, J. R., Spacecraft Attitude Determination and Control, D. Reidel Publishing Company, Boston (1985). 2 Wie, B., Weiss, H., and Arapostathis, A., "Quaternion Feedback Regulator for Spacecraft Eigenaxis Rotations," J. Guid. Control Dyn. 12(3), 375-380 (1989). 3 Haley, D. R., Strikwerda, T. E., Ray, J. C., Fisher, H. L., Heyler, G. A., and Pham, R. T. N., "Performance of the MSX Guidance and Control System," Adv. Astronaut. Sci. 94, 311-330 (1997). 4 Junkins, J. L., and Strikwerda, T. E., "Autonomous Star Sensing and Attitude Estimation," Adv. Astronaut. Sci. 39, 155-184 (1979). 5 Strikwerda, T. E., and Fisher, H. L., "Analysis of the NEAR Star Tracker Flight Data," Proc. SPIE 2810, 265-273 (1996). 6 Strikwerda, T. E., Ray, J. C., Haley, D. R., Heyler, G. A., Fisher, H. L., and Pham, R. T. N., "NEAR Guidance and Control System," Adv. Astronaut. Sci. 94, 397-416 (1997). ACKNOWLEDGMENT: The authors wish to thank all the dedicated and creative members of the NEAR guidance and control team. The NEAR mission is sponsored by NASA. This work was supported under contract N00039-95-C-0002 with the U.S. Navy.