iNavFlight / inav

INAV: Navigation-enabled flight control software
https://inavflight.github.io
GNU General Public License v3.0
3.01k stars 1.44k forks source link

INAV Black Box logging issue - H7 flight controller #9918

Open Hex-Davis opened 3 months ago

Hex-Davis commented 3 months ago

Current Behavior I'm having an issue with the black box in INAV failing to crate a useable flight log or not creating one at all.

I'm reopening this ticket from #9540 and #9876 with the new data that I've gotten while searching for a work around or a fix

LOG00003.TXT LOG00004.TXT LOG00002.TXT LOG00001.TXT

In the attached are attempted recordings at different looptimes (1000,5000,125) and with minimal data being recorded, selecting only gyro raw in one of them. I have found the blackbox begins recording but then once throttle comes off idle ether the recording stops or the data becomes too acratic for it to record (loosing frames or maybe not registering them) Below is a very helpful response i got in a previous ticket, im hoping to get a link to related projects, tickets, discussions or anything working on this.

"Hi Hex. this is a known issue with logging right now. Especially the H7 is a bit troublesome. If I remember correctly, with F765 for example the fastest stable logging rate I was able to achieve was 500Hz. With H7 and F4 as well as F722 everything above 250Hz can cause issues.

you can reduce the logging fields by disabling some you don't need to allow higher rates but for now it is how it is until a better SD driver implementation can be found.

If you wanna do noise analysis, you can disable most fields except gyro and accellerometer data and it should be easy to run 1000Hz (actually overkill already). For pure flight recording I have my logs running at 30Hz on all my fixed wing craft."

Originally posted by @b14ckyy in https://github.com/iNavFlight/inav/issues/9876#issuecomment-2029474973

b14ckyy commented 3 months ago

Can you please also add a full dump as a TXT to your post. If even the workarounds don't work for you there is something fishy going on.

Jetrell commented 3 months ago

I have found the blackbox begins recording but then once throttle comes off idle ether the recording stops or the data becomes too acratic for it to record (loosing frames or maybe not registering them)

I find its the blackbox MOTORS field that causes most of the issues for SDIO logging.

Hex-Davis commented 3 months ago

I'll not record the motors and see if that helps. This is the Dump in word and notepad, which would line up with log004 above i think, dump1.docx dump1.txt And this is a pair of logs with only gyro raw collected. In 6 i did the smallest bump in throttle before the flight started, not enough to fly. Both flights were ~3min long LOG00007.TXT LOG00006.TXT

Hex-Davis commented 3 months ago

I have made some progress with this. I have everything the same as the last dump but i changed the blackbox_denominator to 50 (dump2.docx, dump2.txt) this way the loop time was still high but the recording interval was still low (160hz) i recorded every blackbox parameter, one at a time, and then did a few flights as well. the flights where around 8 min each but the recording stopped early. Attached are each of those recordings labeled with the parameter monitored. each of these was between 30-45sec.

Accelerometer.TXT Attitude.TXT GYRO and accelerometer.TXT Gyro noise peak freq pitch.TXT Gyro noise peak freq roll.TXT Gyro noise peak freq yaw.TXT Gyro RAW.TXT Magnetometer.TXT Motors Output.TXT RC Command.TXT RC data.TXT

Each of these was around 5-10 min long recording GYRO and Accelerometer data.

Flight 1.TXT Flight 2.TXT Flight 3.TXT Flight 4.TXT

Unfortunately the files still have issues with analyzer in blackbox explorer. PID tool box is also having issues loading and analyzing the data.

Hex-Davis commented 3 months ago

My findings thus far: the low loop times and high Blackbox_denominator seem to give the best results but the higher the denominator the lower the frequency rang analyzed. My next steps are to use an external logger.

Hex-Davis commented 2 months ago

Ok I'm looking for some help with these logs. Using a 'Openlog Artemis' from SparkFun I have collected a few recordings but i need some assistance configuring things so the data can be read by the INAV blackbox explorer. All of the below recordings had 10-20 sec of flight time with small bumps on the throttle while the quad was on my table, so no actual flying. The file names include the differences between recordings.

Any help would be greatly appreciated!

BBR = Blackbox ratio baud = is the peripheral baud rate in the ports tab

# Diff all.txt # dump.txt

Data0000_Baud250000_BBR_1over8_Looptime125.TXT Data0001_Baud115200_BBR_1over8_Looptime125.TXT Data0002_Baud115200_BBR_1over16_Looptime125.TXT Data0003_Baud115200_BBR_1over32_Looptime125.TXT Data0004_Baud57600_BBR_1over8_Looptime125.TXT Data0005_Baud57600_BBR_1over16_Looptime125.TXT Data0006_Baud57600_BBR_1over32_Looptime125.TXT