Import from CSV

From BurnSim Wiki
Jump to navigation Jump to search

BurnSim 4 imports test data from text files and from the clipboard, as well as straight from several data loggers. This page covers the text formats and the dialog every one of them goes through. The Test Data Tab covers what you can do with a data set once it is in.

What BurnSim can import

On the Test Data tab, Import File... takes:

File What it is Notes
.csv, .txt, .tsv, .dat Delimited text from any logger or spreadsheet The rest of this page.
.wdh, .wdq A DATAQ WinDaq recording Raw volts per channel, converted through a saved sensor. See The import dialog.
.fire An RMTS firing (reilley.net/rmts) Arrives already set up from the file, including its calibration and stand orientation. See RMTS firings.
An AltosUI CSV export An EasyMotor flight or static test Recognized from its header, whatever its extension. See below.

Import Clipboard takes the same text copied out of a spreadsheet. Excel puts tab-separated text on the clipboard, which is read like a file.

Text files

There is no required format. BurnSim reads:

  • Comma, tab, semicolon or space separated columns. The separator is detected from the file, not assumed.
  • Any number of header lines. The last one before the data names the columns, unless it is a row of units, in which case the line above it does. Units in a name, such as Pressure (psi), Time [ms] or Thrust lbf, are picked out and used to fill in the dialog.
  • Quoted fields, the way Excel and some loggers write them, and decimal commas in a semicolon-separated file (the European Excel default).
  • No header at all, which is read the old BurnSim way: time, pressure, thrust.

A line whose first field is not a number (a header, a units row, a note at the end) is skipped. A single unreadable cell on an otherwise good line is read as 0, so one bad cell does not throw away the point. The dialog says how many lines it skipped and how many cells it read as 0.

The time column must increase down the file. With no time column at all, give the sample rate instead.

The old format still works

A file with no header is read as

Time, Pressure, Thrust

with time in seconds, pressure in psi (gauge) and thrust in lbf. Thrust is optional. For example, time and pressure only:

0,0.00
0.008,7.40
0.017,12.34
0.025,22.20
...

A thrust-only file imports too: give it a thrust column and no pressure column.

The import dialog

Every import except an RMTS .fire file opens this dialog. Here it is for a three-column CSV with a header row:

The test data import dialog for a CSV file with time, pressure and thrust columns.

A file with a "Time (s), Pressure (psi), Thrust (lbf)" header. The roles and units were read from the header, so nothing needed changing.

From top to bottom:

  • One row per column. Each column shows the range it reads and gets a role: Time, Pressure, Thrust, Fire marker or Unused. Pressure or thrust is required.
  • Units or sensor. A column already in engineering units is Already in psi, kPa, MPa, bar, Pa, lbf, N or kgf. A column of raw volts needs a saved sensor to turn it into a reading. New... makes one: a name, pressure or force, units, and the calibration as a slope and intercept per volt, or worked out from two known readings. Sensors are saved, so each is set up once.
  • Time column is in seconds, milliseconds or microseconds. With no time column, give the sample rate in Hz.
  • t=0. Either find t=0 (from a fire marker channel if there is one, otherwise where pressure or thrust starts to rise), or keep the file's own times for data that was already processed.
  • Zero converted columns against their reading just before t=0, because a transducer's resting output wanders between firings.
  • Keep only the firing keeps the burn plus a lead-in and a tail, each 0 s to start with. Untick it to import every row.
  • Motor on the stand and the propellant mass: for a vertical firing, the burnt propellant's weight is put back into the thrust as it burns. A horizontal stand needs nothing.
  • Correct the pressure zero for drift corrects a transducer whose zero drifted during the firing, from its reading after burnout. The import says when it has done so.
  • The preview shows the converted traces and the t=0 line. The line under it says where t=0 came from, how many samples will be kept, and the peaks.

Pressure is gauge, and a negative pressure reading becomes zero.

EasyMotor (AltosUI export)

Altus Metrum's EasyMotor logs chamber pressure in flight or on a stand. Download the flight in AltosUI, export it as CSV, and import that file. BurnSim recognizes the export from its header line (#version,serial,flight,...) and its motor_pressure column, whatever the file is called. Added in 4.0.0.25.

The import dialog for an EasyMotor flight exported from AltosUI, with t=0 found from the pressure rise.

An EasyMotor export: time and pressure only, pressure in pascals, t=0 found at the pressure rise.

Three facts about the export, all from the AltOS source:

  • Pressure is in pascals and already gauge. AltosUI subtracts the reading the board took on the pad. BurnSim sets the column to Already in Pa.
  • Time is seconds from boost, the 50 psi pressure rise on firmware 1.9.13 and later, so it is negative on the pad. BurnSim finds t=0 from the rise.
  • AltosUI always scales the sensor as 0.5-4.5 V over 0-1600 psi. There is no setting for any other sensor, and the voltage is clamped before it is scaled. A firing above 1600 psi therefore comes out flat-topped rather than visibly wrong, and BurnSim warns when a trace has clipped. A sensor with a different range comes out scaled by its full scale over 1600, and the import cannot correct that.

Only pressure is imported. The acceleration columns are the airframe's, and getting thrust from them would need a mass and a drag the file does not hold.