[4.1] Autopilot Bank MODE

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #1108
    Bjoern
    Participant

      Version 4.1 with today’s (24/11/14) fix for the altitude hold mode.

      The SVANG knob in the AP’s ATTITYD mode does not provoke any respone from the plane.

      Looking into styraut_panel_vc.xml and styraut.xml, the bank mode knob doesn’t seem to issue any command to the aileron axis (or if so, they are rather small).

      #1109
      Bjoern
      Participant

        I think I’ve fixed it.

        Tom (and anyone else willing to edit .xml files):

        In styraut.xml, add the following lines above “(A:PLANE BANK DEGREES,degrees) 180 >”:

        [quote] (L:AutoBankSet,number) 0 !=
        if{ (>K:AP_WING_LEVELER_OFF) }[/quote]

        In styraut_panel_vc.xml, add the following behind “0 (>L:AutoBankSet,number)”:
        [quote](>K:AP_WING_LEVELER_ON)[/quote]

        This basically disengages the wing leveler submode of FSX’ attitude hold whenever the SVANG knob is not centered and reengages it when the knob is recentered.

        #1110
        Thomas
        Keymaster

          The turn control actually worked with attitude hold in a previous version, but somehow I managed to screw it up in the 4.1 release. Oh well.

          The FSX wing leveler has always been a headache as it is inherent in the attitude and altitude hold functions unless you disable it in your gauge functions and set the fly_by_wire attribute in aircraft.cfg explicitly to zero.

          Your solution is OK although it may conflict with some other parts of the system. Thanks for your input, I will try to work it from there.

          BTW, please use the “code” tag when adding code snippets in your posts.

          #1113
          Bjoern
          Participant

            Well, there’s no conflict with other AP functions, but the bank angle limiter does not work. The Draken will bank until it flips over.

            I’m trying to rewrite the bank hold code to see if I can make it work properly.

            If this won’t work, I’ll try a different solution based on a fake HDG hold function and FSX’ bank limiter function.

            The “code” tags didn’t work somehow, by the way. I otherwise wouldn’t have used the quote tags.

            #1114
            Bjoern
            Participant

              Update:

              I’ve managed to implement a generic “fly in circles banked to the left/right unless told otherwise” function.
              The only thing left to do is trying to get FSX’ “limit max bank angle” function to work.

              (Sorry for the spam, but you can’t edit posts anymore after 15 minutes or so.)

              #1115
              Thomas
              Keymaster

                Thanks Bjoern, and I am aware that the AP is one of the weak points in my simulation. I think you will have to live with that for the time being – or make DIY solutions since you seem to be FSX SDK savvy. ;)

                You are welcome to contribute with suggested code changes, although you should be aware that this project is already partly commercial and will eventually be payware. Which is why I sometimes seem reluctant to pick up on things. I am not ungrateful, just very careful about not eventually monetizing on other people’s work.

                Regarding the code tag, the html formatting in the forum works fine for me. What browser are you using?

                #1116
                Bjoern
                Participant

                  Update:
                  The J35 is at the moment flying circle after circle at a bank angle of 30°. Nearly there…

                  I’ll upload the changed .xml files once I get the last hitch worked out of the code.
                  Don’t worry about licenses. Put my name down somewhere and buy me a Stark Öl the next time I’m in Sweden.

                  Firefox 34.0 here.

                  (L:SomethingSomething,bool) ! if{ (>L:SomethingDifferent,enum) }

                  – Edit: Nope, no joy.

                  – Edit²: Oh dear, the code tags here aren’t the familiar [code] ones…ID10T error. Sorry!

                  #1119
                  Bjoern
                  Participant

                    So did you have time to try the fix yet, Tom? Does it conflict with any other AP modes?

                    #1120
                    Thomas
                    Keymaster

                      Sorry Bjoern, I really have not had the time for this but will make an effort later today. A better explanation of how “my” autopilot really works will probably be a good starting point, so I’m working on that.

                      #1135
                      Thomas
                      Keymaster

                        OK, I finally had time to look at the problem with the autopilot. Please forgive me if I sometimes appear confused but Draken contains over 15000 lines of code, and some of it I hacked together ten years ago when my brain was in better shape…

                        First of all, the FSX Wing Leveler is not (supposed to be) used at all in Draken. The Altitude Hold mode has its own wing leveling, which can only be disabled via aircraft.cfg AFAIK. If you issue the key command for Altitude Hold, Draken will lock on the current pressure altitude but Wing Leveler will not be activated.

                        However, pressing one of the buttons on the current version of the autopilot panel will activate the Wing Leveler, although it is supposed to be the same command. I overlooked this since I usually use the key commands in flight.

                        The proper way to fix this is to modify the mode select functions in styraut_panel.xml and styraut_panel_vc.xml to switch off the Wing Leveler after activating alt/att hold:
                        (>K:AP_ALT_HOLD_ON) (>K:AP_WING_LEVELER_OFF)
                        And so on. WING_LEVELER_ON should never be used.

                        The bank angle hold function is indeed not working very well right now; as you pointed out it may put you in a “death spiral”. This is basically a matter of fine-tuning the function in styraut.xml and the three “max_bank” entries in aircraft.cfg. I am working on this right now.

                        #1150
                        Bjoern
                        Participant

                          Okay. I’m curious what your solution will look like.

                          By the way: If you force-disconnect the AP, shouldn’t it revert to DÄMPN mode?
                          At the moment, it just disconnects and you have to manually re-engage DÄMPN.

                          One thing I forgot to implement was that the bank selector automatically reverts to zero (neutral) if the AP is disconnected.

                          #1151
                          Thomas
                          Keymaster

                            I raised the amplification factor in my banking function from 1200 to 2400, which seemed to do the trick. I also added a limiting of the max bank angle due to airspeed. The aircraft will now happily maintain altitude in a 50 degrees bank at 700 kmh, but only 35 degrees at 350 kmh.

                            The force-disconnect due to high bank angle was also incorrectly implemented, it disengaged the autopilot at 45 degrees bank when it should be 45 degrees difference from the selected bank angle.

                            The max_bank entries in aircraft.cfg do not affect the banking function, btw. They are only used by the stock wing leveler. Sorry.

                            AFAIK the automatic disconnect due to G max/min, stick movement or excessive bank angles will disengage all autopilot modes – although the system will still be energized unless the reason was a power failure. There is however a manual override switch on the stick that will switch down from HÖJD/ATTITYD til DÄMPN. This switch is not included in my simulation.

                            I will upload an update in a week or so that will include the revised autopilot as well as some other bugfixes.

                            #1152
                            Bjoern
                            Participant

                              The max_bank entries in aircraft.cfg do not affect the banking function, btw. They are only used by the stock wing leveler. Sorry.

                              It limits the bank angle during turns when in HDG HOLD mode. And my solution to the problem was based on an invisible HDG HOLD mode.

                              AFAIK the automatic disconnect due to G max/min, stick movement or excessive bank angles will disengage all autopilot modes – although the system will still be energized unless the reason was a power failure.

                              Funny that SAAB never revised that. They must have known about the operations policy regarding DÄMPN as the standard mode…

                            Viewing 13 posts - 1 through 13 (of 13 total)
                            • The forum ‘Draken 4.x support forum [closed]’ is closed to new topics and replies.