The Design and Performance of the Gondola Pointing System for the Sunrise II Balloon-Borne Stratospheric Solar Observatory

With its 1 meter aperture, the Sunrise Balloon-Borne Stratospheric Solar Observatory was the largest space-based solar telescope. It was designed to study the magneto-convective processes of the sun at resolutions higher than 100 km and the payload took data during a flight from June 12 to June 17, 2013. To achieve its science requirements, the telescope had to point to an accuracy of 26” for extended periods of time. Pointing of the instrument was effected by the Sunrise Pointing System (PS). The PS used measurements provided by a Lockheed Intermediate Sun Sensor (LISS) and passed the data through a cascade of up to four digital filters to calculate the best voltages to drive the azimuthal and elevation motors. All filter settings could be modified in flight to adapt to changing conditions. Using this design, the PS met its requirements, pointing the instrument with an accuracy better than 26” for 60% of the flight and for continuous time periods of up to 99 minutes. In this paper we detail the design and performance of the PS during the 2013 flight.


Introduction
The second science flight of the Sunrise balloon-borne stratospheric solar observatory took place in June of 2013. The stratospheric balloon flight began from ESRANGE (near Kiruna, Sweden) and the payload floated to northern Canada's Boothia Peninsula. By operating at 36 km above most of the Earth's atmosphere, the Sunrise telescope was able to collect data in far ultra violet wavelengths (as low as 214 nm) and observe the sun without the detriment of atmospheric seeing.
The Sunrise balloon-borne stratospheric solar observatory has been fully described by Barthol et al. (2011). The Sunrise Pointing System (PS) was developed by the High Altitude Observatory (HAO) and served multiple purposes, including off-pointing, flat fielding and engineering data collection. Its most critical function was to "coarsely" point the gondola and telescope to a target on the sun with an accuracy better than 26". Once this pointing accuracy was achieved, the Image Stabilization and Light Distribution (ISLiD) system and the Correlating Wave-Front Sensor (CWS) could deliver a stabilized image to the science instruments with a precision of 0.04" (RMS). The science instruments were the Sunrise Filter Imager (SuFI) and the Imaging Magnetograph eXperiment (IMaX). Descriptions of ISLiD and SuFI are given in Gandorfer et al. (2011). CWS is described by Berkefeld et al. (2011). Information for IMaX is given by Martínez Pillet et al. (2011).
Pointing a 1920 kg balloon-borne telescope accurately and continuously towards the sun was a nontrivial matter as there was no fixed structure that could be used to determine the attitude or to react against to orient the telescope. The PS consisted of sensors, actuators and control algorithms that autonomously oriented the telescope. The Sunrise double azimuth control was based in part on the BLAST experiment described by Pascale et al. (2008). The PS was built upon the heritage from the 2007 Sunrise test flight and 2009 Sunrise Science flight but included improvements that are described within. In this paper we first describe the design of the PS and then use flight data to assess its performance.

Design
In this section we review the design of the PS. We first review the actuators and the sun sensors of the instrument, and then provide an overview of the PS program. We then focus on the two most important threads within the PS program and provide details of the pointing algorithms.
A basic block diagram is given in Figure 1. The PS actuators were: coarse azimuth motor, fine azimuth motor (reaction wheel) and elevation motor. The PS sun sensors were: corner cells (azimuthal detectors), 'Precision Azimuth Sun Sensor' (PASS), 'Full Range Elevation Detector' (FRED) and Lockheed Intermediate Sun Sensor (LISS yaw and LISS pitch).

Pointing System Actuators
A schematic of the Sunrise gondola is shown in Figure 2. A labeled photo of the Sunrise gondola is shown in Figure 3. The gondola/telescope could point in both azimuth and elevation. The azimuth drive consisted of a coarse azimuth motor that torqued against the flight train and the balloon, as well as a reaction wheel driven by a separate motor that exchanged angular momentum with the gondola and provided finer tuning of the azimuth motion. Note that the reaction wheel on its own could not provide the azimuth scanning on long time scales as external torques would eventually saturate the speed of the reaction wheel. The specifications of the motors and the reaction wheel can be found in Table 1. For pointing in elevation, the Sunrise design used an inclined linear stage and a single motor to raise and lower the telescope. The specifications of the motor and the stage are also found in Table 1.

