Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility of shorter sampling interval than 10ms #21

Open
HanChangHun opened this issue May 2, 2024 · 4 comments
Open

Possibility of shorter sampling interval than 10ms #21

HanChangHun opened this issue May 2, 2024 · 4 comments

Comments

@HanChangHun
Copy link

Hello,
I am using your fnirsi_logger.py script to log data from the FNB48 power monitor device. First of all, thank you for providing this useful script!

I noticed that the current script reads data from the device every 10ms, which corresponds to a sampling rate of 100 samples per second.
I am wondering if it is possible to achieve a shorter sampling interval, such as 1ms (1000 samples per second), to obtain more fine-grained data.

Thanks for the great project!

@pdl-user
Copy link
Contributor

pdl-user commented May 2, 2024

I'm not ready to write it up yet, but I think the effective maximum sample rate is 25 samples per second, at least for the FNB48S, which I have. The other 3 samples in the frame seem to be some kind of interpolation between the first sample in the frame and the first sample from the next frame.

Averages of 1 second of data (all 100 samples) match the averages of the 25 first samples.

Also, the first samples in a frame have many fewer possible values than the other 3 samples in a frame. In gnuplot, instead of
plot 'filename' u 1:3
do
plot '<grep " 0 " filename' u 1:3,'<grep " 1" filename' u 1:3,'<grep " 2 " filename' u 1:3,''<grep " 3 " filename' u 1:3

Updated to correct that "many fewer possible values" only applies to the temperature (field 7). For voltage or current, plotting the sample positions separately shows them nearly overlaying each other and the curve showing all samples (no grep).

@HanChangHun
Copy link
Author

HanChangHun commented May 3, 2024

@pdl-user Thank you for the great insights! Using only data with a 40ms period appears to be similar to what I have now. I was hoping to push for faster sampling rates, as the FNB48's datasheet mentions 3.2Mbsps, but it seems that might not be feasible.

This might be a bit off-topic, but I've been wondering about the USB meter's ability to capture short power spikes. If there is a power-hungry task that runs for just 5ms and it happens to fall between the sampling points, would the FNB48 still be able to accurately measure that power consumption?

I understand this type of question might be difficult to answer unless one is the manufacturer.

@pdl-user
Copy link
Contributor

pdl-user commented May 3, 2024

@HanChangHun I am sorry for any misunderstanding. I was delivering bad news rather than offering a solution. I don't know much about the FNB48 or whether it has capability for a higher sampling rate.

I don't think any device can capture spikes that happen between samples.

I can' t find a data sheet for the FNB48 and the only manual I have been able to find does not mention sample rate.

I also do not use windows and do no know what the official FNB48 software can do.

@HanChangHun
Copy link
Author

HanChangHun commented May 5, 2024

@pdl-user Thank you for your response and no worries about any misunderstanding. I appreciate you taking the time to share your thoughts on this matter.

I hope that the device might be internally capturing data at a faster rate within the 40ms and then providing us with an average or processed value... hopefully...

Thanks again for sharing your knowledge and perspective on this topic!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants