Jump to content
The simFlight Network Forums
jordanal

FSUIPC4 - Use button to reverse throttle axis?

Recommended Posts

Hi Pete, it's been a while since I've had the need to pop-in here - I hope you and yours are well. :)

A theoretical question if you have a moment. I have FSXsp2 and the latest FSUIPC4-interim with a Saitek Yoke and ThrottleQuads. As you probably already know, the Saitek THQ is a bit different in that, below the hardware idle-detent, it is basicaly a hardware button. As you can see below, for quite some time I've had each throttle-lever button send a repeate reverse-thrust command, which quickly just ramps up reverse-thrust to 100% (unrealisticaly).

[JoystickCalibration]
Throttle1=-16384,-16384,-16384,16383/32

[Axes.PMDG MD-11]
1=YU,256,F,66420,0,0,0

20=;  ********   THRTL LEVERS  **********
21=RY,21,C65966,0 ;             THROTTLE1_DECR
22=UY,21,C65967,0 ;             THROTTLE1_CUT

What I'm now contemplating, I want each throttle-lever button to cause a axis reversal so that after pushing the button, my throttle lever is now reversed; and as I now push the throttle lever forward above the idle-detent, it will be increasing reverse-thrust. Then, if I push the button again (by bringing the throttle-lever below the idle detent) it would once again reverse the throttle axis back to its normal direction; whereby any travel above the idle-detent is normal increasing thrust.

I basically want to use a push-button to reverse my throttle axis each time it is pushed (causing the full axis to alternate between normal and reverse thrust). I know I could calibrate some arbitrary percentage of the axis to forward and reverse thrust using a fake idle-spot, but I have always had the hardware idle-detent equal 0% output (I just couldn't stand it any other way). :wink:

Is this something that might be even remotely possible now, or perhaps someday in the future?

Thanks and regards,

Share this post


Link to post
Share on other sites

What I'm now contemplating, I want each throttle-lever button to cause a axis reversal so that after pushing the button, my throttle lever is now reversed; and as I now push the throttle lever forward above the idle-detent, it will be increasing reverse-thrust.

I understand that, but it's a bit odd pushing FORWARD for more REVERSE thrust -- certainly not like any real aircraft I think.

Is this something that might be even remotely possible now, or perhaps someday in the future?

You can do it pretty easily using a Lua plug-in. When you assign, in FSUIPC, an axis to a Lua plug-in the latter gets the axis value as a parameter ("ipcPARAM"). It can then use it as it likes.

In this case you'd want to change it according to a flag. i.e. Leave it be or negate it. Then you'd send it on as the parameter for the relevant FS control (THROTTLEn_SET). The plug-in would also have to convert the normal Axis range -16384 to +16383 to the correct forward thrust range (0 to 16383) or negative range (0 to -4096 or less, for 25%).

You also need a plug-in for each button, which toggles a global Lua variable (called, say "THRn_BUTTON"). [by "toggle" I mean sets its value to 1 - its previous value].

Then, in the plug-in for each throttle axis, in order to only change direction when the axis is at 'idle' (or close) you'd COPY the global "THRn_BUTTON" to another global, say "THRn_REVERSE", but only if the axis value is idle, or close (e.g < -16000).

In the main part of the throttle axis plugins you'd test the latter global variable, THRn_REVERSE to see which range to convert the axis into before sending it on as the parameter to THROTTLEn_SET.

Regards

Pete

Share this post


Link to post
Share on other sites

You might be bettter off using a Lua routine and programming delays

into the implementation of the FSX reverse thrust functions (F1, F2, F3)

Here is what I did for the A2A B-377. I just use one of the detent switches on my

dual throttle quads to implement the reverse thrust function. I pull all four throttles

back to detent so they are at minimum and one of the switches triggers the action.

My FSUIPC.ini entries pertaining to this discussion:


[JoyNames]
A=Saitek Pro Flight Quadrant
.
.
.
D=Saitek Pro Flight Yoke


[LuaFiles]
1=B377_exit_revers
2=B377_reverse

[Buttons.Boeing Stratocruiser]
..
..
..
16=PA,8,CL2:R,0 ;//REVERSE THRUST ON
17=UA,8,CL1:R,0 ;//REVERSE THRUST OFF

The lines above call Lua the Lua routines below when the Saitek Pro throttle quad detent switch is activated and released.

------------------Lua files --------------
B377_reverse.lua file

i = 0
   ipc.keypress(112)
   ipc.sleep(250)
while i &lt; 14 do
   ipc.keypress(113)
    ipc.keypress(113)
	ipc.keypress(113)
   ipc.sleep(50)
   i = i + 1
end
---------------------------------
B377_exit_revers.lua   file

i = 0
while i &lt; 15 do
   ipc.keypress(114)
      ipc.sleep(50)
	ipc.keypress(114)
   ipc.sleep(50)
   i = i + 1
end

I have done similar things with other aircraft. Lua gives you the ability to set

the delays between subsequent programmed keystrokes so you can control

the rate at which some events occur. This was probably one of my first uses of

Lua plugins and I chose to use two files. In later programming implementations I

combined several functions in a single file and used the FSUIPC user definable

offsets (66C0 and up) to "trigger" various functions.

Paul

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.