# ebner62/metal_hawk2a_embedded architecture

> Architecture diagram of the GitHub repository ebner62/metal_hawk2a_embedded, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ebner62/metal_hawk2a_embedded
- Repository: https://github.com/ebner62/metal_hawk2a_embedded

## Overview

This is embedded flight software for an autonomous CanSat glider. The principal workflow is sensor and ground-station input into the flight loop, which advances flight states, logs and downlinks telemetry, and coordinates guidance, release, and steering actions. Navigation.h implements path geometry and steering calculations; the README documents the broader flight capabilities. The main sketch was not excerpted, so its internal wiring is represented only where the README explicitly describes it.

Main entry points: [`Metal_Hawk2a_Embedded.ino`](https://github.com/ebner62/metal_hawk2a_embedded/blob/main/Metal_Hawk2a_Embedded.ino) (Flight Loop), [`Navigation.h`](https://github.com/ebner62/metal_hawk2a_embedded/blob/main/Navigation.h) (Steering Control)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_flight["Flight Control"]
  node_flight_loop["Flight Loop"]
  node_state_machine["Flight State Machine"]
  node_state_stages["Flight Stages"]
end

subgraph group_sensing["Sensing and Telemetry"]
  node_sensor_fusion["Sensor Updates"]
  node_telemetry["Telemetry Downlink"]
  node_commands["Command Handling"]
end

subgraph group_guidance["Guidance and Actuation"]
  node_navigation["Navigation Geometry<br/>[Navigation.h]"]
  node_path_planning["Path Planning<br/>[Navigation.h]"]
  node_steering["Steering Control<br/>[Navigation.h]"]
  node_servos["Flight Servos"]
  node_release["Payload Release"]
  node_cameras["Camera Triggers"]
end

subgraph group_persistence["Storage and Recovery"]
  node_storage[("Flight Storage")]
  node_state_restore["State Restoration"]
end

node_ground(("Ground Station"))
node_sensors["Flight Sensors"]

node_sensors -->|"sensor input"| node_flight_loop
node_ground -->|"sends commands"| node_commands
node_commands -->|"command input"| node_flight_loop
node_flight_loop -->|"updates sensors"| node_sensor_fusion
node_sensor_fusion -->|"provides readings"| node_flight_loop
node_flight_loop -->|"advances states"| node_state_machine
node_state_machine -->|"governs stages"| node_state_stages
node_flight_loop -->|"sends telemetry"| node_telemetry
node_telemetry -->|"serial downlink"| node_ground
node_flight_loop -->|"logs flight data"| node_storage
node_flight_loop -->|"persists state"| node_state_restore
node_state_restore -->|"uses EEPROM and SD"| node_storage
node_flight_loop -->|"uses navigation math"| node_navigation
node_navigation -->|"computes paths"| node_path_planning
node_path_planning -->|"provides targets"| node_steering
node_flight_loop -->|"adjusts guidance"| node_steering
node_steering -->|"controls surfaces"| node_servos
node_flight_loop -->|"triggers deployment"| node_release
node_flight_loop -->|"triggers cameras"| node_cameras

click node_flight_loop "https://github.com/ebner62/metal_hawk2a_embedded/blob/main/Metal_Hawk2a_Embedded.ino"
click node_state_machine "https://github.com/ebner62/metal_hawk2a_embedded/blob/main/Metal_Hawk2a_Embedded.ino"
click node_state_stages "https://github.com/ebner62/metal_hawk2a_embedded/blob/main/Metal_Hawk2a_Embedded.ino"
click node_sensor_fusion "https://github.com/ebner62/metal_hawk2a_embedded/blob/main/Metal_Hawk2a_Embedded.ino"
click node_telemetry "https://github.com/ebner62/metal_hawk2a_embedded/blob/main/Metal_Hawk2a_Embedded.ino"
click node_commands "https://github.com/ebner62/metal_hawk2a_embedded/blob/main/Metal_Hawk2a_Embedded.ino"
click node_storage "https://github.com/ebner62/metal_hawk2a_embedded/blob/main/Metal_Hawk2a_Embedded.ino"
click node_state_restore "https://github.com/ebner62/metal_hawk2a_embedded/blob/main/Metal_Hawk2a_Embedded.ino"
click node_navigation "https://github.com/ebner62/metal_hawk2a_embedded/blob/main/Navigation.h"
click node_path_planning "https://github.com/ebner62/metal_hawk2a_embedded/blob/main/Navigation.h"
click node_steering "https://github.com/ebner62/metal_hawk2a_embedded/blob/main/Navigation.h"
click node_servos "https://github.com/ebner62/metal_hawk2a_embedded/blob/main/Metal_Hawk2a_Embedded.ino"
click node_release "https://github.com/ebner62/metal_hawk2a_embedded/blob/main/Metal_Hawk2a_Embedded.ino"
click node_cameras "https://github.com/ebner62/metal_hawk2a_embedded/blob/main/Metal_Hawk2a_Embedded.ino"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_flight_loop,node_state_machine,node_state_stages toneBlue
class node_sensor_fusion,node_telemetry,node_commands toneAmber
class node_navigation,node_path_planning,node_steering,node_servos,node_release,node_cameras toneMint
class node_storage,node_state_restore toneRose
class node_ground,node_sensors toneIndigo
```

## Components

### Flight Control

- [Flight Loop](https://github.com/ebner62/metal_hawk2a_embedded/blob/main/Metal_Hawk2a_Embedded.ino): `Metal_Hawk2a_Embedded.ino`
- [Flight State Machine](https://github.com/ebner62/metal_hawk2a_embedded/blob/main/Metal_Hawk2a_Embedded.ino): `Metal_Hawk2a_Embedded.ino`
- [Flight Stages](https://github.com/ebner62/metal_hawk2a_embedded/blob/main/Metal_Hawk2a_Embedded.ino): `Metal_Hawk2a_Embedded.ino`

### Sensing and Telemetry

- [Sensor Updates](https://github.com/ebner62/metal_hawk2a_embedded/blob/main/Metal_Hawk2a_Embedded.ino): `Metal_Hawk2a_Embedded.ino`
- [Telemetry Downlink](https://github.com/ebner62/metal_hawk2a_embedded/blob/main/Metal_Hawk2a_Embedded.ino): `Metal_Hawk2a_Embedded.ino`
- [Command Handling](https://github.com/ebner62/metal_hawk2a_embedded/blob/main/Metal_Hawk2a_Embedded.ino): `Metal_Hawk2a_Embedded.ino`

### Guidance and Actuation

- [Navigation Geometry](https://github.com/ebner62/metal_hawk2a_embedded/blob/main/Navigation.h): `Navigation.h`
- [Path Planning](https://github.com/ebner62/metal_hawk2a_embedded/blob/main/Navigation.h): `Navigation.h`
- [Steering Control](https://github.com/ebner62/metal_hawk2a_embedded/blob/main/Navigation.h): `Navigation.h`
- [Flight Servos](https://github.com/ebner62/metal_hawk2a_embedded/blob/main/Metal_Hawk2a_Embedded.ino): `Metal_Hawk2a_Embedded.ino`
- [Payload Release](https://github.com/ebner62/metal_hawk2a_embedded/blob/main/Metal_Hawk2a_Embedded.ino): `Metal_Hawk2a_Embedded.ino`
- [Camera Triggers](https://github.com/ebner62/metal_hawk2a_embedded/blob/main/Metal_Hawk2a_Embedded.ino): `Metal_Hawk2a_Embedded.ino`

### Storage and Recovery

- [Flight Storage](https://github.com/ebner62/metal_hawk2a_embedded/blob/main/Metal_Hawk2a_Embedded.ino): `Metal_Hawk2a_Embedded.ino`
- [State Restoration](https://github.com/ebner62/metal_hawk2a_embedded/blob/main/Metal_Hawk2a_Embedded.ino): `Metal_Hawk2a_Embedded.ino`

### Other components

- **Ground Station**
- **Flight Sensors**

## Connections

- Flight Sensors → Flight Loop: sensor input (evidence: `README.md`)
- Ground Station → Command Handling: sends commands (evidence: `README.md`)
- Command Handling → Flight Loop: command input (evidence: `README.md`)
- Flight Loop → Sensor Updates: updates sensors (evidence: `README.md`)
- Sensor Updates → Flight Loop: provides readings (evidence: `README.md`)
- Flight Loop → Flight State Machine: advances states (evidence: `README.md`)
- Flight State Machine → Flight Stages: governs stages (evidence: `README.md`)
- Flight Loop → Telemetry Downlink: sends telemetry (evidence: `README.md`)
- Telemetry Downlink → Ground Station: serial downlink (evidence: `README.md`)
- Flight Loop → Flight Storage: logs flight data (evidence: `README.md`)
- Flight Loop → State Restoration: persists state (evidence: `README.md`)
- State Restoration → Flight Storage: uses EEPROM and SD (evidence: `README.md`)
- Flight Loop → Navigation Geometry: uses navigation math (evidence: `README.md`)
- Navigation Geometry → Path Planning: computes paths (evidence: `Navigation.h`)
- Path Planning → Steering Control: provides targets (evidence: `Navigation.h`)
- Flight Loop → Steering Control: adjusts guidance (evidence: `README.md`)
- Steering Control → Flight Servos: controls surfaces (evidence: `README.md`)
- Flight Loop → Payload Release: triggers deployment (evidence: `README.md`)
- Flight Loop → Camera Triggers: triggers cameras (evidence: `README.md`)
