Profile image

[HELP] Need help writing code for variable control surface sensitivity

7,786 SimplyNonsensical  2.2 years ago

I'm currently building a plane that needs more angle on the control surface at a speed threshold.

I've tried
Pitch*0.5 + Trim*0.07 + Roll*0.5 - (abs(TAS>390) ? PitchRate*0.005 : PitchRate*0.05)
which doesn't function.

and

Pitch*0.5 + Trim*0.07 - Roll*0.5 - IAS>375 ? PitchRate*0.005 : PitchRate*0.05
which only causes the control surface to spazz out.

If you're interested, here.

Thanks.

  • Log in to leave a comment
  • Profile image
    81.4k ReinMcDeer

    Judging from the spaghetti...
    You should try multiplying instead of subtracting.
    Pitch*.5*(f(IAS))+Trim*.07+Roll*.5
    Where f(IAS) is some function of your airspeed. This should be more gradual and less spazzy if f(IAS) doesn't involve the Condition ? True : False. A clamped linear or exponential function should do.

    +1 2.2 years ago