Smart algorithm for the preventive monitoring of the impedance fault within a PV generator