Power quality grid code compliance for RE power plants