Skip to content

Improved Thrustmaster Boeing TCA Autopilot Control Integration LUA Script for X-plane

License

Notifications You must be signed in to change notification settings

xpxop/improvedTCA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 

Repository files navigation

improvedTCA

Improved Thrustmaster Boeing TCA Autopilot Control Integration LUA Script for X-plane by Seb

Based on the "Thrustmaster Boeing TCA Autopilot Control Integration Script for X-plane by Andrew Spink (theegg52)"

Changelog

New in v1.0.2-beta

  • Hopefully better smoothing of the knob

New in v1.0.1

  • Thanks to suggestions form BorisEagle for the zibomod you can now also assign different reverser levels (idle, 25%, 50%, 100%) to the two reverser knobs - just assign the commands "Reverser #1 (#2) xxx while holding" to the respective buttons.

  • The "knob press" function has some nice new features:

    • short / click like press -> behaves as in v1.0.0
    • slightly longer press -> a different command can be assigned (in the script - not yet done)
    • a long press -> switches knob to secondary mode: Based on the mode selection (SPD, HDG, ALT) the knob now modifies (BARO, CRS, VS) and short click fires different commands. So far this is only implemented for the zibomod. After 3 seconds of inactivity (no pressing or turning the knob) the knob switches back to primary mode, switching to a different mode via "the ring thing" also always goes to primary mode. The times for what is slighty longer and long press, aswell as the inactivity timeout can be configured in the script (see under Advanced)

Install

Download & copy lua/improvedTCA.lua to YOUR_XPLANE_FOLDER\Resources\plugins\FlyWithLua\Scripts

Setup

Simple

Assign buttons in X-plane to script commands as shown here:

button assignment screenshot button assignment screenshot

New in v1.0.1

  • Thanks to suggestions form BorisEagle for the zibomod you can now also assign different reverser levels (idle, 25%, 50%, 100%) to the two reverser knobs - just assign the commands "Reverser #1 (#2) xxx while holding" to the respective buttons.

  • The "knob press" function has some nice new features:

    • short / click like press -> behaves as in v1.0.0
    • slightly longer press -> a different command can be assigned (in the script - not yet done)
    • a long press -> switches knob to secondary mode: Based on the mode selection (SPD, HDG, ALT) the knob now modifies (BARO, CRS, VS) and short click fires different commands. So far this is only implemented for the zibomod. After 3 seconds of inactivity (no pressing or turning the knob) the knob switches back to primary mode, switching to a different mode via "the ring thing" also always goes to primary mode. The times for what is slighty longer and long press, aswell as the inactivity timeout can be configured in the script (see under Advanced)

Advanced

Increments for normal/fast mode

NEW in v1.0.1 Change these variables (only the values not the names) to adjust the increments/decrements per "click" of the knob:

increments = {
	spd = {
		normal = 1,
		fast = 2,		
	},
	hdg = {
		normal = 1,
		fast = 2,		
	},
	alt = {
		normal = 100,
		fast = 1000,		
	},
	spd2nd = {
		normal = 0.01,
		fast = 0.1,		
	},
	hdg2nd = {
		normal = 1,
		fast = 2,		
	},
	alt2nd = {
		normal = 50,
		fast = 100,		
	}
}

normal for normal / slow knob turn speed fast for fast knob turn speed

Remark: "Fast" is detected via the "button hold" that the knob sends at higher turn speeds

Knob press behavior

NEW in v1.0.1

Change

local minSelHoldTime = 0.5
local minSelLongHoldTime = 2
local secondaryModeTimeOut = 3

to values (seconds) that work for you.

minSELHoldTime -> after this amount of seconds holding down the knob button (sel) the hold action will be fired (not used yet)

minSelLongHoldTime -> long hold time in seconds -> after this time the knob switches to the secondary mode

secondaryModeTimeOut -> if you do not press the knob or turn the knob for this amount of seconds the knob defaults back to primary mode

Adjust the fast / normal speed responsiveness

NEW/CHANGED in Experimental

This new approach to get a smoother knob uses moving average. The knob click to click time (DT) gets checked against the moving average of n = lengthTickValues (default 3). Ff DT is smaller than moving average - maxDeviationSecs - this click gets ignored. Abrupt direction changes are also ignored if direction changes happen in under directionChangeDtThresholdSecs

local maxDeviationSecs = 0.1 -- increase this value to make the knob more responsive (and probably more bouncy)
local minHoldTimeFastTicksSecs = 0.1 -- increase this value to make the knob wait longer before switching to fast turning mode
local minHoldTickDtSecs = 0.05 -- decrease this value to get faster fast tick speed
local directionChangeDtThresholdSecs = 0.5 -- increase this value to make knob less sensitive to sudden direction changes
local lengthTickValues = 3 -- increase this value to increase the number of values for moving average -> larger values mean slower & smoother, 1 turns that off, must be >= 1

Remark: minHoldCounterNormTicks has to be smaller than minHoldCounterFastTicks

Troubleshooting

  • Cannot find the improvedboetca section under FlyWithLua in XPlane to assign functions to buttons!
    • Try to reload all lua scripts via the Plugins->FlyWithLUA menu while a plane is loaded

About

Improved Thrustmaster Boeing TCA Autopilot Control Integration LUA Script for X-plane

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages