• 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.

AP_SPD_VAR_SET

Messages
159
Country
us-colorado
I am trying to find an explanation of AP_SPD_VAR_SET that says more than just 'sets airspeed reference in knots'. Is that all it does? In particular, I would like to understand the relationship between AP_SPD_VAR_SET and AUTOPILOT AIRSPEED HOLD VAR, and between AP_MACH_VAR_SET and AUTOPILOT MACH HOLD VAR. Is AUTOPILOT AIRSPEED HOLD VAR derived from (is a value contained within) AP_SPD_VAR_SET, and likewise AUTOPILOT MACH HOLD VAR is derived from AP_MACH_VAR_SET? If not, where do the values of AUTOPILOT AIRSPEED HOLD VAR and AUTOPILOT MACH HOLD VAR come from, and how are these values initialized?

Thanks,
Al
 
Yes, that's all it does.
(>K:AP_SPD_VAR_SET) sets the IAS (in Knots) which the default Autopilot will hold when airspeed hold is enabled; this set value can be read in (A:AUTOPILOT AIRSPEED HOLD VAR,knots)

Note that event:
- (>K:AP_AIRSPEED_ON) will implicitely write (A:AUTOPILOT AIRSPEED HOLD VAR,knots) to the current IAS.
- (>K:AP_PANEL_SPEED_ON) will just set IAS speed hold On, without affecting (A:AUTOPILOT AIRSPEED HOLD VAR,knots).

Also note that the speed hold function:
- is independant of the AP-Master state, and can only be set if the aircraft.cfg contains:
autothrottle_available= 1
- doesn't become active untill AutoThrottleArmed is Set when the aircraft.cfg contains:
autothrottle_arming_required=1

Rob
 
Last edited:
Rob,
Just to make sure I have it correct:

-K:AP_SPD_VAR_SET holds the reference airspeed for the AP and that value can be read as (or from) A:AUTOPILOT AIRSPEED HOLD VAR.
-Likewise then, AP_MACH_VAR_SET holds the reference Mach# for the AP and that value can be read from A:AUTOPILOT MACH HOLD VAR.

Question: If a value is written into K:AP_SPD_VAR_SET to set a target airspeed in knots, is the corresponding airspeed value expresses in Mach# available as A:AUTOPILOT MACH HOLD VAR, or do you have to first explicitly write a value into AP_MACH_VAR_SET?

If A:AUTOPILOT MACH HOLD VAR is available without explicitly writing into AP_MACH_VAR_SET, then I assume you can set the AP reference airspeed using either K:AP_SPD_VAR_SET or K:AP_MACH_VAR_SET, but regardless how ser, you can retrieve the AP reference airspeed value in either knots or Mach#.

Thanks much for the help.

Al
 
Last edited:
The first part: yes.
And I think it works the same for mach too.

As to the last question: I'm not sure, but if I remember correctly, the value of the airspeed hold var is auto-converted into the mach hold var (for that altitude/pressure) at the moment you switch from speed hold to mach hold.
And vice versa.
But you can easily try how that works ...

Rob
 
Well, technically an A: variable holds the value, and the K: variable sets that A: variable to a new value. But yes, that's basically correct.
 
Yes, that's all it does.
(>K:AP_SPD_VAR_SET) sets the IAS (in Knots) which the default Autopilot will hold when airspeed hold is enabled; this set value can be read in (A:AUTOPILOT AIRSPEED HOLD VAR,knots)

Note that event:
- (>K:AP_AIRSPEED_ON) will implicitely write (A:AUTOPILOT AIRSPEED HOLD VAR,knots) to the current IAS.
- (>K:AP_PANEL_SPEED_ON) will just set IAS speed hold On, without affecting (A:AUTOPILOT AIRSPEED HOLD VAR,knots).

Also note that the speed hold function:
- is independant of the AP-Master state, and can only be set if the aircraft.cfg contains:
autothrottle_available= 1
- doesn't become active untill AutoThrottleArmed is Set when the aircraft.cfg contains:
autothrottle_arming_required=1

Rob
A couple of more questions, please, as I try to understand how the default FSX autopilot works:

As I understand it now, K:AP_SPD_VAR_SET , AP_MACH_VAR_SET and K:AP_VS_VAR_SET_ENGLISH set the IAS, Mach# and Vertical Speed values, respectively, that the autopilot will try to hold. Since these values are not independent of each other, e.g., you can't tell the autopilot to hold a particular IAS with K:AP_SPD_VAR_SET and a particular Mach# with AP_MACH_VAR_SET since IAS and Mach# are related at a given altitude, temperature and pressure, and both are related to vertical speed for a fixed power setting. So you can either set the IAS reference or Mach reference, but not both -- is that correct?

How does the autopilot know if you want to hold IAS or Mach# or Vertical Speed -- does it depend on the whether K:AP_SPD_VAR_SET, AP_MACH_VAR_SET or K:AP_VS_VAR_SET_ENGLISH was the last value set?

Does writing a value into K:AP_SPD_VAR_SET or AP_MACH_VAR_SET accomplish anything if in the aircraft.cfg autothrottle_available=0?

Thanks,
Al
 
A couple of more questions, please, as I try to understand how the default FSX autopilot works:

As I understand it now, K:AP_SPD_VAR_SET , AP_MACH_VAR_SET and K:AP_VS_VAR_SET_ENGLISH set the IAS, Mach# and Vertical Speed values, respectively, that the autopilot will try to hold. Since these values are not independent of each other, e.g., you can't tell the autopilot to hold a particular IAS with K:AP_SPD_VAR_SET and a particular Mach# with AP_MACH_VAR_SET since IAS and Mach# are related at a given altitude, temperature and pressure, and both are related to vertical speed for a fixed power setting. So you can either set the IAS reference or Mach reference, but not both -- is that correct?
Not 100% sure, but Yes, I think that's correct.

How does the autopilot know if you want to hold IAS or Mach# or Vertical Speed -- does it depend on the whether K:AP_SPD_VAR_SET, AP_MACH_VAR_SET or K:AP_VS_VAR_SET_ENGLISH was the last value set?
IAS/Mach Hold is independant of V/S Hold; IAS/MACH Hold just operates the Throttle.

In fact, V/S Hold in FSX DOES NOT exist (using the default FSX AP events/variables).
It is possible to implement a V/S Hold yourself, by setting the AP Altitude to an extreme low/high value (for resp. a neg. or pos. value in K:AP_VS_VAR_SET_ENGLISH) and then set AltHold ON.
Then the AP will follow the set V/S.
So in fact the FSX AP ONLY knows Alt Hold, not V/S Hold.
Example: When you want to implement a V/S Hold function to hold a set V/S via K:AP_VS_VAR_SET_ENGLISH (assuming you want to climb):
- Set AltHold selector to eg. 100.000.
- Set AP-panel AltHold On. FSX now sets the V/S selector to the default value in the aircraft.cfg.
- Then set the desired V/S via K:AP_VS_VAR_SET_ENGLISH
Not sure about the order (long time ago I implemented this), so you have to try ..

Does writing a value into K:AP_SPD_VAR_SET or AP_MACH_VAR_SET accomplish anything if in the aircraft.cfg autothrottle_available=0?
Thanks,
Al
No. You can only set IAS/Mach Hold on when autothrottle_available=1

Rob
 
The events you are asking about simply set an internal variable in the sim. It doesn't control the autopilot beyond that. There are other events that tell the autopilot what mode(s) to use.

I strongly urge you to read the SDK and go through it's examples.
 
Thanks for the info.
I have read some of the SDK but find it difficult to get the big picture sometimes.
Al
 
Back
Top