Jump to content
The simFlight Network Forums

Autopilot Altitude Issue/Question


Recommended Posts

Posted

System information:

MSFS 2020

NXi G1000 aircraft

 

I'm trying to setup control over using the autopilot altitude selection. I'm using the following simulator commands, 2 of which are provided via FSUIPC7:

AP ALT VAR DEC

AP ALT VAR DEC FAST

AP ALT VAR INC

AP ALT VAR INC FAST

 

I using a dial encoder that has a push button function. I would like to set the DEC/INC commands on a regular twist of the dial and the DEC FAST/INC FAST as a compound command when I press the push button and turn the dial.

I HAVE been successful configuring this type of setup using the HEADING/VOR1/VOR2 commands (DEC/INC on a regular twist of the dial and DEC FAST/INC FAST when the button is pressed in).

HOWEVER, when I try to setup the AP ALT,  I get a response of whatever is set to the regular twist of the dial, even when the button is pressed down.

For example, if I program DEC/INC on the regular dial and the FAST functions on the press and turn of the dial, I only see a response of DEC/INC in the sim. If I program DEC FAST/INC FAST on the regular turn of the and the regular DEC/INC on the press and turn, I only see a response of DEC FAST/INC FAST in the sim.

YET, if I program four key presses or buttons with these four methods, I get the proper response. If I program two rotary encoders with these four responses, I get the proper response. I only see the issue when I use a compound programming of these 4 actions.

As mentioned above, I am familiar with programming compound actions and can successfully get this to work with the heading and VOR events.

Any insight/information/thoughts about how I might could get this to work with the AP ALT events?

 

Thanks!

Posted
2 minutes ago, wulybugger said:

I using a dial encoder that has a push button function. I would like to set the DEC/INC commands on a regular twist of the dial and the DEC FAST/INC FAST as a compound command when I press the push button and turn the dial.

The standard way to have both slow and fast inc/dec on a rotary is to use fast/slow buttons in each direction. Some rotaries do have two buttons in each direction for this, one for a fast turn and one for a slow turn.  For rotaries that only have one button in each direction, you can use a lua script that can turn this one button into two virtual buttons, one for the fast action and one for the slow action. Such a lua script is included in the lua examples zip file (in your FSUIPC Documents folder) called Rotaries.lua.

But you should also be able to do this using a button. If this isn't working, try using logging to work out what is happening - activate logging for Buttons & Switches and see what is logged (use Log -> Open Console to see the log in real-time). If you want further help with this, show me / attach your FSUIPC7.ini file, and an FSUIPC7.log file generated with logging for Buttons & Switches activated and showing both the slow and fast assignments.

10 minutes ago, wulybugger said:

HOWEVER, when I try to setup the AP ALT,  I get a response of whatever is set to the regular twist of the dial, even when the button is pressed down.

Well, you will still get the regular assignments unless you add another compound condition to these to only send when the activation button is not pressed.

But what is probably happening is that you are using a momentary button and not a switch, so when you press it it is instantaneous, so when the rotary assignment is triggered it doesn't recognise the activation button as being pressed. If this is the case, then you should switch to using the button flag instead. See the section on using button flags in compound conditions in the Advanced User guide - here is an extract:

Quote

The conditions can be made to apply not to the current state of a button, but to the state of a ‘flag’ that is set and cleared by a button (or even a keypress). For every possible “normal” button (16 joysticks x 32 buttons = 512 buttons) FSUIPC maintains a “Flag” (F). Each time any button is pressed (goes from off to on) FSUIPC toggles its flag. This makes the buttons flag a sort of “latching” switch. You can test it in any parenthesised condition by preceding the condition by F, thus:

         N=CP(F+j2,b2) …

This says the rest of this parameter is obeyed if the Flag associated with j2,b2 is set. A condition (F–j2,b2) tests for the Flag being clear. Note that the actual current state of the button j2,b2 is not relevant. All that matters is whether it last left its Flag set or clear.

John

Posted

Here's what is in the .ini file for these controls:

46=PG,1,C65893,0     -{AP_ALT_VAR_DEC}-
47=CP(+G,2)G,1,C1016,0     -{ap alt var dec fast}-
48=PG,0,C65892,0     -{AP_ALT_VAR_INC}-
49=CP(+G,2)G,0,C1017,0     -{ap alt var inc fast}-

