Profile image

Limit roll when applying max pitch

10.3k VisionAviation  2.7 years ago

Hi,

I'm making a jet which uses canards for pitch and the rear stabilizers for roll. And it works absolutely beautifully, till you apply max pitch and max roll, which makes the aircraft stall.

Is there an input that I can put on the "roll" rotators, which basically limits the min/max input when full pitch is applied?

So something like Pitch>95%? Roll -0.9 0.9 | Pitch<95%? Roll -1 1
But then code that actually works

  • Log in to leave a comment
  • Profile image
    11.6k JesusChrist

    @VisionAviation Try this version:

    Pitch > 0.95 ? clamp(Roll, -0.9, 0.9) : Roll
    
    2.7 years ago
  • Profile image

    @Korzalerke Hey, there actually seems to be a bit of a problem with that code. It does limit roll but it also makes the rotators respond to pitch. Is there a way to remove that?

    2.7 years ago
  • Profile image

    @Korzalerke Yeah I figured that one already, thanks!

    +1 2.7 years ago
  • Profile image
    11.6k JesusChrist

    @VisionAviation Remember to put a - before the first 0.9 or else it won't go up, just something i forgot.

    2.7 years ago
  • Profile image

    @Korzalerke Legend, cheers!

    2.7 years ago
  • Profile image
    11.6k JesusChrist

    Try this:

    Pitch > 0.95 ? clamp(Roll, -0.9, 0.9) : Pitch - Roll
    
    2.7 years ago