# Software Architecture

The software architecture of BLOB is designed as a layered system that enables autonomous operation, intelligent data processing, and reliable communication. This multi-tiered approach allows for separation of concerns, making the system more maintainable, upgradable, and resilient to failures.

## Firmware Layer

At the foundation of BLOB's software stack is the firmware layer, which provides direct control over the hardware components. This low-level software manages the precise movements of the fin propulsion system, optimizing thrust and maneuverability while minimizing energy consumption. The firmware implements sophisticated control algorithms that adapt to changing water conditions, maintaining stable movement patterns even in turbulent environments.

Power management is another critical function of the firmware layer. It continuously monitors battery levels and power consumption rates, dynamically adjusting system operations to extend mission duration. When battery levels approach predefined thresholds, the firmware initiates power-saving protocols, potentially reducing sensor sampling rates or computational loads to ensure sufficient energy remains for safe return to the charging station.

The data acquisition functions within the firmware layer handle the precise timing and synchronization of sensor readings. This ensures that measurements from different sensors can be accurately correlated, creating a coherent multi-parameter snapshot of environmental conditions at specific locations and times. The firmware also performs initial data validation, filtering out obviously erroneous readings before they enter the higher processing layers.

## Operating System Layer

Built upon the firmware foundation is a Linux-based operating system environment that provides standard interfaces and services for higher-level applications. This OS layer manages system resources, schedules tasks, and facilitates inter-process communication. The use of a containerized approach isolates different software components, preventing cascading failures and allowing individual modules to be updated or replaced without affecting the entire system.

The containerization strategy also enhances security by limiting the potential impact of any compromised component. Each container operates with only the permissions and resource access necessary for its specific function, implementing the principle of least privilege throughout the system architecture.

## Mission Control Layer

The Mission Control layer represents the tactical intelligence of BLOB, handling navigation, obstacle avoidance, and mission planning. This layer translates high-level mission objectives (such as "survey area X with pattern Y") into specific movement commands and sensor operations. It continuously processes navigational data to maintain awareness of BLOB's position relative to its surroundings and mission objectives.

The obstacle avoidance system within this layer uses sensor inputs to detect potential collision hazards and calculates safe trajectories around them. This system employs predictive algorithms that anticipate the movement of dynamic obstacles such as vessels or marine life, maintaining a safe distance while continuing mission operations whenever possible.

Mission planning functions optimize patrol routes to maximize coverage efficiency and data quality while minimizing energy consumption. The system can adaptively modify planned routes based on real-time findings, such as dedicating additional time to areas where anomalies are detected or environmental gradients are steep.

## AI Modules

The AI modules represent the analytical intelligence of BLOB, processing the collected sensor data to extract meaningful insights. These modules leverage machine learning models that have been trained on extensive historical datasets to recognize patterns and anomalies across various parameters.

The movement prediction module analyzes current patterns and historical data to forecast how water and sediment will move within the monitored area. These predictions help port operators anticipate changes to navigation channels and plan maintenance activities proactively rather than reactively.

Sediment and chemistry anomaly detection functions continuously compare incoming measurements against established baselines, identifying unusual conditions that may indicate environmental concerns or infrastructure issues. The system distinguishes between normal variations and significant anomalies, reducing false alarms while ensuring important changes are flagged for human attention.

Current profiling and mapping capabilities transform raw data into comprehensive visualizations of water movement throughout the port environment. These visualizations help operators understand complex hydrodynamic patterns that influence vessel navigation, sediment transport, and contaminant dispersion.

## Communication Systems

BLOB employs a dual-mode communication strategy to maintain connectivity across different operational scenarios. When submerged, the system uses underwater acoustic communication to transmit essential status updates and critical findings. This acoustic channel has limited bandwidth but provides reliable connectivity without requiring BLOB to surface, maintaining continuous monitoring operations.

For comprehensive data transmission, BLOB periodically surfaces to utilize above-water communication channels. The system supports both 5G cellular connectivity in areas with coverage and satellite uplinks for more remote deployments. These high-bandwidth connections allow for the transmission of complete datasets, software updates, and detailed mission instructions.

The communication systems implement robust encryption and authentication protocols to ensure data security and prevent unauthorized access or control of the BLOB platform. All transmissions are digitally signed and encrypted using industry-standard cryptographic methods, protecting both the integrity and confidentiality of the collected data.
