I implemented parts of the Energy Library (SLAA538) to add Voltage and Current THD calculation to our MSP430F6779 based Three Phase Watt-Hour meter (based on the SLAA577 EVM).
The THD calculation uses the Fundamental Voltage value but in the fundamental_voltage function I get a negative values of the phase.metrology.dot_prod_logged.V_fundamental which causes the function to stop and return -1.
How can I fix it?