# Torque Controller

**URL:** <https://forums.nlr.gov/t/torque-controller/675>\
**Category:** Controls\
**Created:** [May 7, 2013, 7:50pm UTC](https://forums.nlr.gov/t/torque-controller/675 "2013-05-07T19:50:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Todd.Britt](https://avatars.discourse-cdn.com/v4/letter/t/977dab/32.png) [@Todd.Britt](https://forums.nlr.gov/u/Todd.Britt)\
**Post date:** [May 7, 2013, 7:50pm UTC](https://forums.nlr.gov/t/torque-controller/675/1 "2013-05-07T19:50:51Z")

</div>

I am designing a 1.5MW (Offshore) machine that I am adapting a controller for. How do I calculate Region 1.5 and Region 2.5 offsets? Also, is there a 1.5MW controller that I would be able to look at as a reference to mine? The CertTest area of Fast has the WindPACT .fst file, but there is no controller associated with it.

Thank you!

---

<div class="post-metadata">

**Author:** ![Paul.Fleming](https://dub1.discourse-cdn.com/nrel/user_avatar/forums.nlr.gov/paul.fleming/32/5737_2.png) [@Paul.Fleming](https://forums.nlr.gov/u/Paul.Fleming)\
**Post date:** [May 7, 2013, 9:23pm UTC](https://forums.nlr.gov/t/torque-controller/675/2 "2013-05-07T21:23:57Z")

</div>

Hi,

I’m not myself aware of a 1.5 controller file, but I wonder if you have the windpact.fst file, are there details about the VS law within the FST file itself, ie the values of VS\_RtGnSp, VS\_RtTq, VS\_Rgn2K and VS\_SlPc? This should provide most of what you would need to design a basic controller.

Regarding region 1.5 and 2.5, these can either be implemented as PI controllers (see for example: [upwind.eu/pdf/D%205.1.1.%20C … urbine.pdf](http://www.upwind.eu/pdf/D%205.1.1.%20Controller%20for%205MW%20reference%20turbine.pdf) ) or more simply as is often done, these are just linear interpolations from your optimal kw2 law in region 2 to rated torque in region 3. The parameters above would outline such a line (determined by the slip curve or slope). Similarly, 1.5 would be down to 0 torque.

Hope this helps!

Paul

---

<div class="post-metadata">

**Author:** ![Todd.Britt](https://avatars.discourse-cdn.com/v4/letter/t/977dab/32.png) [@Todd.Britt](https://forums.nlr.gov/u/Todd.Britt)\
**Post date:** [June 5, 2013, 5:44pm UTC](https://forums.nlr.gov/t/torque-controller/675/3 "2013-06-05T17:44:57Z")

</div>

I have been able to get my 1.5 MW machine to run in simulink, but my GenTq and GenPwr are not leaving region 1.5 The GenSpeed and RotSpeed look okay to me but I may be overlooking something. If anyone can help that would be great!

---

<div class="post-metadata">

**Author:** ![Paul.Fleming](https://dub1.discourse-cdn.com/nrel/user_avatar/forums.nlr.gov/paul.fleming/32/5737_2.png) [@Paul.Fleming](https://forums.nlr.gov/u/Paul.Fleming)\
**Post date:** [June 5, 2013, 6:07pm UTC](https://forums.nlr.gov/t/torque-controller/675/4 "2013-06-05T18:07:50Z")

</div>

I should be able to help. Could you use a save to workspace block within your simulink code to save all the input and output signals to the Torque Controller block and post the .mat file? Also, could you copy and paste the code of regionSelectTq?

Paul

---

<div class="post-metadata">

**Author:** ![Todd.Britt](https://avatars.discourse-cdn.com/v4/letter/t/977dab/32.png) [@Todd.Britt](https://forums.nlr.gov/u/Todd.Britt)\
**Post date:** [June 6, 2013, 5:11pm UTC](https://forums.nlr.gov/t/torque-controller/675/5 "2013-06-06T17:11:18Z")

</div>

Thank you so much Paul. I was receiving an error stating the .mat extension was not allowed as an attachment, so I was able to convert it to a spread sheet. Let me know if you need it in a different format as I would be able to email it to you. The file has 6 rows, Time, Generator torque (which is row two and three: Command Torque and Tg respectively), Pitch, Switch, and HSSspeed. I was unable to figure out how to label them in the To File Block.

Below is the code for the embedded Matlab Baseline Torque Controller (regionSelectTq)

Thank you again for taking time to help me.

-Todd

---

<div class="post-metadata">

**Author:** ![Paul.Fleming](https://dub1.discourse-cdn.com/nrel/user_avatar/forums.nlr.gov/paul.fleming/32/5737_2.png) [@Paul.Fleming](https://forums.nlr.gov/u/Paul.Fleming)\
**Post date:** [June 11, 2013, 8:40pm UTC](https://forums.nlr.gov/t/torque-controller/675/6 "2013-06-11T20:40:38Z")

</div>

I think that you have some unit conversion issues (I believe K and w are not in the same units, or same side of the gearbox at least), but I’m not sure the exact rated values of your turbine.

I have found where you can reference the 1.5 controller that should be helpful.

First you can get some input values from Test12.fst:

1800.0 VS\_RtGnSp - Rated generator speed for simple variable-speed generator control (HSS side) (rpm) [used only when VSContrl=1]  
8376.58 VS\_RtTq - Rated generator torque/constant generator torque in Region 3 for simple variable-speed generator control (HSS side) (N-m) [used only when VSContrl=1]  
0.002585 VS\_Rgn2K - Generator torque constant in Region 2 for simple variable-speed generator control (HSS side) (N-m/rpm^2) [used only when VSContrl=1]  
9999.9E-9 VS\_SlPc - Rated generator slip percentage in Region 2 1/2 for simple variable-speed generator control (%) [used only when VSContrl=1]

Next inside of FAST.f90 you’ll find the control logic:

```
  IF ( HSS_Spd >= VS_RtGnSp ) THEN ! We are in region 3 - torque is constant
     GenTrq = VS_RtTq
  ELSEIF ( HSS_Spd < VS_TrGnSp ) THEN ! We are in region 2 - torque is proportional to the square of the generator speed
     GenTrq = VS_Rgn2K*HSS_Spd*HSS_Spd
  ELSE ! We are in region 2 1/2 - simple induction generator transition region
     GenTrq = VS_Slope*( HSS_Spd - VS_SySp )
  ENDIF

```

Finally, look at FAST\_IO.f90 for the conversion from input to stored variables:

VS\_RtGnSp = VS\_RtGnSp\* RPM2RPS ! Convert rated speed to rad/sec.  
VS\_Rgn2K = VS\_Rgn2K /( RPM2RPS_RPM2RPS ) ! Convert Region 2 torque constant to Nm/(rad/sec)^2.  
VS\_SySp = VS\_RtGnSp/( 1.0 + 0.01_VS\_SlPc ) ! Synchronous speed of region 2 1/2 induction generator.  
IF ( VS\_SlPc \< SQRT(EPSILON(VS\_SlPc) ) ) THEN ! We don’t have a region 2 so we’ll use VS\_TrGnSp = VS\_RtGnSp  
VS\_Slope = 9999.9  
VS\_TrGnSp = VS\_RtGnSp  
ELSE  
VS\_Slope = VS\_RtTq /( VS\_RtGnSp - VS\_SySp ) ! Torque/speed slope of region 2 1/2 induction generator.  
IF ( ABS(VS\_Rgn2K) \< EPSILON(VS\_SlPc) ) THEN ! .TRUE. if the Region 2 torque is flat, and thus, the denominator in the ELSE condition is zero  
VS\_TrGnSp = VS\_SySp ! Transitional generator speed between regions 2 and 2 1/2.  
ELSE ! .TRUE. if the Region 2 torque is quadratic with speed  
VS\_TrGnSp = ( VS\_Slope - SQRT( VS\_Slope\*( VS\_Slope - 4.0_VS\_Rgn2K_VS\_SySp ) ) )/( 2.0\*VS\_Rgn2K ) ! Transitional generator speed between regions 2 and 2 1/2.  
ENDIF  
END IF

Note that the 1.5 currently has no 2.5, but if your turbine is a little different than you could, although it won’t do much given the closeness of the optimal curve and the rated operating point.

Good luck!

Paul
