I've been running the on board datalogger quite a bit lately and it seems to be working for the most part, but there's a lot of stuff that doesn't make sense.
For example, the GPS time data is difficult to decipher. According to the datalogging help page, the time value is the "Time of the week (UTC)" in milliseconds. What on earth does this mean? The GPS start time value is 46,017,250, which corresponds to 12.78 hours (assuming that number is actually in milliseconds...), but I started datalogging on Tuesday May 29th at 16:50, so there's no way that the beginning of the week was 12 hours ago.
Also, I left the datalogger running overnight until 09:04 and the end value is 57,847,500, which indicates that the logger only ran for 11,830,250ms (equal to 3.29 hours). I noticed that the logfile had "wrapped around" in memory when I downloaded it, so it seems like there's a maximum amount of time that the logger can actually log before overwriting data. How can I determine the time and date of my flights from this data? Or will I have to log it the old-fashioned way (pen and paper)?
I have other questions too, but I'd like to start with this for now. Could anyone please explain?
It's known the logs are only good for maybe 3.5-4 hours based on the size of the high speed data card inlcuded. Normal flash isn't fast enough, thus why it's a special card.
Next, the logs are information from the sensors, so the GPS firmware is responsible for the unique time format.
to expand on this, the time on the mtk is recorded as milliseconds from midnight based on utc time.
Okay, I think I have it figured out.
I looked up the GPS datasheet, and on page 14 it suggests that the time is output in the format hhmmss.sss - I examined the numbers I was getting using this format, and it still didn't make sense - the last data I got from the GPS time unit was 64582514, which would suggest 6 hours, 45 minutes, 82 seconds, and 514 milliseconds. Obviously 82 seconds doesn't work.
However, examining the numbers as just milliseconds again, I found that 64582514/(60*60*1000) = 17.9 hours. I got the data at about 10:55 PDT, which corresponds to 17:55 UTC. Looks like you were right, Michael! (I mean, of course, you pretty well built Ardupilot ;)
So thanks very much for the help! May I humbly suggest that the page I referenced in my first post be updated to more accurately reflect the fact that time is from the beginning of the day and not the week?
And just in case we thought the issue was resolved, I wanted to clarify another quirk about the logged time - I noticed that the GPS time data doesn't refresh at a consistent 10Hz. It looks like it takes three readings at once, then two more a few dozen ms later, and then three more, and then two more, and then it has counted one full second and the cycle starts again. Is this something that anyone else has noticed?
All the tips and suggestions are really appreciated, thanks!
GPS time data doesn't refresh at a consistent 10Hz. It looks like it takes three readings at once, then two more a few dozen ms later, and then three more, and then two more, and then it has counted one full second and the cycle starts again. Is this something that anyone else has noticed?
I'm going on a limb here but you get that the GPS has a processor and then the APM is an entirely different processor? They talk one way only, so the APM caputures the data when it's ready within it's main loop, and further, writes back out are periodic. Thus in no way, would I expect to see constant 10hz update out of the APM. The APM codes entire purpose is to stabilize the aircraft which requires dedicated CPU time. GPS update is completely secondary function here on a "time available" basis. Further, if you learn nothing else about an 8 bit micro, serial data writes pretty much hang any other action until the message is sent, thus you do them only when absolutely needed.
Now, had you used a FTDI cable and plugged directly into the GPS, then you would be speaking of the GPS firmware not working as expected, but through the APM, this is pretty normal.
In other words, don't overthink this. I'm not trying to imply anything, just that based on your question, you assumed 10hz update, didn't see that, but also I think didn't see the bigger picture of how the system works, and you have to keep that in mind. Anyway, keep asking questions, it's the only way we learn.
Looking at my logs, it seems the GPS is actually updated at 4Hz, not 10. The time numbers increase by 250ms each time. I have APM2 with the included stock GPS.
correct, the mtk is 4hz, but output at 10 hz. most gps are in the 1-5 hz range.