NovaLink is a high-performance, reliable two-way communication software package designed to establish a seamless link between a model rocket's flight computer and a ground control station during flight. Engineered to handle real-time data transmission in challenging environments prone to noise and interference, NovaLink enhances rocket telemetry by ensuring robust and efficient communication.
- Real-Time Communication: Facilitates timely transmission of commands from the ground to the rocket and telemetry data from the rocket back to the ground.
- Reliability: Ensures data integrity and minimizes packet loss with robust error detection and correction mechanisms.
- Performance Optimization: Achieves low latency and efficient CPU usage to meet the stringent timing requirements of active control systems.
- Flexibility and Modularity: Features an abstraction layer supporting various physical communication interfaces and easy integration into diverse systems.
-
Command Structure:
- Unique Command Identifiers: Each command is assigned a unique number (e.g., 101 for a fin test).
- Header Bytes:
- First Byte: Contains sender and receiver IDs, enabling multiple devices to communicate on the same network without confusion.
- Second Byte: Acts as a payload descriptor, indicating the type of command or telemetry data.
- Payload: Contains command-specific parameters, optimized for size and precision using appropriate data types (e.g., 16-bit integers for voltages in millivolts).
- Command Acknowledgment: Implements an acknowledgment system where the receiver confirms receipt of commands. Unacknowledged commands are stored with timestamps and retransmitted until acknowledged or timed out.
-
Telemetry Structure:
- Multiple Payload Types: Supports different telemetry payloads (e.g., Telemetry A, B) identified by unique descriptors.
- Data Fields:
- Voltage Measurements: Uses unsigned 16-bit integers to represent voltages with millivolt precision.
- Position, Velocity, Acceleration: Uses signed 16-bit integers with scaling factors to balance range and precision.
- Memory Usage: Represents percentages using unsigned 8-bit integers.
- Status Flags: Packs multiple boolean values into a single byte using bit manipulation.
-
Packet Structure:
- Start Byte: A fixed value (170 decimal) that signals the beginning of a packet.
- Payload Length Byte: Includes the length of the payload and a checksum for error detection.
- COBS Byte: Utilizes Consistent Overhead Byte Stuffing (COBS) to prevent the start byte value from appearing in the payload.
- Payload: Contains the AVC-encoded data.
- Checksum Byte: Calculated over the payload to detect errors.
-
Error Handling:
- Checksum Verification: Ensures that the payload has not been corrupted during transmission.
- COBS Encoding: Prevents misinterpretation of the start byte within the payload, avoiding synchronization issues.
- Payload Length and COBS Byte Checksums: Additional checksums verify the integrity of critical packet components.
-
Supported Devices:
- XBee Pro 900 HP Radio: A 900 MHz radio module commonly used for telemetry.
- RFD900 Radio Module: An alternative that may offer different performance characteristics.
-
Implementation:
- RadioInterface Class: Defines a generic interface with methods for sending and receiving data, configuring settings, and monitoring status.
- Specific Drivers: (e.g.,
XBeePro900HP
,RFD900
) inherit fromRadioInterface
and implement hardware-specific functionality.
-
Command Queue:
- Implements a priority-based queue to manage outgoing commands.
- Prioritizes critical commands over less urgent ones.
- Handles timeouts and retransmissions based on acknowledgments received.
-
Telemetry Buffer:
- Uses a circular buffer to store incoming telemetry data efficiently.
- Ensures that the most recent data is readily accessible while older data is overwritten as needed.
-
Thread-Safe Operations:
- Employs synchronization mechanisms (e.g., mutexes, lock-free structures) to allow safe access to shared resources in a multithreaded environment.
-
Low Latency and High Throughput:
- Aims for processing latency under 10 milliseconds and the ability to handle at least 100 packets per second.
-
Efficient Memory Management:
- Uses memory pools to reduce the overhead of frequent dynamic memory allocations.
-
Lock-Free Algorithms:
- Implements lock-free data structures where possible to minimize synchronization overhead and avoid bottlenecks.
-
Critical Path Optimization:
- Profiles and optimizes performance-critical sections of code to reduce CPU usage (targeting less than 5% on typical embedded processors).
-
Link Quality Metrics:
- Monitors signal strength, noise levels, and other parameters to assess the health of the communication link.
-
Packet Loss Tracking:
- Keeps statistics on sent, received, and lost packets to identify issues.
-
Latency Measurement:
- Measures round-trip times and processing delays to ensure that the system meets real-time requirements.
-
Logging:
- Provides detailed logs for debugging and analysis using a centralized logging utility.
-
User-Friendly Interface:
- Offers a clear and intuitive API for initializing the communication system, sending commands, and receiving telemetry data.
-
Event Callbacks:
- Allows users to register callback functions that are invoked upon specific events (e.g., new telemetry received, command acknowledgment).
-
Comprehensive Documentation:
- Includes detailed documentation and examples to facilitate integration with other systems.
-
Cross-Platform Compatibility:
- Designed to work on both Linux (for the ground station) and real-time operating systems used by the flight computer.
-
Reliable Communication in Harsh Environments:
- Challenge: Radio communications during rocket flight are subject to interference, signal attenuation, and other issues.
- Solution: Implement robust error detection and correction mechanisms within the SCALPEL protocol, use checksums, and design the system to handle packet loss gracefully.
-
Efficient Use of Limited Resources:
- Challenge: Embedded systems on the rocket have limited processing power and memory.
- Solution: Optimize code for performance, use efficient data structures, and minimize CPU and memory usage through techniques like memory pooling and lock-free algorithms.
-
Synchronization and Timing:
- Challenge: Real-time systems require precise timing and synchronization to function correctly.
- Solution: Use high-resolution timers, prioritize critical tasks, and design the system to meet stringent timing constraints.
-
Scalability and Flexibility:
- Challenge: The system should be adaptable to different hardware configurations and future upgrades.
- Solution: Abstract hardware-specific details using interfaces, allowing for easy integration of new radio modules or communication mediums without significant code changes.
During a Rocket Launch:
-
Pre-Launch:
- The ground control station sends a series of commands to the rocket to configure systems, perform pre-flight checks, or initiate calibration routines.
- NovaLink ensures these commands are reliably transmitted, acknowledged, and any necessary retransmissions are handled automatically.
-
In Flight:
- The rocket's flight computer continuously sends telemetry data back to the ground station.
- This data includes critical parameters such as altitude, speed, orientation, system voltages, and status flags indicating the health of various subsystems.
- The ground station uses this data to monitor the rocket's performance in real time and can send commands to adjust flight parameters if necessary.
-
Post-Flight:
- After the rocket lands, the system may continue to transmit data or receive commands for post-flight analysis and data retrieval.
-
Initialization:
- The NovaLink main class initializes all components, sets up the physical layer interface, and prepares the system for communication.
-
Command Transmission:
- Commands are created and passed to the CommandManager, which queues them based on priority.
- The AVCProtocol encodes the commands, which are then packetized by the SCALPEL layer.
- The packet is transmitted via the physical layer (radio module), where the hardware driver handles the low-level transmission details.
-
Telemetry Reception:
- Incoming data is received by the radio module and passed up to the SCALPEL layer.
- The SCALPEL layer unpacks the packet, verifies checksums, and passes the payload to the AVCProtocol.
- The AVCProtocol decodes the telemetry data, which is then stored in the TelemetryBuffer.
- Event callbacks notify the ground station software of new telemetry data for processing or display.
-
Error Handling and Retransmission:
- If errors are detected (e.g., checksum failures), the system handles them according to predefined policies (e.g., request retransmission, log the error).
- The CommandManager handles retransmission of unacknowledged commands based on timeouts.
- Programming Language: C++17 or later, leveraging modern language features for performance and safety.
- Build System: CMake, for cross-platform build configuration and management.
- Multithreading: Utilizes C++11 threading libraries for concurrent operations.
- Synchronization Primitives: Employs mutexes, condition variables, and atomic operations to ensure thread safety.
- Enhanced Reliability: Robust protocols and error handling mechanisms reduce the risk of communication failures.
- Real-Time Performance: Optimized for low latency and high throughput, meeting the demands of active control systems.
- Flexibility: Hardware abstraction allows for easy adaptation to different communication interfaces and future technologies.
- Ease of Integration: A well-designed API and comprehensive documentation simplify the integration process with other software systems.
- Scalability: Modular design enables the system to be extended or modified with minimal impact on existing components.
- C++17 Compiler: Ensure you have a compatible C++17 compiler installed.
- CMake: Version 3.10 or later.
- Supported Radio Modules: XBee Pro 900 HP or RFD900.
-
Clone the Repository:
git clone https://github.com/yourusername/NovaLink.git cd NovaLink
-
Build the Project:
mkdir build cd build cmake .. make
-
Configure Radio Module:
- Follow the instructions in the
docs/
directory to configure your specific radio module.
- Follow the instructions in the
-
Initialize NovaLink:
#include "NovaLink.h" int main() { NovaLink novaLink; novaLink.initialize(); // Additional setup... }
-
Send Commands:
Command cmd = createFinTestCommand(); novaLink.sendCommand(cmd);
-
Receive Telemetry:
novaLink.registerTelemetryCallback([](Telemetry data) { // Process telemetry data });
For detailed examples and API documentation, refer to the Documentation folder.
Contributions are welcome! Please follow these steps:
- Fork the Repository
- Create a Feature Branch:
git checkout -b feature/YourFeature
- Commit Your Changes:
git commit -m "Add your feature"
- Push to the Branch:
git push origin feature/YourFeature
- Open a Pull Request
Please see our Contributing Guidelines for more details.
This project is licensed under the MIT License. See the LICENSE file for details.
- Special thanks to Lafayette Systems for the inspiration behind this project.
For questions or support, please open an issue on GitHub Issues or contact [email protected].