Skip to main content

Module aerospacenu_gs

Module aerospacenu_gs 

Source
Expand description

AerospaceNU’s ground station’s text: the club’s flight computer board’s radio downlink, one packet a line, as the ground station parsed it.

AerospaceNU, Northeastern University’s rocketry club, flies a flight computer board (the FCB) that sends its readings to a ground station by radio, and publishes the ground station’s text beside its flights’ logs. No published document describes the packets or their units, so every unit a field’s name doesn’t state comes from two checks on the file’s own values that don’t depend on each other (ADR-258 §2, the rule that a unit needs two checks), and a unit no two checks settle is kept as written. The club’s per-flight summaries aren’t read and aren’t a check: they exist for few flights and needn’t match the packets the ground station received.

Layout. A RUN START line with the ground station’s local date and time when it started, then one line a packet or message, each opening with the ground station’s time of day when it received it (invented values; the fields shortened):

RUN START 2025-01-01 10:00:00

10:00:01.250000: Switching radio to band 1
10:00:01.512345: Position Data {'radio_id': 0, 'rssi': '-50 db', 'crc': 'Good', 'time_stamp_ms': 61000, 'fcb_altitude': 0.25, 'v_speed': 0.0, …}
10:00:01.733210: Alt Info & Cfg {'crc': 'Good', 'time_stamp_ms': 61200, 'barometer_pressure': 0.9677…, …}

A packet is its name, then its fields as a Python dictionary literal: text in quotes, numbers, True, False, None, nan, inf and lists. The reader parses that literal itself, bounded: a line over MAX_LINE_BYTES bytes, lists or dictionaries nested more than 8 deep or holding more than 1,024 items, a key that isn’t text or is given twice, make the line unreadable, and it is skipped and counted in a note. So is a line whose literal doesn’t parse, one that isn’t a packet or a message, and a second RUN START. A message, a line with a time and no dictionary, such as Switching radio to band 1 or the ground station’s Invalid message type … and Packet too short …, is skipped and counted.

Corrupt packets. Every packet from the board carries crc, the ground station’s verdict on its radio checksum. A packet whose crc isn’t 'Good' is left out, counted in a note: its bytes failed the check, and in the sample files such packets hold a callsign with stray characters, clocks billions of milliseconds off and readings of 10³⁰. Values in a 'Good' packet are kept as written but for the checks below.

Channels. Every numeric field of every packet is a channel named <packet>.<field>, as Position Data.fcb_altitude, each on its packets’ own times; an element of a list is <packet>.<field>[i], and True and False read 1 and 0. A field holding text isn’t a channel but for rssi ('-50 db', read as its number), Hdop (a number in quotes) and gps_time ('YYYY-MM-DD HH:MM:SS', read as its time of day); the others, such as callsign, crc and gps_string, the raw NMEA sentence of GPS Passthrough, are left out, named in a note. None, nan and inf are gaps, counted. A field the reader doesn’t know is kept as written, Quantity::Unrecognized, named in a note for its packet. At most MAX_CHANNELS channels are kept; values past them, and fields with names over 64 characters, are counted in a note.