Fig. 2
Schematic of the Sunrise II gondola.

Sun sensors
Multiple sun sensors of various accuracy and viewing angles were placed on the instrument. To be able to first find the sun, the PS used less accurate sun sensors but with wide angle acquisition ranges: the corner cells, PASS and FRED. Once the instrument was roughly pointing at the sun, the more accurate LISS sensor data were used. The specifications for the sun sensors are given in Table 2. Descriptions of their design and uses are given below. The corner cells were only used during initial sun acquisition pointing. The corner cells were large area silicon photo diodes. Each photo diode was calibrated to produce identical output for a given photon input. Thus if the front two corner cells had identical output, the gondola was pointing towards the sun. Due to their low accuracy, they only roughly determined the sun's position in azimuth. When the corner cell data were used for tracking, the PS was in low resolution pointing mode.
When the gondola was azimuthally pointed to within a few degrees of the sun, the sun was within the PASS sensor and FRED sensor capture ranges. When the PASS or FRED data were used for tracking, the PS was in intermediate resolution pointing mode.
The PASS was a shadow type sun sensor. The PASS design had two large area silicon photo diodes placed side by side in the azimuth direction and between the diodes was a very thin shadow casting strip. When the sun was directly in front of the PASS, no shadow was cast and the diodes produced identical output. The two diodes were wired together to produce a pointing error signal that was the difference of the output between the two diodes. A zero error signal indicated good pointing. Unfortunately, the error signal was also zero when the when the sun was located beyond the bounds of the PASS capture range. To insure the PASS pointing error data were only used when the sun was within the PASS capture range, the PASS design also included a separate photo diode to measure incoming solar intensity. A large intensity signal coming from this photo diode was used to confirm the validity of the PASS pointing error data. We called this intensity signal the PASS Sun Present signal.
The FRED sensor consisted of two large area silicon photo diodes arranged on an A-frame structure rotated by 90 degrees such that the apex pointed in the elevation direction. The diodes on each side of the A-frame were wired together to produce a pointing error signal that was the difference of the output between the two diodes. A positive or negative signal indicated the sun was above or below the telescope and a zero signal indicated good pointing. Similar to the PASS, the FRED error signal was also unfortunately zero when the sun was beyond the bounds of its capture range. Thus the FRED also required an indicator to confirm that the sun was within its field of view. Since the FRED and PASS capture ranges were designed to overlap, the validity of the FRED pointing error data was confirmed with the PASS Sun Present signal.
When the telescope was pointed to within 15 arcminutes of the sun, the sun was within the capture range of the LISS sensor. The LISS sensor consisted of 5 photodiodes beneath a square aperture window. The central diode provided a Sun Present signal, the difference in output between the right/left diodes provided an azimuthal (yaw) pointing error signal, and the difference in output between the top bottom diodes an elevation (pitch) pointing error signal. A large LISS Sun Present signal indicated valid data. When the LISS data were used for tracking, the PS was in precise resolution pointing mode. Precise resolution pointing mode achieved the desired pointing accuracy of ±26".
The Sunrise telescope was able to off-point from sun center by moving the LISS sensor relative to the telescope frame. The LISS was mounted on a two axis motorized tip/tilt stage, which had precise sub-arc second resolution encoders with a range of 4 degrees. This allowed the telescope to observe features located anywhere on the sun and even beyond the solar limb. It also provided in flight co-alignment between the LISS and the telescope. In flight co-alignment capability was desired as launch forces could perturb alignment. Co-alignment was accomplished by moving the LISS stage as CWS looked for the solar limb. Once the location of the north, south, east and west limbs were found, orientation and spatial scale were computed, stored in memory and saved to the PS disk.
The sun sensors produced analog voltages, which were converted to digital units with a Diamond Systems Analog to Digital (A/D) Converter / Counter Timer board. The digital data from the Diamond board were sampled at 150 Hz by the PS program's Pointing thread, described in more detail in section 2.5.

