## 2 ARCHES LIBS Module
### Instrument Control and Software Description  
The ARCHES LIBS software module comprises the instrument's firmware running on a LattePanda mini PC with Windows 10 in the payload box, and an analysis software running on a ground station computer--the computer where the operations team receives  
Figure 5: Schematic of instrument’s hardware groups and how they are interconnected.  
the data measured in the field. The SBC is equipped with an Arduino Leonardo micro-controller that facilitates direct and fast control of many of the instrument's hardware components, such as the scanner, which is directly driven by a pulse width modulated (PWM) general purpose input/output (GPIO) pin. It also triggers measurements by providing synchronized trigger signals for releasing the laser pulse and recording a spectrum with the spectrometer. The instrument's laser and spectrometer are configured by the control software, implemented in LabView on the SBC Windows system. The software also provides the rover with an API, enabling interaction with the instrument through serial communication. An API software library, implemented in Python, runs on the rover in version 1.2 and manages the sending of instructions to the instrument and retrieving data from it.  
LIBS measurements are initiated by a single command from the rover, encompassing all adjustable measurement parameters. A measurement can comprise multiple LIBS spectra captured at a single position or different positions on the target along an arc. The number of raster points along the arc and the number of laser shots per position can be specified. Additionally, dark spectra are acquired during a measurement--these are spectrometer data collected without the laser firing, while all measurement parameters remain identical to the LIBS measurement. Measurement data can be retrieved from the instrument as raw or processed data. Data processing includes averaging, removing the dark spectrum from the LIBS spectrum, and generating a preview image of a spectrum. The processed data provide a straightforward way to obtain an initial view of the spectrum and is delivered as a processed graph in PNG format.  
If further data analysis is necessary, the data can be retrieved as a binary file containing all information recorded by the instrument. This encompasses spectral information, as well as the temperature and humidity inside the payload box, the temperature of the laser head, the time of the measurement, the number of measurement positions, the corresponding motor positions, and the number of measurements per position. The LIBS spectra are recorded in 4093 channels as 16-bit integers, resulting in a data volume of about 8 kB per spectrum. For a typical measurement involving 5 positions with 20 laser shots and 1 dark spectrum at each position, a file of 840 kB is generated. Wavelength information is retrieved separately, as it remains constant between subsequent measurements, requiring transmission only once. The calibrated wavelength file consists of 4093 channels documented as 32-bit floats, leading to a data volume of 16 kB for wavelength retrieval. All acquired spectra are stored on the internal solid-state drive of the SBC as a backup in the binary raw data format.  
Following the successful execution of the measurement procedure, the data can be requested by the rover through the serial communication link. Once the LIBS data are received from the instrument, the rover can transmit it to a ground station computer for scientific analysis.