Skip to content

cansat-team-tejas/flight-software

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Team Tejas CanSat Firmware

Overview

Firmware for the Teensy 4.1 based CanSat platform handling sensors (BMP280, MPU6050, HMC5883, INA226, MICS-5524, L89 GNSS), telemetry via XBee, and SD logging.

Key Features

  • Single persistent SD logging directory: Flight_<TEAM_ID>
  • Telemetry CSV line ends with last command echo (cmd_echo)
  • SD command gating while telemetry active
  • Lightweight command dispatcher with conditional immediate response sending
  • Altitude fusion (baro + GPS) with filtering
  • Optimized GPS handling for 7semi L89 module

GPS (L89) Optimization

Implemented lean logic in gps.cpp:

  • Configurable constants in constants.h:
    • GPS_BAUD_RATE (boot baud, default 9600)
    • GPS_HIGH_BAUD_RATE (optional 115200 if future reconfiguration added)
    • GPS_FIX_STALE_MS (default 1500 ms) marks data stale when no fresh sentences parsed
    • GPS_MIN_UPDATE_INTERVAL_MS throttles telemetry structure writes (default 200 ms)
  • Tracks last_fix_ms and only marks a fix valid when a fresh valid sentence arrives.
  • If stale, telemetry forced to sentinel values: lat=0, lon=0, altitude=-1000, satellites=0.
  • Avoids unnecessary field updates more often than the configured interval.

Build

Use PlatformIO (Teensy 4.1). Example (PowerShell):

pio run

Or VS Code task: "Build CanSat Project".

Next Steps (Optional)

  • Add dynamic GPS baud escalation (send module config to switch to 115200 then Serial2.updateBaudRate) if desired.
  • Add checksum or CRC to telemetry lines.
  • Implement binary telemetry mode.

Directory Structure (Partial)

  • src/main.cpp – entrypoint
  • lib/ – modular subsystem libraries
  • lib/gps/ – GPS logic (gps.cpp, gps.h)
  • lib/constants/constants.h – system-wide constants & command strings
  • lib/storage/ – SD logging

License

See LICENSE file.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors