generator with permanent magnet