|
3-phase PV router
|
cal / n for every phase and every expected sample count n, in fixed point. More...
#include <energy_bucket.h>
Public Attributes | |
| uint8_t | shift |
| uint16_t | value [N][NMax - NMin+1] |
cal / n for every phase and every expected sample count n, in fixed point.
One cycle's contribution is (sumP / n) x cal = sumP x (cal / n). With this table the ISR multiplies sumP directly, with no division - and without the truncation of that division either.
| NMin | Smallest expected number of sample sets per mains cycle. |
| NMax | Largest expected number of sample sets per mains cycle (<= 64 << SumShift of toFixedPerSample(), so that sumP stays within the 24 bits contribution() expects). |
| N | Number of phases. |
Definition at line 103 of file energy_bucket.h.
| uint8_t Energy::PerSampleCalibration< NMin, NMax, N >::shift |
shared by the whole table
Definition at line 106 of file energy_bucket.h.
| uint16_t Energy::PerSampleCalibration< NMin, NMax, N >::value[N][NMax - NMin+1] |
round(cal x 2^SumShift / n x 2^shift), indexed [phase][n - NMin]
Definition at line 105 of file energy_bucket.h.