PacketFieldRead asUnit, and from where
every board packettime_stamp_msthe clock (below)ms, from its name and the ground station’s clock
every board packetradio_id, lqi, software_version, board_serial_number, rssiQuantity::Numberas written (rssi in dB, as its text says)
Position Datafcb_altitudeQuantity::AltitudeAboveGround: the primary trackm, from the barometer and the coast (below)
Position Datav_speedQuantity::Speed, up positive: FlightLog::vertical_speed_m_sm/s, from the barometer and the coast (below)
Position Datafcb_latitude, fcb_longitudeQuantity::Latitude, Quantity::Longitudedegrees, from their range and their fractions (below)
Position Datagps_timeQuantity::TimeOfDaythe time of day it writes, in whatever time zone
Position Datagps_sats, fcb_state_number, ble_clientQuantity::Numberas written; no source gives the state codes’ meanings
Position Datatemperature, fcb_battery_voltage, gps_alt, ground_speed, course_over_groundQuantity::Unrecognizedkept as written (below)
Orientationaccel_x, accel_y, accel_zQuantity::Accelerationm/s², from the pad’s gravity and the barometer (below)
Orientationrot_vel_x, rot_vel_y, rot_vel_zQuantity::AngularRaterad/s, from the board’s turning and its tilt (below)
Orientationangle_verticalQuantity::Angledegrees, from its range and the accelerometer (below)
Orientationorientation_quaternion[i], fcb_state_numberQuantity::Numbera quaternion’s parts have no unit
Orientationroll, pitch, yaw, orientation_rpy[i], magnetic_field_*Quantity::Unrecognizedkept as written (below)
Alt Info & Cfgbarometer_pressure, barometer_2_pressureQuantity::Pressureatm, from their size and their step (below)
Alt Info & Cfgpress_refQuantity::Pressureatm, from its size and the barometer’s (below)
Alt Info & Cfgground_elev, ground_temp, pitot_ducer_pressQuantity::Unrecognizedkept as written (below)
Pyro Infopyro_continuity[i], pyro_status[i], flash_usageQuantity::Numberas written
Ground Station GPS, Groundstation Statusgs_baroQuantity::Pressureatm, from its size and its step (below)
Ground Station GPS, Groundstation Statusgs_lat, gs_lonQuantity::Latitude, Quantity::Longitudedegrees, as the board’s position
Ground Station GPS, Groundstation Statusgs_alt, gs_tempQuantity::Unrecognizedkept as written (below)
GPS PassthroughLatitude, LongitudeQuantity::Latitude, Quantity::Longitudedegrees, as the board’s position
GPS PassthroughSatellites, HdopQuantity::Numberas written
GPS PassthroughGPS AltQuantity::Unrecognizedkept as written (below)

The line cutters’ packets (Line Cutter Data, Line Cutter Vars) and CLI Data hold fields no source describes: each is kept as written. The board and ground station packets have no events: no source gives the state codes’ or pyro flags’ meanings.

The clock. A board packet’s time_stamp_ms is the board’s clock, in milliseconds by its name. The ground station’s time of day on each line is a second clock, of known unit, that the board’s is checked against: the gap between them, the time the ground station received a packet less the time the board stamped it, holds steady to within the radio’s latency, under a second in the sample files, and steps where the board restarted and its clock began again. The reader cuts the packets, in the file’s order, into stretches where that gap stays within 2 s of the stretch’s first; over the stretch spanning most of the ground station’s clock, at least 20 s, the board’s clock must advance 0.8 to 1.25 s for each second of the ground station’s, where a clock in seconds, centiseconds or microseconds would be 10 or more times off (in the sample files, within 0.4% of 1). Then each packet’s time is the board’s stamp placed on the ground station’s clock by its stretch’s median gap, from the RUN START line’s time: the board’s clock for the steps between samples, the ground station’s to put stretches after a restart in order. Otherwise every packet takes the time the ground station received it, the board’s clocks are kept as written as channels, and a note says why. A packet without a board stamp, as the ground station’s own Ground Station GPS, takes the time it was received. A line’s time of day before the line above’s by more than 12 hours is taken to be the next day.

Units decided by two checks. A unit a field’s name doesn’t state is read only where two checks that don’t depend on each other agree, each note saying which and with what evidence; otherwise the field is kept as written, Quantity::Unrecognized, with a note:

  • The pressures (barometer_pressure, barometer_2_pressure, gs_baro) are read in atmospheres, × 101,325 Pa, by their size and their step. Size: the first value lies within 0.4935 to 1.1, a pad’s pressure (50,000 to 110,000 Pa, the bounds crate::rrc3 argues for) in atmospheres or in bars, and in no other unit a barometer is written in (pascals, hectopascals, kilopascals, psi or inches of mercury are 10 or more times off). Step: the board reads whole pascals and divides by 101,325, so each value times 101,325 lies within the value’s own rounding of a whole number: half a unit in the last place of the 32-bit float the board sends (2⁻²⁴ near 1, so 0.003 to 0.006 Pa), or of the 64-bit float where the value isn’t a 32-bit one, as gs_baro’s aren’t. Atmospheres are taken where at least 99% of at least 10 distinct non-zero values pass at 101,325 and at most 10% pass at 100,000, the step bars would leave; a value off any such step passes either by chance about once in a hundred. In the sample files every value passes at 101,325 and at most 1.6% at 100,000. The pad’s pressure altitude against the GPS isn’t a check: the weather moves it as far as atmospheres and bars are apart, 110 m near sea level.
  • press_ref, the board’s reference pressure, is read in atmospheres where its size passes as above and its first value lies within 0.5% of barometer_pressure’s in the same packet, read in atmospheres: atmospheres and bars are 1.3% apart, and the two are read at one place and time, so no weather comes between them (within 0.08% in the sample files). It is an average, not one reading, so it has no step to check.
  • fcb_altitude is read in meters by the barometer and the coast. The barometer: from barometer_pressure’s first value, on the pad, to its lowest, the climb in the U.S. Standard Atmosphere, 1976 (hpr_atmos::ussa76), against fcb_altitude’s between the Position Data packets nearest those two, within 0.5 s, must lie within 25%; feet, 3.28 times off, can’t, and a climb beyond 25% refuses the file (LogError::Unit). The coast: an upward coast slows at standard gravity and more, as drag adds to it, so from the later sample of the column’s fastest step (of those at most 1 s long), the end of the boost, to its highest value, which leaves out a parachute opened at apogee, the least-squares parabola’s deceleration must lie within a factor of 1.8 of 9.806 65 m/s² either way, at least 5 samples across at least 1 s; read in meters, a column in feet would slow 3.28 g or more (1.8² = 3.24). A parachute opened before apogee, or a coast too short to fit, fails the check and keeps the column; it can’t make feet pass. The barometer checks the column against the pressure and the coast against gravity and the clock, so neither depends on the other. A climb under 10 m, no pressure read in atmospheres, or a coast too short or outside the band keeps fcb_altitude as written, the record’s altitude track empty. In the sample files the column climbs 1.006 to 1.090 times the barometer and its coast slows 1.08 to 1.28 g.
  • v_speed is read in meters per second by the barometer and the coast, neither of which looks at fcb_altitude, whose unit is as unknown. The barometer: over its ascent, from its lowest pressure back to where the pressure last began to fall, the climb in the standard atmosphere must lie within 25% of the speed’s integral over the same times, at least 10 m, the speed taken as a straight line between samples, across gaps in the reception too, as a coast’s speed falls nearly in a line (the longest step bridged is named in the note; 7.1 s in one sample file). The coast: from its highest value to its first at or below 0 after it, the least-squares line’s deceleration must lie within a factor of 1.8 of 9.806 65 m/s², at least 5 samples across at least 1 s. In the sample files the climb is 0.909 to 1.004 times the integral and the coast slows 1.00 to 1.47 g. Otherwise it is kept as written.
  • The positions (fcb_latitude and fcb_longitude, gs_lat and gs_lon, Latitude and Longitude), each pair decided together as one fix, are read in degrees by their range and their fractions. A position of exactly (0, 0) is the receiver’s mark for no fix, a gap, as crate::altos reads AltOS’s, counted in a note. Range: every fix lies within ±90° and ±180°, and most fixes lie beyond ±π/2 or ±π, which radians can’t, nor 10⁻⁷ degrees or NMEA’s ddmm.mmmm written as one number, which lie far beyond ±180. Fractions: in most fixes the latitude’s or the longitude’s part after the whole degrees is 0.6 or more, which degrees and minutes run together, dd.mmmm, can’t be. Most, so that one stray fix decides nothing (in the sample files every fix passes both). A pair with no fix, or failing either check, is kept as written.
  • The accelerometer (accel_x, accel_y, accel_z) is read in meters per second squared by the pad’s gravity and the barometer. The pad’s gravity, as crate::sillygoose checks it: the time the three axes’ magnitude lies within 10% of 9.806 65, each sample counting until the next but at most 1 s, is at least 1 s and twice the time it lies within 10% of 1. The barometer, as crate::aerospacenu_fcb checks the board’s own CSV: from the launch, the first sample of at least 3 times the median magnitude of the 10 before it (at least 3), the next two at least 2 times, the specific force along those samples’ median direction, less 9.806 65, is integrated read in m/s², by trapezoids over steps of at most 0.5 s, to a speed and a climb until the speed falls to 0; at each pressure the integrated climb passes 10 m by, within 0.5 s, the barometer’s climb from its last pressure at or before the launch, in the standard atmosphere, over the integrated climb; the median of at least 3 must lie within a factor of 1.8 of 1. Read in g the speed falls to 0 at once; in feet per second squared the pad reads 3.28 g. In the sample files 3 of the 4 accelerometers pass both, the median 0.997 to 1.090, and one reads 0 throughout.
  • angle_vertical is read in degrees by its range and the accelerometer: every value lies within 0 to 180° and one beyond π, as no angle in radians from vertical can; and at the samples where the accelerometer, read in m/s², reads within 5% of 1 g, at least 10, the median difference between the column and the angle of the accelerometer’s reading from the board’s z axis is at most 2° read in degrees and more than 2° read in radians (in the sample files, 0.11° to 0.70° in degrees, 34° to 416° in radians).
  • The gyroscope (rot_vel_x, rot_vel_y, rot_vel_z) is read in radians per second by the board’s turning and its tilt. Turning, as crate::sillygoose checks it: over stretches of 10 steps at most 0.3 s apart with the accelerometer within 15% of 1 g, the angle its reading turns through and the gyroscope’s turn across it, |ω × â| dt; radians per second are borne out where the gyroscope’s turn is within a quarter to 4 times the accelerometer’s, given at least 3 stretches and 0.2 rad (0.78 to 1.23 in the three sample files whose accelerometer reads; in degrees per second it would be 57 times less). Tilt: the angle between the board’s z axis and vertical can change no faster than the board turns across that axis, √(ω_x² + ω_y²). Over windows of at most 2 s, of steps at most 0.5 s, in which angle_vertical, read in degrees, moves at least 10°, at least 3 of them, the tilt’s change must be at most twice the gyroscope’s turn: read in degrees per second the gyroscope turns 7.6 to 9.3 times too little for the tilt in the sample files, so degrees per second are refuted, and in radians per second the tilt’s change is 0.13 to 0.16 of the turn. A board spinning about its axis turns more than it tilts, so this check refutes too slow a unit and never too fast a one: degrees per second can’t be read.

