Skip to main content

Module blueraven_usb

Module blueraven_usb 

Source
Expand description

The Featherweight Blue Raven’s flight data as its USB port downloads it: one @ LOG_LOW or @ LOG_HIR line a sample, each closed by a CRC, as a terminal program saves them.

The Blue Raven records a low-rate set of data “recorded at 50 Hz” and a high-rate set “recorded at 500 Hz” for each flight (Featherweight, Blue Raven User’s Guide, updated May 12 2026, p18). Besides the phone app’s download (crate::blueraven), the logger’s USB port sends either set to a serial terminal on a command, <download l> or <download h>, and the manual describes the lines it sends (Appendix A, p23–24). Each line “starts with the mnemonic @ LOG_LOW followed by the length of the string, and the time and date of the flight”, then the sync code and the data. The manual ends the low-rate line with a “16b Buypass CRC code for line of text” (p23) and lists none for the high-rate line (p24), but the high-rate lines in the sample logs close with a CRC too, of the same kind:

@ LOG_HIR  139 2026  5 23 10:15:00.120   20    -15     42     -7     -1      3     98  -3000   1500    -40  29812      0      0 CRC: 7730
@ LOG_LOW  211 2026  5 23 10:15:00.140  40 Bo:  7212 49655 V:  4105    22    21    20    23 Vel:     0     0     0 Pos:     0     0     0 ang:   12    5    0 FER:  400  1c1   c3   c1   c3   0   0   0 CRC: F7EB

Recognition. A file is a download when one of its first 1,000 lines opens with @ LOG_HIR or @ LOG_LOW, holds no other @ LOG_, and closes with a CRC that checks (below); no other layout HPR Sim reads opens a line so.

Records and their checks. A terminal saves what the port sends, and the sample logs show what that costs: a record whose CRC: XXXX and line end were lost runs on into the next one, on one line. So every line is cut before each @ LOG_, and each piece is a record only if it holds two things the logger wrote for it:

  • Its CRC. The piece closes with CRC: and four hexadecimal digits, the CRC-16 the manual calls Buypass (polynomial 0x8005, starting at 0, no reflection, no final XOR; its check value on 123456789 is 0xFEE8) of the piece’s text from its @ to its last character that isn’t a space before CRC:: the spaces inside the line count, and only the run of spaces just before CRC: is left out. The example lines’ CRCs are 7730 and F7EB. The manual says the CRC is “for line of text” but not which characters it starts and ends at; this span is the one under which every CRC in the sample files checks.
  • Its length. The number after the mnemonic must be the piece’s length in bytes, from @ through the CRC’s last digit, plus 2 for the line end the logger sends: 139 for a high-rate line of 137 characters.

A piece with no CRC, or whose CRC differs from its text, is dropped, and a note counts each kind: it can’t be told from a record the capture damaged. So is a line holding no @ LOG_ record, such as the live status line, @ BLR_STAT, which the port sends five times a second (p22), or text before a line’s first record. A record whose CRC checks is the logger’s, so anything else wrong in it refuses the file (LogError::Syntax), naming its line: a stated length that isn’t its own, a mnemonic other than these two, a date or time that can’t be one, a value that isn’t a whole number (or, in FER:, hexadecimal digits), more than MAX_VALUES values or MAX_GROUPS groups, a label longer than MAX_LABEL_BYTES, or a layout unlike the first record’s, its kind or its groups and their counts, so that a file holding both downloads is refused too.

The clock. Each record states the logger’s date and time of day to the millisecond, 2026 5 23 10:15:00.120; the record’s clock counts from the first record’s, and a time that doesn’t increase is refused, naming its line. The manual says the date stamp “starts with the build time/date and increments from there”, to be set by the phone (p22), so the date need not be the flight’s: a note gives the first record’s as written. Year, Month, Day and Sync are Quantity::Number channels and Time a Quantity::TimeOfDay one, as the app’s CSV keeps them. The sync code is “a millisecond counter recorded in both the low-rate and high-rate data so that the two data sets can be aligned”, which “rolls over every 250 msec” (p23).

