I'm glad to hear the autopilot scripts worked.
I am still finishing my complete Commander 114 MobiFlight project, so I am not ready to share the full project file yet. However, here is a bonus for anyone using the Honeycomb Bravo Throttle Quadrant.
I configured the Bravo’s left selector knob to determine what the right knob controls. MobiFlight has a guide explaining how to configure the selector variable and use it as a precondition:
https://docs.mobiflight.com/guides/honeycomb-bravo-selector-knob
These are the selector values I am using:
ALT = 0
VS = 1
HDG = 2
CRS = 3
IAS = 4
I repurposed the Bravo’s IAS selector position for the Commander autopilot’s BAR setting.
For each right-knob input, add the appropriate Selector value as a MobiFlight-variable precondition. Place the code under On Press and leave On Release blank.
ALT SELECTOR
Precondition:
Selector = 0
The altitude control normally moves in 100-foot increments. These versions measure how quickly the right knob is being turned:
Slow rotation: 100 feet per click
Medium rotation: 500 feet per click
Fast rotation: 1,000 feet per click
Right Knob - ALT Increase
(E:SIMULATION TIME, seconds)
(L:MF_ALT_LastIncTime, seconds) -
0.08 < if{
1000 (>L:MF_ALT_Step, number)
}
els{
(E:SIMULATION TIME, seconds)
(L:MF_ALT_LastIncTime, seconds) -
0.20 < if{
500 (>L:MF_ALT_Step, number)
}
els{
100 (>L:MF_ALT_Step, number)
}
}
(L:var_PreselectedAltitude_10000, number) 10000 *
(L:var_PreselectedAltitude_1000, number) 1000 * +
(L:var_PreselectedAltitude_100, number) 100 * +
(L:MF_ALT_Step, number) +
99900 min
(>L:MF_ALT_New, number)
(L:MF_ALT_New, number)
10000 /
flr
(>L:var_PreselectedAltitude_10000, number)
(L:MF_ALT_New, number)
10000 %
1000 /
flr
(>L:var_PreselectedAltitude_1000, number)
(L:MF_ALT_New, number)
1000 %
100 /
flr
(>L:var_PreselectedAltitude_100, number)
(E:SIMULATION TIME, seconds)
(>L:MF_ALT_LastIncTime, seconds)
Right Knob - ALT Decrease
(E:SIMULATION TIME, seconds)
(L:MF_ALT_LastDecTime, seconds) -
0.08 < if{
1000 (>L:MF_ALT_Step, number)
}
els{
(E:SIMULATION TIME, seconds)
(L:MF_ALT_LastDecTime, seconds) -
0.20 < if{
500 (>L:MF_ALT_Step, number)
}
els{
100 (>L:MF_ALT_Step, number)
}
}
(L:var_PreselectedAltitude_10000, number) 10000 *
(L:var_PreselectedAltitude_1000, number) 1000 * +
(L:var_PreselectedAltitude_100, number) 100 * +
(L:MF_ALT_Step, number) -
0 max
(>L:MF_ALT_New, number)
(L:MF_ALT_New, number)
10000 /
flr
(>L:var_PreselectedAltitude_10000, number)
(L:MF_ALT_New, number)
10000 %
1000 /
flr
(>L:var_PreselectedAltitude_1000, number)
(L:MF_ALT_New, number)
1000 %
100 /
flr
(>L:var_PreselectedAltitude_100, number)
(E:SIMULATION TIME, seconds)
(>L:MF_ALT_LastDecTime, seconds)
This allows precise 100-foot adjustments when turning the knob slowly, while still making it practical to move from zero to normal cruising altitudes quickly.
VS SELECTOR
Precondition:
Selector = 1
The Commander stores the selected vertical speed in hundreds of feet per minute. These commands adjust it by 200 feet per minute and limit the selection to plus or minus 1,600 feet per minute.
Right Knob - VS Increase
(L:var_PreselectedVerticalSpeed, number)
2 +
16 min
(>L:var_PreselectedVerticalSpeed, number)
Right Knob - VS Decrease
(L:var_PreselectedVerticalSpeed, number)
2 -
-16 max
(>L:var_PreselectedVerticalSpeed, number)
BAR SELECTOR
I use the Bravo’s IAS selector position for the autopilot barometric setting.
Precondition:
Selector = 4
The Commander stores the BAR setting as three separate digits, so the following code handles carrying and borrowing between them.
Right Knob - BAR Increase
(L:var_AutopilotBaroCalibration_01, number) 9 < if{
(L:var_AutopilotBaroCalibration_01, number) 1 +
(>L:var_AutopilotBaroCalibration_01, number)
}
els{
(L:var_AutopilotBaroCalibration_1, number) 9 < if{
0 (>L:var_AutopilotBaroCalibration_01, number)
(L:var_AutopilotBaroCalibration_1, number) 1 +
(>L:var_AutopilotBaroCalibration_1, number)
}
els{
(L:var_AutopilotBaroCalibration_10, number) 9 < if{
0 (>L:var_AutopilotBaroCalibration_01, number)
0 (>L:var_AutopilotBaroCalibration_1, number)
(L:var_AutopilotBaroCalibration_10, number) 1 +
(>L:var_AutopilotBaroCalibration_10, number)
}
}
}
Right Knob - BAR Decrease
(L:var_AutopilotBaroCalibration_01, number) 0 > if{
(L:var_AutopilotBaroCalibration_01, number) 1 -
(>L:var_AutopilotBaroCalibration_01, number)
}
els{
(L:var_AutopilotBaroCalibration_1, number) 0 > if{
9 (>L:var_AutopilotBaroCalibration_01, number)
(L:var_AutopilotBaroCalibration_1, number) 1 -
(>L:var_AutopilotBaroCalibration_1, number)
}
els{
(L:var_AutopilotBaroCalibration_10, number) 0 > if{
9 (>L:var_AutopilotBaroCalibration_01, number)
9 (>L:var_AutopilotBaroCalibration_1, number)
(L:var_AutopilotBaroCalibration_10, number) 1 -
(>L:var_AutopilotBaroCalibration_10, number)
}
}
}
These are working well for me in MobiFlight with the Honeycomb Bravo. The same aircraft variables should also be usable with other hardware after adapting the device inputs and preconditions.