• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FSXA Altitude lock mode acting weird!

Messages
1,749
Country
unitedstates
My latest project i have noticed that when i am flying low altitude and set the altitude hold mode the VSI needle goes to 0 when i am 40 ft from the desired altitude setting. And then it takes a minutes for the trim wheel to slowly adjust and reach the precise altitude setting. But when i am above 10,000 feet the VSI needle looks good until i get to within 40FT and then instead of it using less VSI it goes from 300 FPM to 500 FPM and passes the desired altitude then Oscillates back and forth.

So my question is what setting is causing this?

And why at low altitude does the ALT hold mode change it's rate at 40FT and take too long but above 10,000 feet it reacts to quickly? And the settings in my cfg under autopilot are the same as my last 2 previous projects and they do not have this issue!
 
Messages
1,749
Country
unitedstates
Okay after a long day i solved my own issue. I also noticed that other aircraft have this oscillating issue and i have found the bug. It's caused by coding that tells the ALT HOLD MODE when to engage and disengage. In my case i had told the AP_VS_VAR_SET_ENGLISH to hold 0 when within 25 ft of desired altitude and by default this is already hard coded to do this action at 40ft. So this is why at 40ft i was having these issues.

I also wanted to have another option to have the ALT HOLD MODE on when your already within 300ft of the desired altitude and this causes the same bug as it would keep trying to engage the mode and causes the oscillation.
 

Heretic

Resource contributor
Messages
6,830
Country
germany
Was dealing with the same thing last night, but all I'm telling the AP is to hold the altitude at which it was engaged.

Code:
(A:AUTOPILOT MASTER,bool)
  (A:AUTOPILOT ALTITUDE LOCK,bool) !
  and
  if{ (>K:AP_ALT_HOLD_ON) (A:PLANE ALTITUDE, feet) (>K:AP_ALT_VAR_SET_ENGLISH) }

I think I could cut the oscillations down by adjusting elevator trim effectiveness, but I couldn't completely eliminate them.
 

jx_

Messages
555
Country
unitedstates
If you are using default autopilot, then you have to much ALTITUDE RATE in your settings.

With 40 feet to go the error is -40;

If rate equals or exceeds -40, the autopilot will stop or reverse it's climb. Rate is probably two variables: Vertical Speed Rate of Change and Altitude Rate of Change. These can be found (through experimentation) in sections 14-25 of table 1199.

Don't believe anyone who tells you 1199 no longer works....

trim/balance settings can also cause the issue.
 
Messages
1,749
Country
unitedstates
Your if statement is giving you the oscillation. It's not the cfg file....

Why do you have a variable in the if statement? Does that method work for getting current altitude? I use a different method!

No need for using the "AP_ALT_VAR_SET_ENGLISH" since this should only be for the pilot to manually adjust and would not be needed for holding current altitude.
To create a way to hold the current altitude i use a code like this:

Code:
<!--      ALT MODE         -->

<!--      GET CURRENT ALTITUDE         -->
(L:MODE_ALT, bool) 0 == if{ (A:PLANE ALTITUDE,FEET) (>L:ALT_NODE1,FEET) }
(L:MODE_ALT, bool) 1 == if{ (L:ALT_NODE1,FEET) (>L:ALT_NODE2,NUMBER) }

<!--      AP ALT HOLD         -->
(L:MODE_ALT, bool) 1 == if{ (>K:AP_ALT_HOLD_ON) }


<!--      WITHIN LIMITS          -->
(L:ALT_NODE2,NUMBER) (A:PLANE ALTITUDE,FEET) - ABS -5 &lt;= r 0 &lt;= and (L:MODE_ALT, bool) 1 == and if{ 0 (>K:AP_VS_VAR_SET_ENGLISH) }

<!--      TOLLERANCE 10         -->
(L:ALT_NODE2,NUMBER) (A:PLANE ALTITUDE,FEET) - d -10 &lt;= r -10 &lt;= and (L:MODE_ALT, bool) 1 == and if{ -100 (>K:AP_VS_VAR_SET_ENGLISH) }
(L:ALT_NODE2,NUMBER) (A:PLANE ALTITUDE,FEET) - d  10 &gt;= r  10 &gt;= and (L:MODE_ALT, bool) 1 == and if{ 100 (>K:AP_VS_VAR_SET_ENGLISH) }

<!--      TOLLERANCE 20         -->
(L:ALT_NODE2,NUMBER) (A:PLANE ALTITUDE,FEET) - d -20 &lt;= r -20 &lt;= and (L:MODE_ALT, bool) 1 == and if{ -200 (>K:AP_VS_VAR_SET_ENGLISH) }
(L:ALT_NODE2,NUMBER) (A:PLANE ALTITUDE,FEET) - d  20 &gt;= r  20 &gt;= and (L:MODE_ALT, bool) 1 == and if{ 200 (>K:AP_VS_VAR_SET_ENGLISH) }

<!--      TOLLERANCE 50         -->
(L:ALT_NODE2,NUMBER) (A:PLANE ALTITUDE,FEET) - d -50 &lt;= r -50 &lt;= and (L:MODE_ALT, bool) 1 == and if{ -500 (>K:AP_VS_VAR_SET_ENGLISH) }
(L:ALT_NODE2,NUMBER) (A:PLANE ALTITUDE,FEET) - d  50 &gt;= r  50 &gt;= and (L:MODE_ALT, bool) 1 == and if{ 500 (>K:AP_VS_VAR_SET_ENGLISH) }
 
Last edited:

Heretic

Resource contributor
Messages
6,830
Country
germany
Your if statement is giving you the oscillation. It's not the cfg file....

Why do you have a variable in the if statement? Does that method work for getting current altitude? I use a different method!

I'm not even sure if the current altitude gets set for (>K:AP_ALT_VAR_SET_ENGLISH) as the execution of the statement is stopped as soon as the ALT hold mode is engaged.
 

Roy Holmes

Resource contributor
Messages
1,803
Country
us-virginia
AP_VS_VAR_SET_ENGLISH.

Sets reference vertical speed in feet per minute according to the SDK.
Roy
 
Messages
1,749
Country
unitedstates
Yep that's what i was saying it just sets reference. The only way to tell the AP or a ALT mode to hold current altitude is to create a way to record the current altitude which is what the code above does. Then it executes and adjusts to hold that specific altitude at the time your pressed the mode. FSX only has wing level code that will hold current altitude but it locks the bank and is hardly ever used. Let me know if this code helps?
 
Top