Hello expert What is the function of AC Drop Detection below? And when the input voltage is at the zero-crossing point, when the input current produces a large THD, how is the program solved in this project? Looking forward to your reply!
inline void check_ac_drop(void) { if(iv.vin_filtered > AC_DROP_V_RECT_THRESHOLD) { iv.ac_drop_count = 0; } else { iv.ac_drop_count++; if(iv.ac_drop_count > AC_DROP_COUNT_MAX) { iv.ac_drop = 1; iv.ac_drop_recovery_not_complete = 1; iv.vin_squared_for_ac_drop = 0; //clear for ac recovery detection MiscAnalogRegs.GLBIOVAL.bit.DPWM3B_IO_VALUE = 0; } } if(iv.vin_squared_for_ac_drop > AC_UNDROPPED_THRESHOLD) { iv.ac_drop = 0; MiscAnalogRegs.GLBIOVAL.bit.DPWM3B_IO_VALUE = 1; } }