File Exchange

image thumbnail

Detailed Modelling of a 1.5MW Wind Turbine based on Direct-driven PMSG

version 1.3 (39.5 KB) by

1.5MW Wind Turbine based on Direct-driven PMSG(Permanent Magnet Synchronous Generator)



View License

Though there are many literatures on PMSG wind turbine modelling, I found out that it's difficult to get a detailed simulink model, so I made this, hope you can make full use of it!

Comments and Ratings (46)

ci peng


parisa hejabi

hi i cant run it why????;my matlab is 2016;

sehmus fidan

Mr. Jiayang how we must select right filter values? Could you explain or show some referance-paper?

tuan manh

Dong Xia

Dear Yuan ,
   Thanks for your contributions ,can you tell me what's the value of "Fnow" and where did you set this value,please?

May I read your file please?


Juan (view profile)


I have a question related to the wind turbine block. I have realized that there is a saturation block that avoids that the mechanical torque generated turns negative. If this block is eliminated the model does not work. Apart from that, when the simulation is run with this block it can be observed that the torque generated is limited periodically during a brief instant at a value of 0.01. If the saturation block threshold is increased, it can reach huge negative values... Why does it happen? Something similar happens with the demos provided by SimPowerSystems when the default wind turbine block is used. Anybody knows why?

If there is any other forum in which the topic of the wind turbine block extrange behaviour is commented I would be grateful of being informed.



Juan (view profile)

sanae dahbi

please how i can read this file ? if some one can read it please sent it to me in this email

ahmed tarek

 I need a help to make large scale of wind turbine fixed or doubly fed

Xiao Wang


Thanks for your detailed model. Could you please provide some reference for developing the model?

tunde alade

hello mr ruan jiayang
please the model is not runing its displaying this error:
Failed to find 'Continuous/PID Controller' in library 'simulink' referenced by 'Detailed_PMSG_one_machine/PMSG Wind Turbine/Control/Rotor-side Controls/Id Controller'

can you help

thanks ayo


Hello Mr. Ruan Jiayang,

First I want to tahnk you for your model.

I would love if you could answer me one question.

In the turbine rotor block you add a gain to the rotor speed. This gain should be the nominal value of the rotor speed, however it is not.

Could you tell me where you got this value from, please?

I would highly appreciate your help.

Thank you very much.



Yu (view profile)

How call it is a minor thing, but I did notice most of literature (about PMSG) call it "synchronous reference frame"(which is nothing but rotor angle orientation). I agree this is a better term for PMSG, while the "rotor flux orientation" fits IG/DFIG better...

Ruan Jiayang

Ruan Jiayang (view profile)

The precise description is, the machine side converter is under rotor-angle orientation control.

The reason is that, there is no physical windings on the rotor, so the concept of flux more or less does not apply to the rotor.


Yu (view profile)


Have to say sorry, and turned out that it was due to some version compatibility plus system parameters issues...

Anyways, it is functioning fine now and really appreciate your contribution and patience.

Btw, you are applying rotor flux orientation on machine-side converter control, and grid voltage orientation on grid-side converter control, respectively. Right?

Ruan Jiayang

Ruan Jiayang (view profile)

change your matlab version to R2010,
and your compiler to visual studio 2008.

In win7 or higher, you need to select all the options when installing VS2008.


Yu (view profile)

To be honest, this model does not work at all. Not to me at least...
Is there any thing needed to be done before running it?? Buz all of the power, dc bus, torq etc. are NOT under control.
No offensive, but I would be very glad to see any correction on my comments.

sincerely, yours

Amir Arasteh

First of all, I am thankful for this extremely useful simulation.
Second, after some investigation, I found out that is we plot the electromagnetic torque of the generator there is a low frequency ripple, around 100 Hz, except that of switching frequency. But I could not understand where this ripple comes from. Is there anybody who can help me out?
N.B.: to see the aforementioned ripple you should plot the torque before filtering.

I will be highly grateful if someone can guide me.

Seli Sosu

this has being of great help to me and more interested in matlab than ever before

moussa traore

first thanks about this good work very helpful
so i am doing work in wind turbine energy conversion and i want to understand the principe of control in this case.
if you have any document that can help me knowing your model my mail :
best regards

Ruan Jiayang

Ruan Jiayang (view profile)

may be the fault you added is too weak.
just add a simple voltage sag in the voltage source (see it in the model), you will find out a more evident effect.

Glen Norris