Kept as written, each with a note: the temperatures (temperature, gs_temp, ground_temp), whose names state no unit and which read as a bay’s or the day’s in degrees Celsius or Fahrenheit alike; fcb_battery_voltage, ground_speed, course_over_ground, ground_elev and pitot_ducer_press, whose names state no unit that anything in the file checks (in the sample files pitot_ducer_press follows gps_alt where it isn’t 0); the GPS altitudes (gps_alt, gs_alt, GPS Alt), whose rise against the barometer’s would tell meters from feet but which no second check independent of the barometer reaches; roll, pitch, yaw and orientation_rpy, which lie within ±π as radians would, but which nothing else in the file checks; and the magnetometer, for which the record has no quantity.

The primary track. The record’s altitude is fcb_altitude, the board’s estimate above its zero, the pad (within 4 m of 0 on the pad in the sample files), where it is read in meters; its vertical speed is v_speed. The track takes the Position Data samples in time order, the first at each time; a note counts those put in order. The record states no temperature or battery: those fields’ units aren’t settled.

Values. A value too large to hold once converted to its unit, such as a pressure of 10³⁰⁸ atmospheres, refuses the file, naming its line (LogError::Syntax), so that every channel holds values in SI or gaps.

Constants§

ALTITUDE_STEP_M
The barometric altitude’s step, m: the board’s barometers read whole pascals (every pressure in the sample files is a whole number of pascals divided by 101,325, module docs), and fcb_altitude, the board’s filtered estimate sent as a 32-bit float, has no step of its own, so the pascal’s, 1 / (ρ₀ g₀) with the International Standard Atmosphere’s ρ₀ = 1.225 kg/m³ (ISO 2533:1975) and g₀ = 9.806 65 m/s², 0.083 m at sea level, is its resolution near the ground.
MAX_CHANNELS
The most channels a record keeps: the sample files have under 150.
MAX_LINE_BYTES
The longest line read, bytes: the ground station’s longest packet in the sample files is under a kilobyte.

Functions§

read
Reads the ground station’s text.
recognizes
Whether the text is the ground station’s: its first line that isn’t blank opens RUN START.