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.
This example has been tested on a Speedgoat Performance real–time target machine with an Intel® 3.5 GHz i7 multi–core CPU. This model can run in real time with a step size of 50 microseconds.