Here's the log file showing me exercise the left/right turn of the knob, as well as pressing and holding the button and turning the knob, which should execute the fast events, but in BOTH cases where the condition is False and True, the altitude changes only be 100 feet, NOT 1000 feet for the case of the FAST events. In addition it can be seen that the Ctrl= switches from 1016/1017 to C65892/C65893 which represent the FAST and regular control events:

   253985 Button changed: bRef=0, Joy=0 (G), Btn=1, Released
   254953 Button changed: bRef=0, Joy=0 (G), Btn=0, Pressed
   254953 [Buttons] 48=PG,0,C65892,0
   254953 FS Control Sent: Ctrl=65892, Param=0 AP_ALT_VAR_INC
   254953 [Buttons] 49=CP(+G,2)G,0,C1017,0
   254953 .... Condition (+G,2) = FALSE
   255031 Button changed: bRef=0, Joy=0 (G), Btn=0, Released
   255438 Button changed: bRef=0, Joy=0 (G), Btn=0, Pressed
   255438 [Buttons] 48=PG,0,C65892,0
   255438 FS Control Sent: Ctrl=65892, Param=0 AP_ALT_VAR_INC
   255438 [Buttons] 49=CP(+G,2)G,0,C1017,0
   255438 .... Condition (+G,2) = FALSE
   255516 Button changed: bRef=0, Joy=0 (G), Btn=0, Released
   256125 Button changed: bRef=0, Joy=0 (G), Btn=1, Pressed
   256125 [Buttons] 46=PG,1,C65893,0
   256141 FS Control Sent: Ctrl=65893, Param=0 AP_ALT_VAR_DEC
   256141 [Buttons] 47=CP(+G,2)G,1,C1016,0
   256141 .... Condition (+G,2) = FALSE
   256203 Button changed: bRef=0, Joy=0 (G), Btn=1, Released
   256422 Button changed: bRef=0, Joy=0 (G), Btn=1, Pressed
   256422 [Buttons] 46=PG,1,C65893,0
   256422 FS Control Sent: Ctrl=65893, Param=0 AP_ALT_VAR_DEC
   256422 [Buttons] 47=CP(+G,2)G,1,C1016,0
   256422 .... Condition (+G,2) = FALSE
   256500 Button changed: bRef=0, Joy=0 (G), Btn=1, Released
   266719 Button changed: bRef=0, Joy=0 (G), Btn=0, Pressed
   266719 [Buttons] 48=PG,0,C65892,0
   266719 FS Control Sent: Ctrl=65892, Param=0 AP_ALT_VAR_INC
   266719 [Buttons] 49=CP(+G,2)G,0,C1017,0
   266719 .... Condition (+G,2) = FALSE
   266797 Button changed: bRef=0, Joy=0 (G), Btn=0, Released
   267297 Button changed: bRef=0, Joy=0 (G), Btn=0, Pressed
   267297 [Buttons] 48=PG,0,C65892,0
   267297 FS Control Sent: Ctrl=65892, Param=0 AP_ALT_VAR_INC
   267297 [Buttons] 49=CP(+G,2)G,0,C1017,0
   267297 .... Condition (+G,2) = FALSE
   267375 Button changed: bRef=0, Joy=0 (G), Btn=0, Released
   268328 Button changed: bRef=0, Joy=0 (G), Btn=1, Pressed
   268328 [Buttons] 46=PG,1,C65893,0
   268328 FS Control Sent: Ctrl=65893, Param=0 AP_ALT_VAR_DEC
   268328 [Buttons] 47=CP(+G,2)G,1,C1016,0
   268328 .... Condition (+G,2) = FALSE
   268406 Button changed: bRef=0, Joy=0 (G), Btn=1, Released
   268703 Button changed: bRef=0, Joy=0 (G), Btn=1, Pressed
   268703 [Buttons] 46=PG,1,C65893,0
   268703 FS Control Sent: Ctrl=65893, Param=0 AP_ALT_VAR_DEC
   268703 [Buttons] 47=CP(+G,2)G,1,C1016,0
   268703 .... Condition (+G,2) = FALSE
   268781 Button changed: bRef=0, Joy=0 (G), Btn=1, Released
   269688 Button changed: bRef=0, Joy=0 (G), Btn=0, Pressed
   269688 [Buttons] 48=PG,0,C65892,0
   269688 FS Control Sent: Ctrl=65892, Param=0 AP_ALT_VAR_INC
   269688 [Buttons] 49=CP(+G,2)G,0,C1017,0
   269688 .... Condition (+G,2) = TRUE
   269688 FSUIPC Control Action: Ctrl=1017, Param=0
   269766 Button changed: bRef=0, Joy=0 (G), Btn=0, Released
   270141 Button changed: bRef=0, Joy=0 (G), Btn=0, Pressed
   270141 [Buttons] 48=PG,0,C65892,0
   270141 FS Control Sent: Ctrl=65892, Param=0 AP_ALT_VAR_INC
   270141 [Buttons] 49=CP(+G,2)G,0,C1017,0
   270141 .... Condition (+G,2) = TRUE
   270141 FSUIPC Control Action: Ctrl=1017, Param=0
   270219 Button changed: bRef=0, Joy=0 (G), Btn=0, Released
   271016 Button changed: bRef=0, Joy=0 (G), Btn=1, Pressed
   271016 [Buttons] 46=PG,1,C65893,0
   271016 FS Control Sent: Ctrl=65893, Param=0 AP_ALT_VAR_DEC
   271016 [Buttons] 47=CP(+G,2)G,1,C1016,0
   271016 .... Condition (+G,2) = TRUE
   271016 FSUIPC Control Action: Ctrl=1016, Param=0
 

 

