DigitalShoestringSolutions / PowerMonitoring

GNU General Public License v3.0
0 stars 1 forks source link

Integration jitter #34

Open tobyaharris opened 6 days ago

tobyaharris commented 6 days ago

The integration is looking a bit unsteady. I tried shrinking the Time Buckets to enhance the issue and sure enough, buckets smaller than one minute make for very jittery Energy integrations, even when the power is steady:

image

With a time bucket approaching the order of magnitude of the sample rate, I wouldn't be surprised at some counting jitter due to significant relative variation in how many samples fall in each bucket.

I suspect the integrator is vulnerable to this because it might be summing each (sample value x time until next sample). How can we handle the time window edge cases?

Although related I feel this is a different problem to #7 .

Greg-Hawkridge commented 2 days ago

That will always be an issue - we should limit time bucket to being >10m