scieee AI-readable full text Open interactive document viewer

Implementation of a flowgraph-based satellite operations software for Earth Observation missions

Alós Mairal, Julia

Abstract

This project aims to develop mission-critical software that facilitates the monitoring and automation of the operations plan between the Operation Center and the CubeSats. This software will assist operators in various tasks, including scheduling satellite passes, controlling one or multiple Ground Stations to follow the satellite, preparing execution plans with contingencies for all the different steps in the communication protocol, and automating these processes. To minimize errors introduced by operators, the software will offer an interactive user interface for configuring message sets and information exchange during contact. It will also allow for the setup of conditional blocks that depend on received data, creating a seamless and error-free feedback loop. The objective is to gradually reduce the operator's workload, to the point of making their interaction unnecessary. This will enable automated communication with the satellite at any time of day. As part of the operations, all uploaded and downloaded data will be stored for posterior processing, with automated processing wherever possible. The software will be developed using the Rust programming language, known for its speed, memory safety, and thread safety. Rust compiler detects a significant amount of common errors at compile-time, this will allow the development of a highly reliable and high-performance application. While the project will initially focus on supporting the 3Cat-4 satellite, it will also create the basis to operate any other satellite in the future, such as the RITA Payload.

Full text

TREBALL DE FI DE GRAU TFG TITLE: Implementation of a flowgraph-based satellite operations software for Earth Observation missions DEGREE: Double bachelor’s degree in Aerospace Systems Engineering and Network Engineering AUTHOR: J ´ulia Al´ os Mairal ADVISORS: Hyuk Park Adri´ an P´ erez-Portero DATE: July 20, 2023 T´ıtol: Implementaci´ o d’un software d’operacions per sat` el·lit basat en diagrames de flux per a missions d’observaci´ o de la Terra Autor: J´ ulia Al´ os Mairal Directors: Hyuk Park Adri´ an P´ erez-Portero Data: 20 de juliol de 2023 Resum Aquest projecte t´ e com a objectiu desenvolupar un programari de missi´ o cr´ ıtica que faciliti la supervisi´ o i automatitzaci´ o del pla d’operacions entre el Centre d’Operacions i els CubeSats. Aquest programari ajudar` a els operadors en diverses tasques, com programar les communicacions amb els sat` el·lits, controlar una o diverses Estacions Terrestres per seguir el sat` el·lit, preparar plans d’execuci´ o amb conting` encies per a totes les diferents etapes del protocol de comunicaci´ o i automatitzar aquests processos. Per minimitzar els errors introdu¨ ıts pels operadors, el programari oferir` a una interf´ ıcie d’usuari interactiva per configurar conjunts de missatges i intercanviar informaci´ o durant el contacte. Tamb´ e permetr` a la configuraci´ o de blocs condicionals que depenen de les dades rebudes, creant un bucle de retroalimentaci´ o sense problemes i sense errors. L’objectiu final ´ es reduir gradualment la c` arrega de treball de l’operador fins al punt de fer innecess` aria la seva interacci´ o. Aix` o permetr` a la comunicaci´ o automatitzada amb el sat` el·lit en qualsevol moment del dia. Com a part de les operacions, totes les dades intercanviades s’emmagatzemaran per al seu posterior tractament, amb un processament automatitzat sempre que sigui possible. El programari es desenvolupar` a utilitzant el llenguatge de programaci´ o Rust, conegut per la seva velocitat, seguretat de mem` oria i seguretat de fils d’execuci´ o. El compilador Rust detecta una quantitat important d’errors comuns en temps de compilaci´ o, aix` o permetr` a el desenvolupament d’una aplicaci´ o altament fiable i d’alt rendiment. Si b´ e el projecte es centrar` a inicialment en donar suport al sat` el·lit 3Cat-4, tamb´ e crear` a les bases per operar qualsevol altre sat` el·lit en el futur, com ara el RITA Payload. Title : Implementation of a flowgraph-based satellite operations software for Earth Observation missions Author: J´ ulia Al´ os Mairal Advisors: Hyuk Park Adri´ an P´ erez-Portero Date: July 20, 2023 Overview This project aims to develop mission-critical software that facilitates the monitoring and automation of the operations plan between the Operation Center and the CubeSats. This software will assist operators in various tasks, including scheduling satellite passes, controlling one or multiple Ground Stations to follow the satellite, preparing execution plans with contingencies for all the different steps in the communication protocol, and automating these processes. To minimize errors introduced by operators, the software will offer an interactive user interface for configuring message sets and information exchange during contact. It will also allow for the setup of conditional blocks that depend on received data, creating a seamless and error-free feedback loop. The objective is to gradually reduce the operator’s workload, to the point of making their interaction unnecessary. This will enable automated communication with the satellite at any time of day. As part of the operations, all uploaded and downloaded data will be stored for posterior processing, with automated processing wherever possible. The software will be developed using the Rust programming language, known for its speed, memory safety, and thread safety. Rust compiler detects a significant amount of common errors at compile-time, this will allow the development of a highly reliable and highperformance application. While the project will initially focus on supporting the 3Cat-4 satellite, it will also create the basis to operate any other satellite in the future, such as the RITA Payload. CONTENTS Acknowledgements ............................... 1 Acronyms ...................................... 3 Introduction .................................... 5 CHAPTER 1. State of the art ......................... 7 1.1. Introduction to Satellites and CubeSats ................... 7 1.2. Satellite operations ............................... 7 1.2.1. Ground segment . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.2.2. Telemetry, Tracking and Command . . . . . . . . . . . . . . . . . . 8 1.2.3. Satellite Orbit Analysis and Tracking . . . . . . . . . . . . . . . . . 9 1.3. NanoSat Laboratory .............................. 15 1.3.1. Missions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 1.3.2. Ground segment . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 CHAPTER 2. Conceptual design . . . . . . . . . . . . . . . . . . . . . . 19 2.1. Ground Segment management . . . . . . . . . . . . . . . . . . . . . . . . 19 2.1.1. Satellite management . . . . . . . . . . . . . . . . . . . . . . . . . 20 2.1.2. Ground Station management . . . . . . . . . . . . . . . . . . . . . 20 2.1.3. Scheduling module . . . . . . . . . . . . . . . . . . . . . . . . . . 20 2.2. Flowgraph-based TT&C ............................ 22 2.2.1. Flowgraph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.2.2. Flowgraph edition modes . . . . . . . . . . . . . . . . . . . . . . . 27 2.2.3. Execution manager . . . . . . . . . . . . . . . . . . . . . . . . . . 28 2.2.4. Flowgraph execution modes . . . . . . . . . . . . . . . . . . . . . . 30 2.3. Data downlink and storage ........................... 31 2.4. Access levels .................................. 32 2.4.1. Ground Station Manager . . . . . . . . . . . . . . . . . . . . . . . 32 2.4.2. Satellite Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 2.4.3. Telemetry Expert . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 2.5. Requirements .................................. 33 CHAPTER 3. Software design . . . . . . . . . . . . . . . . . . . . . . . . 37 3.1. Architecture ................................... 37 3.1.1. Programming environment . . . . . . . . . . . . . . . . . . . . . . 38 3.1.2. Database Models . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 3.1.3. Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 3.1.4. Date and time format . . . . . . . . . . . . . . . . . . . . . . . . . 50 3.1.5. Accesibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 3.2. Software structure ............................... 51 3.2.1. API Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . 53 3.2.2. TLE automatic update Implementation . . . . . . . . . . . . . . . . 58 3.2.3. Execution Manager Implementation . . . . . . . . . . . . . . . . . . 59 3.2.4. Inter-Process communication . . . . . . . . . . . . . . . . . . . . . 66 3.3. Graphical User Interface (GUI) ......................... 70 3.4. Deployment ................................... 77 CHAPTER 4. Case study: 3Cat-4 . . . . . . . . . . . . . . . . . . . . . . 79 4.1. Application layer ................................ 79 4.1.1. Type Application layer packet . . . . . . . . . . . . . . . . . . . . . 79 4.1.2. CRC32 (Cyclic Redundancy Check) . . . . . . . . . . . . . . . . . 80 4.2. Telecommand .................................. 81 4.2.1. AES Encryption . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 4.3. Telemetry .................................... 82 4.3.1. POCKET+ algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . 82 CHAPTER 5. Testing and verification ................... 85 5.1. Unit tests .................................... 85 5.2. Integration tests ................................. 85 5.3. Verification tests ................................ 86 5.3.1. Orbit prediction and Tracking . . . . . . . . . . . . . . . . . . . . . 87 5.3.2. Graphical User Interface (GUI) Testing: Flowgraph Editing and Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 5.3.3. Data decoding verification . . . . . . . . . . . . . . . . . . . . . . . 89 5.4. Real case scenario ............................... 89 CHAPTER 6. Conclusions and future work ............... 91 Bibliography .................................... 93 APPENDIX A. Operation Center Software API . . . . . . . . . . . . . . 97 A.1. Authentication ................................. 97 A.2. Scheduling endpoints ............................. 97 A.3. Flowgraph-based TT&C endpoints . . . . . . . . . . . . . . . . . . . . . . 102 A.4. Cap’n Proto Models ...............................105 2 Implementation of a flowgraph-based satellite operations software for Earth Observation missions ACRONYMS AES Advanced Encryption Standard. 81, 82 AOS Acquisition of Signal. 24, 44, 58–61, 65, 68, 88 API Application Programming Interface. 20, 38, 48, 49, 52, 53, 59, 66, 68, 71, 77, 85 ECEF Earth-Centered Earth-Fixed. 11–14, 55 ECI Earth-Centered Inertial. 10–12, 54, 55 ENU East, North, Up. 11, 14, 15 EO Earth Observation. 5, 7, 8, 15, 16, 31 ESA European Space Agency. 16, 82 GS Ground Station. 7–9, 11, 12, 14, 15, 17, 19–21, 23–27, 30, 32, 37, 42–44, 49, 51, 53–56, 59–61, 64, 69, 72, 74, 77, 79–82, 85, 87, 89–92 GUI Graphical User Interface. viii, 51, 52, 65, 68, 70, 71, 85, 88–90, 92 HTML HyperText Markup Language. 52 HTTP Hypertext Transfer Protocol. 48, 51, 53 JWT JSON Web Tokens. 50, 51 LDAP Lightweight Directory Access Protocol. 50, 51 LLA Latitude, Longitude, and Altitude. 11–13 LOS Loss of Signal. 24, 58, 60–65, 68, 88 LXC Linux Containers. 77 NORAD North American Aerospace Defense Command. 10, 20, 30, 44, 46, 54, 55, 59, 72–74, 87 OpCen Operation Center. 7, 8, 17, 19, 23, 28, 37, 39, 59, 64, 66, 79, 83, 86–92 REST Representational State Transfer. 48 SDR Software-defined radio. 89 SGP4 Standard General Perturbations Satellite Orbit Model 4. 5, 10, 11, 54, 87 SQL Structured Query Language. 41 TLE Two-Line Element. 5, 10, 20, 21, 24, 39–41, 43, 54, 58–61, 85 3 4 Implementation of a flowgraph-based satellite operations software for Earth Observation missions TOML Tom’s Obvious, Minimal Language. 55 TPC Transmission Control Protocol. 48 TT&C Telemetry, Tracking, and Command. 5, 6, 8, 19, 22, 37, 51, 54, 71, 72, 74, 79, 86, 89–91 UHF Ultra High Frequency. 17, 26 UI User Interface. 52 URI Uniform Resource Identifier. 48 UTC Coordinated Universal Time. 50, 53 VHF Very High Frequency. 17, 26 WASM WebAssembly. 70, 71 INTRODUCTION Since the beginning of humanity, an insatiable curiosity to explore the unknown has driven humanity to exceed the boundaries of what is deemed possible. This relentless pursuit began the space race and propelled incredible technological advancements, from the development of rockets to the creation of sophisticated satellites orbiting our planet. In recent years, a remarkable surge in satellite launches has been observed. This phenomenon is a result of various factors that have contributed to this growing trend. Technological advancements in the space industry have played a significant role in driving the increase in satellite launches. Ongoing developments and improvements in satellite technology have enabled the creation of smaller, more efficient, and cost-effective designs. This has opened up new opportunities for organizations and companies to design, build, and launch their satellites. The rising demand for space services has also been a key driver behind the increase in satellite launches. Telecommunications, Earth Observation (EO), satellite navigation, meteorology, scientific research, and other areas increasingly rely on satellite infrastructure to provide global services and connectivity. However, the growing number of satellites presents challenges in terms of management and control. It is crucial to have a robust infrastructure that enables efficient monitoring, control, and coordination of these satellites. This involves real-time tracking of their position and status, establishing reliable two-way communications, and processing the large volumes of data generated by the satellites. As humanity continues to push the boundaries of space exploration and satellite technology, it is essential to ensure the availability of the necessary infrastructure and capabilities to effectively manage this expanding fleet of satellites. This requires collaboration, innovation, and the development of advanced systems and technologies to support the future of space exploration and maximize the benefits that satellites can bring to society. Objectives This final degree thesis focuses on the development of a mission-critical software system that revolutionizes the monitoring and automation of operations between the Operation Center and CubeSats. The main objective is to design an Operation Center software that integrates and manages various tasks handled by the operator during satellite missions. Acting as a central hub and orchestrator, the software will facilitate the coordination of one or more Ground Stations. The Operation Center software will be designed to fulfill three fundamental tasks: scheduling satellite passes, providing Telemetry, Tracking, and Command (TT&C) capabilities, and enabling data analysis. By leveraging a tracking system based on the Standard General Perturbations Satellite Orbit Model 4 (SGP4) Orbit propagator and satellite’s Two-Line Element (TLE), the software will allow operators to predict future passes of the satellites. Furthermore, it will enable the programming of communication with compatible Ground Stations. In addition, the software will allow operators to configure the sequence of processes and messages to be exchanged during the missions through a user-friendly graphical interface. The interface will be a graph-based operations flowgraph, where each node will correspond to a telecommand, and responses will be analyzed to guide the flow toward 5 6 Implementation of a flowgraph-based satellite operations software for Earth Observation missions further actions. The software will be capable of generating telecommands, receiving and parsing responses and beacons from any of the implemented satellites, and establishing network socket connections with the Ground Stations. Upon reception of the messages, the scientific data will be recollected for future analysis and the telemetry data obtained will be stored in an InfluxDB database. This will enable the visualization of telemetry data through the Grafana software. Methodology This project has been carried out at the UPC NanoSat Lab and has had a duration of one year. In the development of this project, three phases have been identified. The first phase focused on learning the Rust programming language while also designing and planning the project. Simultaneously, an analysis of the libraries that should be used for the development was conducted. This established the foundations for the subsequent software development. The next phase involved the actual implementation of the project, translating the design of the different modules into executable code, and creating a user-friendly graphical interface. In the final stage of the project, tests and verifications were performed to ensure the proper functioning of all software components and validate that they met the defined requirements. Any issues or bugs discovered during testing were carefully addressed and resolved to improve the stability and reliability of the software. Throughout the project, regular weekly meetings were held to monitor progress, discuss encountered challenges, and make necessary adjustments. Additionally, version control using Git was employed to ensure the integrity of the codebase. Contents This thesis report has been divided into six chapters. Chapter 1 serves as an introduction, providing the necessary background knowledge and context for the project. It offers an overview of satellite operations, describing the equipment used in the ground segment, the TT&C process, and the data processing associated with these operations. The next two chapters considered the core of the project, focus on the development process. Chapter 2 outlines the scope of the project and presents the software requirements that need to be fulfilled. With a clear understanding of the project’s needs, Chapter 3 delves into the software development process, discussing decision-making, employed technologies, and the overall development approach. It provides an overview of the steps and methodologies followed in the software development. Once the software’s functionality is developed and explained, Chapter 4 conducts a specific study for the 3Cat-4 satellite. This study explores the considerations, characteristics, requirements, and challenges associated with the 3Cat-4 satellite, to take into account to provide support with the developed software. Chapter 5 focuses on the validation of the software’s functionality and performance. It details the procedures and methods used to conduct verification tests and presents the results obtained. Additionally, it discusses the testing of the software in a real-world scenario. The final chapter, Chapter 6, concludes the thesis by providing an overview of the project and highlighting potential areas for future improvements and further implementations. CHAPTER 1. STATE OF THE ART 1.1. Introduction to Satellites and CubeSats During the last decades, the increasing number of satellites being launched for various purposes, such as communications, EO, navigation systems, and space exploration, has been mainly driven by the development of smaller satellites known as CubeSats. CubeSats are standardized, small-sized satellites that can be built, assembled, and launched in a relatively shorter period of time and at a lower cost compared to traditional larger satellites. The CubeSat standard introduced a modular and compact design based on a standardized unit known as a 1U. A 1U CubeSat is a 10 cm cube typically weighing around 1 to 1.33 kg. This standardized form factor enables easy integration and compatibility across different CubeSat missions. Since the inception of the CubeSat concept, larger sizes beyond the 1U have become increasingly popular. These larger sizes, such as the 1.5U, 2U, 3U, 6U, and 12U, have provided a scalable and versatile platform for satellite designers. Each size represents a multiplication of the 1U unit, allowing for greater volume and expanded capabilities [19]. Figure 1.1: Standard CubeSats sizes [18]. 1.2. Satellite operations Satellite operations can be divided into two segments that work in coordination: the space segment and the ground segment. The space segment refers to the satellite itself and its components that operate in the space environment. It operates autonomously or under the guidance of ground control commands, executing various functions to achieve the desired mission outcomes. These functions may include data collection, signal transmission, scientific measurements, or navigation services. On the other hand, the ground segment contains the infrastructure and systems on Earth that support satellite operations. It includes a network of Ground Stations (GSs) strategically located around the globe, Operation Centers (OpCens), communication networks, and the associated software and hardware. Is responsible for managing and monitoring the satellite’s activities, receiving and processing telemetry data, sending commands, and analyzing the data collected by the satellite. 7 8 Implementation of a flowgraph-based satellite operations software for Earth Observation missions 1.2.1. Ground segment The ground segment of satellite operations involves a range of equipment and systems that support the management, control, and monitoring of satellite activities. The primary components commonly found in the ground segment: •Ground Stations: GSs are equipped with antennas and communication equipment, they serve as the direct link between the ground segment and satellites in orbit. Their primary function is to receive telemetry data transmitted by the satellite, including information on the satellite’s health, status, and performance. In addition, are responsible for tracking satellites as they move across the sky, by precisely pointing their antennas toward the satellite’s location, establish and maintain communication links during the satellite’s orbit. Furthermore, transmit commands and instructions to the satellite, allowing for control and operation. •Ground Networks: The ground segment relies on ground networks to establish connectivity between GSs, OpCens, and other facilities involved in satellite operations. These networks facilitate the transmission of data, commands, and instructions between different components of the ground segment and the satellite. •Operations Centers: They act as the central hub for managing satellite operations. OpCens are equipped with sophisticated software systems, hardware infrastructure, and a team of operators. The operators are in charge of monitoring and controlling the satellite’s activities, analyzing telemetry data, and making decisions regarding mission objectives and satellites. •Remote Terminals: They serve as user interfaces that enable the retrieval of transmitted information for additional processing. 1.2.2. Telemetry, Tracking and Command Satellite TT&C is an essential part of space missions, encompassing functions and processes for monitoring, controlling, and communicating with the satellite from a ground station or control center. Telemetry is a key component of TT&C and involves collecting data from the satellite’s onboard sensors, such as temperature, power levels, attitude, and orbit details. This telemetry data provides valuable insights into the satellite’s health, status, operational parameters, scientific experiments, and EOs. It is transmitted to ground stations, allowing operators to monitor the satellite’s performance, detect anomalies or deviations, and conduct data analysis for scientific purposes. Command uplink is another crucial aspect of TT&C, allowing operators to send instructions and commands to the satellite. These commands can include configuring subsystems, executing specific operations, adjusting orbital parameters, or performing diagnostics. The command uplink ensures that the satellite operates according to mission objectives and can adapt to changing requirements. Maintaining reliable communication between the GS and the satellite is essential throughout the mission. The TT&C subsystem enables bidirectional communication, facilitating the transmission of telemetry data from the satellite to the ground station and the reception of commands and instructions from the GS to the satellite. This communication link ensures effective monitoring, control, and coordination of the satellite’s operations. State of the art 9 1.2.3. Satellite Orbit Analysis and Tracking This section focus on studying satellite orbits and exploring the necessary tools and steps for accurate satellite tracking. This includes characterizing satellite trajectories, understanding orbital propagation algorithms, conversions between coordinate systems, and determining Look Angles for precise antenna alignment with the satellite. Which are essential aspects for establishing reliable communication between GS and satellites. 1.2.3.1. Keplerian elements An orbit is the trajectory that a satellite follows around a celestial body, such as the Earth. These trajectories are defined by Kepler’s Laws that describe the motion of planets: •Law 1: All planets move in elliptical orbits with the Sun located at one focus. •Law 2: The line connecting any planet to the Sun sweeps out equal areas in equal times. •Law 3: The square of the period of any planet is proportional to the cube of the semi-major axis of its orbit. ⇒T2=Ca3 An orbit can be characterized based on the Keplerian elements (a,e,i,Ω,ω,v). These elements are a set of parameters that describe the shape, size, and orientation of an orbit in space [16]. Figure 1.2: Keplerian elements describing a satellite orbit in the ECI coords [15]. The Keplerian elements include: •a: Semi-major axis, gives the size of the orbit. •e: Eccentricity, gives the shape of the orbit (0≤e<1). 10 Implementation of a flowgraph-based satellite operations software for Earth Observation missions •i: Inclination angle, gives the angle of the orbit plane to the central body’s equator. •Ω: Right ascension of the ascending node, which gives the rotation of the orbit plane from reference axis. •ω: Argument of perigee is the angle from the ascending nodes to perigee point, measured along the orbit in the direction of the satellites motion. •v: True anomaly gives the location of the satellite on the orbit. 1.2.3.2. Two-Line Element Set Format The TLE is a data format used to represent the mean Keplerian orbital elements of Earthorbiting objects. These elements are made available by North American Aerospace Defense Command (NORAD) and are commonly used for tracking and predicting the orbits of satellites and other space objects. The mean values for each element are generated using the SGP4 orbital model, which is a mathematical algorithm used to predict the orbital state vectors of satellites relative to the Earth-Centered Inertial (ECI) coordinate system, based on its orbital elements, including parameters such as inclination, eccentricity, mean anomaly, argument of perigee, and mean motion. This model predicts the effect of perturbations caused by the Earth’s shape, drag, radiation, and gravitation effects from other bodies such as the sun and moon [17]. The data of the NORAD TLE consists of three lines in the following format: AAAAAAAAAAAAAAAAAAAAAAAA 1 NNNNNU NNNNNAAA NNNNN.NNNNNNNN +.NNNNNNNN +NNNNN-N +NNNNN-N N NNNNN 2 NNNNN NNN.NNNN NNN.NNNN NNNNNNN NNN.NNNN NNN.NNNN NN.NNNNNNNNNNNNNN Where Line 0 is a twenty-four character name, and Lines 1 and 2 correspond to the standard Two-Line Orbital Element Set Format. Figure 1.1 shows each line’s contents in detail. Table 1.1: TLE format. State of the art 11 1.2.3.3. Orbital Coordinate Systems Before delving into the topic of tracking satellites and pointing GS antennas towards them, it is important to consider the different coordinate systems that accurately define the position and orientation of objects in three-dimensional space. These coordinate systems include the ECI, the Earth-Centered Earth-Fixed (ECEF), the East, North, Up (ENU), and the Latitude, Longitude, and Altitude (LLA). The ECI coordinate system is centered at the Earth’s center, remains fixed in space, and does not rotate with the Earth. The z-axis runs along the Earth’s rotational axis pointing North, the x-axis points in the direction of the vernal equinox (an imaginary line segment pointing from the center of the Earth towards the center of the Sun at the beginning of Spring of epoch J2000), and the y-axis completes the right-handed orthogonal system. When using an orbital propagator like SGP4, the position obtained is typically represented in the ECI coordinate system. This coordinate system provides a fixed reference frame, allowing for an accurate representation of satellite positions in space. The ECEF coordinate system, on the other hand, is fixed with respect to the Earth’s surface. Its origin is at the Earth’s center, and its axes are aligned with the Earth’s rotation. In the ECEF system, the z-axis aligns with the Earth’s rotational axis, pointing towards the North Pole, the x-axis points to the Prime Meridian (Greenwich Meridian), and the y-axis, as before, completes the orthogonal system. (a) Earth-Centered Inertial (ECI). (b) Earth-Centered Earth-Fixed (ECEF) and East, North, Up (ENU). Figure 1.3: Coordinate Systems [11]. In the ENU coordinate system, the reference point serves as the origin, and the x-axis points East, the y-axis points North, and the z-axis points up perpendicular to the local tangent plane. The orientation of the axes is determined by the reference point and is aligned with the local horizontal and vertical directions. Finally, the LLA, also known as geodetic coordinates, represents a position on the Earth’s surface using latitude, longitude, and altitude (or elevation). LLA coordinates take into account the Earth’s shape, specifically using an ellipsoidal model such as the WGS84 ellipsoid, which approximates the Earth’s shape more accurately than a simple sphere. This coordinate system is the most commonly used in everyday navigation, maps, and geospatial applications, and it is the one used to describe the location of the GSs. CHAPTER 2. CONCEPTUAL DESIGN In this chapter, the reasons behind the development of this software will be explained, along with the necessary requirements it must fulfill and the overall scope of the project. There are three distinct needs that this software aims to address: Scheduling, TT&C, and Data Downlink and Storage. Each of these needs is intended to support the different tasks performed by operators throughout the satellite operation process. For convenience, each of them will be referred to as: •Scheduling module •TT&C module •Data Downlink and Storage module The satellite operators at UPC NanoSat Lab require a reliable and efficient tool to effectively manage and coordinate the commanding and downlink of the satellites through the GSs and OpCen. To address these challenges, a centralized software is necessary to provide operators with a comprehensive overview of all satellites under their control, allowing them to track and monitor each satellite, ensuring optimal resource utilization and streamlined coordination across various missions, making better decisions, prioritizing tasks, and allocating resources strategically. 2.1. Ground Segment management Without a robust scheduling mechanism, the operators face significant challenges in maintaining centralized control, leading to potential inefficiencies, operational difficulties, and the risk of errors. One of the key advantages of implementing a scheduling system is its ability to predict and determine when satellites will be visible from specific GSs. By leveraging orbital data, satellite orbits, and the Earth’s rotation, operators can identify optimal communication windows, facilitating efficient planning and scheduling of communication sessions. This ensures a reliable and uninterrupted data exchange between satellites and GSs. Furthermore, a scheduling system will facilitate the management of the GSs, by leveraging knowledge of their operational status, and indicating whether they are available and ready for communication with the satellites or under maintenance. This information will assist in selecting the most suitable GS, based on factors such as availability, operational frequencies, and bandwidth, thereby optimizing overall communication performance within a network of GSs. In previous works done by the team of UPC NanoSat Lab, this topic has been addressed [9]. By designing an OpCen that centralizes data and enables the control of multiple GSs. This centralized approach allows for efficient management, analysis, and control of satellite operations. Operators can seamlessly monitor and communicate with satellites, and automated scheduling capabilities optimize GS utilization. That is why this new project is presented as an evolution of the previous work, providing greater scope and utility to the system. 19 20 Implementation of a flowgraph-based satellite operations software for Earth Observation missions 2.1.1. Satellite management The scheduling module should support the management and scheduling of multiple satellites. Operators should be able to easily add, remove, and modify satellite information. This includes assigning operational frequencies of satellites, allowing for the selection of the appropriate GS during scheduling. Additionally, it should allow for the modification of the NORAD ID as it may be assigned shortly after the satellite’s deployment into orbit. The NORAD ID serves as a unique identifier for the satellite and is crucial for tracking and communication purposes. Thus, updating the NORAD ID is necessary to ensure accurate and coherent information. Furthermore, during the initial stage after launch, predicting the precise orbit of a satellite can be challenging due to the difficulty of distinguishing individual nanosatellites from other cubesats during the early stages when they are launched together. Additionally, the lack of precision in the injection vector provided by the launcher makes it difficult to determine the precise position and velocity of the orbit. As a result, the software used for tracking and orbit prediction should allow for manual input of TLE data by operators. This ensures that the most up-to-date and accurate information is used for orbital predictions. Moreover, the software should have the capability to automatically update the TLE data periodically using the Celestrak1Application Programming Interface (API), which provides reliable and current orbital information. 2.1.2. Ground Station management In addition to controlling the different satellites, the software should also enable the management of GSs to have control over both sides of the communication. The software should provide information about the available GSs, including their locations, operational frequencies, and current operational status. This information will be crucial in determining the feasibility of communication with the satellite. 2.1.3. Scheduling module The scheduling module unifies satellite management and GS management, intending to efficiently plan and schedule communications with the satellites based on their specific requirements and specifications. By integrating satellite management and GS management, the scheduling module enables seamless coordination of resources and tasks. It takes into account various factors such as satellite availability, GS capabilities, communication windows, and satellite-specific requirements. The scheduling module leverages the specifications provided by the satellites to choose the most compatible GSs taking into consideration the frequency bands and bandwidth of the satellites, ensuring that the communication sessions are planned in a way that meets the specific needs of each satellite. Furthermore, the scheduling module uses the TLE to compute the satellite orbits to determine when the communication can take place. 1Celestrack: https://celestrak.org/ Conceptual design 21 2.1.3.1. Scheduling options The software should offer a variety of options to accommodate diverse scheduling needs. Operators will have the flexibility to choose from different scheduling modes based on their specific requirements. These options include: •One Pass: This option schedules the next available pass for a satellite starting from the current time. It allows operators to quickly schedule a single communication session for immediate operations. •Multiple Passes: Operators can specify the number of consecutive passes they want to schedule for a satellite, and the software will search and schedule the nearest passes that will happen. •Multiple Passes from Date: With this option, operators can schedule a specific number of passes starting from a chosen date. This option is useful for planning future communication sessions in advance. •All Passes Until Date: Operators can schedule all available passes for a satellite until a specified future date. •All Passes Within Time Interval: This option allows operators to define a specific time interval and schedule all the passes that will occur within that period. When making these predictions, several factors must be considered, as they can affect both the performance and accuracy of the software. The predictions are based on the orbital parameters extracted from the TLE of the satellites. Therefore, if the TLE data is not up-to-date, the predictions may not be entirely accurate. Additionally, when scheduling a pass far in advance, the predicted results may not be entirely precise. Furthermore, the calculation follows an iterative process to identify the moments of acquisition of sight and loss of signal events. If the search period is not properly defined, it could potentially cause the software to become stuck in an infinite loop, in the cases that the desired event may not occur. To prevent this, a time limit is imposed for the first three cases, mentioned above, where there is no specific end date for the search. This time limit can either be a default value set by the software or directly inputted by the operator. Another factor to consider is what to do when two passes of different satellites occur at the same time and require the use of the same GS. In such cases, if a conflict is found with a previously scheduled pass, the operator will be notified of the conflict, and the scheduling software will prevent the conflicting pass from being scheduled, avoiding overlaps or clashes in the planned passes. By notifying the operator about the conflict, they will have the opportunity to review and adjust the scheduling accordingly to ensure the desired execution. Finally, all the predictions will be displayed in a graphical interface, providing essential information for the operator. This includes details such as the satellite, GS, start and end time of the pass, maximum elevation, and other relevant information. The interface will allow operators to easily visualize and evaluate the scheduled passes, being able to eliminate those that do not meet the needs or do not want to be carried out. Additionally, the interface will also display the completed passes, allowing operators to review the historical data and performance of the satellite operations. 22 Implementation of a flowgraph-based satellite operations software for Earth Observation missions 2.1.3.2. External Accessibility Furthermore, an additional application for this software is to promote collaboration and facilitate resource sharing among external operators and organizations. This will enable them to utilize the infrastructure available at the UPC NanoSat Lab. By providing access to this software, external users can plan and schedule their satellite passes, ensuring the availability of the necessary resources for their specific missions and operations, and enabling them to make the most of the deployed infrastructure at the UPC NanoSat Lab. In summary, the scheduling module of the software serves both operational and commercial purposes. It facilitates the scheduling of passes for the satellites, ensuring efficient resource utilization. Once the passes are completed, all relevant information is recorded, allowing for the billing of services rendered. This capability enables the UPC Nanosat Lab to track and charge for the utilization of its resources. 2.2. Flowgraph-based TT&C Nowadays, the tasks of TT&C in satellite operations are carried out manually by operators at UPC NanoSat Lab, and even though the procedures to be followed during operations are defined in detail, these introduce the possibility of human errors, which may impact the satellite’s performance. The TT&C operators are responsible for collecting telemetry data, commanding its operations, maintaining its orbit, detecting anomalies, managing communication links, and monitoring the satellite’s health. These tasks are crucial for ensuring the successful operation and management of satellites throughout their lifetimes. There is a strong need for automated support that simplifies operations and provides comprehensive assistance and guidance to the operators. By implementing advanced automation and intelligent software, this process would effectively reduce the workload and greatly enhance the efficiency of TT&C tasks, leading to smoother and more efficient satellite operations. 2.2.1. Flowgraph A flowgraph defines a set of processes and operations to be performed by software. These tasks are grouped into independent components and connected following a predefined logic. This modular approach promotes code reusability, maintainability, and scalability, as components can be easily added, removed, or modified without impacting the entire system. The goal is to provide a flexible and adaptable design tool for different missions. Operators can easily modify or extend flowgraphs to accommodate changes in mission requirements or operational scenarios. This allows for quick adjustments of components, making it easier to build complex systems from smaller, reusable blocks. Furthermore, flowgraphs enable automated decision-making by incorporating logic and algorithms within the design of blocks. The flowgraph analyzes data and makes real-time decisions, reducing the need for manual intervention and improving the overall reliability Conceptual design 23 Figure 2.1: Example implementation of a TT&C flowgraph. and efficiency of satellite operations. Additionally, flowgraphs offer a visual representation of the system’s structure and the flow of data between different components. For those reasons, the integration of flowgraph technology covers all the objectives, as it provides a powerful tool for visualizing, organizing, and managing the complex flow of the data, commands, and processes involved in satellite operations. This provides a clear and intuitive representation of the entire process, enables operators to visually design and configure the sequence of operations, define dependencies between tasks, monitor the flow of data and commands, and make informed decisions in real time. When designing a flowgraph, it is important to consider that each satellite mission has its own unique objectives, goals, and specific requirements. These missions utilize different protocols and communication systems, making it impractical to reuse the same code in the blocks for every mission. Therefore, a personalized flowgraph is necessary for each mission to accommodate these variations and ensure optimal performance and compatibility. In this context, three different types of blocks have been distinguished based on their functionalities. These include utility blocks, mission blocks, and background blocks. •Utility blocks: These blocks are designed to be versatile and applicable to various missions. They offer high-level control and functionality, performing generic operations that assist in managing and controlling the flowgraph. Their purpose is to provide a consistent and standardized set of operations that can be used across different satellites, promoting reusability and reducing the need for mission-specific customization. •Mission blocks: These blocks are specific design for each mission and are responsible for the exchange of information between the satellite and the OpCen. They incorporate mission communication protocols, commands, data structures, and other specific functionalities. Also, integrate some logic to take decisions about the next block to be executed. These blocks share the same functionality and visual representation across all the satellites and only vary their execution based on the specifications of the missions. •Background blocks: These blocks handle background processes and tasks that support the overall operation of the satellite. They provide essential functions such as connecting to the GS, managing database storage, and performing auxiliary tasks. While these blocks may not directly contribute to the primary mission objectives, they play a crucial role in ensuring the correct functioning of the satellite’s operations. 24 Implementation of a flowgraph-based satellite operations software for Earth Observation missions 2.2.1.1. Utility blocks Within this group, there are two blocks that have very similar functionalities: the Acquisition of Signal (AOS) and Loss of Signal (LOS) blocks. These blocks employ orbital propagation algorithms to predict and calculate various parameters related to satellite passes over a GS, as well as to detect and manage the satellite’s visibility to the GS. The AOS block is responsible for monitoring the satellite’s position and determining the moment when it is about to pass over the GSs, preparing for the initiation of communication. By utilizing parameters such as the latitude, longitude, and altitude of the GSs, along with the satellite’s TLE data, the AOS block calculates the Look angles necessary for establishing communication. Once the satellite’s elevation angle exceeds a predefined threshold, the LOS block takes over. This block continuously tracks the satellite to determine when it is no longer visible to the GSs, marking the end of the communication. Additionally, another block, known as the Tracking block, can be found in this group. The Tracking block is responsible for computing the necessary antenna movements required to accurately point the antenna toward the satellite and track its path during the pass. Its main function is to generate a file containing the calculated movements and send it to the GSs to follow these instructions. 2.2.1.2. Mission blocks Mission blocks are responsible for generating and receiving data that is transmitted to and from the satellite. These blocks have a unique and customized implementation specifically for the mission they are designed for. This means that each set of mission blocks is executed by a different code to adapt to the communication requirements and protocols of the individual satellite missions. By utilizing mission-specific code, these blocks can efficiently handle data generation, reception, and processing following the unique characteristics and objectives of each mission. However, it is important to highlight that there is an ongoing effort to standardize the operation of satellites in the future. This initiative aims to eliminate the need for such distinction among mission blocks, as a unified and standardized approach would be adopted across multiple satellites. This will greatly facilitate the operation of new satellites, as they will be compatible with the standardized software and protocols, promoting enhanced interoperability and reducing complexity. During operations, mission blocks take input data and generate a serialized message for transmission through the GSs interface. They then await a response, which is subsequently decoded and analyzed to determine the block’s success. These blocks also incorporate control parameters for communication, such as the timeout time. The timeout defines the duration within which a block considers a package lost if no response is received. The adjustability of the timeout is crucial since the processing speed of commands by the satellite may vary, resulting in different RTT (Round Trip Time) for each case. Additionally, mission blocks include the number of retry attempts for package transmission in case of a timeout or other unsuccessful execution. Based on the received response or the inability to execute the block successfully due to a timeout or other events, mission blocks determine their output, enabling further decisionmaking and processing within the flowgraph. Conceptual design 25 The mission blocks can be categorized into three types, as a function of the input parameters: •Send Command: This block takes a command as input. It generates a data package containing the command to be transmitted to the satellite through the GSs interface. •Send File Command: This block takes both a command and a file as input. The command represents instructions, while the file contains the actual content of the package to be sent. •Send Bytes Command: This block directly accepts a sequence of bytes as input and is utilized in scenarios where no specific data structure has been defined for a particular case. It allows for the transmission of raw bytes as the content of the data package, providing flexibility in handling diverse data formats or situations that do not adhere to predefined structures. In addition, to provide flexibility for handling various execution scenarios within the mission blocks and providing appropriate output paths depending on the outcome of the block’s operation can be differentiated another three different cases: •Simple Output: In this case regardless of the execution result, there is only one possible output. •Success-Fail Conditional Output: In this scenario, the output is determined based on the success or failure of the block’s execution. If the execution is considered successful, the Success output is chosen; otherwise, the Fail output is selected. •Success-Fail-Timeout Conditional Output: In this case, if a failure occurs, the selection of the output varies depending on the origin of the failure, which can be attributed to either a timeout or another reason. Combining both groups, the software supports up to nine different combinations, providing operators with a high degree of flexibility and customization. By linking the blocks together, operators can define the sequence of operations and the data flow within the flowgraph, allowing the coordination and integration of various tasks and ensuring that the execution follows the desired workflow. 2.2.1.3. Background blocks Background blocks, similar to utility blocks, are executed in the same way regardless of the mission. They are designed to perform complementary tasks to the execution of the flowgraph, providing support in various areas such as data querying and storage in databases and files, as well as establishing connections with the GSs. The Ground Station block acts as a bridge between the flowgraph execution and the GSs. Its primary role is to establish and maintain a connection with the GSs throughout the communication process. Moreover, it should enable GSs roaming, which allows for the flexibility to switch to a different communication GSs during satellite operations. This capability 26 Implementation of a flowgraph-based satellite operations software for Earth Observation missions ensures uninterrupted communication by facilitating a smooth transition to an alternative GSs location if required to maintain the satellite connection. Once the communication is completed, it frees up the channel to allow the next communication session. Currently, the UPC NanoSat Lab operates two antennas in Montsec (including one for UHF and another for S-Band) and an additional two antennas in Barcelona (UHF and VHF). These antennas have a standardized data exchange interface, making them interoperable within the software, which will be explained in detail later. During the flowgraph execution, the GS block receives packets generated by the mission blocks and sends them to the GSs for transmission to the satellite. Simultaneously, it receives packets sent by the satellite, allowing them to be processed by the mission blocks, facilitating bidirectional communication between the satellite and the software. The Database Connection block provides the functionality to interactively query the configuration of the executing flowgraph. As the execution progresses, the flowgraph can dynamically retrieve information such as which block to execute at each step, the specific command to be sent, the data associated with the command, and any other relevant details necessary for the proper functioning of the execution. The Backup block has the functionality of collecting all the information generated during the execution of the flowgraph. This includes data generated from packet reception and transmission to the satellite, as well as the various decisions and paths taken during the flowgraph execution. The background block serves two main purposes. Firstly, it serves as a record of everything that has happened during the communication for later analysis and error detection. Secondly, the Background block is used to support the visual representation of the execution. When an operator joins the execution midway, it is essential to provide them with a complete overview of the previous events. By utilizing the information collected by the Background block, the operator can access to the complete representation of the execution history. This ensures that the operator has the necessary context and can make informed decisions based on the entire flowgraph execution, even if they didn’t observe it from the beginning. Finally, there is one last block directly related to Data Downlink and Storage, which is explained in depth in Section 2.3.. This block is the Data Storage block, responsible for storing all telemetry data received during the execution. The stored data can be visualized by the operator using Grafana, allowing for monitoring and analysis of the satellite’s performance and health, to take decisions during the processes. Finally, there is one last block directly related to Data Downlink and Storage, which is explained in depth in Section 2.3.. This block is the Data Storage block, responsible for storing all telemetry data received during the execution. All the data is sent and saved into a telemetry database, enabling the operator to visualize the stored data using Grafana. This functionality allows for monitoring and analysis of the satellite’s performance and health, aiding in informed decision-making during the processes. However, the detailed discussion of the telemetry database falls beyond the scope of this work. Conceptual design 27 2.2.2. Flowgraph edition modes At this point, the advantages that a modular block design provides when it comes to developing the chain of actions and commands that must be executed in a flowgraph are already known. One of these advantages is undoubtedly the flexibility that it offers and the adaptability to any situation. However, it is essential to consider how the satellite pass will be connected to the flowgraph that must be executed. The choice of a flowgraph can be conditioned by many factors such as the use of a particular GSs, the time in which the contact with the satellite will occur, or the objectives of the communication. In this manner, the introduction of different operating modes to the flowgraph enhances another level of customization and flexibility for a given scenario. As a result, four different selection criteria can be defined: •Personalized pass: This mode enables the design of a chain of blocks to be executed by explicitly selected passes (one or more), allowing the design of personalized communications for specific scenarios. •Programmed: In specific scenarios, it is possible that depending on what time the contact with the satellite occurs, the operator is not available. This case could be, for example, during nighttime hours when autonomous execution of the flowgraph becomes necessary. During the configuration, it is essential to specify the start and end time of the prioritized flowgraph selection period. •Default Ground Station: Another criterion to consider in the flowgraph design can be the selection of the GSs responsible for the transmission. Having different flowgraphs, allows customization and adaptation to the specific capabilities of each GSs, optimizing the communication parameters and protocols to maximize performance. In this case, the operator should indicate their preferred GSs for the execution. •Default flowgraph: However, if none of the previously configured modes in a satellite are compatible with the pass, the default design will be selected. It is important to note that unlike the other modes, which may or may not be present, there should always be only one default model. Before the satellite contact, the server examines the configured flowgraphs for that particular satellite to determine the appropriate flowgraph. Each mode is assigned a preference based on its exclusivity and restrictions. The priority order, from highest to lowest, is as follows: Personalized Pass, Programmed, Default GSs, and Default. This ensures that the server selects the most suitable flowgraph for the given scenario, taking into account the specific requirements and constraints of each mode. An example of the configuration and assignment of these modes can be found in figure 2.2. 34 Implementation of a flowgraph-based satellite operations software for Earth Observation missions Table 2.1: Backend Requirements Conceptual design 35 Table 2.2: Frontend Requirements CHAPTER 3. SOFTWARE DESIGN This chapter presents the design and implementation of the software, discussing the decision-making process and justifying the chosen technologies based on the previously defined requirements. 3.1. Architecture The software is designed with a client-server structure, where the client requests services or resources from the server, and the server provides those services or resources in response to client requests. Figure 3.1: Software architecture The server, located at the UPC NanoSat Lab’s OpCen, offers three primary services: Scheduling, Flowgraph-based TT&C, and Data downlink and storage. Each service has its independent database for data storage and management, all hosted on the same server. This separation ensures data isolation and enables independent management and processing of the services. To ensure synchronization between the Flowgraph and the Scheduling module, a communication channel is established between the two. This allows for the notification of any updates or changes in the satellite pass planning, enabling the Flowgraph module to adjust its execution accordingly and ensuring seamless coordination. Additionally, during the execution of flowgraphs, the software establishes a connection with any of the GS in the network. 37 38 Implementation of a flowgraph-based satellite operations software for Earth Observation missions For the client, two graphical user interface options have been developed. The first option is a web application hosted on the server, providing easy accessibility from any device with a web browser, while the second one is a desktop application. Both interfaces offer the same set of functionalities, allowing users to choose the one that best suits their needs and preferences. To allow interaction between the clients and the server, a RESTful API and a WebSocket interface are utilized. This standardized interface allows clients to make queries, retrieve data, and fully utilize the software’s capabilities. Additionally, telemetry data obtained during communications can be visualized through the interface provided by Grafana. In the following sections, a more in-depth discussion will be provided about the process and the functionalities of the previously introduced aspects. 3.1.1. Programming environment For the development of the program, the Rust1language has been chosen due to its reputation built on its speed, memory safety, and thread safety. Rust features enable the detection of numerous common errors during compilation, ensuring code correctness and reducing the possibility of runtime errors. Its focus on memory safety, which helps to prevent issues like null pointer dereferences and buffer overflows, enhancing the overall reliability and security of the software [8]. The reason for choosing Rust for the development of the ground segment in satellite communications is that it involves critical tasks such as command execution, telemetry processing, and data storage. By preventing programming errors, Rust helps minimize the risk of crashes, data corruption, and security vulnerabilities. Furthermore, this project requires concurrent handling of multiple tasks simultaneously, such as handling operator requests while communicating with satellites, receiving telemetry, sending commands, and managing data storage. Rust, combined with the Tokio2 framework, provides efficient and scalable solutions for managing concurrent operations in an async environment. Also, real-time processing and low-latency communication are crucial in the ground segment. Rust’s emphasis on low-level control and zero-cost abstractions enables efficient memory management and optimal performance, making it suitable for these demanding requirements. Considering these factors, Rust emerges as the perfect choice for developing the ground segment in satellite communications, as it provides the necessary safety, concurrency, performance, and memory management features required for such critical and complex tasks. Additionally, the Rust community offers an extensive ecosystem of third-party crates, enabling developers to create clean, maintainable, and reusable code. Some notable examples used in this project include: serde3, used for the serialization and deserialization of 1Rust official webpage: https://www.rust-lang.org/. 2Tokio Docs: https://docs.rs/tokio/latest/tokio/. 3serde official webpage: https://serde.rs/. Software design 39 data structures; tracing4, which provides a flexible framework for instrumenting, collecting, and analyzing diagnostic information in applications; anyhow5, for error handling, and endian codec6, for encoding and decoding data in different endianness formats, making it easy to work with binary data in big-endian or little-endian byte order. 3.1.1.1. Async ecosystem with Tokio Tokio is an asynchronous runtime for the Rust programming language, offering a powerful solution for handling concurrent and asynchronous tasks. It provides a multi-threaded runtime for executing asynchronous code, an asynchronous version of the standard library, and a large ecosystem of libraries [7]. The following code demonstrates the usage of Tokio. In the example, two asynchronous tasks are concurrently executed using the tokio::spawn, which means that both tasks are running at the same time. The handles vector stores the tasks, and the program awaits the completion of each task. Tokio’s runtime manages the scheduling and execution of these tasks, ensuring that they make progress concurrently without blocking each other. #[ tokio :: main ] async fn main () { let mut handles = Vec :: new () ; handles . push ( tokio :: spawn ( async { // Async task1 }) ); handles . push ( tokio :: spawn ( async { // Async task2 }) ); for handle in handles . into_iter () { let _ = handle . await ; } } In the project, this behavior is applied to the whole software. The main execution of the Op- Cen program utilizes multiple threads to handle different tasks concurrently. Three threads are distinguished at the top of the program. The first thread is dedicated to supporting the server, which allows operators to make queries and requests. Inside this thread, each time an operator makes a query, a new thread is created and destined to handle their request. This approach enables transparent service provision to multiple operators simultaneously. The second thread is dedicated to periodically updating the TLE of the satellites registered on the system. This ensures that the latest orbital information is available for accurate satellite tracking and management. Most of the time, this thread remains in an idle state, 4tracing Docs: https://docs.rs/tracing/latest/tracing/. 5anyhow Docs: https://docs.rs/anyhow/latest/anyhow/. 6endian codec Docs: https://docs.rs/endian_codec/latest/endian_codec/. 40 Implementation of a flowgraph-based satellite operations software for Earth Observation missions without consuming system resources, and it only becomes active when it’s time to perform the TLE updates according to the predefined refresh interval. Finally, there is a dedicated thread for the Execution Manager, which is responsible for managing the execution of satellite operations. This thread creates and controls individual threads for each satellite, ensuring proper coordination and management of their respective tasks. More detailed information about this process will be provided later. Also, the complexity of this project requires handling many tasks in parallel, and while some tasks can be executed independently of each other, in most cases, there is a need for a mechanism to communicate and exchange information between different threads of the program. To facilitate these communications, channels are used. The Tokio library enables asynchronous communication, which allows for non-blocking execution. For example, if a thread is waiting for a message, it remains inactive, waiting for the arrival of a new message, freeing up resources that can be dedicated to other tasks. The Tokio library provides four different types of channels, three of which will be used throughout the project: •mpsc (multi-producer, single-consumer): This type of channel allows communication between multiple producers and a single consumer. It is useful when multiple threads need to send information to a single receiving thread. •oneshot: This type of channel allows sending a value or an error once from a sending thread to a receiving thread. It is useful when a one-time signal needs to be sent from one thread to another. •broadcast: This type of channel allows sending messages to multiple consumers. Each time a message is sent, all connected consumers will receive a copy of the message. It is useful when a message needs to be sent to multiple recipients. These channels provide efficient and safe mechanisms for communication between threads, enabling effective coordination of tasks and maintaining synchronization in a concurrent environment. 3.1.2. Database Models 3.1.2.1. SQLite Database When deciding on the type of database to use for data storage, the choice between a relational or non-relational database depends on several factors, such as the nature of the data, project requirements, and query needs. A relational database offers a well-defined structure with tables, rows, and columns, and supports complex queries. On the other hand, a non-relational database can handle large volumes of data with a flexible schema and allows queries with high read and write performance. Given the well-defined structure of the data models that will be discussed in the following sections, a relational database has been chosen as the preferred storage solution. Specifically, SQLite7has been selected due to its lightweight nature and simplicity. These qualities make it an ideal choice for efficient storage and management of structured data. 7SQLite webpage: https://sqlite.org/index.html. Software design 41 This type of database provides a structured way to store and manage data. It consists in tables, which are organized structures of rows and columns. Each table represents a specific entity or type of information. Rows contain individual items, and columns represent the attributes or characteristics of those items. Tables can be related to each other to retrieve related information. The rusqlite8library provides a convenient way to integrate SQLite databases into Rust projects. One of its important features is the ability to prevent Structured Query Language (SQL) injection attacks. By using placeholders in the SQL statement and prepared statements, rusqlite ensures that user-provided values are treated as data rather than executable SQL code. This effectively mitigates the risk of SQL injection vulnerabilities, as the user input is properly escaped and quoted. However, in situations where concurrent access to the database is required, such as in an asynchronous environment, proper concurrency mechanisms are necessary to ensure data integrity. This is particularly important because SQLite is an embedded database system that directly reads from and writes to the database file. To address this problem, the combination of the tokio-rusqlite9library and the rusqlite library provides mechanisms for locking and managing concurrent access to the SQLite database. The following example illustrates how a query is performed asynchronously using the aforementioned libraries. The conn.call() method is used to execute the query asynchronously, while the query row() method is employed to retrieve a single row from the result set. The purpose of this specific query is to fetch the TLE of a satellite based on its norad id. If everything goes as planned, the function will return its corresponding TLE. async fn get_tle_satellite ( conn : & Connection , norad_id : i32 ) -> anyhow :: Result <TLE , Error > { let res = conn . call ( move | conn | { conn.query_row( " SELECT tle1 , tle2 FROM satellites WHERE norad_id = ?1", params ![ norad_id ], | row | { let line1: String = row . get (0) . unwrap () ; let line2: String = row . get (1) . unwrap () ; Ok ( TLE { line1 , line2 }) },) }) . await . context (" Failed get TLE " )?; Ok ( res ) } 8rusqlite GitHub repository: https://github.com/rusqlite/rusqlite. 9tokio-rusqlite Docs: https://docs.rs/tokio-rusqlite/latest/tokio_rusqlite/. 42 Implementation of a flowgraph-based satellite operations software for Earth Observation missions 3.1.2.2. Scheduling models Scheduling is responsible for the forecasting and scheduling of satellite contacts. The necessity of establishing a data structure capable of storing all relevant information on such an event is reflected in the table Passes. This table should store relevant information about each pass, including the satellite and GS involved, the timing of the communication, and additional details like the maximum elevation of the satellite. Two additional Database models, Ground station and Satellite, must also be defined. The Ground station table includes fields such as localization, operating frequency range, available bandwidth, and other pertinent information. Similarly, the Satellite table stores data on the satellite’s operating frequencies and bandwidth. This information facilitates the identification of compatible GSs for each satellite based on their respective operational requirements. Figure 3.2: Scheduling Class diagram The Class diagram shown in figure 3.2, defines how the different models will be related. Both, Satellites and Ground station are considered independent entities, while Passes is related to a single satellite and a GS. Taking a closer look at the Satellite database model, the following attributes are established: •norad id: This field is mandatory, and corresponds to the Satellite Catalog Number. This will be the unique identifier of the satellite, which will be used in the Passes table to link a pass to its satellite. Software design 43 •satellite name: This field is only used as a complement to the norad id, this will make the satellites easy to identify on the user’s platform, providing human readability. It corresponds to the object name. •ulfreq: The uplink frequency of the satellite is expressed in Hz, which is the frequency at which the ground transmitter sends the signal to the satellite. •dlfreq: The downlink frequency of the satellite expressed in Hz, refers to the frequency at which the satellite transmits signals back to Earth for reception by the GS antenna. •bandwidth: The spectrum of the signal transmitted by the satellite. It serves to identify which GSs are compatible for data transmission with the satellite, together with the ulfreq and dlfreq. •tle1: Corresponds to the Line1 of the TLE, which contains essential information about the satellite, including its identification number, classification, and orbital information. •tle2: Like the previous field, this corresponds to Line 2 of the TLE. It provides detailed orbital information about the satellite, such as the satellite’s inclination, right ascension of the ascending node, and other information (see Chapter 1.2.3.2.). •tle manual: A flag that indicates whether the origin of the TLE is of manual origin or has been obtained from the Celestrack API. •datetime: Refers to the DateTime in a TLE, that indicates the specific moment in time at which the orbital elements are valid or applicable. •update time: This field, unlike the previous one, provides the date and time at which the TLE data was obtained. It is important to update the TLE used to calculate the satellite’s orbits since it has a limited validity period due to the dynamic nature of orbital motion and the influence of many factors. To achieve precise calculations and predictions, a more up-to-date set of orbital elements is required [2]. Also, for the Ground station, following attributes are defined: •gs id: A unique identifier for the GS. This will later be used in the Passes table to link the pass to its GS. •gs name: Indicates the name of the GS that should be displayed on the user’s platform. •gs location: This field contains the coordinates of the antenna, which are used to calculate the look angles. The latitude, longitude, and altitude are stored in a serialized object. struct Coords { latitude: f64, longitude: f64, altitude: f64, } 50 Implementation of a flowgraph-based satellite operations software for Earth Observation missions saves development time but also allows for the seamless production and consumption of structured data without the need for manual implementation of serialization and deserialization logic. As a result, it simplifies the creation, manipulation, and access of values defined in the schema, making the process easier and more efficient. However, the advantages of Cap’n Proto go much further. One notable feature that it offers is random access, which allows reading just one field of a message without parsing the entire data structure, also it supports zero-copy data transfer, which improves performance and reduces memory consumption. It also checks the structural integrity of the message just like any other serialization protocol would [1]. For Rust, the capnp13 library contains the necessary facilities for reading and writing Cap’n Proto messages. Additionally, the capnpc tool enables the compilation of the data structures, generating Rust code that can be used in the project. Considering the need to share the models between the backend and the frontend, a library has been created to contain these models. This approach enables more efficient and practical utilization of the models in both projects, reducing redundant code and enhancing code reuse. 3.1.4. Date and time format Date and time formats play a critical role in ensuring consistency and interoperability between systems. Inconsistencies in date and time representations can result in software malfunctions, incorrect calculations of satellite orbits, operator confusion, and loss of passes. To mitigate these issues, the RFC 3339 standard format has been chosen as the reference for handling date and time information. RFC 3339: YYYY-MM-DDTHH:MM:SSZ In this way, all dates processed on the server adhere to the Coordinated Universal Time (UTC) zone, providing a common reference point for data consistency. Additionally, this standardization also enables smooth operations with dates in the database. To avoid confusion in the user interface, dates will be displayed in their respective local time zones. However, it’s important to note that before sending requests to the server, these dates must be properly parsed and converted to UTC to maintain consistency and accuracy. 3.1.5. Accesibility The accessibility of the system has been implemented to ensure secure and controlled access, following the access levels defined by the requirements. To achieve this, a combination of Lightweight Directory Access Protocol (LDAP) for authentication and JSON Web Tokens (JWT) for authorization has been employed. LDAP serves as the authentication mechanism, allowing users to verify their identities by validating their credentials against a centralized directory. This directory securely stores user information such as usernames and passwords. When a user attempts to login, their credentials are compared against the LDAP directory to authenticate their identity. Once a user is authenticated, JWT comes into play for authorization purposes. When a successful authentication, the user is issued with a JWT token, which contains encrypted 13Cap’n Proto Github repository: https://github.com/capnproto/capnproto-rust. Software design 51 information about their identity and role. This token is introduced on the header of the subsequent requests, so the server can validate the JWT token to ensure that the user has the necessary permissions and access rights to perform the requested actions. By combining LDAP for authentication and JWT for authorization, the system establishes a robust and secure access control mechanism. LDAP ensures that only authenticated users with valid credentials can have access to the software, while JWT guaranty access based on the user’s role and permissions encoded in the token. 3.2. Software structure The software is structured into two main modules: the server module and the GUI module. The server module is responsible for handling server-side logic and it is the core of the project. While the GUI module focuses on presenting a user-friendly interface and handling user interactions. The server software, named operations, contains both the Scheduling and the Flowgraphbased TT&C backends: •operations – src: This folder holds all the files of the main program. –api: In this folder, the HTTP routes for the different services are defined, including the authentication mechanisms, along with various methods necessary for their proper functioning. –pass scheduling: This folder contains the implementation of the HTTP routes, database queries, and methods related to the Scheduling service. –flowgraph: This folder contains the necessary files for flowgraph editing and visualization. It includes HTTP routes, database queries, and threads for managing WebSockets used in editing and executing flowgraphs. –execution: This folder contains the code for the Execution Manager, Utility, and Background blocks, along with a subfolder that contains the code for the Mission blocks of each satellite mission to be operated. Additionally, the code for the different missions is organized into separate folders, each containing the necessary functions adapted to the specific characteristics, protocols, and requirements of each satellite. ∗main.rs: This file contains the code responsible for initializing the different services offered by the program. It includes the initialization of the database connection, starting the server, and the execution manager. ∗lib.rs: This file defines several modules that encapsulate different functionalities of the software. – tests: In this folder, all the tests are grouped together, including unit tests, integration tests, and any other tests related to the software. ∗gs conf.toml: This configuration file defines the endpoints of the interfaces for the differents GSs. ∗Cargo.toml: Configuration file that specifies various aspects of the package, including its name, version, dependencies, build settings, etc. 52 Implementation of a flowgraph-based satellite operations software for Earth Observation missions The frontend module, named operations egui, has the following structure: •operations egui –api: This folder contains a library that implements all the API endpoints. It is used for the frontend to request information from the server and interact with it. – frontend: This folder contain the code of the GUI. –assets: This folder contains the static assets such as images and js files used in the frontend. –src: This folder contains the frontend source code. –componets: This folder contains reusable User Interface (UI) components that are used throughout the application. It also includes the different pages and views of the application, providing the necessary components for rendering and displaying the user interface. ∗main.rs: It is the main entry point of the frontend application. ∗lib.rs: This file is responsible for managing the views and pages to be displayed. ∗app.rs: This file handles the application’s state and manages the responses received from the server. ∗utils.rs: This file contains styles, visuals, color palettes, and themes used in the application. ∗index.html: Is the main HyperText Markup Language (HTML) file that serves as the entry point for the frontend application, when it is compiled for web application. ∗Cargo.toml: The manifest file specifying dependencies and build configurations. ∗Cargo.toml: The manifest file for the frontend module. In addition to these modules, there is an auxiliary library is used to share functionalities, utilities, and resources between the server and GUI modules. It includes models built with Cap’n Proto for communication between the server and user interfaces, as well as functions for DateTime format conversions. This approach simplifies development, reduces code duplication, and ensures consistency throughout the software, as these functions are used in various parts of both modules. The library named schemas has the following file structure: •schemas –models: This folder holds all the Cap’n Proto models used in the program. ∗auth.capnp: This file contains the bodies of the messages exchanged during the login process. ∗configure flowgraph.capnp: This file contains the request bodies used during the message exchanges in the WebSocket for configuring the flowgraphs. Software design 53 ∗execute flowgraph.capnp: This file contains the request bodies used in the WebSocket for executing the flowgraphs. ∗ground station.capnp: This file contains the models related to the GS requests. ∗satellite.capnp: This file contains the models related to the satellite requests. ∗schedule.capnp: This file contains the models used for the Scheduling API. –src: contains the autogenerated code for the models defined in the Cap’n Proto files, as well as the ”lib” file. ∗lib.rs: This file serves as an entry point for utilizing the Cap’n Proto models and includes the necessary import statements to make these modules accessible within the project. Additionally, it provides a collection of methods that simplify datetime manipulation tasks. These methods handle operations such as converting datetimes between UTC and local time, parsing datetime strings into objects, and formatting datetimes into desired string representations. ∗auth capnp.rs ∗configure flowgraph capnp.rs ∗execute flowgraph capnp.rs ∗ground station capnp.rs ∗satellite capnp.rs ∗schedule capnp.rs ∗build.rs: Script executed during the build process. Responsible for compiling the Cap’n Proto files located in the ”models” folders and generating the corresponding Rust code in the ”src” folder. ∗Cargo.toml: The manifest file for the Rust package. 3.2.1. API Implementation One of the primary threads within the server is the API thread, which has been implemented using the Axum framework. The API thread acts as the entry point for client requests, processing incoming HTTP requests and generating appropriate responses. It handles routing, ensuring that each request is directed to the corresponding endpoint based on the defined routes. The endpoints are responsible for executing the necessary logic to fulfill the client’s request and generate the desired response. The following routes had been defined: •/auth: This route handles the authentication, it contains the endpoint to perform the login and consequently obtain an authentication token. •/schedule: This route is responsible for managing the scheduling of satellite missions and tasks. It provides endpoints to do all the operations related to the satellites, GS, and schedule passes. 54 Implementation of a flowgraph-based satellite operations software for Earth Observation missions •/flowgraph: This route is responsible for handling operations related to the flowgraph configurations. It provides various endpoints to facilitate the management of flowgraph-related tasks within the TT&C software. •/ws/configuration/flowgraph id: This route provides WebSocket endpoints for real-time configuration of the flowgraph identified by the parameter. •/ws/execution/norad id: Similar to the previous route, this route provides Web- Socket endpoints for interacting with the execution of a specific satellite identified by its NORAD ID. A more detailed analysis of each route, method, message body, and access level can be found in Appendix A. Most of the functions that handle operator requests involve reading or writing data from the database. However, some functions have more complex functionality, such as pass prediction, upload mission blocks, and the functionality of the WebSocket. The following sections will provide more detailed explanations of these functionalities. 3.2.1.1. Pass schedule In Section 2.1.3.1., the different options available for predicting passes were discussed, including One pass, Multiple passes, Multiple passes from a specific date, All passes until a specific date, and All passes within a time interval. When making a pass prediction request using the RequestPasss Cap’n Proto model, the operator needs to provide the NORAD ID of the satellite they want to predict passes for, along with their desired prediction option. The data required for the prediction depends on the selected option. For example, if the operator chooses the Multiple passes from a specific date option, they would need to provide the number of passes and the start date for the prediction. In addition to the required data, there are also optional parameters that can be provided. One parameter is the maximum search duration, which is only necessary when the prediction does not have an end date, if this parameter is not provided, a default value of 48 hours is used for the calculation. Another optional parameter is the forced save flag. When conflicts arise between the predicted passes and the saved passes, the default behavior is to not save the predicted passes. However, if the forced save flag is set, only the passes that do not have conflicts will be saved. Once the request is received by the server, and as long as the operator has a valid token with the role of Satellite Operator, the server performs several steps. First, it queries the database to retrieve the TLE data of the satellite. If the satellite exists in the database, the server proceeds to determine the compatible GS and obtains its coordinates. Using the TLE data, the server employs the Rust library called sgp414 to retrieve the Keplerian elements of the satellite’s orbit, as described in Section 1.2.3.2.. It then utilizes the SGP4 model to propagate the orbit, enabling accurate predictions of the satellite’s position and velocity over time. Based on the specified start time provided in the request body or using the current time, depending on the chosen option, the orbital elements of the satellite are propagated to that specific moment in time. By propagating the orbital elements, the position and velocity of the satellite are calculated in the ECI coordinate system. 14SGP4 Docs: https://docs.rs/sgp4/latest/sgp4/. Software design 55 To determine if the satellite is visible from the GS at that particular moment, the process described in Section 1.2.3.3. is executed. Initially, a conversion from ECI to ECEF coordinates takes place. This conversion takes into account the rotation of the Earth and its orientation in space. Once the satellite’s position is in the ECEF coordinate system, further conversion is carried out to obtain the Look Angles. Look Angles coordinates provide the azimuth (horizontal angle), elevation (vertical angle), and slant range (distance) of the satellite relative to the GS, enabling the determination of whether the satellite is within the line-of-sight of the GS’s antenna. This process is continued iterated by incrementing the propagation time in one-second intervals until the satellite’s elevation angle with respect to the GS becomes positive. At this moment, it is considered that the satellite is in line-of-sight of the GS. The next step is to identify when the satellite will no longer be visible. This occurs when the elevation angle becomes negative. The objective is to determine the specific window of time during which communication with the satellite can take place. This process of predicting visibility and communication windows is repeated until reaching either the specified end time or the requested number of passes. Once all the passes have been computed, the next step is to check if any of them conflict with the already stored passes. If no conflict is found, the predicted passes will be stored in the database. However, if a conflict occurs, the passes will only be saved if the force save flag has been requested. In this case, only the passes that do not have any conflicts will be saved. After completing this process, a response containing all the resulting passes is sent back to the operator. This response provides the operator with a list of all the predicted passes and the conflicts found if any. 3.2.1.2. Upload Mission Blocks The program has been designed to be as modular and adaptable as possible in order to operate different satellites with minimal, simple, and fast configuration. In some cases, as mentioned before, it is not always possible to achieve complete modularity because certain satellites require the use of specific protocols for their communications. Therefore, new code must be added to support those satellites. However, in other cases, the code for mission blocks can be used for multiple satellites. The only difference between operating with one satellite or another will be the commands to be sent, as the packet structure and communication protocols are common among these satellites. That’s why it is necessary to be able to upload files with the appropriate configuration. These files are in Tom’s Obvious, Minimal Language (TOML)15 format, tailored to each satellite, and they specify the names and identifiers of the commands and other specifications for their proper functioning. In the following example, a fragment of the TOML configuration file for mission blocks is shown for the 3Cat4 satellite. This file is sent in the request body along with the NORAD ID to specify the desired configuration. The first line specifies that the configuration to be executed for this satellite is the one classified as CubeCat4, and it includes the protocols and message formats required for executing its flowgraph. The subsequent lines define the names and identifiers of the commands, indicating whether they are send command or send file command types. Additionally, the option field can be used to specify any special 15TOML official website: https://toml.io/en/ 56 Implementation of a flowgraph-based satellite operations software for Earth Observation missions execution requirements for a block. For instance, the ”UPDATE TIME” block should include the timestamp of the last packet received by the satellite and the actual timestamp of the GS as the message content. This special behavior is indicated by assigning a number to the option field specifying the processes to be followed in this special case. These processes are defined for each different configuration. [CubeCat4] [[ CubeCat4.send_command]] name = "HELLO" id = 0 [[ CubeCat4.send_command]] name = " UPDATE_TIME " id = 1 option = 0 [[ CubeCat4.send_file_command]] name = "MANAGER_SET_CONF" id = 12 3.2.1.3. Configuration WebSocket The main objective of the configuration WebSocket is to facilitate real-time control of updates and configurations made by the operator on a specific flowgraph. Simultaneously, these changes are reflected in the graphical interfaces of other operators who are also editing the same flowgraph. This serves as a central hub for managing configuration updates, the server allows immediate visibility and synchronization, empowering users to work in collaboration and coordination for the configuration of the flowgraph. The server-side implementation of WebSockets establishes and maintains a continuous connection by dedicating a separate thread to each user. Each thread is further divided into two parts: one exclusively for sending messages and the other for receiving user requests. These tasks are executed independently. When a user sends a request, it is received by the receiving thread, which processes the request and performs the necessary tasks. The result of these actions needs to be transmitted not only to the thread responsible for transmission but also to all users who want to receive updates on the flowgraph. To facilitate this, a communication channel is established to enable the notification of changes to all interested parties. To achieve this multi-producer, multi-consumer communication, a broadcast channel is used. This channel is created when the server starts and is stored in the program’s state to be accessible by all clients. Since the channel is common to all clients, every message carries an identifier indicating the corresponding flowgraph to which the message applies. This allows the transmission thread to filter the messages and send only the relevant information to each client. The broadcast of changes allows for immediate visibility and synchronization, empowering users to work together efficiently on the flowgraph. The server’s role in facilitating real-time communication and dissemination of configuration updates enhances the overall editing experience and ensures consistency across all connected clients. Software design 57 Figure 3.5: (1) The operator sends an update. (2) The server checks and stores the information. (3) The update is sent to the transmission thread. (4) The updates are sent to the operators. The actions that can be performed using this functionality can be grouped into different categories based on their objectives: •Load data: This group includes two messages, the Load Flowgraph and Mission Blocks. These messages are sent directly from the server to the client once the WebSocket connection has been established, providing the necessary information for the client to start working with the flowgraph. The Load Flowgraph contains all the necessary information to load and display in the client interface the saved configuration of the flowgraph. It includes details such as the nodes, connections, settings, and parameters of the flowgraph. While the Mission Blocks message contains a collection of commands and blocks that can be configured for the satellite. •Update configuration: This group contains all actions related to the dynamic editing of the flowgraph. It includes operations such as inserting new blocks, creating connections between them, deleting blocks or connections, moving blocks within the graph, configuring block commands, uploading payload content for block commands, and setting timeouts. When the server receives a configuration update request, it validates the provided data to ensure its correctness. Once validated and saved the changes, the server broadcasts the modifications to all users who are interested in the particular flowgraph. This ensures that the graphical interfaces of all connected users reflect the updated configuration in real-time. •Configure flowgraph modes: This group contains actions related to the configuration of the modes of execution of the flowgraph mentioned in Section 2.2.2., such as adding a new flowgraph to the satellite’s configuration, deleting an existing flowgraph, or updating an existing flowgraph. •Control: This group comprises a single message known as Block edition. This message is specifically intended to block the edition of the flowgraphs when communication with the satellite is initiated. This message prevents any errors that may occur due to parameter modifications during execution. Also, this message aware the operators of the imminent start of satellite communication so that they can make the necessary preparations for it. 58 Implementation of a flowgraph-based satellite operations software for Earth Observation missions 3.2.1.4. Execution WebSocket For the Execution WebSocket, the functionality becomes more complex. In the previous scenario, the operator would send a message, it would be processed, the changes would be saved in the database, and all interested users would be notified. However, in this case, the actions performed have direct implications for the execution flow of satellite communication. The main objective of this WebSocket is to enable real-time monitoring of the processes occurring during satellite communication. This allows the operator to actively control and interact with the execution while simultaneously visualizing the ongoing processes on their graphical interface. Therefore, in this case, it is not the reception thread of the WebSocket that is responsible for notifying other interested operators. Instead, it is the thread executing the satellite’s flowgraph that processes the requests and generates the messages to be sent by the transmission threads of the WebSockets. The messages that can be sent through this WebSocket can be classified into the following groups: •Load data: This group includes messages that facilitate loading the graphical representation of the flowgraph onto the operator’s interface. It consists of the Load Flowgraph message, which contains all the blocks, connections, and configurations, and the Info Time message, providing information about the timing of AOS and LOS events. These messages are sent by the server once the communication is established. •Events: This group comprises messages that are sent by the server when an event occurs, which should be displayed on the operator’s interface to keep them informed about the ongoing processes. The messages in this group include Start Block,End Block,Send Log, and Download File. The Download File message is sent when a new file is generated as a result of an execution event, like the reception of a scientific experiment result, and the operator can download it for further analysis. •Execution control: These messages allow interaction and control over the ongoing execution. The Req Manual Next Block message is sent by the server when a block completes its execution, and there are multiple connected blocks on one of its output pins. In response, the operator needs to provide a Res Manual Next Block message indicating which configured block should be executed next. Additionally, some messages enable stopping the automatic execution of the flowgraph and switching to manual mode. The Manual Execution message is used to transition between automatic and manual modes, while Manual Block creates a block to be executed manually, and Delete Manual Block removes a block from the waiting list. Finally, the Finish message indicates the end of the execution, triggered either by the operator’s request or the occurrence of the LOS event. 3.2.2. TLE automatic update Implementation There is a second thread in the server’s execution responsible for updating the TLE of the satellite at regular intervals over 48 hours. To accomplish this, the server check which Software design 59 satellites have the automatic update flag enabled. For each of these satellites, a request is made to the Celestrak API16 to retrieve the updated TLE data. Regular TLE updates ensure an up-to-date view of the satellite’s orbit and guarantee that the prediction of the passes, the tracking of the satellites, and communication operations will be performed with the most accurate information available. The query to obtain the TLE information from Celestrak is the following, by replacing the {norad id}placeholder with the correct five-digit NORAD ID of the satellite [25]. https://celestrak.org/NORAD/elements/gp.php?CATNR={norad id}&FORMAT=TLE The response of Celestrak’s API includes on Line 0 the name of the satellite, while Lines 1 and 2 contain the first and second lines of the TLE data, respectively. 3.2.3. Execution Manager Implementation The thread containing the Execution Manager can be considered the software’s core, as it houses the most critical components of its logic. It is responsible for overseeing and managing the execution of satellite flowgraphs. Based on the information inputted by operators through the API and the scheduled communications, the Execution Manager takes charge of resource allocation and task planning. This involves coordinating the efficient utilization of execution threads dedicated to each satellite, optimizing the distribution and allocation of resources, and ensuring that there are no conflicts or blocks in the concurrent execution of flowgraphs. At the program’s start, the Execution Manager queries the OpCen database for scheduled passes of the satellites, selecting the one that will occur earlier. Based on this information, it generates a thread for each satellite, which remains in a waiting state until the communication starts time. Additionally, it listens for notifications whenever there are modifications to the pass schedule, ensuring that there is always a thread prepared to execute the communication for the next upcoming pass of each satellite. Simultaneously, it informs the operators about the satellites that are being executed and provides them with the channels through which they can monitor and interact with the execution process. The satellite thread operates by waiting until the execution start time is reached, which is configured to be three minutes before the satellite enters line-of-sight. This three-minute window takes into consideration the operator’s preparation time and the antenna alignment process, as this duration allows the operator to adequately prepare for the execution, and additionally, it provides sufficient time for the GS antenna to align it with the satellite’s position and ensuring an optimal line-of-sight connection, according to the procedures explained in Section 1.2.3.3.. The first step is to inform the Execution Manager that the satellite communication is about to take place so that it can notify the operators and lock the flowgraph configuration for that satellite. Simultaneously, the flowgraph to be executed is selected, taking into account the configured modes and preferences specified in the requirements (see Section 2.2.2.). Along with selecting the flowgraph, the AOS block is obtained, serving as the initial point for executing the mission blocks and establishing the chain of connections. In the case that the satellite does not have any configured flowgraph, the same procedure is followed 16Celestrak webpage: https://celestrak.org/ 66 Implementation of a flowgraph-based satellite operations software for Earth Observation missions Figure 3.12: LOS thread task flow. 3.2.4. Inter-Process communication Throughout the explanation of the implementation, it has been mentioned that the server consists of multiple threads to accommodate the program’s requirements, and information exchange between them is essential for the project’s proper functioning. This necessitates the establishment of communication channels between various software components, as described in Section 3.1.1.1.. Two distinct types of messages can be identified: notification messages (NotifyMsg) and execution messages (ExecutionMsg). Notification messages serve to interact with the Execution Manager, including notifying updates on the OpCen database, responding to operator inquiries regarding the satellite execution state, and providing notifications about the execution status of a flowgraph. On the other hand, execution messages are specifically designed to control the execution processes of specific flowgraphs. The NotifyMsg messages can be classified into three categories: •Update notification: These messages are sent from the Database thread when an operator requests a specific action through the API, which results in a modification in the database that directly affects the satellites controlled by the Execution Manager. These are NextPass, DeletePass, DeleteSatellite, and UpdateNorad and were explained in depth in Section 2.2.3. •Operator messages: This group includes the ReqExecuting and ResExecuting messages, which are exchanged between the operator connected via WebSocket and the Execution Manager. The ReqExecuting message is used to ask about the execution status of a satellite, and the Manager responds accordingly. If the satellite is currently executing or the execution event has started, the Manager informs all connected users by sending a ResExecuting message. In addition, there are the ReqChannelFG and ResChannelFG messages. Once the operator has been notified that a satellite is executing, the operator’s WebSocket Software design 67 thread requests information about the specific flowgraph that is being executed and the channel through which communication can be established with it. The ResChannelFG message provides the operator with the requested information, allowing them to interact with the ongoing execution. •Execution notification: This group includes the StartExecution and FinishExecution messages. These messages are sent from the satellite execution thread to inform the Execution Manager about the initiation and completion of the satellite communication process. The StartExecution message is sent when the communication with the satellite begins, providing information about the selected flowgraph that will be executed. It serves as a notification to the Execution Manager that the execution process has started for a particular satellite. On the other hand, the FinishExecution message is sent when the communication with the satellite is completed and consequently, the Execution Manager marks the current pass as finished and initiates a new thread for executing the next pass of the satellite. Figure 3.13: Exchange of Update notification messages and the resulting behavior between the Database thread and the Execution Manager In the example in Figure 3.14, the operator first queries if a specific satellite is being executed, and the Execution Manager responds that it is not. Then, the communication with the satellite is initiated, and this event is notified by the Satellite thread to the Execution Manager. The Execution Manager, in turn, informs the operator of this event. Subsequently, the ChannelFG messages are exchanged, allowing the operator to start monitoring the execution of the satellite task. 68 Implementation of a flowgraph-based satellite operations software for Earth Observation missions Figure 3.14: Message exchange between the Operator WebSocket, Execution Manager, and Satellite thread. To facilitate communication and enable the transmission and reception of information from various components, it should be set up as a broadcast channel. This allows multiple threads, including those serving operators through the API and those dedicated to satellites tasks, to send information to the Execution Manager. The Execution Manager can then relay relevant information to all connected operators via WebSockets. Using a single channel for these communications simplifies the tasks of the Execution Manager, as it only needs to listen to the channel and respond accordingly when receiving a message. On the other hand, ExecutionMsg can be classified into three groups. The first group is intended for visual and monitoring purposes, allowing operators to see the ongoing processes in their graphical interface. The second group is used to control and interact with the execution, while the last group comprises messages sent from various satellite task threads to inform about events that affect the normal flowgraph execution. These messages are sent through different channels based on their origin and purpose. •Informational messages: These messages are generated by the main thread of the satellite. These messages include informative text to be displayed in the GUI (LogMsg), indicating the start or end of block execution (StartBlock and EndBlock), requesting the selection of the next block to execute (ReqNextBlock), or providing predictions of AOS and LOS events. These messages are received by connected operators through WebSockets and by the backup thread. This channel is created by the Execution Manager, allowing operators to easily ac- Software design 69 quire it through message exchange of type NotifyMsg, specifically using ReqChannelFG and ResChannelFG. This process is necessary because these channels are unique to each thread and dynamically created. Initially, operators only have access to the communication channel that enables them to communicate with the Execution Manager. Furthermore, when an operator establishes their connection with the flowgraph execution, they send a message through the same channel to the Backup thread (ReqExecution). In response, via a dedicated mpsc channel established between the operator and the backup thread, it transmits a list of previously received messages and the sender endpoint, enabling interaction with the main satellite execution. •Intervention messages: These messages influence the flowgraph execution through operator intervention, and can be sent by different operators connected via the Web- Socket interface. These messages are exclusively received and processed by the main flowgraph thread. Therefore, they are sent through an mpsc channel, and the sender information is stored in the backup thread, allowing operators to access them when their connection is established. The operations that can be performed through this channel include sending a ResNextBlock message in response to a ReqNextBlock, indicating the desired next block for execution. Also, operators can send a ManualMode message to switch between automatic and manual execution modes, a ManualBlock message containing the configuration of a mission block to be executed, or a Finish message to terminate the flowgraph execution and communication with the satellite. •Control messages: Control messages are sent from the thread of the flowgraph. These messages, just like informational ones, are transmitted through the same broadcast channel. Despite sharing the channel, it doesn’t pose any issues because each endpoint will only process the messages that are relevant to them while disregarding the rest. The control messages include ReqZMQ and ResZMQ, used to exchange messages sent to or received from the satellite between the flowgraph execution thread and the ZMQ interface; ResCommand, which is received when a ZMQ message is a response to a sent telecommand; Timeout, triggered when the mission block being executed has reached the maximum number of telecommand resend attempts; ITelemetry or HTelemetry, received when new telemetry is obtained from the satellite; ExperimentFile, received when the result of an experiment is obtained; and finally, LOSMsg, which indicates that the satellite is no longer visible to the GS, resulting in the termination of communication. 70 Implementation of a flowgraph-based satellite operations software for Earth Observation missions Figure 3.15: Example exchange of ExecutionMsg during a flowgraph execution 3.3. Graphical User Interface (GUI) Egui17 is a lightweight, immediate mode GUI framework for Rust that enables the creation of native-looking user interfaces. The term ”immediate mode” refers to the fact that the GUI is built from scratch on every frame based on the current state of the application. Therefore, only the visible components are rendered, and interaction with them is immediate, offering great performance and simplicity. Additionally, Egui is designed to be cross-platform compatible, allowing developers to use it on different devices and operating systems, such as Windows or Linux. The combination of Rust’s strong type system and memory safety features with Egui’s design principles leads to reliable and robust frontend development experiences [6]. Furthermore, Egui can be easily compiled into WebAssembly (WASM)18, a binary instruction format that runs with near-native performance and serves as a compilation target for web applications. This feature enables developers to benefit from Egui’s capabilities in web development, delivering native-like user interfaces on the web platform, that can be run in any web browser. Developing the application for the web has the advantage of being accessible from any device with a web browser by simply accessing the web URL. However, in general, desktop 17Egui GitHub repository: https://github.com/emilk/egui. 18WASM official webpage: https://webassembly.org/. Software design 71 applications tend to have better performance compared to those generated with WASM. This is because the browser needs to interpret and translate the code, which can impact performance and resource consumption. Desktop applications can directly access system resources and take advantage of the full power of the user’s device, including CPU, memory, and graphics processing. This direct access often results in better performance and responsiveness compared to web-based applications. The answer to which option is the best for the software interface is that there is no definitive answer. Both options offer different advantages, making them suitable for certain parts of the project and not as ideal for others. The only difference when programming the application for either option lies in how API calls to the server are made. In the case of WASM, JavaScript is used for API calls, while in the desktop application, calls are made directly from the application. This supposes the need to adapt the way that the calls are made while the rest of the logic and layout of the application keep the same for both options. By adding conditional compilation tags #[cfg(not(target arch = "wasm32"))] or #[cfg(target arch = "wasm32")] to the code, it can be specially tailored to any target architecture. This flexibility in development is why the decision was made to create a graphical interface for both options. In this way, the web application allows the Scheduling interface to be accessed by multiple users without the need for a standalone executable. However, for the TT&C software, it is recommended to use the desktop application as it can provide better performance due to the complexity of its operations. The GUI has been designed in a way that all the information displayed in different views is stored in the application’s state, making it accessible from any component. All responses received from the server as a result of operator requests are centrally handled to update the information stored in the app’s state and, consequently, update the content of the views reactively. By centralizing response handling, the application ensures efficient and synchronized updates to the app’s state, thereby reflecting real-time changes in the displayed views. When launching the application, the initial view presented is the login page, where the operator can enter their credentials. In the event of incomplete or incorrect information, an error message is displayed, ensuring operators are promptly informed. Once successful validation of the credentials, a splash screen is displayed while the necessary information is fetched from the server. (a) Login View (b) SplashScreen Figure 3.16: Login and SplashScreen Views 72 Implementation of a flowgraph-based satellite operations software for Earth Observation missions After the loading process, a screen is displayed with a navigation bar at the top, providing access to different components of the Scheduling module, such as the scheduler, satellites, and GS, as well as the TT&C module. The initial screen presents a table, as shown in Figure 3.17, that displays all the scheduled passes. Operators can utilize the interface to program new passes and delete any passes that are not required. Additionally, the table provides filtering options, enabling operators to filter the passes based on specific criteria such as satellite name or NORAD ID, ground station name, or maximum elevation by specifying a threshold. At the bottom of the table, operators can adjust the number of items to display per page and navigate through different pages of the table. Figure 3.17: Programmed passes View From the same screen, operators can program new passes by clicking on the ”New Pass” button. This action opens a window, as shown in Figure 3.18, where operators can schedule a pass with the multiple options explained in Section 2.1.3.1.. (a) One Pass (b) Multiple Passes (c) All Passes Within Time Interval (d) Multiple Passes from Date (e) All Passes Until Date (f) Date Picker Figure 3.18: Scheduling modes Software design 73 At the same time, if the operators want to view the completed passes, they can click on the ”Show past passes” button, and the table will display the completed passes, as shown in Figure 3.19. In the case that any of these passes generated files during communication with the satellite, it will be indicated by the icon. By clicking on this icon, operators can download a zip file containing all the associated files. Figure 3.19: Past passes View Through the navigation bar, operators can access the Satellite Management page. On this page, all the satellites configured by the operator are displayed, as presented in Figure 3.20. The operator can perform various actions on this page, including adding a new satellite by clicking on the green card and entering its details, modifying the NORAD ID, or uploading a configuration file for a specific satellite using the åicon, and editing or deleting a satellite using the and icons respectively. Figure 3.20: Satellites View 74 Implementation of a flowgraph-based satellite operations software for Earth Observation missions As before, operators can access the GS Management page through the navigation bar. On this page, all the registered GS are displayed, including their basic information such as location and operational frequency ranges. Additionally, operators have the option to view and/or modify the status of the GS using a toggle switch, as shown in Figure 3.21. Figure 3.21: Ground Stations View Lastly, operators can access the page dedicated to the TT&C module, where a list of all satellites with configured flowgraphs is displayed. From this page, operators can view upcoming passes for a specific satellite and the selected flowgraph for execution, by clicking in the ñicon, as shown in Figure 3.22. When a flowgraph is about to start or is currently running, a icon is displayed, providing access to the execution visualization. Figure 3.22: Flowgraph menu View By selecting one of the satellites displayed on the list, the flowgraph editor page opens, as shown in Figure 3.24. The top left of the screen displays the NORAD ID of the edited satellite, along with the date and time of the last update and the remaining time until the satellite’s execution begins. This window also provides information about the currently configured flowgraph, and provides access to a menu that lists all the flowgraphs associated with the satellite, from where can be modified their configurations, or create new ones, as illustrated in Figure 3.23. Software design 75 Figure 3.23: Flowgraph Modes Configuration On the other hand, the top right of the screen displays the scheduled passes for the selected satellite and provides information about the time window during which the satellite will be in line-of-sight, as well as the associated flowgraph that will be executed during that pass. The flowgraph editor page provides operators with the necessary tools to configure the sequence of blocks that will be executed during the mission. Operators can easily add new blocks, customize commands, upload payload files for the commands, interconnect the blocks, and perform various other actions. Figure 3.24: Flowgraph configuration View During an ongoing communication session with the selected satellite, operators will have access to the execution control screen, depicted in Figure 3.25. This screen offers a real-time view of the running flowgraph, allowing operators to monitor and track the performance of the flowgraph. Executed blocks are visually distinguished by a green color, while blocks currently in progress are highlighted in yellow and unexecuted blocks are presented in gray, providing a clear visual representation of the flowgraph’s execution progress. Furthermore, the top-right window provides access to the manual mode controls, from which operators are allowed to temporarily halt the execution process and send messages manually, the logs screen, and additionally, operators can also download files generated during the communication with the satellite. 82 Implementation of a flowgraph-based satellite operations software for Earth Observation missions 4.2.1. AES Encryption AES is a symmetric encryption algorithm. It operates on fixed-size blocks of data, typically 128 bits, and uses a secret key to perform encryption and decryption. AES employs multiple rounds of substitution, permutation, and mixing operations to transform the plaintext into ciphertext. The strength of AES lies in its key size, with options for 128-bit, 192-bit, and 256-bit keys. The encryption process involves applying mathematical operations to the data and key, creating a complex and secure transformation that is computationally difficult to reverse without the correct key. AES provides a high level of security and is recognized as a standard encryption algorithm for sensitive information [23]. In the case of 3Cat-4, a 128-bit key is used to encrypt the header of the command. Before encryption, it is required to compute the CRC32 with both the header and the content, as it is included in the command header. 4.3. Telemetry Telemetry transmitted by the satellite can be present in two different formats: Instantaneous Telemetry and Historic Telemetry. Instantaneous Telemetry provides a complete snapshot of the satellite’s current state. It includes a wide range of detailed information, such as sensor readings, system statuses, power levels, temperature measurements, and more. This real-time telemetry allows ground operators to monitor the satellite’s health and performance in great detail. This type of telemetry is transmitted in messages of the IT HT BEACON and IT BEACON types. The telemetry payload within these messages has a fixed length of 308 bytes. On the other hand, Historic Telemetry offers a condensed and simplified version of the telemetry data collected over a period of time. This format contains a summarized view of the satellite’s past performance, and provides valuable insights into the satellite’s longterm behavior, enabling operators to analyze its performance over extended periods, even in cases where there was no direct communication with the satellite. This type of telemetry is sent together with the instantaneous telemetry in an IT HT BEACON packet or separately upon operator request in an RHTpacket. To optimize data transmission and storage, Historic Telemetry is typically sent in blocks that contain a certain number of messages. These blocks are compressed using the POCKET+ algorithm, which reduces the data size without significant loss of critical information. When decompressed, these messages have a length of 111 bytes of information. 4.3.1. POCKET+ algorithm POCKET+ is an efficient compression and decompression algorithm developed by the ESA specifically designed for compressing time series data generated for status monitoring. It is particularly well-suited for compressing fixed-length data structures, such as housekeeping telemetry data from spacecraft, while considering limitations in resources and bandwidth during communication between the spacecraft and the GS. The compression process employed by the satellite involves several steps to optimize the Case study: 3Cat-4 83 transmission and storage of data. Initially, when a new packet is generated, it undergoes an XOR operation with a reference packet. This operation allows for the separation of the bits into predictable and unpredictable categories based on the information provided in the mask packet. Any predictable bit value that is not the same as the reference data value is immediately classed as nonpredictable (Negative Mask Update), while any non-predictable that has the same value as the reference data value over a tracking period will be classed as predictable in the next tracking period (Positive Mask Update). The positive and negative mask updates are sent to the receiver in the form of counters, followed by the corresponding non-predictable bit values sent in the clear. Once the compressed packet is created, it can be transmitted or stored as required. The mask is updated at every iteration and thus the data redundancy is constantly tracked. Unexpected changes are dealt with immediately but it takes at least one tracking period of consistent positive results to declare a bit predictable again. Thus the robustness of the system is increased while the performance and stability are kept. Figure 4.3: Compressed packet [24]. For decompression, the one that must be done in the OpCen software to obtain the telemetry data, a model of the mask is maintained and updated with the counters arriving in every packet. These can be positive updates and/or negative updates and/or absolute values. This mask is then used to indicate which bits in the non-predictable field of the compressed packet should be inserted into a copy of the reference packet. Thanks to the update rules the reference packet can be any packet of that type successfully received in the present or last tracking period [24]. 84 Implementation of a flowgraph-based satellite operations software for Earth Observation missions CHAPTER 5. TESTING AND VERIFICATION The complexity of this project, coupled with the requirement for scalability, demands thorough testing to ensure the proper functioning of each component. These tests are not only crucial for guaranteeing the project’s integrity but also serve to validate the preservation of existing functionality during future developments. This chapter provides an overview of the testing procedures conducted in the project. It starts with unit tests, which focus on testing small functions. It then progresses to integration tests, which verify the behavior of more complex features. Finally, it includes verifications of proper functionality for all the software modules, including the GUI, and concludes with testing in a real-case scenario. 5.1. Unit tests Unit tests are designed to assess small components or units of software. This approach is well-suited for most of the API operations of the Scheduling module, as they primarily involve CRUD operations (create, read, update, delete) on database instances. This type of testing has been employed to validate the behavior of functions responsible for accessing database resources and to ensure that any future developments do not impact the existing functionality. During the design of these tests, two challenges were encountered. The first challenge was that all tests are executed in parallel, which impossibilities sharing a single database for all the tests, as using a single database could lead to interference between the tests. To overcome this challenge, a separate database is generated for each test, and it is deleted at the end of the test. To facilitate this approach, the test-context1library has been used, which provides a convenient way to manage the setup and teardown of resources specific to each test, ensuring isolation and avoiding interference between tests. During the test setup phase, a database is created and populated with test data. The function under test is then executed, and the resulting operation is validated to ensure it produces the expected outcome. Finally, in the teardown phase, the test database is deleted to clean up resources and prepare for subsequent tests. The second challenge arises from the fact that Rust does not natively support testing asynchronous code. However, this issue has been successfully resolved by utilizing the async-trait2library, which has made it possible to guarantee the correct behavior and functionality of asynchronous operations within the project. 5.2. Integration tests Integration tests are designed to evaluate the interaction and integration between different components. These tests have been used to verify the correctness of the pass scheduling process. This process involves multiple steps, such as interpreting the type of request made by the operator, retrieving the satellite’s TLE from the database, selecting a GS, 1test-context Docs: https://docs.rs/test-context/latest/test_context/ 2async-trait Docs: https://docs.rs/async-trait/latest/async_trait/ 85 86 Implementation of a flowgraph-based satellite operations software for Earth Observation missions Figure 5.1: Unit Tests results. calculating the predicted passes based on the requested parameters, checking for conflicts with previously scheduled passes, and finally saving the predicted passes. To verify that the obtained results in the pass prediction are as expected, the communications widows had been calculated using the Gpredict3program as a reference. A margin of error has been allowed to account for slight differences between both predictions. Additionally, different scenarios have been tested, including cases without conflicts where the passes should be saved, cases with conflicts, and extreme situations where the satellite will never be visible to the ground station. Figure 5.2: Integration Tests results. 5.3. Verification tests The verification tests have focused on the core functionalities of each module in the OpCen software. For the scheduling and TT&C modules, the tests have aimed to validate the accuracy of the tracking and orbital prediction functions. In addition, for the TT&C module, the tests have also focused on ensuring that the editing and execution of flowgraphs work properly through the GUI. Lastly, for the Data Downlink and Storage module, the tests have verified that the telemetry and experiment data sent by the satellite are decoded correctly and accessible to the operators. 3Gpredict: http://gpredict.oz9aec.net/ Testing and verification 87 5.3.1. Orbit prediction and Tracking To validate the results obtained from the calculations performed by the software, the Gpredict application has been used. Gpredict is a powerful tool that provides fast and accurate real-time satellite tracking using the NORAD SGP4/SDP4 algorithms and also tracks satellites relative to different observer locations [21]. When verifying the accuracy of orbit predictions, it is important to consider that the SGP4 model, which has been the one implemented in the OpCen software, is specifically optimized for computing orbits in Low Earth Orbit (LEO), which typically range from a few hundred kilometers up to around 2,000 kilometers above the Earth’s surface. One wellknown satellite operating in this orbit is the International Space Station (ISS). Figure 5.3 shows how the ground track of three orbit predictions performed by the OpCen software matches the prediction obtained with Gpredict. (a) Orbit prediction OpCen. (b) Orbit prediction Gpredict. Figure 5.3: Ground Track verification ISS. However, conducting a more detailed analysis reveals valuable insights. Table 5.1 presents the communication window predictions for the passes scheduled on 10/7/2023 at the Montsec GS. The calculations of the times, azimuth angles, and elevation angles exhibit a close alignment, demonstrating the accurate performance of the system. 88 Implementation of a flowgraph-based satellite operations software for Earth Observation missions OpCen Gpredict AOS LOS Max El AOS Az LOS Az AOS LOS Max El AOS Az LOS Az 00:20:22 00:30:14 17.22º286.04º56.35º00:20:21 00:30:13 17.22º286.04º56.31º 01:58:01 02:07:59 18.46º305.28º78.29º01:58:00 02:07:58 18.46º305.22º78.25º 03:34:52 03:45:43 56.94º306.12º115.66º03:34:51 03:45:41 56.92º306.12º115.63º 05:11:54 05:21:39 17.98º291.66º162.95º05:11:53 05:21:38 17.98º291.67º162.97º 20:18:46 20:28:05 14.30º190.71º71.22º20:18:44 20:28:04 14.30º190.78º71.21º 21:54:23 22:05:15 70.69º239.57º54.72º21:54:22 22:05:14 70.68º239.55º54.72º 23:32:00 23:42:04 19.76º278.22º53.89º23:31:59 23:42:03 19.76º278.17º53.86º Table 5.1: Passes prediction ISS 10/07/2023. Additionally, an analysis of the Look Angles for the first identified pass confirms the effective performance of the antenna tracking. Figure 5.4 provides a visual representation of the Look Angles, showcasing the consistent and reliable tracking capabilities of the OpCen software. (a) Tracking OpCen. (b) Tracking Gpredict. Figure 5.4: Tracking verification ISS. 5.3.2. GUI Testing: Flowgraph Editing and Execution To perform this test, two terminals were utilized, one running the desktop application and the other running the web application, allowing the verification of functionality on both platforms. The verification process began by ensuring the correct saving and retrieval of configurations made by the operator, enabling the reproduction and visualization of the flowgraph in the GUI. Additionally, the synchronization between multiple users has been examined to confirm that simultaneous editing of the same flowgraph is possible, with changes being accurately reflected in the GUI for all users. Following the configuration phase, an execution test has been conducted. The ZMQ endpoints responsible for sending and receiving messages from the satellite were connected to a dummy server that simulated the transmission of real satellite messages previously recorded. This test aimed to evaluate the functionality of the GUI in handling and processing the received messages sent by the OpCen software. Additionally, it allowed for testing the execution process of the blocks within the flowgraph, ensuring that the desired operations and interactions between components were properly executed. Testing and verification 89 5.3.3. Data decoding verification The main objective was to verify the proper decoding of the files and telemetry sent by the 3Cat-4 satellite. This involved comparing the data obtained by the OpCen software with the data provided by the satellite’s own software. By ensuring that the decoded data matched, it was confirmed that the OpCen software accurately decoded and processed the information transmitted by the satellite. 5.4. Real case scenario The objective of this test is to validate the functionality of the TT&C module in a real environment. The test will be conducted at the UPC NanoSat Lab facilities, utilizing a dummy GS equipped with a PlutoSDR. PlutoSDR4is a versatile Software-defined radio (SDR) device developed by Analog Devices. It offers a wide frequency range and can transmit and receive various signals. In this context, the PlutoSDR will be used to transmit the messages between the GS and the 3Cat-4 satellite, which is currently in the lab’s facilities. Scenario Figure 5.5: Test Scenario. The operator utilizes the OpCen software GUI to configure the flowgraph and monitor the communication process, while Grafana is used to visualize the received telemetry data. The GUI communicates with the OpCen server via websockets (1), while the OpCen server communicates with the dummy GS using ZMQ sockets (2). Within the dummy GS, two scripts are running: GNU Radio and plutozmq. GNU Radio5 is a free and open-source software development toolkit that handles signal processing tasks and provides a variety of blocks for creating radio systems in software. The GNU Radio script converts the bits received from the OpCen (2) into a modulated signal with amplitude, phase, and frequency (3), and vice versa. The plutozmq script manages the PlutoSDR board, redirecting its inputs and outputs to the GNU Radio script. 4Pluto SDR: https://wiki.analog.com/university/tools/pluto/devs/embedded_code 5GNU Radio Wiki: https://wiki.gnuradio.org/index.php/Main_Page 90 Implementation of a flowgraph-based satellite operations software for Earth Observation missions The PlutoSDR board transforms the processed bits (4) into a voltage signal, which is then upconverted to the transmitting frequency and amplified (5). The antenna transmits these signals, which are received by the satellite. Additionally, to ensure the correct transmission between the GS and the satellite, an additional PlutoSDR device is used to listen to the communication frequency channel (437.35 MHz). This device connects via USB (6), and with the help of the open-source software GQRX SDR6, the communications can be visualized for monitoring and verification purposes. Results The successful test results demonstrate that the TT&C module operates effectively in a real environment. The communication between the GS and the 3Cat-4 satellite was successfully established using the dummy GS. All commands were processed correctly by the satellite, and the exchange of messages was completed successfully. Throughout the test, the operator utilized the OpCen software GUI to configure the flowgraph and monitor the communication process. The operator had the capability to pause the execution and switch to manual mode when required. The telemetry data received from the satellite was accurately received and decoded. The data was then visualized in Grafana. The test’s positive outcome demonstrates the functionality and reliability of the TT&C module in facilitating communication between the GS and the satellite. 6Gqrx SDR: https://gqrx.dk/ CHAPTER 6. CONCLUSIONS AND FUTURE WORK This project focused on establishing the foundations for the creation of an OpCen capable of supporting multiple satellite missions and facilitating coordination between different GS. The implementation of the OpCen aimed to centralize the management of both satellite and GS operations, and it needed to be a scalable and flexible platform to adapt to the needs of current and future missions. The main objective was to reduce the operator’s workload through a graphical interface that simplified ground segment tasks. This interface would provide a design tool to configure specific commands and processes during communications, as well as a control function to visualize and monitor ongoing processes. The goal was to reduce the probability of human errors and improve operational efficiency. This project began by creating a module for orbit calculations to predict satellite communication windows. Through this module, the operator could input satellite data and schedule one or multiple passes with compatible GS. Simultaneously, a module was developed to support the TT&C area. In this module, the operator was provided with the capability to design message chains to be exchanged with the satellite, allowing them to interconnect blocks and create a customized flowgraph. This functionality enabled efficient and flexible configuration and control of satellite communications, tailored to the specific needs of each mission. The flowgraph design provided an intuitive and visual graphical interface, facilitating the understanding and configuration of interactions between the operator and the satellite. Currently, this feature is only available for communications with the 3Cat-4 satellite. However, by introducing the necessary code for encoding and decoding messages and protocols from other satellites, it will be able to provide the same support to them. Furthermore, based on the scheduled passes created by the operator, the software is capable of autonomously establishing a connection with the satellite, allowing for communications at any time of the day. The execution of the flowgraph takes into account the received information to direct the flow of operations. Finally, all processed and generated information during the execution is saved for later visualization and analysis. Additionally, this project has been one of the first projects carried out by the UPC NanoSat Lab using the Rust programming language. This required an in-depth study of its capabilities and the available libraries that best suited the project’s requirements. The choice of Rust as the programming language was based on its focus on safety, performance, and concurrency, making it an ideal option for critical applications such as satellite operations management. It has been confirmed that Rust indeed has a promising future in this field. 91 Request Passes Description: Schedule the passes for the given satellite based on the requested mode, only if the stored configuration of the satellite is supported by any of the ground stations and if there is no conflict with those already programmed. Method: PUT Path:/schedule Auth: Ground Station Manager Body:RequestPass (maxSearchDuration is optional, by default 48 hours) Answers: •200 OK →PassList •400 BAD REQUEST •401 UNAUTHORIZED •404 NOT FOUND →(Unable to find the specified satellite or a compatible ground station for the given satellite) •406 NOT ACCEPTABLE →(Error occurred while retrieving the TLE from the database, decoding the elements, or computing the Keplerian elements) •409 CONFLICT →(Scheduling could not be successfully completed because one or more passes have conflicted with the already scheduled ones) Delete Pass Description: Deletes the existing pass identified by the pass id parameter. Method: DELETE Path:/schedule Auth: Ground Station Manager Body: - Answers: •200 OK •401 UNAUTHORIZED •404 NOT FOUND Get all past passes Description: Returns a list of 101 finished passes, sorted from most recent to least recent, starting from index*100. Method: GET Path:/schedule/past/:index Auth: - Body: - Answers: •200 OK →PassList •400 BAD REQUEST Get all satellites Description: Returns a list of all satellites stored in the database. Method: GET Path:/schedule/satellites Auth: - Body: - Answers: •200 OK →SatelliteList Add Satellite Description: Creates a new satellite and stores it in the database using the provided configuration. Method: POST Path:/schedule/satellites Auth: Ground Station Manager Body:Satellite Answers: •200 OK •400 BAD REQUEST •401 UNAUTHORIZED •404 NOT FOUND →(Failed to download TLE data for the registered satellite) Edit Satellite Description: Rewrites the information of an existing satellite with the one provided in the request. Method: PUT Path:/schedule/satellites Auth: Ground Station Manager Body:Satellite Answers: •200 OK •400 BAD REQUEST •401 UNAUTHORIZED •404 NOT FOUND →(Failed to download TLE data for the updated satellite) Update TLE Satellite Description: Update the TLE of the satellite identified by the norad id parameter if the satellite has the automatic download TLE flag configured. Method: PUT Path:/schedule/satellites/:norad id Auth: Ground Station Manager Body: - Answers: •200 OK •400 BAD REQUEST →(The satellite does not have the automatic flag set) •401 UNAUTHORIZED •404 NOT FOUND →(Failed to download TLE data for the updated satellite) Delete Satellite Description: Deletes the satellite identified with the specified norad id parameter. Method: DELETE Path:/schedule/satellites/:norad id Auth: Ground Station Manager Body: - Answers: •200 OK •401 UNAUTHORIZED •404 NOT FOUND Update Satellite NORAD ID Description: Update the NORAD ID of the satellite identified by the norad id parameter and replace it with the norad id new parameter if the satellite is not currently performing a pass. Method: POST Path:/schedule/satellites/:norad id/:norad id new Auth: Ground Station Manager Body: - Answers: •200 OK •401 UNAUTHORIZED •404 NOT FOUND •406 NOT ACCEPTABLE →(Satellite is currently executing a pass) Get all Ground Stations Description: Returns a list of all the ground stations stored in the database. Method: GET Path:/schecule/gs Auth: - Body: - Answers: •200 OK →GroundStationList Update operative state Ground Station Description: Update the operational flag of the ground station if it exists. Method: PUT Path:/schecule/gs Auth: Ground Station Manager Body:GroundStation (Only the gsId and operative fields are necessary) Answers: •200 OK •400 BAD REQUEST •401 UNAUTHORIZED •404 NOT FOUND A.3. Flowgraph-based TT&C endpoints Get all Satellites (with a flowgraph configured) Description: Returns a list of all satellites that have at least one configured flowgraph, ordered by their last update timestamp. Method: GET Path:/flowgraph Auth: Satellite operator & Telemetry Expert Body: - Answers: •200 OK →FlowgraphList •401 UNAUTHORIZED Create new Flowgraph Description: Create the first flowgraph for the desired satellite if none has been configured yet, with the Acquisition of Sight block already instantiated and the default mode configured. Method: POST Path:/flowgraph Auth: Satellite operator Body:Flowgraph (Only the name and noradId fields are necessary) Answers: •200 OK →Flowgraph •400 BAD REQUEST •401 UNAUTHORIZED •406 NOT ACCEPTABLE →(Already exists one flowgraph for the satellite) Upload Mission Blocks Description: Upload a file containing the information for the desired mission block execution to be selected during the flowgraph execution, along with a list of all the commands. Method: PUT Path:/flowgraph Auth: Satellite operator Body:MissionBlockFile Answers: •200 OK →Edition (operationType: missionBlock) •400 BAD REQUEST •401 UNAUTHORIZED •406 NOT ACCEPTABLE →(Error reading the import file) Get all Flowgraphs Satellite Description: Obtain all the flowgraphs associated with the satellite identified by the norad id parameter. Method: GET Path:/flowgraph/:norad id Auth: Satellite operator Body: - Answers: •200 OK →FlowgraphList •401 UNAUTHORIZED •404 NOT FOUND Delete Flowgraphs Satellite Description: Delete all flowgraphs associated with the satellite. Method: DELETE Path:/flowgraph/:norad id Auth: Satellite operator Body: - Answers: •200 OK •401 UNAUTHORIZED •404 NOT FOUND Test Satellite execution Description: Starts the execution of the flowgraph using the Ground Station of the test environment. Method: GET Path:/flowgraph/test/:norad id/:flowgraph id Auth: Satellite operator Body: - Answers: •200 OK •401 UNAUTHORIZED •404 NOT FOUND Websocket configuration interface Description: Allows configuring the flowgraph identified by the flowgraph id parameter. All operations performed are validated and accepted by the server, which sends updates to all users connected to the socket, enabling collaborative configuration. Path:/ws/configuration/:flowgraph id Auth: Satellite operator Message format:Edition Websocket execution interface Description: Allows viewing and controlling the execution of the flowgraph for the satellite identified by the norad id parameter. Path:/ws/execution/:norad id Auth: Satellite operator (all functionalities) & Telemetry Expert (only receive messages and request files) Message format:Execution A.4. Cap’n Proto Models auth.capnp @0xa53401f35b9c1292; struct User { username @0 : Text; password @1 : Text; } struct Roles { token @0 : Text; satelliteOperator @1 : Bool; groundStationManager @2 : Bool; telemetryExpert @3 : Bool; } ground station.capnp @0xde755e0b536afcda; struct GroundStationList { list @0 : List(GroundStation); } struct GroundStation { gsId @0 : Int32; gsName @1 : Text; gsLocation @2 : Coords; ulfreqMax @3 : UInt32; ulfreqMin @4 : UInt32; dlfreqMax @5 : UInt32; dlfreqMin @6 : UInt32; bandwidth @7 : UInt32; operative @8 : Bool; } struct Coords { latitude @0 : Float64; longitude @1 : Float64; altitude @2 : Float64; } schedule.capnp @0xf47587b04aae443e; struct RequestPass { noradId @0 : Int32; maxSearchDuration @1 : UInt32; forcedSave @2 : Bool; requestType : union { onePass @3 : Void; multiplePasses : group { numPasses @4 : UInt32; } allPassesUntil : group { end @5 : Text; } allPassesInterval : group { start @6 : Text; end @7 : Text; } multiplePassesFrom : group { numPasses @8 : UInt32; start @9 : Text; } } } struct TLE { objectName @0 : Text; line1 @1 : Text; line2 @2 : Text; } struct PassList { list @0 : List(PassData); } struct PassData { id @0 : Int32; noradId @1 : Int32; startTime @2 : Text; endTime @3 : Text; aos @4 : Text; los @5 : Text; maxElevation @6 : Float64; aosAzimuth @7 : Float64; losAzimuth @8 : Float64; conflict @9 : Bool; satName @10 : Text; gsName @11 : Text; logPath @12 : Text; } òDate time format is YYYY-MM-DDTHH:MM:SSZ (Example: 2023-06-18T16:30:20+00:00) satellite.capnp @0xee66025180549fc4; struct SatelliteList { list @0 : List(Satellite); } struct Satellite { noradId @0 : Int32; satelliteName @1 : Text; ulfreq @2 : UInt32; dlfreq @3 : UInt32; bandwidth @4 : UInt32; tle : union { manual : group { line1 @5 : Text; line2 @6 : Text; } automatic : group { datetime @7 : Text; updateTime @8 : Text; } } } configure flowgraph.capnp @0x89bf19e6c1a7021f; struct Edition { lastEdit @0 : Text; operationType : union { newBlock : group { operationId @1 : UInt32; blockId @2 : Int32; blockDefinition @3 : Text; positionX @4 : Float32; positionY @5 : Float32; command @6 : Text; outputType @7 : Text; } newConnection : group { originId @8 : Int32; output @9 : Text; destinationId @10 : Int32; input @11 : Text; } uploadFile : group { blockId @12 : Int32; file @13 : Text; data @14 : Data;