# Questions regarding the Kp gains of ROSCO in Region 2

**URL:** <https://forums.nlr.gov/t/questions-regarding-the-kp-gains-of-rosco-in-region-2/2426>\
**Category:** Computer-Aided Engineering Software Tools\
**Created:** [March 18, 2021, 2:19pm UTC](https://forums.nlr.gov/t/questions-regarding-the-kp-gains-of-rosco-in-region-2/2426 "2021-03-18T14:19:56Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xianping.Du](https://avatars.discourse-cdn.com/v4/letter/x/ce73a5/32.png) [@Xianping.Du](https://forums.nlr.gov/u/Xianping.Du)\
**Post date:** [March 18, 2021, 2:19pm UTC](https://forums.nlr.gov/t/questions-regarding-the-kp-gains-of-rosco-in-region-2/2426/1 "2021-03-18T14:19:56Z")

</div>

Dear Jason, Bonnie, or Nikhar,

I am working on the ROSCO control tuning but I have a question regarding the Kp gain in Region 2. The paper (Nikhar et al 2019) mentions that the A is parameterized by wind velocity, but I only found a single Kp in the ROSCO controller for NREL5MW, DTU10MW, and IEC15MW. I read the ROSCO code and Simulink model and there is no scheduling process for Kp(v). Recently, I found there is an option in the ROSCO\_toolbox ([url][ROSCO\_toolbox/controller.py at 8ac261d15354dcbdfa645af75a74de29a23c55a6 · NREL/ROSCO\_toolbox · GitHub](https://github.com/NREL/ROSCO_toolbox/blob/8ac261d15354dcbdfa645af75a74de29a23c55a6/ROSCO_toolbox/controller.py#L533%5B/url%5D)), which scheduled the Kp based on the wind velocity vector below the rated wind speed and also has an option to specify a wind speed to interpolate the Kp gain at this point.

Does this mean the single Kp\_vs in the ROSCO DISCON.IN is interpolated at a fixed wind speed? If so, what is this specific wind speed? If else, what is the condition? Thank you

Reference:  
Abbas, N.J., A. Wright, and L. Pao. An Update to the National Renewable Energy Laboratory Baseline Wind Turbine Controller. in Journal of Physics: Conference Series. 2020.

---

<div class="post-metadata">

**Author:** ![Nikhar.Abbas](https://avatars.discourse-cdn.com/v4/letter/n/3da27b/32.png) [@Nikhar.Abbas](https://forums.nlr.gov/u/Nikhar.Abbas)\
**Post date:** [March 18, 2021, 8:39pm UTC](https://forums.nlr.gov/t/questions-regarding-the-kp-gains-of-rosco-in-region-2/2426/2 "2021-03-18T20:39:50Z")

</div>

Hi Xianping,

This is admittedly not very clear - sorry about that!

The region two gain schedule is, technically, scheduled by v and calculated at each wind speed. In the ROSCO toolbox, this happens here:  
[github.com/NREL/ROSCO\_toolbox/b … er.py#L252](https://github.com/NREL/ROSCO_toolbox/blob/main/ROSCO_toolbox/controller.py#L252)

When the DISCON.IN file is written, the last value in the `vs_gain_schedule` is used:  
[github.com/NREL/ROSCO\_toolbox/b … es.py#L123](https://github.com/NREL/ROSCO_toolbox/blob/8ac261d15354dcbdfa645af75a74de29a23c55a6/ROSCO_toolbox/utilities.py#L123)

So, this corresponds to, basically, rated wind speed, as it is the wind speed coresponding to the last value in v\_below\_rated as defined here: [github.com/NREL/ROSCO\_toolbox/b … er.py#L161](https://github.com/NREL/ROSCO_toolbox/blob/8ac261d15354dcbdfa645af75a74de29a23c55a6/ROSCO_toolbox/controller.py#L161)

I hope this clears things up for you.

Cheers,  
Nikhar

---

<div class="post-metadata">

**Author:** ![Xianping.Du](https://avatars.discourse-cdn.com/v4/letter/x/ce73a5/32.png) [@Xianping.Du](https://forums.nlr.gov/u/Xianping.Du)\
**Post date:** [March 18, 2021, 9:18pm UTC](https://forums.nlr.gov/t/questions-regarding-the-kp-gains-of-rosco-in-region-2/2426/3 "2021-03-18T21:18:03Z")

</div>

Hi Nikhar,

Thank you for your reply. Yes, I also found this operation in writing DISCON.IN. Have a good evening!

Xianping

---

<div class="post-metadata">

**Author:** ![Ali.Elyaakoubi](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@Ali.Elyaakoubi](https://forums.nlr.gov/u/Ali.Elyaakoubi)\
**Post date:** [March 9, 2024, 3:39pm UTC](https://forums.nlr.gov/t/questions-regarding-the-kp-gains-of-rosco-in-region-2/2426/4 "2024-03-09T15:39:31Z")

</div>

Dear Dr @Nikhar.Abbas  
Please helps, when proceeding to executing rosco control for nrel 5MW in simulink FAST V8, I found parameters missing  
How to get these parameters please  
and what look like these errors

 ![fast](https://europe1.discourse-cdn.com/nrel/original/2X/1/1f9ac91bbd8e60d704ae09fd2fa6b24db153629d.jpeg)

---

<div class="post-metadata">

**Author:** ![Jason.Jonkman](https://dub1.discourse-cdn.com/nrel/user_avatar/forums.nlr.gov/jason.jonkman/32/3086_2.png) [@Jason.Jonkman](https://forums.nlr.gov/u/Jason.Jonkman)\
**Post date:** [March 11, 2024, 5:04pm UTC](https://forums.nlr.gov/t/questions-regarding-the-kp-gains-of-rosco-in-region-2/2426/5 "2024-03-11T17:04:04Z")

</div>

Dear @Ali.Elyaakoubi,

The script FAST2Matlab.m is included in the MATLAB Toolbox: [matlab-toolbox/FAST2MATLAB at main · OpenFAST/matlab-toolbox · GitHub](https://github.com/OpenFAST/matlab-toolbox/tree/main/FAST2MATLAB). From the error, it doesn’t sound like you have the MATLAB Toolbox installed and accessible.

Best regards

---

<div class="post-metadata">

**Author:** ![Ali.Elyaakoubi](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@Ali.Elyaakoubi](https://forums.nlr.gov/u/Ali.Elyaakoubi)\
**Post date:** [March 11, 2024, 6:55pm UTC](https://forums.nlr.gov/t/questions-regarding-the-kp-gains-of-rosco-in-region-2/2426/6 "2024-03-11T18:55:14Z")

</div>

Normally in FAST V8, it is not needed this script, how we can proceed with this script to execute openFast dear @Jason.Jonkman

---

<div class="post-metadata">

**Author:** ![Jason.Jonkman](https://dub1.discourse-cdn.com/nrel/user_avatar/forums.nlr.gov/jason.jonkman/32/3086_2.png) [@Jason.Jonkman](https://forums.nlr.gov/u/Jason.Jonkman)\
**Post date:** [March 11, 2024, 11:35pm UTC](https://forums.nlr.gov/t/questions-regarding-the-kp-gains-of-rosco-in-region-2/2426/7 "2024-03-11T23:35:12Z")

</div>

Dear @Ali.Elyaakoubi,

I’m not sure I understand. Can you clarify what you are trying to do? What script are trying to execute?

Best regards,

---

<div class="post-metadata">

**Author:** ![Ali.Elyaakoubi](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@Ali.Elyaakoubi](https://forums.nlr.gov/u/Ali.Elyaakoubi)\
**Post date:** [March 15, 2024, 11:05pm UTC](https://forums.nlr.gov/t/questions-regarding-the-kp-gains-of-rosco-in-region-2/2426/8 "2024-03-15T23:05:48Z")

</div>

Dear @Jason.Jonkman, i want to execute rosco model in simulink. Please tell me how to get the controller parameters as mentioned in screenshot

 ![fast](https://europe1.discourse-cdn.com/nrel/original/2X/1/1f23eeede8399015a90ca9be9d8c7a1f95e52ef8.jpeg)

Thank you in advance

---

<div class="post-metadata">

**Author:** ![Jason.Jonkman](https://dub1.discourse-cdn.com/nrel/user_avatar/forums.nlr.gov/jason.jonkman/32/3086_2.png) [@Jason.Jonkman](https://forums.nlr.gov/u/Jason.Jonkman)\
**Post date:** [March 15, 2024, 11:09pm UTC](https://forums.nlr.gov/t/questions-regarding-the-kp-gains-of-rosco-in-region-2/2426/9 "2024-03-15T23:09:50Z")

</div>

Dear @Ali.Elyaakoubi,

I’m sorry, but I don’t understand your question. Please clarify.

Best regards,

---

<div class="post-metadata">

**Author:** ![Ali.Elyaakoubi](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@Ali.Elyaakoubi](https://forums.nlr.gov/u/Ali.Elyaakoubi)\
**Post date:** [March 15, 2024, 11:12pm UTC](https://forums.nlr.gov/t/questions-regarding-the-kp-gains-of-rosco-in-region-2/2426/10 "2024-03-15T23:12:17Z")

</div>

Dear @Jason.Jonkman, please how to fix this error when executing rosco model in simulink

 ![fast](https://europe1.discourse-cdn.com/nrel/original/2X/1/1f23eeede8399015a90ca9be9d8c7a1f95e52ef8.jpeg)

Thanks

---

<div class="post-metadata">

**Author:** ![Daniel.Zalkind](https://avatars.discourse-cdn.com/v4/letter/d/5daacb/32.png) [@Daniel.Zalkind](https://forums.nlr.gov/u/Daniel.Zalkind)\
**Post date:** [March 18, 2024, 3:39pm UTC](https://forums.nlr.gov/t/questions-regarding-the-kp-gains-of-rosco-in-region-2/2426/11 "2024-03-18T15:39:48Z")

</div>

Hi,

I think this kind of issue is better suited for the ROSCO GitHub.

It appears that you’re not loading the correct information into the Matlab workspace before running the simulink model. The `runFAST.m` script was developed for this purpose, but it’s not actively maintained or tested: [https://github.com/NREL/ROSCO/tree/main/Matlab\_Toolbox](https://github.com/NREL/ROSCO/tree/main/Matlab_Toolbox)

Best, Dan

---

<div class="post-metadata">

**Author:** ![Ali.Elyaakoubi](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@Ali.Elyaakoubi](https://forums.nlr.gov/u/Ali.Elyaakoubi)\
**Post date:** [March 20, 2024, 9:12pm UTC](https://forums.nlr.gov/t/questions-regarding-the-kp-gains-of-rosco-in-region-2/2426/12 "2024-03-20T21:12:43Z")

</div>

Dear @Daniel.Zalkind  
I have executed the runFAST script, but an error occured always. Can you please let me know what i am did wrong

 ![fast](https://europe1.discourse-cdn.com/nrel/original/2X/4/4eb0ccad42c897253707ead45a79a4fe2421a75c.jpeg)

Best regrads

---

<div class="post-metadata">

**Author:** ![Daniel.Zalkind](https://avatars.discourse-cdn.com/v4/letter/d/5daacb/32.png) [@Daniel.Zalkind](https://forums.nlr.gov/u/Daniel.Zalkind)\
**Post date:** [March 20, 2024, 10:19pm UTC](https://forums.nlr.gov/t/questions-regarding-the-kp-gains-of-rosco-in-region-2/2426/13 "2024-03-20T22:19:08Z")

</div>

Hi Ali,

I don’t know what is wrong. We can’t actively maintain these matlab scripts, but don’t want to remove them because they are helpful to some users. I suggest you set a break point at that part of the code and review the error in greater detail. There may be some helpful previous issues and solutions on the GitHub page: [Issues · NREL/ROSCO · GitHub](https://github.com/NREL/ROSCO/issues?q=is%3Aissue+matlab)

Best, Dan