Pointing System program overview
The PS computer, a Diamond systems PLT-N270XT-2G, ran the highly optimized PS program, which was written in C++. In addition to pointing, the PS program had to simultaneously perform other administrative tasks, and hence was multi-threaded. Threads consisted of:  Artificial Intelligence (AI) thread: The role of this thread was to autonomously orchestrate PS pointing. The thread made pointing mode decisions and smoothed the transition from one pointing mode to the next pointing mode. In order to compile long term statistical information from the sun sensors and motors, this thread ran relatively slowly, once every 9 seconds.
 Pointing thread: This thread performed the crucial role of pointing the gondola and telescope. To insure the PS achieved the desired pointing accuracy of better than ±26", this thread ran quickly at 150 Hz.
 Incoming command thread: This thread processed incoming commands from the Instrument Control Computer (ICU). This thread only ran when a new ICU command was received.
 CWS thread: This thread processed incoming commands from the CWS. This thread only ran when a new CWS command was received.
 CWS PS pointing lock thread: This role of this thread was to immediately signal the CWS whenever the PS pointing was within the capture range of the CWS components, ±6".
 Write data thread: This thread wrote all PS data to the ICU. To insure no data was lost, this thread ran at a slightly faster rate than memory buffers were filled (every 5 seconds).
 House Keeping thread: The role of this thread was to regularly transfer a small snippet of the most recent PS data to ground personnel. With this data ground personnel were able to roughly assess PS performance and health. To keep ground personnel frequently updated, this thread ran at 1 Hz.
 Thumbnail thread: The role of this thread was to provide detailed sun sensor and motor data in a 'thumbnail' packet to ground personnel. With the thumbnail data, ground personnel were able to determine how well pointing algorithms were behaving and adjust parameters as needed. Thumbnail data proved pivotal in fine tuning parameters and improving pointing accuracy. As bandwidth was limited, thumbnails were only sent to ground when pointing improvements were required.
The workhorses of the PS program were the AI thread and the Pointing thread. They are described in detail in sections 2.4 and 2.5 below.

AI thread
The AI thread had two main goals: to decide which pointing mode to place the telescope in and to find the pointing alignment offsets between the various sensors. This thread allowed the PS to autonomously point to the sun from any initial gondola/telescope position.
In order to transition from a disoriented pointing to a highly accurate pointing, the PS had three pointing modes called low, intermediate and precise. Azimuth and elevation axes were treated independently. Each mode used different sensors and algorithms to orient the telescope. The instrument initially started in low resolution pointing mode and the PS slowly rotated the gondola towards the sun. Once the AI thread had determined that the gondola was stably pointing to the sun within a few degrees in azimuth, intermediate azimuthal pointing mode would begin. Simultaneously, sunlight became available on the elevation sensors, and the AI thread then activated the intermediate elevation pointing mode. When the AI thread determined that azimuthal or elevation pointing was stable to within a few arcminutes, it activated the precise (arc second) pointing mode for that axis. Additionally, steps could be skipped so that the precise pointing mode could start immediately as long as relevant criteria were met.
The AI thread used running means and running standard deviations of the sun sensors, motor voltages and motor velocities to determine if a pointing mode was stable. These statistics were also used to determine if a higher resolution pointing mode could be enabled. Each pointing mode had an associated set of variables to enable/disable certain sensors and certain pointing algorithms. For example, for the low azimuthal pointing mode, only the data from corner cell sun sensors were enabled, and only the pointing algorithm for the coarse azimuth motor (see details in the following section) was enabled.
Another major role of the AI thread was to calibrate the alignment angles between each sensor. In order to compute the misalignment angles, the AI thread would progressively add a small numerical offset to a sensor reading until the statistics of the next most accurate sensor improved. If the statistics of the next sensor did not improve, the AI thread would try adding an offset in the opposite direction. Once a good offset was found, it was applied to the coarser sensor, retained in memory and saved to a file on the PS disk. In this manner the PS calculated the alignments between the corner cells and the PASS, the corner cells and the LISS yaw, and the FRED and the LISS pitch. Thus if any misalignment between sun sensors existed or changed at launch or occurred during the flight, it was automatically handled by the AI thread. The offsets could be set via commands from ground. And similarly, threshold settings for statistics and pointing offsets could be modified in flight via commands sent from ground. Auto-pointing could be commanded to be enabled or disabled and commanded to go into manual mode.

