## Processing linearization output to obtain PID controller coefficients

This forum if for discussing controls. Questions about how to implement controls in FAST are more appropriate to the CAE Tools forum.

Moderator: Bonnie.Jonkman

Jannik.Luehning
Posts: 7
Joined: Thu May 27, 2021 6:18 am
Organization: University of Applied Sciences Berlin
Location: Berlin, Germany

### Processing linearization output to obtain PID controller coefficients

Hi,

I am currently trying to design a PI pitch controller with openFAST and Simulink. Therefore, I am following the “Advanced Control Design for Wind Turbines”-paper (https://www.nrel.gov/docs/fy08osti/42437.pdf).

To obtain the values for Ki and Kp I linearized my model at a desired operating point in region 3, linearizing every 10-degrees of azimuth. For the linearization I enabled the FlapDOF1, GenDOF and TwFADOF1 DOFs. Afterwards I successfully calculated the state-space and output matrices as well as the azimuth-averaged matrices, using the fx_mbc3.m script from the openFAST Matlab toolbox.

In the paper (p. 45/46) it states that one uses the azimuth averaged state matrices (AvgA, AvgB, etc.) to solve equation 4.1 and I also assume equation 3.8 (p. 29), is that correct?
The linearization in the paper results in the constants A, B, Bd (p.29). However, the fx_mbc.m-script outputs the azimuth averaged state 10x10 matrices. How do I process these, to obtain constants as in the paper?

Thanks and kind regards
Jannik

Jason.Jonkman
Posts: 5975
Joined: Thu Nov 03, 2005 4:38 pm
Location: Boulder, CO
Contact:

### Re: Processing linearization output to obtain PID controller coefficients

Dear Jannik,

• MBC and azimuth-averaging should eliminate the influence of the generator-azimuth state, which should then be removed from the linear model before use. This is discussed e.g. in the following forum topic: viewtopic.php?f=4&t=1903. This will reduce your state-space model from 10 states down to 9 states.
• In the paper you reference, Eq. (3.8 ) is based on a one-state model shown in Eq. (3.1), with only the generator speed state active. You can obtain such a model from OpenFAST by enabling only GenDOF. This will result in a two-state model, and then, as in the first bullet, you can reduce this down to one state by azimuth averaging and susbsequently eliminating the generator azimuth state.
I hope that helps.

Best regards,
Jason Jonkman, Ph.D.
Senior Engineer | National Wind Technology Center (NWTC)

National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway | Golden, CO 80401
+1 (303) 384 – 7026 | Fax: +1 (303) 384 – 6901
nwtc.nrel.gov

Jannik.Luehning
Posts: 7
Joined: Thu May 27, 2021 6:18 am
Organization: University of Applied Sciences Berlin
Location: Berlin, Germany

### Re: Processing linearization output to obtain PID controller coefficients

Dear Jason,
Thank you for your quick response.
As you suggested I reduced the the DOFs to the GenDOF only. However, I still encounter some issues.

• The MBC now fails with the error “fx_mbc3 WARNING: Number of blades is 0, not 3. MBC transformation was not performed.” I can still obtain the AvgA, AvgB, etc. matrices.
• The AvgA matrix is now resulting in [0,1;67.126,-5.777], if I understand you correctly the first column is supposed to be all zero (which is not the case) and can then be eliminated. What could be the issue here? And even if I could eliminate the first column, I would still have a vector with two values, how would I use this vector in eq. 3.8 from the paper?
• The AvgB matrix is a 2x9 matrix, what would be the procedure here?
Thanks for your help. I also attached my linearization files and a screenshot of my linearization-settings.
Kind regards
Jannik
Attachments
linerization-setup.png (54.43 KiB) Viewed 213 times
model-windturbine-lin.zip

Jason.Jonkman
Posts: 5975
Joined: Thu Nov 03, 2005 4:38 pm
Location: Boulder, CO
Contact:

### Re: Processing linearization output to obtain PID controller coefficients

Dear Jannik,

• When you don't have any states in the rotating frame, then MBC3 does not apply, but you can still azimuth-average the matrices.
• As the forum post linked above discussed, you should eliminate the column associated with the generator-azimuth state (assuming it is virtually zero) and you can then eliminate the first row of A and B because it has nothing but zeros and the trivial relationship that generator speed equals itself (A(1,2) = 1). The A matrix will then be a scalar and B will be a row vector.
• If A(2,1) is nonzero (before eliminating rows and columns), I would guess the value is nonzero because of numerical roundoff. I would suggest plotting A(2,1) across azimuth angle (which is reported in x_op(1)) to see if the mean is close to zero, as I would expect it to be. Ensuring the solution is in periodic steady state before linearizing (e.g., virtually constant speed), ensuring that the linearization covers one full rotation of the rotor, and ensuring the output precision is high enough (e.g., OutFmt = "ES17.9E3") should help.
• You can ignore any column in B that is not needed.
Best regards,
Jason Jonkman, Ph.D.
Senior Engineer | National Wind Technology Center (NWTC)

National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway | Golden, CO 80401
+1 (303) 384 – 7026 | Fax: +1 (303) 384 – 6901
nwtc.nrel.gov

Jannik.Luehning
Posts: 7
Joined: Thu May 27, 2021 6:18 am
Organization: University of Applied Sciences Berlin
Location: Berlin, Germany

### Re: Processing linearization output to obtain PID controller coefficients

Dear Jason,
• As you suggested, I made sure that the rotor speed was constant before linearizing, that the linearization covers a full rotation and increased the output precision. I also reduced the time step. My azimuth-averaged A(2,1) is still nonzero. Do you have another suggestion? I plotted A(2,1) vs. azimuth angles (see attachment). Does it seem reasonable to you? How can I estimate how big the effect of a nonzero average A(2,1) would be?
• Which column of B corresponds to the generator speed? I could not find any resources which describe this.
Thank you and kind regards
Jannik
Attachments
A(2_1)-vs-azimuth.png (15.95 KiB) Viewed 197 times

Jason.Jonkman
Posts: 5975
Joined: Thu Nov 03, 2005 4:38 pm
Location: Boulder, CO
Contact:

### Re: Processing linearization output to obtain PID controller coefficients

Dear Jannik,

From what I can see, the average value does look close to zero except for the presence of "spikes" at 60, 180, and 300 degrees azimuth, which I presume are associated with with the tower influence model. My guess is that the mean will get close to zero if the tower influence model is disabled. It looks likes enabling the tower influence model will result in some nonzero mean. I'm not sure how important tower influence is in your case, but if it is very important to you, I would probably suggest linearizing at a finer azimuth resolution to better resolve the "spike".

The generator speed is not a column of B. The list of inputs making up the columns of B is described at the top of the linearization (*.lin) file in the section titled, "Order of inputs:".

Best regards,
Jason Jonkman, Ph.D.
Senior Engineer | National Wind Technology Center (NWTC)

National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway | Golden, CO 80401
+1 (303) 384 – 7026 | Fax: +1 (303) 384 – 6901
nwtc.nrel.gov

Jannik.Luehning
Posts: 7
Joined: Thu May 27, 2021 6:18 am
Organization: University of Applied Sciences Berlin
Location: Berlin, Germany

### Re: Processing linearization output to obtain PID controller coefficients

Dear Jason,
• I reduced the Azimuth to 2 degrees and was indeed able to obtain a value for A(2,1) which is close to zero. The “spike” did actually resolve in a downward and upward spike (see attachment).
• Thanks for the hint regarding the description of input ports. Is my assumption correct that I will have to use B(2,9), which is “collective blade-pitch command”, as input for B?
• As my baseline pitch controller model so far does not react as expected, I am trying to factor out possible mistakes. Regarding the linearization, would I have to linearize with ElastoDyn enabled or disabled? If so, I assume I would have to set the rated torque as constant?
Kind regards
Jannik
Attachments
A(2_1)-vs-azimuth-180lin.png (18.94 KiB) Viewed 156 times

Jason.Jonkman
Posts: 5975
Joined: Thu Nov 03, 2005 4:38 pm
Location: Boulder, CO
Contact:

### Re: Processing linearization output to obtain PID controller coefficients

Dear Jannik,

I'm glad you better resolved the "spike" which now results in a zero mean for A(2,1).

I agree that column 9 in the standard inputs is collective blade-pitch, which sounds like the input you need.

I'm not sure understand enough about what you are doing to be able to answer your last question. OpenFAST does not allow you to disable ElastoDyn altogether (although you can disable all of the ElastoDyn DOFs).

Best regards,
Jason Jonkman, Ph.D.
Senior Engineer | National Wind Technology Center (NWTC)

National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway | Golden, CO 80401
+1 (303) 384 – 7026 | Fax: +1 (303) 384 – 6901
nwtc.nrel.gov

Jannik.Luehning
Posts: 7
Joined: Thu May 27, 2021 6:18 am
Organization: University of Applied Sciences Berlin
Location: Berlin, Germany

### Re: Processing linearization output to obtain PID controller coefficients

Dear Jason,

sorry for the confusion, I meant ServoDyn not ElastoDyn. So far, I linearized my model with ServoDyn disabled. To linearize at an operating point with rated generator speed I must set a high pitch angle due to the lacking generator torque. My reasoning was, that I might need to include the generator torque through ServoDyn. Is that correct?

Kind regards,
Jannik

Jason.Jonkman
Posts: 5975
Joined: Thu Nov 03, 2005 4:38 pm
Location: Boulder, CO
Contact:

### Re: Processing linearization output to obtain PID controller coefficients

Dear Jannik,

Yes, that sounds correct.

Best regards,
Jason Jonkman, Ph.D.
Senior Engineer | National Wind Technology Center (NWTC)

National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway | Golden, CO 80401
+1 (303) 384 – 7026 | Fax: +1 (303) 384 – 6901
nwtc.nrel.gov