- Posts: 4402
Datalogger
- PhracturedBlue
- Topic Author
- Offline
So I've started work on a data-logger.
Here is an example of the configuration screen:
My plan is that the configuration is done per-model. There will be a directory 'datalog' which contains a bunch of files (datalog1.txt, datalog2.txt, ...) Each file will be 4kB and they will be filled in series (write 4k of data to datalog1.txt then switch to datalog2.txt)
The logs will be written periodically in 'append' mode (so restarting the Tx or switching models will not overwrite previous data.
There will be a button to reset the log files and start writing from the beginning.
The idea is that you can select which data you want to capture from the above config page.
I'm not yet sure how to write the data. If I write it in csv format, it'll be easy to work with, but will potentially use up a lot of space.
I can write binary data in a much more compressed manner, but then you'll need some application to extract it into a usable format.
We are again limited by the filesystem code in that I cannot create or resize files on the Tx, so all files need to be pre-created. i could use a single big file instead of many small ones, however then resizing the file needs special toos.
Please Log in or Create an account to join the conversation.
- Kdean
- Offline
- Posts: 213
What are some of the other uses for such a logger?
Please Log in or Create an account to join the conversation.
- vlad_vy
- Offline
- Posts: 3333
Is it possible to export data from binary to csv format by any means (over USB or anything else)?
Please Log in or Create an account to join the conversation.
- Kdean
- Offline
- Posts: 213
It can also function as a "Black Box" like real aircraft have. After a crash you can look at the data to see what happened before impact. Would still need a simulator like play back to see attitude of aircraft with given inputs. But at least the telemetry data could be useful to see if it was a power issue or burn out of esc or motor.
Please Log in or Create an account to join the conversation.
- RandMental
- Offline
- Posts: 521
a simulator (Phoenix) to see you flight and the reason for that "crash"!
Please Log in or Create an account to join the conversation.
- FDR
- Offline
RandMental wrote: I see an option to export / replay this file via ppm-out into
a simulator (Phoenix) to see you flight and the reason for that "crash"!
I think you couldn't use for that, since it would be sampled with limited frequency, so it wouldn't play back the command changes between those samples...
Please Log in or Create an account to join the conversation.
- RandMental
- Offline
- Posts: 521
FDR wrote:
RandMental wrote: I see an option to export / replay this file via ppm-out into
a simulator (Phoenix) to see you flight and the reason for that "crash"!
I think you couldn't use for that, since it would be sampled with limited frequency, so it wouldn't play back the command changes between those samples...
Yip, your right of course, a case of typing rather than thinking it through. Would have been nice, though.
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Topic Author
- Offline
- Posts: 4402
I'm not sure the Tx is really a useful place to look at the data, but it could be done.
You can't convert to csv on the fly, but it would be easy to have an app that could do so.
My guess is that the value of more data outweighs the readability of it. Also If we want to view it on the Tx, binary will require a lot less code.
Please Log in or Create an account to join the conversation.
- RandMental
- Offline
- Posts: 521
RandMental wrote:
FDR wrote:
RandMental wrote: I see an option to export / replay this file via ppm-out into
a simulator (Phoenix) to see you flight and the reason for that "crash"!
I think you couldn't use for that, since it would be sampled with limited frequency, so it wouldn't play back the command changes between those samples...
Yip, your right of course, a case of typing rather than thinking it through. Would have been nice, though.
Hi FDR, PB,
May be it is possible, using differential encoding decoding and a fast enough clock such a differential bit stream may be able to give a good Simulator experience on 6 channels.
Do you know what is the typical or required rate of change of the PPM signals when flying? If we work on a 5% PPM resolution (steps), updated at the TX 8 channel frame rate. it might just work to log a 5-6 minute flight in 4kbyet files.
Will do some PPM measurements tonight...
Please Log in or Create an account to join the conversation.
- FDR
- Offline
The physics are different and the conditions like wind differ too, so the same commands would result in a very different behaviour. The model in the sim would probably crash very soon...
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Topic Author
- Offline
- Posts: 4402
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Topic Author
- Offline
- Posts: 4402
Yes I agree, as a playback it wouldn't make much sense other than to analyze your stick movements to see what if anything you were doing wrong.FDR wrote: I'm a bit skeptical about the possibility of playing back a log on the sim whatever fine the sampling is.
The physics are different and the conditions like wind differ too, so the same commands would result in a very different behaviour. The model in the sim would probably crash very soon...
Please Log in or Create an account to join the conversation.
- Kdean
- Offline
- Posts: 213
Please Log in or Create an account to join the conversation.
- RandMental
- Offline
- Posts: 521
FDR wrote: I'm a bit skeptical about the possibility of playing back a log on the sim whatever fine the sampling is.
The physics are different and the conditions like wind differ too, so the same commands would result in a very different behaviour. The model in the sim would probably crash very soon...
Hi FDR, I have to agree to a certain extend, but the converse is also true - by practising on a SIM you have the perfect helicopter, and while it helps training for orientation and muscle memory, in real life you have to content with a non-perfect heli which depending on the mechanical setup and off centre COB, etc, can be a very different animal. (i know you can change the heli config, weather, etc, on most SIMs, but that is not the point here)
So perhaps there is still a case to be made for such a TX output logger, BUT then it is probably easier just to record the PPM-out signals and find a way to replay them into the PPM-in HID dongle. Having said that, PB can we add the option to output PPM even when flying with other protocols?
Then we can verify and test my suggestion without affecting your plans for the data logger.
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Topic Author
- Offline
- Posts: 4402
I thought I'd get it out there for testing and feedback while I work on the Devo10 interface (this is another feature that won't be available on the 7e)
Notes:
You can only change the selected elements when the logger is not running.
There is currently no way to toggle it from the main screen
The data is written in a binary format, and does not include the header information. This means if you run a custom firmware with different capabilities, you'll need to also alter the parsing script to be able to decode the log.
The log is in datalog.bin. If this file isn't available, logging will be disabled. The default is 16kb but it can be as large as you like.
There is a script in utils/datalog2csv.py that can be used to convert the binary data into a csv.
I will supply a compiled python (exe) version with the release so users don't need python to use it
Please Log in or Create an account to join the conversation.
- vlad_vy
- Offline
- Posts: 3333
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Topic Author
- Offline
- Posts: 4402
Also, I chose not to put the GPS stuff at the top because very few folks will actually use it. The RTC is at the end to keep the code simple due to it being conditionally available.
Please Log in or Create an account to join the conversation.
- vlad_vy
- Offline
- Posts: 3333
Please Log in or Create an account to join the conversation.
- rbe2012
- Offline
- So much to do, so little time...
- Posts: 1433
"MIX0", "MIX1", "MIX2", "FMODE1", "FMODE2", "FMODE3"]
Please Log in or Create an account to join the conversation.
- rbe2012
- Offline
- So much to do, so little time...
- Posts: 1433
If you have reached 60s you can just go further right. Text disappears.
Look here in pages/common/_datalog_page.c line 28++:
static const char *ratesel_cb(guiObject_t *obj, int dir, void *data)
{
(void)obj;
(void)data;
dlog.rate = GUI_TextSelectHelper(dlog.rate, 0, DLOG_RATE_LAST, dir, 1, 1, NULL);
return DATALOG_RateString(dlog.rate);
}
Please Log in or Create an account to join the conversation.
- Home
- Forum
- Development
- Development
- Datalogger