Pointing thread
The primary role of this thread was to point the gondola and telescope by continually adjusting motor voltages to minimize pointing errors seen by the sun sensors. Additional roles were to sample environmental data and store all data in memory buffers.
The Pointing thread was called each time an I/O interrupt was generated by the Diamond Systems Analog to Digital (A/D) Converter / Counter Timer board, model DSC_DMM32DXAT. The thread first captured the current sample of all of the data provided by the A/D board: sun sensor data, amplifier and motor temperatures, PS computer environmental data, and three axis accelerometer data from two separate areas on the gondola and one on the telescope. The thread next queried the coarse azimuth, fine azimuth and elevation encoders for current positions. The thread then distributed the sun sensor data, reaction wheel velocity and elevation motor velocity through the pointing algorithms. The output of the algorithms produced voltages that the thread sent to the appropriate azimuthal or elevation motor to improve pointing. The pointing algorithms are described in the next section.
The rate at which the Pointing thread was called had to be set to be fast enough to achieve the desired pointing consistency and accuracy. The lowest rate needed to achieve the desired pointing accuracy was calculated to be ~100Hz. Faster rates yielded improved performance. Code optimization allowed the PS Pointing thread to run quickly, so the Diamond Counter/Timer board was set to run at 150Hz.
The Pointing thread was highly optimized for speed and efficiency. It was coded to insure that it consumed identical clock times and identical CPU cycles every time it was trigged for execution. No 'if' or 'case' statements were used. Instead, all calculations for all light sensors and all pointing algorithms were computed in each sample. The outputs of the algorithms were multiplied by the disable/enable values set by the AI thread, and then were added all together and sent to the appropriate motors. Since the Pointing thread just did sampling and numerical calculations, and never had to choose what light sensor to use or what algorithm to use, the thread always ran in the same amount of time. The CPU cycles used by the Pointing thread easily fitted within 150Hz.

Pointing algorithms
The pointing algorithms were 'servo suites' that took as input sensor and motor data to compute the necessary voltages for the azimuth and elevation motors in order to orient the telescope to the desired attitude. They were composed of up to four sequential user selectable digital filters (low pass, high pass, lead, lag, integrator, notch, peak or one-to-one). The output from the filters was multiplied by a servo suite gain.
Each pointing mode had its own set of servo suites.  Figure 4.
The details for each servo suite follow:  AzcTrack implemented low resolution azimuth pointing mode using corner cell data for input. The output from AzcTrack suite was a voltage to the Azc (coarse azimuth) motor, which rotated the entire gondola.  AzfTrack implemented intermediate azimuthal pointing mode when using the PASS signal as input, or precise azimuth pointing mode when using the LISS yaw as input.
The output from the AzfTrack suite was a voltage to the Azf motor, which accelerated or decelerated the reaction wheel. The acceleration/deceleration of the reaction wheel rotated the gondola by small, precise amounts. A desired Azf velocity of 10 RPM ensured that the Azf motor was nearly always in motion.  AzfToAzc spun off excessive Azf (reaction wheel) velocity to Azc. The input was the difference between the desired Azf velocity and the actual Azf velocity.
The output from the AzfToAzc suite was a voltage to the Azc motor, which very slightly rotated the entire gondola. This very slight rotation allowed the reaction wheel to slow.
 El_Track implemented intermediate elevation pointing mode when using the FRED signal as input, or precise elevation pointing mode when using the LISS pitch signal as input.
The results from the El_Track suite were passed to the El_Local servo suite.  El_Local acted to reduce the effects of bearing friction and changed the output of El_Track from a motor current (the effects of which will change with temperature) to a calibrated velocity. The results from the El_Local suite were passed to the El_Frict function.

 El_Frict
