# Generator Power

**URL:** <https://forums.nlr.gov/t/generator-power/7466>\
**Category:** Controls\
**Created:** [August 29, 2024, 2:35pm UTC](https://forums.nlr.gov/t/generator-power/7466 "2024-08-29T14:35:11Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jared.Sanchez](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Jared.Sanchez](https://forums.nlr.gov/u/Jared.Sanchez)\
**Post date:** [August 29, 2024, 2:35pm UTC](https://forums.nlr.gov/t/generator-power/7466/1 "2024-08-29T14:35:11Z")

</div>

Hello everyone, I’m working with the NREL 5MW WT with FAST/Simulink. I’m aplying a control systhem for Pitch and Torque but I have truble, at the time I extract the generated power from the FAST funtion the values tend to 0, I’ve check the multiplication of torque and generator speed and it goes fine. Could someone give advice on how to get a diferent value?  
In the graphics, the orange is what I should be getting (obtained from torque and wg) and the purple is the generator output.

 ![Captura de pantalla 2024-08-29 163234](https://europe1.discourse-cdn.com/nrel/original/2X/6/6c78f062234a9695a30ecc620ab5daf2949d51fc.png)  
 ![Captura de pantalla 2024-08-29 163312](https://europe1.discourse-cdn.com/nrel/original/2X/7/75a40ebf2580e10a83d360d402c64d4b5f0078be.png)

---

<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:** [August 29, 2024, 4:35pm UTC](https://forums.nlr.gov/t/generator-power/7466/2 "2024-08-29T16:35:47Z")

</div>

Dear @Jared.Sanchez,

Which FAST output are you plotting? Is this output `GenPwr` from ServoDyn? If you are using `VSContrl` = 4 to receive torque and power from Simulink, ServoDyn output `GenPwr` simply returns the value passed to the S-Function from Simulink.

Best regards,

---

<div class="post-metadata">

**Author:** ![Jared.Sanchez](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Jared.Sanchez](https://forums.nlr.gov/u/Jared.Sanchez)\
**Post date:** [September 5, 2024, 9:50am UTC](https://forums.nlr.gov/t/generator-power/7466/3 "2024-09-05T09:50:13Z")

</div>

Yes, I’m using the VSContrl = 4, the situation is that my inputs (Power and torque) have real values and the product of those is quite similar to my power comand. The problem is that after entering to the FAST function, the value returs as near 0. I’ve already tried changing the order of inputs and checed the script but couldn’t got a good output.

 ![image](https://europe1.discourse-cdn.com/nrel/original/2X/4/4b2cdc92fdbcfdd65c1b910d0f8ac45c2770e10a.png)  
This is the script.

 ![image](https://europe1.discourse-cdn.com/nrel/original/2X/6/6d9aa1bcf7c9c1683ecebd5dd5d151f1f55f00a2.png)  
And this is what I’m sending as Power and Roque input.

---

<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:** [September 5, 2024, 12:32pm UTC](https://forums.nlr.gov/t/generator-power/7466/4 "2024-09-05T12:32:11Z")

</div>

Dear @Jared.Sanchez,

I would expect that with `VSContrl` = 4, that the `GenPwr` output from ServoDyn would match what you set the generator power input to the S-Function to be in Simulink. Are you plotting the `GenPwr` output from ServoDyn?

Best regards,

---

<div class="post-metadata">

**Author:** ![Jared.Sanchez](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Jared.Sanchez](https://forums.nlr.gov/u/Jared.Sanchez)\
**Post date:** [September 5, 2024, 5:55pm UTC](https://forums.nlr.gov/t/generator-power/7466/5 "2024-09-05T17:55:50Z")

</div>

Yes, I’m polting GenPwr from the ServoDyn

---

<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:** [September 5, 2024, 6:49pm UTC](https://forums.nlr.gov/t/generator-power/7466/6 "2024-09-05T18:49:47Z")

</div>

Is the generator torque you are inputting to the S-Function from Simulink what you are seeing in the `GenTq` output from ServoDyn?

---

<div class="post-metadata">

**Author:** ![Jared.Sanchez](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Jared.Sanchez](https://forums.nlr.gov/u/Jared.Sanchez)\
**Post date:** [September 5, 2024, 7:21pm UTC](https://forums.nlr.gov/t/generator-power/7466/7 "2024-09-05T19:21:04Z")

</div>

As `GenTq` output I’m getting this: the value seems to be fixed at 27

 ![image](https://europe1.discourse-cdn.com/nrel/original/2X/f/f47730a105499802af3c0ba5f1ce7e51378271ab.png)

In addition, the angular speed obteined from `RotSpeed` is this (the yellow line):

 ![image](https://europe1.discourse-cdn.com/nrel/original/2X/b/b78ea181eb6c78338d1a6a88b38d117929536041.png)

---

<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:** [September 5, 2024, 7:40pm UTC](https://forums.nlr.gov/t/generator-power/7466/8 "2024-09-05T19:40:59Z")

</div>

Dear @Jared.Sanchez,

It sounds to me like OpenFAST is not receiving the inputs from Simulink. Are you sure you’ve set `VSContrl` = 4? Do you have `GenTiStr` = `GenTiStp` = TRUE with `TimGenOn` = 0 s and `TimGenOf` \> `TMax`?

Best regards,

---

<div class="post-metadata">

**Author:** ![Jared.Sanchez](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Jared.Sanchez](https://forums.nlr.gov/u/Jared.Sanchez)\
**Post date:** [September 6, 2024, 11:58am UTC](https://forums.nlr.gov/t/generator-power/7466/9 "2024-09-06T11:58:16Z")

</div>

I have it as this:

 ![image](https://europe1.discourse-cdn.com/nrel/original/2X/7/755b9689b04416a8b60c906e4958e76562fd64dc.png)

Both conditions are `GenTiStr GenTiStp` are set as true and `TimGenOn = 0` . I’m silulating 200 seconds so the time is fine as 200 is smaller than 9999.9.

---

<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:** [September 6, 2024, 12:41pm UTC](https://forums.nlr.gov/t/generator-power/7466/10 "2024-09-06T12:41:34Z")

</div>

Another possible error is that you are plotting the incorrect column of output data from the OpenFAST output (_.out_ or _.outb_) file.

---

<div class="post-metadata">

**Author:** ![Jared.Sanchez](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Jared.Sanchez](https://forums.nlr.gov/u/Jared.Sanchez)\
**Post date:** [September 6, 2024, 12:45pm UTC](https://forums.nlr.gov/t/generator-power/7466/11 "2024-09-06T12:45:26Z")

</div>

It’s a scope with the extract funtion, do you know how can I verify if I’m using the correct column?  
In this way I’m getting something around 3,000 W but the turbine should be generating 100 times that.

---

<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:** [September 6, 2024, 1:02pm UTC](https://forums.nlr.gov/t/generator-power/7466/12 "2024-09-06T13:02:37Z")

</div>

Oh, I thought you were saying that the problem was that the OpenFAST outputs (`GenTq` and `GenPwr` from ServoDyn) were not matching what you are inputting to the S-Function from Simulink. Now, it sounds like the problem is within your own Simulink model. I can’t really help with that.

Best regards,

---

<div class="post-metadata">

**Author:** ![Jared.Sanchez](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Jared.Sanchez](https://forums.nlr.gov/u/Jared.Sanchez)\
**Post date:** [September 6, 2024, 1:06pm UTC](https://forums.nlr.gov/t/generator-power/7466/13 "2024-09-06T13:06:14Z")

</div>

Indeed thats the problem, the outputs don’t match the inputs. And don’t know why that keeps happening.
