1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

FSXA Default Fly By Wire?

Discussion in 'Flight dynamics' started by Heretic, 10 Oct 2015.

  1. Heretic

    Heretic Resource contributor

    Joined:
    1 Feb 2007
    Messages:
    5,519
    Country:
    germany
    Has anyone ever investigated the default fly by wire functionality?

    I'd like to know if there are any ways to improve or tweak it for a certain aircraft.

    Because as-is, the system is simply junk for non-autopilot control. An empty A320 feels like a fully loaded 747 with broken control surfaces, especially in the pitch domain.
    Not to mention the disconnect bug at 100 feet that does not allow you to flare and the awful stall protection behaviour which does not disconnect the TO/GA mode after recovery and simply keeps the throttle firewalled.

    I understand what the real FBW is supposed to do and that flying an Airbus or F-16 or any other FBW aircraft feels different to flying a plane with direct (augmented) control surfaces, but what FSX presents as FBW is nowhere near usable.
     
  2. Heretic

    Heretic Resource contributor

    Joined:
    1 Feb 2007
    Messages:
    5,519
    Country:
    germany
    This is a gauge to at least fix the stall protection bug. It will simply disconnect and reconnect the Spoilers and Elevator computer after a safe speed has been attained to restore throttle and elevator control.

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    
    <SimBase.Document Type="AceXML" version="1,0">
      <Descr>AceXML Document</Descr>
      <Filename>A320_FWB.xml</Filename>
      <SimGauge.Gauge id="Gauge" ArtDirectory=".">
      <FloatPosition>0.000,0.000</FloatPosition>
      <Size>1,1</Size>
      <Update_When_Hidden>True</Update_When_Hidden> 
      <Update id="FBW Stuff">
      <Script>
      (A:Fly By Wire Alpha Protection,bool)
      (A:Airspeed select indicated or true, knots) 145 &gt; and
      (A:FLY BY WIRE SEC SWITCH:1, bool) and
      (L:FBW Alpha Recovery, bool) ! and
      if{ 1 (>K:FLY_BY_WIRE_SEC_TOGGLE) 1 (>L:FBW Alpha Recovery, bool) }
      
      (L:FBW Alpha Recovery, bool)
      (A:FLY BY WIRE SEC SWITCH:1, bool) ! and
      if{ 1 (>K:FLY_BY_WIRE_SEC_TOGGLE) }
      
      (L:FBW Alpha Recovery, bool)
      (A:Airspeed select indicated or true, knots) 150 &gt; and
      (A:FLY BY WIRE SEC SWITCH:1, bool) and
      if{ 0 (>L:FBW Alpha Recovery, bool) }
      </Script>
      </Update>  
      </SimGauge.Gauge>
    </SimBase.Document>
     
  3. Heretic

    Heretic Resource contributor

    Joined:
    1 Feb 2007
    Messages:
    5,519
    Country:
    germany
    Observations from flight tests with the default FBW in the default A321:

    1. If all computers are switched off, there is no control authority at all.
    2. The flight augmentation computer switches do not do anything in any of both modes (normal and direct)*.
    3. Any of the ELAC and SEC computer switches is enough to enable direct control mode.
    4. All three SEC computers and at least one ELAC computer is required for normal control mode.
    5. Normal control mode takes control of the yaw damper, hence no rudder authority.

    *Normal mode = sluggish, computer controlled, direct mode = direct input to control surfaces
     
  4. cheangjc

    cheangjc

    Joined:
    14 Aug 2011
    Messages:
    104
    Country:
    singapore
    I have, and its simply unusable from my experience no matter how many tweaks.

    You would have much better luck implementing a custom FBW system if you ever need it, as it can be used as part of an custom autopilot if you are at that level.
     
  5. Heretic

    Heretic Resource contributor

    Joined:
    1 Feb 2007
    Messages:
    5,519
    Country:
    germany
    I've tried coding a custom PID controller for FBW use, but realized too late that you need to disconnect joystick input from the control surfaces in order to achieve this.
    Implementing FBW via autopilot is doable for the pitch domain at least, but there's no "bank hold" mode.

    One other workaround that I've tested so far is auto-disconnecting one SEC computer below a certain altitude so that takeoffs and landings can be done in direct control mode without the hard handover from direct to normal at 100 feet. This would require an overhead panel tweak to turn the SEC1 toogle switch into a SEC1 arming switch.
     
  6. SierraB

    SierraB

    Joined:
    31 Oct 2012
    Messages:
    240
    Country:
    germany
    can confirm your observations. In normal mode sluggish as hell, but in direct mode it almost feels like a fighter jet..

    Apart from the single line in the cfg there apparently isn't anything you could do about it as the whole fbw stuff is in a dll.

    Maybe this is of any help: http://talk.pafs.wf/viewtopic.php?t=2250
     
  7. Heretic

    Heretic Resource contributor

    Joined:
    1 Feb 2007
    Messages:
    5,519
    Country:
    germany
  8. ollyau

    ollyau Resource contributor

    Joined:
    5 Jan 2008
    Messages:
    1,021
    Country:
    us-california
    You can do that in SimConnect by masking things like the AXIS_ELEVATOR_SET and AXIS_AILERON_SET events, but it's not exactly the most straightforward thing to do. It's how the FSX Blue Angels Hornet fly-by-wire FCS works, and probably what the program at the Project Airbus forum does as well.
     
  9. Heretic

    Heretic Resource contributor

    Joined:
    1 Feb 2007
    Messages:
    5,519
    Country:
    germany
    *Bump*
    Spent the last hours banging my head on the desk while trying to wrestle down the FBW. I think what I got in the end is an acceptable workaround.

    Attitude hold after reenabling SEC1 is acceptable with minor deviation from the previous, manually held attitude.
    Hitting a limiter will cause some ugly shuddering unless the stick is moved in the opposite direction or the plane falls back into the arena on its own.
    Hands off recovery by the default AFLOOR function is also possible, but needs to be terminated manually by moving the stick.

    Requires XMLTools for the limiters.

    Code:
    <Gauge Name="A32x FBW Fix" Version="1.0">
    <!-- Fly By Wire Fix
    Will disengage the default SEC mode to enable more direct aileron and elevator control when the stick is deflected.
    When the stick is recentered, SEC will engage again and the plane will try to hold the last pitch and bank angle
    Pitch and bank protection modes are implemented
    -->
    <Macro Name="FBWStickLimit">0.1</Macro><!-- SEC will disengage at this (absolute) stick deflection from center (default: 0.1 = 10%) -->
    <Macro Name="FBWBankLimit">30</Macro><!-- Bank Limiter will engage at this bank angle -->
    <Macro Name="FBWPitchLimitUp">30</Macro><!-- Pitch Limiter will engage at this upward pitch -->
    <Macro Name="FBWPitchLimitDown">15</Macro><!-- Pitch Limiter will engage at this downward pitch -->
    <!-- FLY BY WIRE FIX -->
    <!-- FLY BY WIRE FIX -->
    <!-- FLY BY WIRE FIX -->
    <Element>
    <Select>
    <Value>
    <!-- Track stick position -->
    (A:YOKE X POSITION,position) abs (>G:Var1)
    (A:YOKE Y POSITION,position) abs (>G:Var2)
    
    <!-- Protection modes -->
    (A:Autopilot Master,bool) ! if{
    <!-- Bank protection. Monitors plane bank and freezes the bank angle at the limiter value, unless corrective action is taken  -->
    (A:PLANE BANK DEGREES, radians) rddg abs @FBWBankLimit &gt; (L:A32x FBW Bank Protection, number) 0 == and
    if{ 1 (>L:A32x FBW Bank Protection, number) }
    (L:A32x FBW Bank Protection, number) 0 !=
    if{ (A:PLANE BANK DEGREES, radians) rddg -@FBWBankLimit &lt; (A:YOKE X POSITION,position) 0 &gt; and if{ -@FBWBankLimit (>C:SIMVARS:PLANE BANK DEGREES, degrees) }
       (A:PLANE BANK DEGREES, radians) rddg @FBWBankLimit &gt; (A:YOKE X POSITION,position) 0 &lt; and if{ @FBWBankLimit (>C:SIMVARS:PLANE BANK DEGREES, degrees) }
       (A:PLANE BANK DEGREES, radians) rddg abs @FBWBankLimit &lt;
       (A:PLANE BANK DEGREES, radians) rddg -@FBWBankLimit &lt; (A:YOKE X POSITION,position) 0 &lt; and or
       (A:PLANE BANK DEGREES, radians) rddg @FBWBankLimit &gt; (A:YOKE X POSITION,position) 0 &gt; and or
       if{ 0 (>L:A32x FBW Bank Protection, number) } }
    
    <!-- Pitch protection. Monitors plane pitch and freezes the bank angle at the respective limiter value, unless corrective action is taken -->
    (A:PLANE PITCH DEGREES, radians) rddg @FBWPitchLimitDown &gt; if{ 1 (>L:A32x FBW Pitch Protection, number) }
    (A:PLANE PITCH DEGREES, radians) rddg -@FBWPitchLimitUp &lt; if{ 2 (>L:A32x FBW Pitch Protection, number) }
    
    (L:A32x FBW Pitch Protection, number) 1 == if{ @FBWPitchLimitDown (>C:SIMVARS:PLANE PITCH DEGREES, degrees) }
    (L:A32x FBW Pitch Protection, number) 2 == if{ -@FBWPitchLimitUp (>C:SIMVARS:PLANE PITCH DEGREES, degrees) }
    
    (L:A32x FBW Pitch Protection, number) 1 ==
    (A:PLANE PITCH DEGREES, radians) rddg @FBWPitchLimitDown &lt; (A:YOKE Y POSITION,position) 0 &gt; or and if{ 0 (>L:A32x FBW Pitch Protection, number) }
    (L:A32x FBW Pitch Protection, number) 2 ==
    (A:PLANE PITCH DEGREES, radians) rddg -@FBWPitchLimitUp &gt; (A:YOKE Y POSITION,position) 0 &lt; or and if{ 0 (>L:A32x FBW Pitch Protection, number) }
    }
    
    (A:Sim On Ground,bool) ! if{
    <!-- Disable SEC when stick is deflected or keeps on deflecting and bank and alpha values are within limits -->
    (A:YOKE X POSITION,position) abs (G:Var1) !=
    (A:YOKE Y POSITION,position) abs (G:Var2) != or
    (A:YOKE X POSITION,position) abs @FBWStickLimit &gt; or
    (A:YOKE Y POSITION,position) abs @FBWStickLimit &gt; or
    (A:Fly By Wire Sec Switch:1,bool) and
    if{ 1 (>K:FLY_BY_WIRE_SEC_TOGGLE) }
    
    <!-- Reenable SEC switch if there's no more stick movement or bank or alpha limits have been exceeded -->
    (A:YOKE X POSITION,position) abs (G:Var1) ==
    (A:YOKE Y POSITION,position) abs (G:Var2) == and
    (A:YOKE X POSITION,position) abs @FBWStickLimit &lt; and
    (A:YOKE Y POSITION,position) abs @FBWStickLimit &lt; and
    (A:Fly By Wire Sec Switch:1,bool) ! and
    if{ 1 (>K:FLY_BY_WIRE_SEC_TOGGLE) }
    }
    </Value>
    </Select>
    </Element>
    </Gauge>
     
  10. Heretic

    Heretic Resource contributor

    Joined:
    1 Feb 2007
    Messages:
    5,519
    Country:
    germany
    Forget the above, this one is much more efficient and works much better near the edge of the envelope. The unified code block evaluates much better and SEC1 only disengages when it's supposed to.
    XMLTools users also get a hard pitch and bank wall when even the FBW computer can't stop the aircraft from running outside the envelope.

    Code:
    <Gauge Name="A32x FBW Fix" Version="1.0">
    <!-- Fly By Wire Fix
    Will disengage the default SEC mode to enable more direct aileron and elevator control when the stick is deflected.
    When the stick is recentered, SEC will engage again and the plane will try to hold the last pitch and bank angle
    Pitch and bank protection modes are implemented
    -->
    <Macro Name="FBWStickLimit">0.1</Macro><!-- SEC will disengage at this (absolute) stick deflection from center (default: 0.1 = 10%) -->
    <Macro Name="FBWBankLimit">30</Macro><!-- Bank Limiter will engage at this bank angle -->
    <Macro Name="FBWPitchLimitUp">30</Macro><!-- Pitch Limiter will engage at this upward pitch -->
    <Macro Name="FBWPitchLimitDown">15</Macro><!-- Pitch Limiter will engage at this downward pitch -->
    <!-- FLY BY WIRE FIX -->
    <!-- FLY BY WIRE FIX -->
    <!-- FLY BY WIRE FIX -->
    <Element>
    <Select>
    <Value>
    <!-- Track stick position -->
    (A:YOKE X POSITION,position) abs (>G:Var1)
    (A:YOKE Y POSITION,position) abs (>G:Var2)
    
    <!-- 
    Yoke X: Deflect to right for a positive value
    Yoke Y: Pull for positive value
    Plane Bank: Positive when banking to the left
    Plane Pitch: Positive when nose points down 
    -->
    
    <!-- Check for yoke deflection. If none, enable SEC1 if disabled.
    If any, determine if plane is outside of envelope limits with control action that would put it farther out. Yes: Enable SEC1, if disabled and implement hard stops by blocking any further pitch or bank at limit value + 5. No: Disable SEC1, if enabled. -->
    (A:YOKE X POSITION,position) abs (G:Var1) !=
    (A:YOKE Y POSITION,position) abs (G:Var2) != or
    (A:YOKE X POSITION,position) abs @FBWStickLimit &gt; or
    (A:YOKE Y POSITION,position) abs @FBWStickLimit &gt; or
    if{ (A:PLANE BANK DEGREES, radians) rddg -@FBWBankLimit &lt; (A:YOKE X POSITION,position) 0 &gt; and
       (A:PLANE BANK DEGREES, radians) rddg @FBWBankLimit &gt; (A:YOKE X POSITION,position) 0 &lt; and or
       (A:PLANE PITCH DEGREES, radians) rddg -@FBWPitchLimitUp &lt; (A:YOKE Y POSITION,position) 0 &gt; and or
       (A:PLANE PITCH DEGREES, radians) rddg @FBWPitchLimitDown &gt; (A:YOKE Y POSITION,position) 0 &lt; and or
       if{ (A:Fly By Wire Sec Switch:1,bool) ! if{ 1 (>K:FLY_BY_WIRE_SEC_TOGGLE) }
       (A:PLANE BANK DEGREES, radians) rddg -@FBWBankLimit 5 - &lt; if{ -@FBWBankLimit 5 - (>C:SIMVARS:PLANE BANK DEGREES, degrees) }
       (A:PLANE BANK DEGREES, radians) rddg @FBWBankLimit 5 + &gt; if{ @FBWBankLimit 5 + (>C:SIMVARS:PLANE BANK DEGREES, degrees) }
       (A:PLANE PITCH DEGREES, radians) rddg -@FBWPitchLimitUp 5 - &lt; if{ -@FBWPitchLimitUp 5 - (>C:SIMVARS:PLANE PITCH DEGREES, degrees) }
       (A:PLANE PITCH DEGREES, radians) rddg @FBWPitchLimitDown 5 + &gt; if{ @FBWPitchLimitDown 5 + (>C:SIMVARS:PLANE PITCH DEGREES, degrees) } }
       els{ (A:Fly By Wire Sec Switch:1,bool) if{ 1 (>K:FLY_BY_WIRE_SEC_TOGGLE) } } }
    els{ (A:Fly By Wire Sec Switch:1,bool) ! if{ 1 (>K:FLY_BY_WIRE_SEC_TOGGLE) } }
    </Value>
    </Select>
    </Element>
    </Gauge>