The high-rate record holds, after the sync code, “[gyro X deg/s x100] [gyro Y deg/s x100] [gyro Z deg/s x100] [Accel X Gs x100] [Accel Y Gs x100] [Accel Z Gs x100] [Quaternion X x 30000] [Quaternion Y x 30000] [Quaternion Z x 30000] [Quaternion magnitude x 30000]” (p24). The gyro rates are “raw data in the sensor axis”, and the accelerations come from the ±32 g accelerometers below 32 g and from the high-range one above it. The quaternion is written “with the rotation axis first and the magnitude term fourth”, “scaled up by a factor of 30,000 to fit into signed 16-bit integers”.

The low-rate record holds labeled groups (p23):

GroupThe manual’s fields, in its orderRead as
Bo:temperature from the baro sensor; pressure in atm × 50,000the temperature as written, Quantity::Unrecognized, as the manual states no unit for it here; the pressure in Pa
V:battery, Apo, Main, 3rd and 4th outputs, mV; output current, mAV; A
Vel:upward, down-range and cross-range velocity, ft/sm/s, Quantity::Speed
Pos:inertial altitude, down-range and cross-range position, ftm: Quantity::InertialAltitude, then Quantity::Distance
ang:tilt angle, deg × 10; roll angle, deg; future tilt angle, deg × 10degrees, Quantity::Angle
FER:the rocket’s flight event register, then the Apo, Main, 3rd and 4th outputs’the registers’ bits, Quantity::Number, from hexadecimal

The velocities and positions are “ground-relative inertial coordinates (rather than rocket axes)”, and the registers “hex-encoded binary values that use one bit for each event” (p23–24); the manual doesn’t say which bit is which event, so no Event is taken from them.

Counts unlike the manual’s. A logger’s firmware need not write what the manual of the day lists: in the sample logs, a high-rate record holds 12 values where the manual lists 10, V: holds 5 where it lists 6, and FER: 8 where it lists 5. One rule takes them: a group holding at least the manual’s count is read by the manual, in its order, and the values past it are kept as written, Quantity::Unrecognized (in FER:, registers of unknown meaning, Quantity::Number); a group holding fewer is kept as written whole, as nothing says which value is missing. A group the manual doesn’t list is kept as written too. A value kept as written is named by its group and its place there, counted from 1, such as V: 3 or LOG_HIR 11, and a note says so for each group. The maker’s forum describes two more 500 Hz fields than the manual, the “deployment output current” and the “aux analog voltage” (Featherweight, Blue Raven development thread, rocketryforum.com, 2023-03-31), but not their order, so the high-rate record’s 11th and 12th values stay as written.

The sample logs’ survey (cargo xtask logs) holds three parts of the reading to the file and the same rocket’s other files: every high-rate record’s quaternion, read from the 7th to the 10th value, has a norm within 2 of 30,000, as a unit quaternion cut to whole numbers must; the first FER: value’s lowest bit, the one the app’s files call Liftoff, first sets within 0.1 s after the three axes’ acceleration first passes 3 g; and the pressure on the pad is within 2 % of the TeleMega’s in the same rocket. The gyro rates, velocities, positions, angles and voltages are read by the manual’s scales with no such check.

The record has no barometric track, as the download writes the pressure, not an altitude: FlightLog::time_s and FlightLog::altitude_m are empty, as for the Raven’s raw .FIPa, and every value is a channel.

Constants§

MAX_GROUPS
The most groups a low-rate record may hold, over twice the manual’s 6, and the longest a group’s label may be, bytes, four times the manual’s longest, Vel:: so that a record’s labels can’t fill its columns’ names, its notes or the time spent checking them.
MAX_LABEL_BYTES
See MAX_GROUPS.
MAX_VALUES
The most values a record may hold after its sync code, over ten times the 24 of the sample logs’ low-rate record; a file past it isn’t a Blue Raven’s.

Functions§

read
Reads a Blue Raven’s USB download.