General PMSM control ( FOC and field weakening) example.

I am trying to find General PMSM control ( FOC and field weakening) example.

But I am not able to find it.

If any one has an example of this, please let me know.