Analysis and mitigation of power quality issues in distributed generation systems using custom power devices