ISSUIUC / TARS-Software

Illinois Space Society's flight software codebase for the TARS avionics system
https://issuiuc.github.io/flightcode-docs/classes.html
17 stars 4 forks source link

[AV-193] Integrate Barometer Library and Thread #38

Closed lyc11776611 closed 2 years ago

lyc11776611 commented 2 years ago

Added barometer (MS5611) library and datalog functions.

NPIPHI commented 2 years ago

This library does not provide altitude, only the pressure.

lyc11776611 commented 2 years ago

I have implemented a hypsometric equation in the tick function to calculate altitude, not sure if that's what we want though. Hopefully the log() in the tickFunction is not too much of a stall for the system. The units are sorted out and output is in meter. Also, the contants hardcoded in the program will need some justification in higher altitude, which may involve more complex program (e.g. https://en.wikipedia.org/wiki/Barometric_formula, for different range of altitude there's different constants). Currently, based on the constant given in this website, the error from 10km to 71km ranges from ~1.5km to ~7km. Beneath 10km it should be more accurate.