# Different Pitch rate in and outside FAST SFunction in Simulink

**URL:** <https://forums.nlr.gov/t/different-pitch-rate-in-and-outside-fast-sfunction-in-simulink/2316>\
**Category:** Controls\
**Created:** [August 13, 2020, 6:22am UTC](https://forums.nlr.gov/t/different-pitch-rate-in-and-outside-fast-sfunction-in-simulink/2316 "2020-08-13T06:22:23Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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 13, 2020, 12:46pm UTC](https://forums.nlr.gov/t/different-pitch-rate-in-and-outside-fast-sfunction-in-simulink/2316/2 "2020-08-13T12:46:43Z")

</div>

Dear Yunpeng,

Similar questions have been asked and answered before, e.g.:

> [@Pitch control error](http://forums.nlr.gov/t/pitch-control-error/1319/17):
>
> Dear Barry, The rapidly varying blade-pitch angles you are seeing in your Simulink model are likely caused by the extrapolation of inputs implemented within the FAST S-Function (as discussed in other forum topics e.g. [S-Function input output signal mismatch - #2 by Jason.Jonkman](http://forums.nlr.gov/t/s-function-input-output-signal-mismatch/1502/2)). My guess is the pitch angle of 5 degrees that you are setting in your Simulink model does not match the initial blade-pitch angle set within the ElastoDyn primary input file, hence the large variation in pitch angles…

> [@pitch and torque spikes on variations](http://forums.nlr.gov/t/pitch-and-torque-spikes-on-variations/1762/2):
>
> Dear Leanardo, The FAST S-Function will use extrapolated values of the inputs from Simulink when advancing from time step n to n+1 (linear or quadratic extrapolation, depending on your setting of InterpOrder). This extrapolation may cause problems (e.g. the spikes you are seeing) if the pitch-angle command is not a smooth function e.g .when stepping up the pitch angle as you are. I would suggest ramping up the pitch angle with a smooth function to avoid problems with the extrapolation (prefer…

> [@S-Function input output signal mismatch](http://forums.nlr.gov/t/s-function-input-output-signal-mismatch/1502/2):
>
> Dear Joannes, The FAST v8 S-Function for the MATLAB/Simulink interface is a discrete-time block, meaning that inputs go in at time step “n” and outputs come out at time step “n+1”. Within the block, the output calculation at n+1 involves an extrapolation of inputs (linear or quadratic), which is normally negligible when the inputs vary slowly in time, but is visible when the inputs vary a lot between time steps. The error seems to imply that the model has going unstable, with vary large unrea…

> [@Start-up of NREL 5MW](http://forums.nlr.gov/t/start-up-of-nrel-5mw/2277/3):
>
> Dear Jason, Thanks for your immediate reply. Yes, you are right, it seems to be related to the initial conditions. I thought about that before, but just wasn’t aware how sensitive the controller is on poor initial conditions. Animated by your post, I run a simulation with TPCOn = 0, a steady wind of 12 m/s and an initial rotor speed of 12.1 rpm - and everything went fine. However, even with a slight change of the initial rotor speed to e.g. 12.25 rpm, the pitch controller becomes unstable resu…

Best regards,

---

_[View the full topic](https://forums.nlr.gov/t/different-pitch-rate-in-and-outside-fast-sfunction-in-simulink/2316)._
