How andre-stemper/atmonsat works
AtMonSat is a host/target anomaly-detection testbed with a portable C++ algorithm and PC and STM32 backends. The principal workflow sends datapoints from the host through a target data link and object protocol; a datapoint callback runs the detector, which interpolates and windows sensor values, invokes a TensorFlow Lite Micro model, scores prediction error with Mahalanobis distance, and applies a threshold before returning detection and timing results. The README documents these stages; some backend implementations and the host notebooks are not in the supplied tree or excerpts, so uncertain runtime links are dashed.
Main entry points: protocol.h Object protocol · atmonsat_anomaly_detection.cc Anomaly detector · atmonsat_testbench.cc Backend callbacks · protocol_datalink_pipe.cc PC pipe link
Components 19
Host testbed
- Notebook control
Target communication
- Object protocol
firmwares/atmonsat_common_sources/protocol.h - Protocol commands
firmwares/atmonsat_common_sources/protocol_definitions.h - PC pipe link
firmwares/atmonsat_common_sources/protocol_datalink_pipe.cc - STM32 USART link
firmwares/atmonsat_common_sources/protocol_datalink_stm32_usart.cc
Detection pipeline
- Backend callbacks
firmwares/atmonsat_common_sources/atmonsat_testbench.cc - Anomaly detector
firmwares/atmonsat_common_sources/atmonsat_anomaly_detection.cc - ISLCC interpolation
firmwares/atmonsat_common_sources/islcc_interpolator.h - Data windows
firmwares/atmonsat_common_sources/datawindow.h - Datapoint values
firmwares/atmonsat_common_sources/datapoint.h - TFLite model
firmwares/atmonsat_common_sources/atmonsat_model.cc - Mahalanobis score
firmwares/atmonsat_common_sources/mahalanobis.h - Anomaly threshold
firmwares/atmonsat_common_sources/threshold.h - Output reporting
firmwares/atmonsat_common_sources/atmonsat_output_handler.cc
Platform runtime
- PC backend
firmwares/atmonsat_common_sources/main_native.cc - STM32 backend
firmwares/atmonsat_common_sources/main_stm32.cc - FreeRTOS backend
firmwares/atmonsat_common_sources/main_stm32_freertos.cc - Execution timing
firmwares/atmonsat_common_sources/time_metric.h
Other components
- Experiment operator
Connections 21
- Experiment operator → Notebook control: configures experiment
- Notebook control → PC pipe link: selects PC link
- Notebook control → STM32 USART link: selects target link
- PC pipe link → Object protocol: transports bytes
- STM32 USART link → Object protocol: forwards bytes
- Object protocol → Protocol commands: uses command IDs
firmwares/atmonsat_common_sources/protocol.h - Object protocol → Backend callbacks: dispatches objects
- Backend callbacks → Anomaly detector: runs iteration
- Backend callbacks → Execution timing: measures execution
- Anomaly detector → ISLCC interpolation: interpolates inputs
firmwares/atmonsat_common_sources/atmonsat_anomaly_detection.cc - Anomaly detector → Data windows: forms input windows
firmwares/atmonsat_common_sources/atmonsat_anomaly_detection.cc - Anomaly detector → TFLite model: invokes inference
- Anomaly detector → Mahalanobis score: scores prediction error
firmwares/atmonsat_common_sources/atmonsat_anomaly_detection.cc - Anomaly detector → Anomaly threshold: decides anomaly
firmwares/atmonsat_common_sources/atmonsat_anomaly_detection.cc - ISLCC interpolation → Datapoint values: processes datapoints
firmwares/atmonsat_common_sources/islcc_interpolator.h - Data windows → Datapoint values: stores datapoints
firmwares/atmonsat_common_sources/datawindow.h - Anomaly detector → Output reporting: reports results
- Backend callbacks → Object protocol: returns replies
- PC backend → Object protocol: uses backend protocol
- STM32 backend → Object protocol: uses backend protocol
- FreeRTOS backend → Object protocol: uses backend protocol