Hardware: ADE943 in AD-PQMON-SL
OS: Linux (Installed on Banana Pi BPI-M4)
Error Screenshot:
Coding in pqlib_convert.c:
To measure phase-to-phase voltage
float convert_voltage_three_phase_mag_type(ADI_VOLTAGE_TYPE mag_phase_1, ADI_VOLTAGE_TYPE mag_phase_2, ADI_PHASE_ANGLE_TYPE angle_phase_1, ADI_PHASE_ANGLE_TYPE angle_phase_2)
{
float converted_voltage_phase_1_mag = (float)mag_phase_1 * ((float)ConversionConstant_Voltage);
float converted_voltage_phase_2_mag = (float)mag_phase_2 * ((float)ConversionConstant_Voltage);
float converted_voltage_phase_1_angle = ((float)angle_phase_1 * 0.017578125f) * (M_PI / 180);
float converted_voltage_phase_2_angle = ((float)angle_phase_2 * 0.017578125f) * (M_PI / 180);
float voltage_three_phase_total_mag = (float)sqrtf((converted_voltage_phase_1_mag * converted_voltage_phase_1_mag) +
(converted_voltage_phase_2_mag * converted_voltage_phase_2_mag)
- (2 * converted_voltage_phase_1_mag * converted_voltage_phase_2_mag * cosf(converted_voltage_phase_1_angle - converted_voltage_phase_2_angle)));
return voltage_three_phase_total_mag;
}
Troubleshooting steps that has been taken:
- In no-OS/projects/eval-pqmon/src/common/pqlib_convert.c >> Line 63, M_PI constant from math .h has been used and build hex file without abnormal.
- Add line below in no-OS/projects/eval-pqmon/Makefile but error persisted
- LDLIBS += -lm
- Passing LDFLAGS+="-lm" on the command line during building hex file but error persisted
- make PLATFORM=maxim TARGET=max32650 INTERFACE=usb PQLIB_PATH=C:/Users/XXXXXXX/no-OS/projects/eval-pqmon/pqlib_dir LDFLAGS+="-lm" run