Friction was reduced further with the Friction Compensation function. This was not a digital filter but rather a function that compensated for stiction in the motor/drive as well as gravitational effects. It is detailed below. The output from this function was the voltage applied to the El_ (elevation) motor, which then drove the telescope lever arm along the inclined elevation stage. Movement of the lever arm raised or lowered the telescope.
With the exception of the El_Frict function, the filters used in the above servo suites were all cascaded digital filters. The digital filters used by the PS followed the form: (1) The type of filter, low pass, lead, notch, etc., determined the ak and bk coefficients. The PS used both 1 st order (M=1 and N=1), and 2 nd order (M=2 and N=2) filters.
Filters for each suite were chosen based on models of gondola structure, its resonances, its pendulum modes and also on each motor's characteristics. Settings were refined with data acquired during hang tests where white noise was added to a servo input and the servo output was split out to a HP 35660A Digital Signal Analyzer.
Selection of the optimal suite gains and filter frequencies ensured that a servo remained stable, resonances of the mechanical structure of the gondola were not excited, and pendulum motions were not reinforced. Vibrations of the telescope were particularly undesirable as they negatively affected the CWS performance. High frequency vibrations prevented the CWS from achieving a closed loop control lock of the image stabilization system. And low frequency vibrations could create residual image smear.
Settings for all of the servos and functions could be modified in-flight via commands sent through the ICU. Modification of the settings allowed the PS to improve pointing performance and adapt to nuances of evolving flight conditions. Thumbnails containing 6 seconds of 150Hz sun sensor data, motor voltages and velocities provided detailed servo performance information. Analysis on the ground by servo engineers determined where improvements were needed in the servo settings. Improved settings could quickly be sent up to the PS and activated. The settings in Table 3 produced a continuous 99 minute period during which pointing was within ±26" of the target. The low pass filters removed high frequency noise. The lead filters effected a phase lead which enhanced responsiveness. The high quality notch filters were tuned to suppress gondola pendulum frequencies and elevation motor response frequencies. The integrators provided high pointing accuracy.
Suite gains also had to be chosen with care. The deleterious effect of too large a suite gain is shown in data from the commissioning phase of the mission. During the commissioning phase, servo settings similar to those of the 2009 flight were initially tried and subsequently adjusted. A trial setting applied on 2013 June 12 at 10:08:24 used fairly high servo suite gain for AzfTrack (-400.). As seen in Figure 5, this resulted in a very high noise level, particularly at a gondola structural resonance at 10Hz. A downloaded thumbnail revealed the problem to the PS engineers, who determined a smaller AzfTrack servo suite gain was required. At 10:08:38 an AzfTrack servo suite gain of -150.0 was uploaded to the PS, and as seen in Figure 6, the smaller gain resulted in greatly improved pointing and much less noise at 10Hz. The dashed blue lines in the LISS plot are visual aides showing the boundries of the ±26" pointing limit. The El_Frict friction compensation function was an improvement added for the 2013 flight. It compensated for stiction in the motor/drive and varying gravitational effects along the inclined elevation stage. For most motors, a non-linear friction region exists where it is more difficult to initiate the rotation of the axle. In this area, more force, hence higher voltage must be used. If one does not compensate for this behavior, any small voltage sent within the friction region will not move the motor the desired amount, and the next servo loop will see the increased pointing error and send ever larger voltages to the motor. This typically causes oscillating overshoot/undershoot ('limit cycle') and very poor pointing performance.
To compensate, a friction compensation function can be implemented. Friction compensation functions assume many shapes depending on what details are included in the friction model. For Sunrise, a simple Coulomb friction model was used and was designed to match the specifics of the Sunrise elevation motor and elevation stage geometry. The Sunrise friction compensation function simply boosted the voltage within a small region around the origin with a multiplicative factor, El_FrictSlope. Outside of the region offsets were added. The equations follow: Figure 7 shows the output voltage as a function of the input voltage for the cases in Eq. (2).
To accommodate evolving conditions, telescope loading, temperature changes or other issues affecting the friction characteristics of the motor, El_FrictSlope, Threshminus and Threshplus could be individually modified. During the flight only symmetric adjustments of Threshminus and Threshplus were needed to maintain good motor performance and good pointing. These adjustments were likely necessary due to the non-linearity of the elevation stage design as well as diurnal temperature variations.
As Figures 8 and 9 indicate, the use of the El_Frict friction compensation function was critical to maintaining good pointing. In Figure 8, where no friction compensation was in use, pointing was erratic, elevation motor voltage was quite high, and elevation motor velocities varied widely and rapidly. In Figure 9 where friction compensation was implemented, pointing was greatly improved, motor voltages were smaller and velocities excursions were greatly diminished. When the friction compensation function was not used, the extra push caused by the servo overshoot could induce pendulum motions. As seen in Figure 8, the large excursions with a ~8 second periodicity appear to be due to an overshoot/undershoot induced pendulum motion of the telescope. The smaller excursions with a ~2 second periodicity exist in both Figures. These were likely caused by the short period oscillation of the gondola on its suspension system (flight train).

