A bidirectional converter for the integration of LiFePO4 batteries with RES-based generators part I: Revising and finalizing design