Simple Voltage-Controller
The desired rms values of d- and q-component of the space phasor current in rotor fixed coordinate system are given by inputs "id_rms" and "iq_rms". Using the given rotor position (input "phi"), the actual threephase currents are measured and transformed to the d-q coordinate system. Two PI-controller determine the necessary d- and q- voltages, which are transformed back to threephase (output "y[3]"). They can be used to feed a voltage source which in turn feeds a permanent magnet synchronous machine.
Note: No care is taken for current or voltage limiting, as well as for field weakening.