This example shows how to use a permanent magnet synchronous generator (PMSG) to charge a battery. An ideal angular velocity source is used to maintain the rotor speed constant. The Control subsystem uses field oriented control to regulate the torque of the PMSG. The torque reference is obtained as a function of dc-link voltage. The initial battery state of charge is 25%. The Scopes subsystem contains scopes that allow you to see the simulation results.
The plot below shows the generator torque and the battery voltage and state of charge.