Profile image

Fly by Wire Code Help

4,230 Red920  1.9 years ago

I dont know how to adjust the plane's fbw because it wobble uncontrollably. Does anyone know what number to edit on the code?

Example for the roll:

clamp01(Throttle > 0)(clamp(Pitch/1.5 - ( (PitchRate/(35+(80abs(Pitch)))) + ( clamp01(1-Activate1)clamp(AngleOfAttack/30,-1,1) ) )+((( RollRate/(80+(400abs(Roll))-(abs(Yaw)*60)) ) + Roll)),-1,1))+(Trim/8)-0.08

i dunno what value i will change to suit to my plane ( sorry about my grammar).

@GuyFolk is the owner of this funky tree code.

  • Log in to leave a comment
  • Profile image

    @Red920
    you're welcome :)

    +1 1.9 years ago
  • Profile image
    4,230 Red920

    @ZeroWithSlashedO TYSM I change the 80 on the third section of the code and it stop wobbling 😯.

    +1 1.9 years ago
  • Profile image

    so essentially what the code is trying to do is:

    clamp01(Throttle > 0) * (clamp(Pitch/1.5 - ( (PitchRate/(35+(80 * abs(Pitch))))

    it tries to reduce or increase the input of Pitch with PitchRate, which the sensitivity adjusts with the absolute value of Pitch (always maintains a positive value)

    (clamp01(1 - Activate1) * clamp(AngleOfAttack/30, -1, 1)))

    it also tries to move by the output of AngleOfAttack which can be deactivated via AG1

    ((clamp(RollRate/(80+(400 * abs(Roll))-(abs(Yaw) * 60)) ) + Roll)),-1,1))

    it also tries to move via Roll, stabilized by RollRate which the sensitivity is determined by the absolute value of Roll and Yaw

    (Trim/8)-0.08

    and lastly, it also moves by trim


    TL;DR, it's a Pitch damper (first section of code) an AoA Limiter (second section of code), and a Roll damper (third section of code) at the same time

    this is me trying to understand how the code works

    as for your question, try increasing the 35 on the first section of code or the 30 on the second section of code if it's wobbling up and down, and try changing the 80 on the third section of the code if it's wobbling from side to side

    if any of those don't work, just play around with it :)

    +2 1.9 years ago