Results
During the 2013 flight of ~120 hours, the gondola/telescope was pointing within ±26" for more than 50% of the flight. If one adds all time periods during which the gondola/telescope was pointing within ±26" for at least 1 minute continuously, the total sum is over 72 hours, or 60% of the flight.
Long periods of continuous good pointing were needed for scientific goals, e.g., long exposures, calibrations and movies. Thus continuous, long duration pointing periods of accuracy better than ±26" were highly desired. Table 4 shows the total sum of time over the entire flight that the gondola/telescope was pointed continuously within ±26" of the target for time periods of 30 seconds, 1 minute, 2 minutes, 5 minutes and 10 minutes.
Shown in the fourth column of Table 4 are the statistics from the 2009 flight of Sunrise (Sunrise I). Comparison shows Sunrise II pointing statistics were a factor of two better than Sunrise I. During Sunrise I, thumbnails were not available, so servo engineers on the ground had very limited information to fine tune the servos. Having the benefit of thumbnails and the ability to upload informed servo settings were pivotal in the improved performance of the 2013 flight. Figure 10 shows the histogram of the durations of all good pointing periods in the 2013 flight. There were several time periods greater than an hour where the gondola/telescope was continually pointing within ±26" of the target. Notably, a 99 minute period of continuous good pointing was achieved.
Scientific objectives required re-pointing of the gondola/telescope for geometric scaling, flat fielding and targeting of interesting solar features. To save time, re-pointing was done quickly and these sudden offsets disrupted the continuity of the good pointing. Without these perturbations, the PS could have attained longer periods of continuous good pointing. To test this hypothesis, the statistics for long periods of good pointing were rerun by setting all LISS errors to zero for 30 seconds after any re-pointing command was received. The recomputed histogram is shown in Figure 11. As can be seen from Figure 11, adjusting for commanded re-pointing has combined several of the shorter periods together. Remarkably, two periods of good pointing exceeded 135 minutes. In comparison with the 2009 flight, as reported by Barthol et al. (2011), the longest period with telescope pointing within ±46" of the target was 45 minutes.
Termination of many good pointing periods resulted from elevation pointing failure, an example of which is shown in Figure 12. Since these failures were sporadic events, thumbnails were not available for engineers to diagnose the problem. Post flight analysis revealed the failure was due to the very high 100Hz frequency setting used for the integrator filter in the El_Local servo suite. Reducing the frequency by a few percent would likely eliminate the failure and still maintain pointing performance.   Occasionally, azimuthal pointing failure occurred as well. The AzfTrack servo did not include a friction compensation function. Thus, under circumstances where the velocity of the reaction wheel approached zero, overshoot/undershoot of the Azf motor voltage occurred. An example is given in Figure 13. Around 14:35:32, a typical atmospheric disturbance perturbed the pointing and the servo required the reaction wheel to slow. Around 14:35:46 the velocity called for by the servo was positive, but very close to zero. However, friction caused the reaction wheel to stall and the pointing to further degrade. Larger LISS yaw error signals caused the servos to demand more voltage, beginning the overshoot/undershoot pattern.
The Figure also shows that the Azc motor also suffered overshoot/undershoot stiction effects. The Azc velocity excursions that occurred at 14:35:52 and 14:36:08 were quite large, but produced by relatively small voltage changes.
This type of pointing problem did not occur frequently since the Azf motor was nearly always moving. But the easy addition of friction compensation functions to the output of the AzfTrack and AzfToAzc servos could completely eliminate this failure mode.

Conclusions
The Sunrise II Pointing System was able to maintain stable pointing within the required ±26" of the target for a substantial portion of the 2013 flight. With this success, ISLiD and CWS were able to perform well, and the science instruments, IMaX and SUFI were able to obtain high quality data. Using Sunrise II observations, Riethmüller et al. (2013) and Danilovic et al. (2014) have presented the first high resolution images of quiet and active regions of the sun in the Mg II k 2796 Å line. An upcoming special issue of The Astrophysical Journal (Supplement Series) will be devoted to Sunrise II and describe the many exciting results stemming from its observations.
Were a third flight of Sunrise to occur, easily made improvements to the PS, e.g., El_Local filter adjustments and friction compensation functions for the fine (AzfTrack) and coarse azimuth (AzfToAzc) servos, would provide even better pointing and longer duration times of continuous good pointing.