Dear Ruan Jiayang,

Thanks for uploading such a great model but I have query.

I am trying add three phase electrical faults to the model and observe their effect on the output. But no matter what fault I place in the model, the models output current and voltage signals remain the same.

Does this model have the capacity to do this? if so what am I doing wrong?

Thanks in advance!


Sajid (view profile)

i like your design dear
good luck

Dear Ruan Jiayang,

My name is sanusi kamilu. I came across your model on wind turbine. Im a beginner in this field and have been given final year project to work on 2-wind turbines feeding a single inverter. But my greatest challenge is how to model wind turbine generator to get the output ac. I wiil appreciate if you can help me with a relevant material that will help me in this regard. My email adress is

Thank you

Dear Ruan Jiayang,

My name is sanusi kamilu, a student of university of malaya, malaysia. I came across your model on wind turbine. Im a beginner in this field and have been given final year project to work on 2-wind turbines feeding a single inverter. But my greatest challenge is how to model wind turbine generator to get the output ac. I wiil appreciate if you can help me with a relevant material that will help me in this regard.

Thank you



Your model inspired me a lot. Could you tell me the parameter sheet of this system? Since I have been reading many papers on similar topic, there is no detailed sheet attached. Especially the flux linkage established by magnets of PMSG. I am doing this project behind the schedule. Maybe you stop check this page. So please contact me if you have time and will. Thanks for your work again. If any of you guys want to discuss with me, that is my e-mail. cheers

Povi Nike

Could you write where could I change sample time Ts?

Povi Nike

jothi priya

Excellent work sir.Have you published any articles or papers related to this model.can you please give the parameter details used for modelling the grid connected PMSG.


Xu (view profile)

This model is very good, but may I ask where can I get the detailed parameters of the turbine, like the rotational inertia of the rotor and the starting torque?
Thank you very much!


Malik (view profile)

i cant make this model run on Matlab 7.12.0 R2011a. Get these errors. Please help!

error1: Problem creating Accelerator MEX file for model 'Detailed_PMSG_one_machine'.
To see the build output, use set_param('Detailed_PMSG_one_machine','AccelVerboseBuild','on')

error2: An installed compiler was not detected. Certain simulation modes, as well as host-based coder builds require that a compiler be installed. Please install one of the supported compilers for this release as listed at:

MATLAB must be restarted after the compiler is installed.


   I am working on the pmsg based off shore wind farm.I am facing problem in design the model of the pmsg based wind farm of 100 MW.Could you please assist me how to change the ratings of turbine, generator. I am using your model also I am facing problems could you please help me


when i am trying to run the model it showing the error whic i metion in the box
{The "FixedStepDiscrete" solver cannot be used to simulate block diagram 'Detailed_PMSG_one_machine' because it contains continuous states}

will u please explain what is this

Ahmed Ali

Dear Mr. Ruan,
Thank you very much for your help. why the power and voltage are fluctuating, what is the use of crow bar protection.
my email is ( I have some questions could we contact.


dke (view profile)

could you put on an article related with this model,
thank you


Peng (view profile)

Dear Mr. Ruan,

thank you very much for your contribution. I can run the model, but i don't think the control is richt,because:
the d-axis current id of the machine-side-converter is not 0, and the q-axis current iq of the machine-side-converter can not track the reference value.

my e-mail is "", i am a PhD student at the techinische universitaet Berlin, i am very glad to know you each other for further discussion.

Kind regards!
Yufei Peng

Ruan Jiayang

Ruan Jiayang (view profile)

you can use the "normal" mode rather than "accelerator" model to avoid addtional compilers.


Dear Mr Ruan,
Thank you very much for your contribution. I just want to ask you if you have published any article or documentation related to this model.
I would also like to ask you if you could upload a version of the file that does not require compiler.
Kind Regards.

Ruan Jiayang

Ruan Jiayang (view profile)

I have updated the model, it can be run with no errors now.


Ali (view profile)

Dear Mr Ruan
Thank so much for this great model, but
When I start to run an Error evaluating 'StopFcn' callback of block_diagram 'Detailed_PMSG_one_machine'.

Caused by:
Undefined function 'cprintf' for input arguments of type 'char'

please help me

Ruan Jiayang

Ruan Jiayang (view profile)

for use of the model,please delete the codes in "Model Properties/call backs", if necessary.:)



Some useless codes have been deleted.

MATLAB Release
MATLAB 7.10 (R2010a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video