Posted

Please attach files rather than posting extracts...

It is strange that I cannot see a button 2 press event logged, but the condition does change from false to true, and the control is being activated.
The fast controls use offset 0x07D4 and set the AUTOPILOT ALTITUDE LOCK VAR simvar. If this is not working, then the aircraft doesn't use that simvar (or uses it in conjunction with something else) . Try assigning to the AS1000 presets instead, i.e.
    AS1000_AP_ALT_INC_100
    AS1000_AP_ALT_INC_1000
    AS1000_AP_ALT_DEC_100
    AS1000_AP_ALT_DEC_1000

 

Posted

I've included the full .ini and .log files. I did update to try the AS1000 presets, but I see the same results. HOWEVER, if I assign these controls or presets to separate keys or dials such that I DON'T use compound statements, then everything works as expected. I ONLY see the issue when I try to combine these commands using compound statements.

FSUIPC7.ini FSUIPC7.log

Posted

I have checked this here now and it looks like in both cases (i.e. when using FS Controls and when using presets) what is happening is that both controls are being sent, but the FS is only responding to the first control.  I am not sure why this is happening, but really you shouldn't be sending the slow/small inc/.dec control when sending the fast one. To prevent this, add another preset condition in the slow control to be only sent when the trigger button is off, i.e. change:

Quote

10=PA,29,C65662,0     -{VOR1_OBI_DEC}-
11=CP(+A,30)A,29,C1026,0     -{vor1 obi dec fast}-
12=PA,28,C65663,0     -{VOR1_OBI_INC}-
13=CP(+A,30)A,28,C1027,0     -{vor1 obi inc fast}-
14=PA,13,C65664,0     -{VOR2_OBI_DEC}-
15=CP(+A,14)A,13,C1028,0     -{vor2 obi dec fast}-
16=PA,12,C65665,0     -{VOR2_OBI_INC}-
17=CP(+A,14)A,12,C1029,0     -{vor2 obi inc fast}-
18=PA,9,C65880,0     -{HEADING_BUG_DEC}-
19=CP(+A,10)A,9,C1024,0     -{heading bug dec fast}-
20=PA,8,C65879,0     -{HEADING_BUG_INC}-
21=CP(+A,10)A,8,C1025,0     -{heading bug inc fast}-

to

Quote

10=CP(-A,30)A,29,C65662,0     -{VOR1_OBI_DEC}-
11=CP(+A,30)A,29,C1026,0     -{vor1 obi dec fast}-
12=CP(-A,30)A,28,C65663,0     -{VOR1_OBI_INC}-
13=CP(+A,30)A,28,C1027,0     -{vor1 obi inc fast}-
14=CP(-A,14)A,13,C65664,0     -{VOR2_OBI_DEC}-
15=CP(+A,14)A,13,C1028,0     -{vor2 obi dec fast}-
16=CP(-A,14)A,12,C65665,0     -{VOR2_OBI_INC}-
17=CP(+A,14)A,12,C1029,0     -{vor2 obi inc fast}-
18=CP(-A,10)A,9,C65880,0     -{HEADING_BUG_DEC}-
19=CP(+A,10)A,9,C1024,0     -{heading bug dec fast}-
20=CP(-A,10)A,8,C65879,0     -{HEADING_BUG_INC}-
21=CP(+A,10)A,8,C1025,0     -{heading bug inc fast}-

John

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.