Profile image

Need Help With a Funky Trees Code

495 Hellsverg  1.8 years ago

I'm trying to simulate aerodynamic compression at high speeds; I've already written a code for my elevons right here: clamp(clamp(Pitch*1, -1, 0.5) + -Roll*0.5, -1, 1)

It restricts the maximum deflection angle in a downwards pitch half to that of the upwards pitch, AND restricts the maximum overall deflection angle together with the roll angle. I did find a line of code that closely simulates aerodynamic compression right here: Pitch/(1+pow(IAS/150,2))

I want to retain the downwards pitch and roll angle restriction while also implementing the compression code, but I haven't managed to do so just yet.

Is it even possible?

  • Log in to leave a comment
  • Profile image
    46.9k PlaneFlightX

    @Hellsverg Just use what you wrote for pitch for roll. About the issue at high speeds, just tweak the values a bit.

    1.8 years ago
  • Profile image
    495 Hellsverg

    @PlaneFlightX YES, it works beautifully! But I also want the compression to affect the roll angle too. I've written this line but the effect is way too strong if I'm being honest. Too much compression at high speeds but just fine at 500-600kph: clamp(clamp(Pitch/(1+pow(IAS/343,2)), -1, 0.5) + -Roll/(1+pow(IAS/343,2))*0.5, -1, 1)

    1.8 years ago
  • Profile image
    46.9k PlaneFlightX

    From your first code, take the Pitch*1. Replace it with the second code. That should work.

    1.8 years ago