More realistic trim for HoneyComb Bravo and Xplane12
X-Plane is an extremely realistic flight simulator with one of the most accurate flight models. If like me you have chosen the HoneyComb series for your controls, then you probably have issues with the aircraft trim. In fact, the HoneyComb Bravo trim wheel isn’t very a sensitive command and this can make the trim difficult to achieve. Luckily, X-Plane can be adapted with Lua code for many things, here’s a solution if you also have this issue. Unlike MSFS24 where additional software is required, here it only needs a few lines of code to make the adaptation, which is really convenient.
The elevator trim command on the Bravo is mechanically a wheel that turns forward or backward, practical and quite similar to what is found in general aviation. Technically, this command is considered as 2 buttons, one to compensate downward and the other upward. The basic configuration associates these 2 buttons with the corresponding elevator trim function, but the increment is very (too) small, which requires turning the wheel for a long time to compensate for the aircraft, which is not realistic.
After searching and finding non-working solutions for me, I created a simple Lua script to improve the trim in X-Plane 12 with HoneyComb Bravo, here it is. The principle is very simple: we create two new commands that will be substitutable for the basic ones and change the position of the elevator trim more quickly. In the example below, the value is fixed (0.01), feel free to evolve it according to your needs and your feelings and why not according to the aircraft setting made in the acf model.
1dataref("xp_elv_trim", "sim/flightmodel/controls/elv_trim", "writable")
2
3function set_trim_up(trim_inc)
4 xp_elv_trim = xp_elv_trim + trim_inc
5 if xp_elv_trim > 1.0 then
6 xp_elv_trim = 1.0
7 end
8 if xp_elv_trim < -1.0 then
9 xp_elv_trim = -1.0
10 end
11end
12
13create_command("FlyWithLua/XinCTO/HCBTrimUp",
14 "This command increases the elevation trim by 1%",
15 "set_trim_up(0.01)",
16 "",
17 "")
18
19create_command("FlyWithLua/XinCTO/HCBTrimDown",
20 "This command decrease the elevation trim by 1%",
21 "set_trim_up(-0.01)",
22 "",
23 "")
To use this code as presented below, place it in a file with an .lua extension in the folder X-Plane 12\Resources\plugins\FlyWithLua\Scripts, then refresh the scripts in X-Plane (or start it). After that, associate the two fictitious buttons of the HoneyComb Bravo trim wheel to use the Lua plugin ones from now on.
The principle of operation is very simple:
Line 1: we map X-Plane’s memory zone onto a variable which we can change the value of the depth trim Line 3: the function that allows directly changing the value of the trim, bounded between -1.0 and 1.0, is a float Lines 13 and 19: the definition of the two new commands with the call to the function with the increment The compensation value here is 1% positive or negative, it is given as an example.
Have safe flights.
References:
- X-Plane Developer
- X-Plane dataref