key: cord-0308970-lcpsqaxj authors: Kushwah, Rakhee; Stana, Theodor A.; Pearce, Mark title: The design and performance of CUBES -- a CubeSat X-ray detector date: 2021-07-20 journal: nan DOI: 10.1088/1748-0221/16/08/p08038 sha: dfa1c189e25a5f42a4500714198c7615c71c427c doc_id: 308970 cord_uid: lcpsqaxj CUBES is a X-ray detector payload which will be installed on the KTH 3U CubeSat mission, MIST. The detector comprises cerium-doped Gd3Al2Ga3O12 (GAGG) scintillators read out with silicon photomultipliers through a Citiroc Application-Specific Integrated Circuit. The detector operates in the energy range $sim$35-800 keV. The aim of the CUBES mission is to provide experience in the operation of these relatively new technologies in a high-inclination low earth orbit, thereby providing confidence for component selection in more complex satellite missions. The design of the CUBES detector is described, and results from performance characterisation tests carried out on a prototype of CUBES, called Proto-CUBES, are reported. Proto-CUBES was flown on a stratospheric balloon platform from Timmins, Canada, in August 2019. During the $sim$12 hour long flight, the performance of Proto-CUBES was studied in the near-space environment. As well as measuring the X-ray counts spectra at different atmospheric depths, a 511 keV line from positron annihilation was observed. CubeSat missions have become a popular way to enhance science, technology, engineering and mathematics (STEM) subjects at universities. Students gain first hand experience in the design, implementation and testing of electronic and mechanical space systems in a multidisciplinary and collaborative environment [1] . The KTH Space Center [2] engages students in the construction of a 3U CubeSat mission, called MIST (MIniature Student saTellite) [3], shown in Figure 1 . The payloads are provided by research groups at KTH and Swedish industry [3], while satellite mechanics and ancillary sub-systems (e.g. power, on-board computer, radio communications) are procured from the company Innovative Systems in Space (ISISpace). MIST is planned to be launched in 2022 into a sun-synchronous (98 • inclination) orbit at an altitude of ∼640 km, with a local time of ascending node of 10:00. The CUBES (CUBesat x-ray Explorer using Scintillators) payload is designed to measure the energy of incident X-rays in the 35-800 keV band. This is achieved using two ∼0.2U assemblies, each comprising cerium-doped Gd 3 Al 2 Ga 3 O 12 (GAGG) scintillators read out with silicon photomultipliers through an Application-Specific Integrated Circuit (ASIC). The silicon photomultiplier (or multi-pixel photon counter, MPPC, as it is referred to in this paper) can replace traditional vacuum-tube photomultipliers (PMT) in scintillator detector systems. Although well-established in terrestrial applications [4] , there is little experience of using the devices in the space environment. The MPPC is a light-weight, compact, and robust solid-state single photon detector which is insensitive to magnetic fields. For a bias voltage of only ∼50 V, a The dimensions of each unit (U) are standardised to 10×10×10 cm 3 The two deployable photovoltaic cell arrays, and four deployable UHF antenna are not shown. The sides of the satellite are partially covered in order to manage the thermal environment of satellite components. CUBES is mounted behind an aperture in these insulation materials. gain similar to that obtained with a PMT operating at ∼1000 V can be achieved, for comparable quantum detection efficiency. A disadvantage is that the dark counting rate is relatively high and temperature-dependent. Moreover, it is found to increase with high-energy proton irradiation [5, 6] . The temperature-dependence of the gain necessitates active bias voltage control. GAGG scintillators are well suited for the detection of X-rays due to their high stopping power (density ∼6.6 g/cm 3 ) providing a mean free path of 0.34 mm and 0.98 mm for X-ray photons with energy 40 keV and 100 keV respectively [7] . They are mechanically robust and non-hygroscopic, thereby simplifying packaging requirements. Their light-yield is high, ∼55 photons/keV, and comparable to CsI(Tl). The scintillation emission is centred at ∼520 nm, which is reasonably well-matched to the MPPC peak spectral sensitivity at ∼450 nm. Studies [8] have demonstrated a low internal background, that the light-yield dependence on temperature is small and not significantly affected by exposure to radiation, and that activation effects are small. The scintillation decay time is fast, ∼90 ns, and is preserved by the intrinsic fast response of the MPPC. The resulting fast current pulse is processed by a low-power ASIC. One of goals of the CUBES mission is to assess the performance of these relatively new technologies in low-earth orbit in preparation for a possible future research mission, e.g. the gamma-ray burst polarimeter, SPHiNX [9] , which has completed a Phase A study in the Swedish InnoSat national satellite programme. Measurement data will also allow students to study the properties of the X-ray radiation present in low-earth orbit, as well as potentially allowing the observation of transient events connected to, e.g., solar flare events [10] and gamma-ray bursts [11] . Data from CUBES are expected to be useful when interpreting results obtained by another MIST payload, SEUD (Single-Effect Upset Detector) [12] , which aims to study mitigation methods for in-orbit single event upset rate in a field-programmable gate array (FPGA). Other space missions have adopted GAGG scintillator coupled to MPPC read out, e.g. the GARI-1 and -2 missions expected to be launched to the International Space Station in 2021 and 2022, respectively, under the U.S. Department of Defence Space Test Program. Another example is GRID [13] , a Chinese 6U CubeSat mission launched in October 2018. The proposed HERMES mission [14] uses a novel solution where GAGG scintillators are read out using a silicon drift detector. University-built CubeSat missions are known to have a relatively low success rate [15, 16] . Due to cost and time constraints, missions are usually constructed using commercial off-theshelf (COTS) components with little or no design redundancy. This is the case for CUBES. Comprehensive qualification testing is therefore an important aspect of ensuring mission success. As a part of the design qualification phase of CUBES, a prototype detector, Proto-CUBES, has been developed, primarily for functional and thermal testing. The qualification phase also includes an evaluation of measurements made during a stratospheric balloon flight, at altitudes of ∼20-30 km. Final qualification tests of the CUBES flight model will be conducted once the payload is integrated with the MIST satellite, and will include thermal-vacuum testing, shock/vibration tests, as well as functional performance tests. Total ionising dose studies of key components using a Co-60 source were planned, but the majority of tests have been indefinitely postponed due to the COVID-19 pandemic. The MPPC power supply module has been tested, however [17] . In this paper, we present the design details of CUBES and the results obtained from characterisation studies and balloon flight of the Proto-CUBES instrument. The paper is organised as follows. The CUBES payload is outlined in Section 2. In Section 3, on-ground performance, calibration and thermal studies of Proto-CUBES are presented. Results from the Proto-CUBES balloon flight campaign are described in Section 4. An outlook on future developments is provided in Section 5. In the final configuration of the MIST satellite, there will be two CUBES payloads (see Figure 19 ) in the bottom unit of the CubeSat, as shown in Figure 1 . Each CUBES payload consists of a printed circuit board (PCB) which contains all the instrument's elements. A block diagram of the CUBES PCB is shown in Figure 2 . The GAGG scintillators are procured from the C&A Corporation. Each of the three GAGG scintillators has a volume of 1×1×1 cm 3 and is wrapped with layers of PTFE tape to increase the scintillator light-yield. To prevent ambient light from reaching the scintillators, they are encased in a 3D-printed mould filled with opaque silicone rubber potting compound (RTV627). Each GAGG scintillator is optically glued to an MPPC of the type S13360-6050PE from Hamamatsu Photonics. A MPPC is an array of avalanche photodiodes (APDs) operated in Geiger mode, which generates a short current pulse when a photon deposits a sufficient energy in the scintillator material. Each APD is a sensitive photodiode which multiplies the photocurrent under the action of a reverse bias voltage. The bias voltage is provided by a programmable "high-voltage" power supply (HVPS) module, the C11204-02, also from Hamamatsu Photonics. This device can provide the very stable voltage needed by the APDs (on the order of tens of V) and it has built-in programmable temperature compensation, which is useful for compensating temperature-induced gain variations in the MPPCs. MPPC current pulses are processed by the Citiroc ASIC manufactured by Weeroc [18] . The Citiroc provides pre-amplification, shaping and track-and-hold functions in separate high-gain (HG) and low-gain (LG) chains, as well as fine adjustments to MPPC bias voltages via digitalto-analog (DACs) on each of its 32 channels. Resulting pulses are digitised on the CUBES PCB by means of a dual analog-to-digital converter (ADC) chip, the 12-bit AD7356 from Analog Devices [19] . The ASIC is controlled by logic embedded in a SmartFusion2 System-on-Chip (SoC) FPGA manufactured by Microsemi, part number M2S010-VFG256I [20]. The SoC also contains a Cortex-M3 microcontroller integrated on the same chip, which is used on CUBES to implement communication to the MIST on-board computer (OBC) and control the C11204-02 HVPS module. The amplitude of the current pulse output by the MPPC depends on the deposited X-ray photon energy. To characterise the radiation environment around the satellite, the data acquisition (DAQ) system implemented in the FPGA of the CUBES SoC collects pulse-height spectra from each of the scintillator detectors. The data are periodically stored in time-stamped histograms. MPPC pulses with an amplitude exceeding the ASIC trigger threshold, above which current pulses arriving from the MPPCs are converted to voltages and sent to the ASIC's output. The ADC converts these into a digital representation which is used by the CUBES DAQ system to decode the memory address to read and increment a counter value. Six histograms are stored by the CUBES DAQ system, each of the three MPPCs is allocated one histogram for the HG chain and one for the LG chain. Each of the six histograms contains 2048 bins (one bin contains two ADC values). Following each DAQ run, a DAQ data file is stored on CUBES which contains the six histograms and a 256-byte header. The header contains "housekeeping" data such as DAQ run time, instrument live time, temperature, MPPC bias voltage and current drawn by the MPPC -a key indicator of radiation damage to the MPPC, since the dark current has been shown to increase with prolonged radiation exposure [5] -and number of pulses from the MPPCs crossing the configurable threshold on the ASIC. Header included, CUBES stores 24832 bytes of data to its memory during one DAQ run. The Proto-CUBES PCB implementation of the system depicted in Figure 2 is shown in Figure 3 . During development of the experiment and characterisation studies, an Arduino Due is used as an OBC simulator, as depicted in Figure 4 . The simulator implements the MIST Space Protocol (MSP) as the data link layer protocol in the seven-layer OSI model [21] ; the physical layer protocol is the Inter-Integrated Circuit (I 2 C) bus. On CUBES, MSP commands are used to configure the ASIC and the DAQ system, and retrieve scientific and housekeeping data. To retrieve the data from CUBES for analysis, a modified version of the CitirocUI software is used. The CitirocUI software is provided by the ASIC vendor for use with their ASIC evaluation boards. For this project, the CitirocUI software has been modified by us to send commands over a serial port to the Arduino. The Arduino translates most of these commands into MSP commands to configure the ASIC and the CUBES DAQ system. During in-orbit operations of CUBES, this modified CitirocUI will be used to test ASIC configurations before uploading them to CUBES. After ASIC and DAQ configurations are applied, most of the in-orbit operations of CUBES are foreseen to be autonomous, with data files downloaded from the payload periodically. For Proto-CUBES, each GAGG scintillator has a volume of 5×5×5 mm 3 and is wrapped in several layers of 0.075 mm thick PTFE tape to improve the collection efficiency for scintillation photons. Each GAGG scintillator is coupled to a MPPC using optically transparent Epotek 301 glue. The ensemble of GAGG scintillators and MPPCs is covered with an opaque mouldable black silicone rubber material (generically referred to as "Sugru") to ensure no stray light enters the detector ensemble. The CUBES trigger rate will strongly depend on orbital position. High rates are expected in the polar regions and at the South Atlantic Anomaly (SAA). The live time is dictated by the time taken by each pulse to be processed by the Citiroc ASIC, which for CUBES is ∼43 s. During this time, the CUBES DAQ system is unable to process subsequent pulses. The live-time dependence on trigger rate has been studied using a fibre-coupled blue LED, driven by a pulse generator. The LED light is coupled to each of the MPPCs using an optical fibre splitter. Each fibre was terminated with a ST connector which mated with a receptacle mounted on the MPPC. The LED pulse parameters were chosen to produce a MPPC current pulse which simulated a 59.5 keV energy deposit (Am-241 emission) in a GAGG scintillator. For each LED pulsing frequency, the live time was obtained from the housekeeping data in the DAQ data file. Figure 5 shows that the experimental live time values agree well with the theoretical expectation, defined as where is the number of incoming pulses, = 43 s as stated above and is the total acquisition time. Using the energy spectra of trapped protons and electrons from SPENVIS and a simplified GEANT4 [22] model of CUBES, the maximum trigger rate in-orbit has been estimated. During passages through the South Atlantic Anomaly and in the polar region, the trigger rate is of the order https://www.spenvis.oma.be/ of a few MHz, and measurements will be dead-time limited. During approximately 65% of the orbit, the trigger rate is <10 kHz, however. The detector setup was characterised to obtain the energy-channel calibration using different radioactive sources. The spectra obtained by the HG and the LG amplifier chains of the Citiroc for one of MPPC channels is shown in Figure 6 and Figure 7 respectively. The HG chain allows to measure 59.5 keV photons from Am-241, 81 keV photons from Ba-133 and 122 keV photons from Eu-152. The spectra from 356 keV photons from Ba-133, 511 keV from Na-22 and 662 keV photons from Cs-137 were acquired using the LG chain. The photopeak position shows a linear dependence on energy, as shown in Figure 8 . The ASIC does not display significant non-linearity, as reported previously [23] . All three GAGG scintillators showed a similar light output and energy-channel relation. Using the same spectra, the energy resolution is also computed and shown in Figure 9 . The points are fitted with a function of the form, ( ) = ( + / √ ), as expected from the Poisson counting statistics. With the lower trigger threshold set above the noise floor, the energy range achieved for each MPPC channel (referred to as MPPC1, MPPC2 and MPPC3 in the text) is shown in Table 1 . An upper threshold is also applied to avoid pulses which saturate the ADC connected to output of the Citiroc. There is a discontinuity in the energy ranges obtained from HG and LG chains. Moreover, differences in MPPC gain leads to different maximum energy values. For the flight detector, it is foreseen that these effects can be mitigated by adjusting the gain of HG and LG chains and/or the MPPC gain. The temperature of CUBES is primarily dictated by sun illumination, and therefore depends on orbital position. The MIST satellite is attitude controlled, and will be oriented such that CUBES payload will not be directly illuminated by the sun. The thermal design of MIST aims to provide an operating temperature range for CUBES of -20 -30 • C. This temperature range is driven by the MPPC specifications, as well as the expected bias voltage tuning range achievable using the Citiroc's input DACs (see Section 2). Since the MPPC gain and the GAGG scintillator light-yield are temperature dependent [8, 24] , temperature characterisation tests of the detector system have been performed. As described in Section 2, the HVPS module, C11204-02, has a built-in temperature compensation circuit. The MPPC bias voltage is varied according to a device-specific temperature coefficient, thereby keeping its gain constant. The temperature coefficient of the MPPCs used here is 54 mV/ • C [25] . To test this, the detector was placed inside a temperature controlled chamber, and the GAGG scintillators were irradiated with 511 keV photons from a Na-22 source. Spectra were acquired across the temperature range -10 • C to +15 • C, with each DAQ run lasting for 4 minutes. The variation in the position of the photopeak with temperature is shown in Figure 10 . With the recommended temperature compensation of 54 mV/ • C, the photopeak position exhibited a small temperature dependence. Other studies have observed similar behaviour [24] . The test was repeated using a range of temperature coefficients, and the results are shown in Figure 10 . The temperature dependence of the peak position is characterised with a linear function. The dependence of the function slope (ADC channel/ • C) on the device temperature coefficient factor (mV/ • C) is shown in Figure 11 . The temperature dependence of the 511 keV photopeak position can be removed using a temperature coefficient of ∼50.9 mV/ • C. Table 2 . The error bars are smaller than the data point markers. The recommended temperature coefficient for the MPPC, 54 mV/ • C, does not fully remove the temperature dependence. Stratospheric balloon flights, operating at altitudes between 30-40 km, provide a means to acquire operational experience of instruments in the near-space environment. Payloads may be subject to a similar range of temperatures to that found in orbit, and the mbar-level vacuum means that the primary heat transfer mechanisms are radiation and conduction. The balloon floats over the majority of the earth's atmosphere. Fluxes of cosmic particles are only partially attenuated providing a more realistic multi-component radiation environment than on-ground. Instruments are, furthermore, operated remotely over radio links, as is the case in orbit. The flight duration can be between several hours to several weeks depending on the balloon type, launch season, launch site and flight trajectory. Payloads, in the absence of an unforeseen landing in, e.g., water, are usually recoverable soon after the flight is terminated allowing inspection of hardware, and design changes prior to possible retesting. The design of Proto-CUBES is relatively simple. The scintillator field-of-view is large, with no collimation, and there is no anticoincidence shield. The instrument therefore responds to energy deposits from the range of cosmic radiation present in the atmosphere. The nature of the radiation experienced by balloon-borne instruments depends on altitude. Galactic ('primary') cosmic-rays (∼90% p, ∼10% He, <1% other nuclei and electrons) interact with atoms at the top of the atmosphere (∼40 km), creating showers of secondary particles which follow the direction of the momentum vector of the primary particle. While traversing the atmosphere, the charged and neutral secondary particles decay and lose energy, resulting in an altitude-dependent intensity of particles, with the maximum intensity known as the Pfotzer-Regener maximum [26] . Part of the flux of secondary particles comprises X-rays photons which are generated through electromagnetic and nuclear processes in the atmosphere. Sources include 0 decay, e ± bremsstrahlung, e + e − annihilation, and the de-excitation of nuclei arising from spallation/neutron-capture. Photon energies are degraded through multiple Compton scattering interactions, and the lowest energy photons are depleted through photoelectric absorption on atoms in the atmosphere. The intensity of the upward-/downward-going components of the X-ray flux varies with altitude. The albedo flux is dominant. In the Proto-CUBES energy range, the differential flux (cm −2 s −1 keV −1 sr −1 ) depends on energy, E, as ∼E −2 [27, 28] . A flux of primary X-ray radiation (the cosmic X-ray background, CXB) impinges the top of the atmosphere. The nature of the flux is well-measured [29] . Above 20 keV, the energy dependence of the differential flux is ∼E −3 until ∼1 MeV. The spectrum at balloon altitudes is subject to atmospheric attenuation [30] . Even at the highest altitudes, the CXB contribution is small compared to atmospheric X-rays. The balloon flight took place in Ontario, Canada, corresponding to a geomagnetic latitude ( ) of ∼57.65 • , and a vertical cut-off rigidity of ∼1 GV [31] . Bremsstrahlung from precipitating electrons can increase the X-ray flux in the atmosphere during periods of elevated geomagnetic activity, especially in high-latitude locations. This contribution primarily generates ionisation effects at altitudes of ∼60 km [32] . This source is not expected to affect our measurements, since no significant geomagnetic activity was reported during the flight [33] . The contribution from primary cosmic-ray electrons is suppressed due to the relatively high cut-off rigidity at the launch site. Secondary electrons are produced in the atmosphere. However, simulations studies conducted for different float altitudes (ℎ) and geomagnetic latitudes show that the electron flux is negligible compared to the photon flux (ℎ=30 km, =11.5-17.2 • ) [34] , (ℎ=38 km, =65.4 • ) [35] . Neutrons are copiously produced in the atmosphere as a result of weak interaction processes or nuclear processes such as cascades or evaporation. The resulting broad range of neutron energies, ∼0.1 MeV-10 GeV is further extended to thermal neutron energies as neutrons scatter off atmospheric nuclei [36] . There may also be a local component created as cosmic rays interact with the gondola and payload structures. Depending on the detector material used, neutrons can be a significant source of background for X-ray instruments operated in the atmosphere. A schematic diagram showing how Proto-CUBES is integrated into a self-contained system for the stratospheric balloon flight is shown in Figure 12 . Following the approach used for on-ground (Figure 3) is integrated into a self-contained system for the stratospheric balloon flight. The Proto-CUBES detector is controlled by an Arduino Due microcontroller, which is connected to the ground-station via a virtual RS232 link implemented over radio. An independent reset signal, "STOR", is also provided. The inflight power system comprises high-power lithium-thionyl chloride batteries. During testing on the ground, the instrument can also be powered from a bench-top power supply using the "power/battery arm" connector. For flight, the internal battery circuit is activated by inserting an arming connector. testing, the MIST OBC is simulated by an Arduino Due microcontroller. There is a command and data link to the Arduino via a virtual RS232 connection established over a radio link. Data is also stored on a SD memory card, which can be recovered post-flight. An independent connection ("STOR") is provided as a radio-controlled "open-collector" signal (active low), which allows a reset signal to be issued to the instrument during flight. The reset signal was used in cases where the instrument entered an unknown state, to revert the Arduino and CUBES microcontrollers, as well as the CUBES FPGA logic, to a known, "start-up" state. The instrument was powered by three 3.6 V SAFT LSH20 lithium-thionyl chloride batteries wired in series. Each battery has an in-built 5 A fuse. Two sets of serially connected batteries are diode-coupled in parallel to provide redundancy. The instrument consumes 150 mA, resulting in a power consumption of 1.65 W. One set of three batteries provides an operational time of at least 24 hours at -20 • C. Once armed the power cannot be remotely cycled, but a reset signal can be issued if a component becomes unresponsive. The instrument components were placed in an aluminium enclosure with 2.5 mm thick walls, as shown in Figure 13 . The side, top and bottom faces of the enclosure in the vicinity of the GAGG scintillators was reduced to a thickness of 1 mm. The transmission factor for a beam of X-rays with energy 20, 50, 200, 500 keV traversing 2.5 mm (1 mm) thick aluminium is 10% (40%), 78% (91%), 92% (97%), 95% (98%), respectively [37]. The enclosure was covered in 3 cm thick styrofoam sheets to provide thermal insulation. The resulting assembly was wrapped in 200 m thick aluminiumised mylar to reflect incident sunlight. The Proto-CUBES enclosure was installed on the French Space Agency (CNES) CAR-MENCITA gondola as part of the CABUX mission, which included a number of other payloads. Proto-CUBES was accommodated as part of the EU Research Infrastructure programme, HEMERA. The location of the Proto-CUBES enclosure on the gondola is shown in Figure 14 . The scintillator detectors have an unoccluded field-of-view over approximately the entire hemisphere directed away from the gondola perpendicular to zenith. X-rays entering the opposite hemisphere will be attenuated by gondola and payload materials. The internal battery system was activated ∼30 minutes prior to launch. Prior to this, a Am-241 source had been used to confirm that there was no significant change in the energy calibration for each MPPC channel between post-assembly testing in the laboratory in Stockholm and pre-flight tests at the launch site. The gondola was launched from Timmins Airport, Ontario, Canada Data acquisition proceeded reliably through-out the flight. Pulse height histograms were transmitted to ground for each MPPC channel once per minute. The live-time registered for each histogram file was >95% through-out the flight. The MPPC bias voltage was set to 54.5 V, and a temperature compensation of 50.9 mV/ • C was used. The time-dependence of key flight variables is shown in Figure 15 . The flight comprised a ∼1.9 hour long ascent phase, two ∼4 hour long periods at approximately constant "float" altitude, ∼30 km (10 g/cm 2 vertical atmospheric overburden), and ∼20 km (80 g/cm 2 ), a ∼1.9 hour long transition between these altitudes, and a ∼0.5 hour long descent phase (mostly by parachute). Data Figure 14 : Proto-CUBES installed on the CARMENCITA gondola prior to launch. The gondola structure stands ∼2.5 m tall, and weighs ∼420 kg. The hoisting straps connected to the top of the gondola illustrate how the gondola is connected to the balloon rigging. Four sacrificial cardboard crash pads are mounted under the gondola to lessen impact forces when the gondola lands by parachute after the flight. A number of payloads are distributed around the gondola (white boxes). Proto-CUBES is located at the top of the gondola (silver-coloured box). collected during the float phases is the focus of this section. Gondola housekeeping data such as position, altitude, and atmospheric pressure were recorded by CNES during the flight. Temperature data was provided by a sensor inside the MPPC power supply module. The measured temperature covered the majority of the range expected in-orbit (see Section 3.3). A temperature below 0 • C (-10 • C) was recorded for ∼70% (40 %) of the flight. The temporal development of the counting rate obtained from triggered events in all three MPPCs is shown in Figure 15 . During the ascent phase, the Pfotzer-Regener maximum is reached at an altitude of ∼20 km. The count rate measured during the ascent phase is less than that measured at a comparable altitude during the second float phase. This is because the altitude increases rapidly during ascent, resulting in a steady decrease in the instantaneous count rate after passing through the Pfotzer-Regener maximum, and consequently an underestimation of the counting rate during the 1 minute long data collection runs. At an altitude of ∼33 km, the balloon altitude, and count rate, stabilised. As expected, the counting rate correlates with atmospheric pressure after passing the Pfotzer-Regener maximum. The dependence of the counting rate on atmospheric pressure for MPPC2 channel is shown in Figure 16 , for low-energy (HG chain), high-energy (LG chain), and LG events which saturate the ADC connected to the output of the Citiroc. The saturated events are due to high energy photon interactions, as well as a significant contribution from minimum-ionising charged particles (MIPs), which deposit ∼5 MeV when traversing the full GAGG scintillator thickness of 5 mm. The count-rate is dominated by low energy events, as expected due to the inverse power law nature of the incident X-ray radiation, and the energy dependence of the detection efficiency (discussed below). At higher altitudes, the count-rate for both LG and HG events decreases. The low-energy count-rate continually decreases. The high-energy rate starts to flatten at an altitude around 30 km, which is thought to be due to the high-energy component of the CXB scattering into the Proto-CUBES energy range. At this altitude (overburden 10 g/cm 2 ), CXB photons with an energy exceeding 50 keV have a transmission probability of ∼20% [38] . The count-rate for saturated LG events reaches a maximum value higher in the atmosphere (25 km, compared to 20 km for X-rays), and then stays approximately constant. Similar behaviour was reported [39] for measurements using other types of scintillator materials, Cs 2 LiYCl 6 (CLYC) and CeBr 3 , during a 22 day long stratospheric balloon flight around the Antarctic continent, and were subsequently replicated using a Monte Carlo simulation of cosmic-ray air showers. The energy counts spectra recorded at the two float altitudes from the HG and LG chains for MPPC2 channel is shown in Figure 17 . Aside from the normalisation, the spectral properties show no significant dependence on altitude. In order to convert the counts spectrum into an energy spectrum, the instrument response must be accounted for. This is beyond the scope of the work presented here. One component of the response is the GAGG scintillator X-ray detection efficiency. In [40] , the >20 keV detection efficiency for a GAGG scintillator of similar dimensions to that used here is shown to decrease rapidly (photoelectric absorption dominates) until an incident energy of ∼500 keV, and then remain approximately constant (Compton scattering dominates) at ∼20%. This tendency is seen in the LG channel. Since Proto-CUBES has a wide field-of-view, a detailed mass model of instrument and gondola components is also required, e.g. to account for attenuation and local particle production, as well as determining contributions from high-energy photons which Compton scatter into the Proto-CUBES energy range. In Figure 17 , the HG channel shows a low-energy cut-off around 40 keV, which is dictated by the Citiroc trigger threshold. The suppression of counts in the energy range 40-90 keV is a consequence of how the Citiroc trigger system is implemented. Due to the nature of the tests with radioactive sources (Section 3.2), this effect was not evident prior to the balloon flight, but it will need to be characterised, and corrected for in subsequent flight data. In the LG channel, an excess of events is evident at 511 keV. This is more clearly seen in Figure 18 , where the counts spectra acquired at both float altitudes are summed. The summed spectrum is well described by a power law, a Gaussian feature at 511 keV and a constant.The parameters from the fit are listed in Table 3 . The 511 keV energy resolution obtained in flight, (8.5±0.2)%, is smaller than that obtained during laboratory tests conducted at room temperature, (11.7±0.2)% ( Figure 9 ). This discrepancy may be due to the lower temperature experience by the GAGG scintillator in flight, 0 --15 • C. This trend matches that reported elsewhere [41] , although the energy resolution is reported to be temperature independent in other work [24] , so further study is warranted. The Gaussian feature at 511 keV is ascribed to a positron annihilation line smeared by the GAGG scintillator energy resolution. Such a line may arise (i) if a primary or secondary cosmic-ray position interacts with material in the vicinity of the scintillators; (ii) due to the decay of spallation products (e.g. Na-22) created when cosmic-ray protons interact in the aluminium materials surrounding Proto-CUBES; (iii) from pair production by high energy photons which interact in dense materials surrounding Proto-CUBES. An intrinsic 511 keV feature may also arise due to cosmic-ray proton interacting in the GAGG scintillator, which leads to the + decay of Gd (51% mass fraction in GAGG). The presence of Gd also allows for the capture of thermal neutrons, with associated production of X-ray lines [40, 42] . While several lines are expected to fall in the Proto-CUBES energy range, these were not observed during the relatively short balloon flight. Independent of origin, the 511 keV feature provides a convenient way to monitor the energy scale calibration during flight. When work on CUBES started, it was foreseen that a single detector board, of the size shown in Figure 3 , would be installed on MIST. As the development work for CUBES progressed, the opportunity to install two PC/104-format CUBES detectors boards arose. Following the Proto-CUBES balloon flight, a new version of the CUBES PCB was therefore designed. The new CUBES PCB, shown in Figure 19 , is approximately twice the size of the PCB used for Proto-CUBES, but 200 300 400 500 600 700 800 900 Energy (keV) 2 10 3 10 Counts Figure 18 : The summed energy counts spectrum for two float altitudes (from the LG channel). The summed spectrum is fit with 300 + + exp(−0.5(( − )/ ) 2 ), where E is the energy in keV. The normalisation, is specified at 300 keV. The fitted parameters are listed in Table 3. the core components are unchanged. Characterisation work on the new CUBES PCBs is on-going, using the same test setup as shown in Figure 4 . The upper and lower surfaces of the PCB are covered in a ∼1 mm thick aluminium sheet to provide a heat path for components, and to shield components from low energy cosmic ray electrons. The Citiroc ASIC provides a dedicated calibration input, but this was not implemented for Proto-CUBES. During the nominal one year mission, GAGG scintillator and/or MPPC characteristics may change due to exposure to cosmic radiation. To allow the ASIC response to be studied independently from these components, the Citiroc calibration input has been connected to an output on the FPGA via a 100 pF capacitor. The FPGA can drive a 2.5 V pulse through the capacitor to generate a 250 pC charge pulse, there-by simulating a MPPC signal. During on-the-ground characterisation of the instrument, a pulse generator can be connected to the calibration input to characterise the linearity of the ASIC without using the FPGA. The ∼25 kB histograms stored on Proto-CUBES will be too large for the limited data downlink capabilities provided within MIST. As a result, the DAQ system in the flight version of CUBES will compress the data prior to sending it to the OBC for downlink. Several compression types are being developed, from fixed-width rebinning to logarithmic scale rebinning. Although the data will be re-binned by CUBES prior to sending to the OBC, data during a DAQ run will still be stored at full size, i.e., 2048 bins per histogram. It is foreseen that the full-size bins will be downlinked during the early stages of operation, while commissioning CUBES. Cubesat: A new generation of picosatellite for education and industry low-cost space experimentation Mist, miniature student satellite The silicon photomultiplier: fundamentals and applications of a modern solid-state photon detector Radiation damage study of sensl j-series silicon photomultipliers using 101.4 mev protons Radiation damage assessment of sensl sipms Nist xcom Evaluation of GAGG:ce scintillators for future space applications Science prospects for SPHiNX -A small satellite GRB polarimetry mission Gamma-Ray Bursts: The brightest explosions in the Universe GRID: a student project to monitor the transient gamma-ray sky in the multi-messenger astronomy era The HERMES-technologic and scientific pathfinder Secondary spacecraft in 2016: Why some succeed (and too many do not Engineering methodology for student-driven cubesats Software development and qualification testing of a cubesat x-ray monitor, Master's thesis Citiroc 1A Datasheet version 2.5 SmartFusion2 SoC FPGA Product Brief The OSI Reference Model Recent developments in geant4 A Compton polarimeter using scintillators read out with MPPCs through Citiroc ASIC, Nuclear Instruments and Methods in Physics Research A 943 Energy resolution and temperature dependence of ce:gagg coupled to 3 mm × 3 mm silicon photomultipliers Mppc datasheet Erich regener and the ionisation maximum of the atmosphere The background counting rates in a balloon borne hard x-ray telescope Techniques in balloon x-ray astronomy Cosmic x-ray background and earth albedo spectra withSwiftBAT Diffuse cosmic and atmospheric MeV gamma radiation from balloon observations Geomagnetic cutoff rigidities and geomagnetic coordinates appropriate for the carrington flare epoch Effects of cosmic rays on the Earth's environment Data taken from the goes browser Simulation of cosmic rays in the earth's atmosphere and interpretation of observed counts in an x-ray detector at balloon altitude near tropical region Xl-calibur -a second-generation balloon-borne hard x-ray polarimetry mission PoGOLino: A scintillator-based balloon-borne neutron detector, Nuclear Instruments and Methods in Nist standard reference database 126 -x-ray mass attenuation coefficients Hard X-ray astronomy from balloons Near-space operation of compact csi, clyc, and cebr3 sensors: Results from two high-altitude balloon flights Performance study of GAGG:ce scintillator for gamma and neutron detection Evaluation of GAGG:ce scintillators for future space applications Investigation into the potential of gagg:ce as a neutron detector Part of this work derives from the Phase A studies for the SPHiNX mission, which was funded by the Swedish National Space Agency (grant number 232/16). MP acknowledges support from the Swedish Research Council (grant number 2016-049929). The Proto-CUBES balloon flight was provided through the EU Horizon 2020 Research Infrastructure programme, HEMERA. As well as providing a flight opportunity, funding was awarded through the HEMERA programme to allow KTH personnel to participate in the balloon campaign. Personnel from Centre National d'Etudes Spatiales (CNES), and, in particular, Frédéric Blon, Nicolas Bray, Stéphane Louvel, and André Vagas, are gratefully acknowledged for their assistance with technical and logistical practicalities surrounding the balloon flight. Thermal and vacuum test facilities were provided by the KTH Space Centre. The MIST team, under the leadership of Sven Grahn, is thanked for providing the interface details required to develop CUBES. Marcus Persson is thanked for his contributions to the development of the Proto-CUBES data acquisition system, and for his participation in the balloon flight campaign. The authors are very grateful to Hiromitsu Takahashi (Hiroshima University) for providing the GAGG scintillators used in this work.