plane icon Welcome to Microsoft Flight Simulator’s SDK Q&A Platform!

You have questions regarding the SDK? DevMode Tools? SimConnect? You would like to submit an idea for future improvements, seek help or exchange knowledge? You’re in the right place.

In the upcoming flighting, we've changed the behaviour of the content.xml file. If your addon uses this file, please read this article!

Please take a moment to read the platform’s guidelines before you get started!


question

pms50 avatar image
pms50 asked pms50 answered

Autopilot altitude manual arming

We didn't find a correct way to manage dynamically manual autopilot altitude arming.

Currently, the sim always arms altitude so it's not possible to have a VS, FLC, or PITCH mode that doesn't switch to ALT at the selected altitude.

There is a parameter "no_alt_capture_in_vs_mode" in the aircraft config file but nothing to do that dynamically so implementing a manual arming in an aircraft is a nightmare.

Using slots is not working too because the active slot value is always copied into the "AUTOPILOT ALTITUDE LOCK VAR" slot 0 variable.

The workaround we have found is to set a very high value (ex 99000) in the "AUTOPILOT ALTITUDE LOCK VAR" but many users complain because their HUD or other aircraft instrument displays 99000 as the currently selected altitude in this case.

We have also noticed that the "AUTOPILOT ALTITUDE ARM" sim variable is never set.

Maybe a K event that disables auto arming could help or any other solution allowing dynamic manual arming.

The Asobo KAP140 ARM button is not implemented, probably because of this situation.

Thanks for your feedback about that. This is currently a blocking situation for many aircraft.

aircraft
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

mattnischan avatar image
mattnischan answered

@pms50

Presently the way to do this is by enabling avionics managed autopilot mode. This makes all the mode transitions and simvars the responsibility of the avionics code.

You can enable avionics managed mode by setting simvar AUTOPILOT AVIONICS MANAGED to true by using key events K:AP_AVIONICS_MANAGED_ON (and K:AP_AVIONICS_MANAGED_OFF if you would like to go back to normal). This will disable automatic transition to altitude capture mode. Then, you can write your own altitude capture/arm logic in your avionics instead.

The only caveat is that you will need to write the autopilot state simvars on your own: while in AUTOPILOT AVIONICS MANAGED they will not reflect the actual underlying autopilot mode, to allow avionics to "drive" the autopilot using some underlying mode but "report" whatever mode they desire. So, in your case, you would write to AUTOPILOT VERTICAL HOLD when you engage V/S (using the standard V/S key event), then when you detect your altitude hold conditions, engage alt hold (again using the standard alt hold key event) and write to AUTOPILOT ALTITUDE LOCK.

Again, just to be super clear: the avionics must manage the sync of the autopilot state simvars on their own while in AUTOPILOT AVIONICS MANAGED. Writing to the autopilot state simvars does not change the underlying autopilot mode, only using the key events does.

While in alt lock, the same ALTITUDE LOCK VAR simvar controls the altitude to hold at. There is no change there. Hope this helps!

-Matt

10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

pms50 avatar image
pms50 answered pms50 edited

Thank you Matt for your answer.
I will try to investigate in this way but the problem is that I have to write all the AP state variables (which ones exactly, all of them?).
This seems to be a huge task because most of the time we'll not be in the armed mode so I will have to rewrite by myself all the mode transitions and simvars. Now, maybe I didn't understand exactly what the K:AP_AVIONICS_MANAGED_ON does.
Today everything works as expected but this auto arming that can't be disabled dynamically. Probably 2 new K events to enable/disable auto arming would do the job the easiest way (ex K:AP_ALT_AUTO_ARM_ON and K:AP_ALT_AUTO_ARM_OFF) plus maybe a simvar to get the current AUTO ARM state.

10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

pms50 avatar image
pms50 answered

So I tried with the managed mode but this is definitively not the place in a gauge to do that (many side effects).
This should be done at the autopilot manager level (maybe by K events as I suggested).
Anyway, I was able to disable auto arming in the WT autopilot manager and that works fine.
The functionality is just missing for the stock Asobo autopilot manager.
Hope we could get it.

10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 19.1 MiB each and 23.8 MiB total.