Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
Collapse
Just Flight Community Forum
  1. Home
  2. Just Flight
  3. MSFS Products
  4. Black Square Add-Ons
  5. Starship
  6. Autopilot goes from VOR to ROLL when tracking VOR

Autopilot goes from VOR to ROLL when tracking VOR

Scheduled Pinned Locked Moved Starship
17 Posts 5 Posters 322 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jmarkows
    wrote on last edited by
    #7

    Are you running the latest version? There was a bug at launch that caused that.

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jouxeur33
      wrote on last edited by Jouxeur33
      #8

      oh i have 0.1.0 but latest is 0.1.2 u think that could be the cause?

      EDIT : i've read the change log and there is something about it indeed so its on me thanks anyways!

      1 Reply Last reply
      1
      • Black SquareB Black Square

        @MarkS If you really want to open that can of worms for yourself, search for the following in Starship_Interior.XML

        (>L:var_AutopilotDisconnectTone, bool)
        

        I'm happy to help with that. I just wanted to give you a quick answer before I left my desk for a few minutes.

        MarkSM Online
        MarkSM Online
        MarkS
        wrote last edited by MarkS
        #9

        @Black-Square said in Autopilot goes from VOR to ROLL when tracking VOR:

        I'm happy to help with that. I just wanted to give you a quick answer before I left my desk for a few minutes.

        @Black-Square Nick, sorry, I know you're a busy guy, but I'm going to have to ask for some help with this. My first calculator was a slide rule way back last century, but this RPN stuff throws me once the nesting starts. I have to tease it out into a non-RPN form to try to get a handle on it, and even then I'm not sure I'm getting it right.

        (In fact, I'm pretty sure I introduced an intermittent timing issue with my "personalization" mod, because I get spurious warning button activations from time to time, sometimes only transient, sometimes they cycle for a while. That's on me though, not asking for your help with that.)

        To recap, what I am looking to do is to trigger the autopilot disconnect tone if the autopilot fails over from NAV to ROLL mode. And of course it should cease sounding if I press the autopilot disconnect button as usual.

        If CurrMode = ROLL and LastMode = NAV then
            PlaySound(AutopilotDisconnect)
        LastMode = CurrMode
        

        The code itself likely isn't that hard, but I'm having trouble locating the relevent mode variables, and there's nested code in that whole Flight Director section that I can't quite get my head around, so I'm not sure where to safely put the code even if I had the vars on hand.

        1 Reply Last reply
        0
        • Black SquareB Online
          Black SquareB Online
          Black Square
          Black Square Developer
          wrote last edited by
          #10

          @MarkS Give this a try 🙂 I'm not sure exactly what this will do, but it should be a good place to start.

          <UseTemplate Name="ASOBO_GT_Update">
          	<FREQUENCY>1</FREQUENCY>
          	<UPDATE_CODE>
          		(A:AUTOPILOT MASTER, bool) (O:lastApNavMode) (A:AUTOPILOT BANK HOLD, Bool) (A:AUTOPILOT WING LEVELER, Bool) or and and if{
          			1 (&gt;L:var_AutopilotDisconnectTone, bool)
          		}
          		(A:AUTOPILOT NAV1 LOCK, bool) (&gt;O:lastApNavMode)
          	</UPDATE_CODE>
          </UseTemplate>
          
          MarkSM 1 Reply Last reply
          0
          • Black SquareB Black Square

            @MarkS Give this a try 🙂 I'm not sure exactly what this will do, but it should be a good place to start.

            <UseTemplate Name="ASOBO_GT_Update">
            	<FREQUENCY>1</FREQUENCY>
            	<UPDATE_CODE>
            		(A:AUTOPILOT MASTER, bool) (O:lastApNavMode) (A:AUTOPILOT BANK HOLD, Bool) (A:AUTOPILOT WING LEVELER, Bool) or and and if{
            			1 (&gt;L:var_AutopilotDisconnectTone, bool)
            		}
            		(A:AUTOPILOT NAV1 LOCK, bool) (&gt;O:lastApNavMode)
            	</UPDATE_CODE>
            </UseTemplate>
            
            MarkSM Online
            MarkSM Online
            MarkS
            wrote last edited by
            #11

            @Black-Square said in Autopilot goes from VOR to ROLL when tracking VOR:

            @MarkS Give this a try I'm not sure exactly what this will do, but it should be a good place to start.

            Thank you. Any particular location in the Flight Director code section you'd recommend to put it?

            1 Reply Last reply
            0
            • Black SquareB Online
              Black SquareB Online
              Black Square
              Black Square Developer
              wrote last edited by
              #12

              You can drop that anywhere in the file between other <UseTemplate Name="ASOBO_GT_Update"> tags. For instance, right after the <!-- Flight Director --> comment.

              MarkSM 2 Replies Last reply
              0
              • Black SquareB Black Square

                You can drop that anywhere in the file between other <UseTemplate Name="ASOBO_GT_Update"> tags. For instance, right after the <!-- Flight Director --> comment.

                MarkSM Online
                MarkSM Online
                MarkS
                wrote last edited by
                #13

                @Black-Square I'll give it a go. I suppose it could be dropped in anywhere but in good practice it ought to be at least near the other relevant functionality.

                (P.S. as hard as it is for me to parse RPN, your code is a treat to work with for this old automation engineer).

                1 Reply Last reply
                0
                • Black SquareB Black Square

                  You can drop that anywhere in the file between other <UseTemplate Name="ASOBO_GT_Update"> tags. For instance, right after the <!-- Flight Director --> comment.

                  MarkSM Online
                  MarkSM Online
                  MarkS
                  wrote last edited by
                  #14

                  @Black-Square no joy. ☹

                  According to an Axes and Ohs watch list I set up to monitor, it appears the O:lastApNavMode variable isn't getting updated,(what is an O variable anyway?), or perhaps Axes and Ohs isn't capable yet of seeing it. I can declare it in the watch list, and it appears, but that doesn't necessarily mean there's communication to it.

                  I did a test flight with two VORs and deliberately flew through their zone 'o' confusion to force a failover from NAV to ROLL. Which happened as expected, but no alarm.

                  In fact, the AUTOPILOT BANK HOLD and AUTOPILOT WING LEVELER are never '1' at any point in during flight testing, and I'm not sure if it's something I'm doing or not doing or its just one of those weird things that are out of our hands like state saving.

                  This tickles my old engineering brain a little and I'm tempted to take a crack at it. I'm wondering if I can just declare a var in the interior.xml that Axes and Ohs can (demonstrably) see, to replace the O var. Maybe Mr Occam had a nice shave and will smile kindly on my attempt.

                  Here's the sequence with the Axes and Ohs watch lists.

                  99a4cf52-32fd-49d2-bdc6-3c5b0d04c1c5-image.png

                  1 Reply Last reply
                  0
                  • Black SquareB Online
                    Black SquareB Online
                    Black Square
                    Black Square Developer
                    wrote last edited by
                    #15

                    O:Vars are local to the scope of that UseTemplate tag, but if you just replace the O with an L, that should make it globally visible.

                    Do I misunderstand your message, or is AUTOPILOT BANK HOLD true in your last screenshot, right when we expect it to be?

                    I don't see anything wrong with the code, but I can test it when I'm next working in the simulator. Can you show me where you inserted it into the file?

                    MarkSM 1 Reply Last reply
                    0
                    • Black SquareB Black Square

                      O:Vars are local to the scope of that UseTemplate tag, but if you just replace the O with an L, that should make it globally visible.

                      Do I misunderstand your message, or is AUTOPILOT BANK HOLD true in your last screenshot, right when we expect it to be?

                      I don't see anything wrong with the code, but I can test it when I'm next working in the simulator. Can you show me where you inserted it into the file?

                      MarkSM Online
                      MarkSM Online
                      MarkS
                      wrote last edited by
                      #16

                      @Black-Square said in Autopilot goes from VOR to ROLL when tracking VOR:

                      Do I misunderstand your message, or is AUTOPILOT BANK HOLD true in your last screenshot, right when we expect it to be?

                      No, that's on me, I missed that it was set. Nice catch. Interesting though, that Wing Leveler is never true.

                      I put the new code at the top of the Flight Director section (I was bold and already changed the O to an L but haven't had a chance to test it yet).

                      a7065d8b-c524-4430-8ca3-ca016106db38-image.png

                      I sat with it for a bit afterwards and thought it might simplify to something like this (sorry for the infix pseudocode, can't "think" in RPN):

                      If
                      	A:AUTOPILOT_MASTER = True and L:lastApNavMode = True and A:AUTOPILOT_NAV1_LOCK = False
                      Then
                      	L:var_AutopilotDisconnectTone := 1
                      Endif
                      L:lastAPNavMode := A:AUTOPLOT_NAV1_LOCK
                      

                      The RPN issue I have with the above is that the NAV1 LOCK comparator is (I think) an "and not" operation in RPN, and I don't know how to do that. I'm not entirely sure what BANK HOLD or WING LEVELER are bringing to the party, but you surely have a better handle on that than I.

                      1 Reply Last reply
                      0
                      • J jmarkows referenced this topic
                      • MarkSM Online
                        MarkSM Online
                        MarkS
                        wrote last edited by MarkS
                        #17

                        Against my better judgement, I came up with this refactoring of the infix pseudocode I proposed above:

                        <!-- Mark's Occam-Channeling Autopilot NAV to ROLL mode failover alarm (probably doesn't work) -->
                        
                        <UseTemplate Name="ASOBO_GT_Update">
                        	<FREQUENCY>1</FREQUENCY>
                        	<UPDATE_CODE>
                        		(A:AUTOPILOT NAV1 LOCK, bool) (L:lastApNavMode) (A:AUTOPILOT MASTER, bool) not and and if {
                        			1 (&gt;L:var_AutopilotDisconnectTone, bool)
                        		}
                        		(A:AUTOPILOT NAV1 LOCK, bool) (&gt;L:lastApNavMode)
                        	</UPDATE_CODE>
                        </UseTemplate>
                        

                        I looks almost right to my eye, but I still don't know if that 'and not' is legal. Guess I'll find out later. 😶 At least it's easy to remove if (when) it fails spectacularly. 😆

                        Addendum: It didn't fail, but it didn't work either. @Black-Square shouldn't (L:lastApNavMode) be (L:lastApNavMode, bool) instead?

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users