lhr-solar / MPPT

Max Powerpoint Tracker Code
MIT License
2 stars 2 forks source link

Add some sample smoothing for the sensor class #23

Open dimembermatt opened 4 years ago

dimembermatt commented 4 years ago

Currently, the sensor classes grab data from the ADC and update an internal variable that can later be extracted for MPPT. This typically is exposed to a lot of variance temporally.

We should smooth out our signal input by holding a buffer of N samples size, and taking the moving average of that buffer whenever we get a new output from the sensor.

This needs to be applied for both the current and voltage sensors.

dimembermatt commented 4 years ago

See moving average (the easy implementation) and kalman filters (a more advanced implementation).

dimembermatt commented 4 years ago

Reference #26 for a mockup of the SMAFilter class.

dimembermatt commented 4 years ago
dimembermatt commented 4 years ago

Add tests for EMAA and Kalman filter.

dimembermatt commented 4 years ago

27 Merged.

dimembermatt commented 4 years ago

Nevermind, forgot we need some tests.