Jump to content
The simFlight Network Forums

Independent controls for a paraglider simulator using FSUIPC


Recommended Posts

Hello -

I'm looking for some assistance regarding the use of independent controls for a paraglider simulator using FSUIPC.  The controls for the paraglider model uses ailerons, and the ailerons use one control input.  I would like to use two inputs: one for the left brake toggle and one for right brake toggle.  However, I've run into a couple of issues and hope to get some input:

1)  One of the two inputs will have to be reversed:  How could I go about doing this in FSUIPC?   I'm using retracting wire potentiometers so I can't reverse the hardware input.

2)  Is there a way to equalize both inputs somehow?  What I find when I assign two inputs (using a simple joystick controller with two sticks) is that one will override the other.  Is there a way to provide an additive input if both inputs are "pulled in"?

I appreciate any information you can share.  Thank you.

 - Mark

Link to comment
Share on other sites

12 hours ago, Mark Des said:

1)  One of the two inputs will have to be reversed:  How could I go about doing this in FSUIPC? 

Either use the REV option in the Calibration Tab, or, if not calibrating, just  use suitable arithmetic modifiers in the Axis assignment section in the FSUIPC settings (INI file). 

The former is described in the User Guide, the latter in the Advanced User's Guide (section "Additional parameters to scale input axis values").

12 hours ago, Mark Des said:

2)  Is there a way to equalize both inputs somehow?  What I find when I assign two inputs (using a simple joystick controller with two sticks) is that one will override the other.  Is there a way to provide an additive input if both inputs are "pulled in"?

Not without doing that yourself with a Lua plug-in program. There's never been a need to add two analogue inputs together. It certainly doean't appear to make sense. And to make the result valid, both inputs would need to have half the full range to avoid over-maximum values.

Pete

 

Link to comment
Share on other sites

Pete, thank you for taking time to answer my questions.  I'm just now learning about the usefulness of FSUIPC is for my application and appreciate your support.

I was in err when I stated to "equalize" the inputs.  I meant to say that I want to determine a differential value based on left and right inputs.  For a paraglider (which, for all intent and purposes, has independently controlled ailerons), I'm looking to create a flight model which tries to simulate the flying characteristics given the limitations of FS.

My intentions are as follows (just thinking off the top of my head at the moment):

X=Left Brake=X Axis (Raw value 0-255)

Y=Right Brake=Y Axis (Raw value 0-255)

Z=127+Y/2-X/2 (which would be the aileron input value)

Given this, no application of X or Y results in level flight, and simultaneous input of both X and Y inputs (left and right brake toggles applied equally) would result in level flight, even to the extent of both fully (full brakes, in paragliding lingo).

Something else I would like to consider is to provide a slight input to flaps upon application of both brakes.  This would be a fractional value of the avg of the X and Y inputs, something like:

F = 127 +(Y+X)/16

Well, what do you think my next step should be?  Is this functionality something I would have to consider creating a Lua plug-in for?  If there is any additional thoughts from yourself or others on the forum, it would be duly appreciated.

Regards,

Mark

 

 

Edited by Mark Des
Link to comment
Share on other sites

5 hours ago, Mark Des said:

My intentions are as follows (just thinking off the top of my head at the moment):

X=Left Brake=X Axis (Raw value 0-255)

Y=Right Brake=Y Axis (Raw value 0-255)

Z=127+Y/2-X/2 (which would be the aileron input value)

You could do that pretty easily with a Lua plug-in. Assign and calibrate X and Y as usual, and in the Lua code read both brake offsets, perform your calculation, and send it to the ailerons via the normal aileron axis control.

But note that your 0-255 range would become 0-16383 automatically. The aileron needs to go from -16384 to +16383 with 0 meaning level.

But if a paraglider effectively has independent ailerons, I don't understand why this isn't programmed into the model you are using?

5 hours ago, Mark Des said:

Something else I would like to consider is to provide a slight input to flaps upon application of both brakes.  This would be a fractional value of the avg of the X and Y inputs, something like:

F = 127 +(Y+X)/16

Again, the same wort of Lua plug-in, or better part of the same one. 

In both cases adjust your computations to deal with the normal sim range of values (0-16383 for flaps too).

Pete

 

Link to comment
Share on other sites

Pete, thanks for the direction.   As a newbie Lua programmer, I was able to hack together the code below.  I read the x and right joystick inputs, converted into usable aileron, rudder, and elevator values, and sent to FS.  This at least gives me different parameters I can use to tune and adjust both in the lua module and in the aircraft.cfg for real-world flight dynamics of a paraglider.  Note that I did try to make the flaps work but was not able to get the controls to function correctly :(

-- Paraglider Controls v1.0

-- FSX Lua Plug-In
-- flyingndiving at yahoo.com
--
-- Read x and y linear inputs of joystick, calculate corrected ailerons, elevator, and rudder, and write to FS
--
-- loop forever
 while 1 do
-- read x and y axis (joystick) inputs
 x_axis = ipc.axis(1, "X")
 y_axis = ipc.axis(1, "Y")
-- convert x and y axis inputs into differential aileron_value
 aileron_value = (x_axis - y_axis) / 2
-- convert x and y axis inputs into average elevator value
 ele_value = (-x_axis - y_axis) / 8
-- convert x and y axis inputs into differential rudder value
 rudder_value = (x_axis - y_axis) / 2
-- write aileron_value, ele_value, and rudder_value to FSX
 ipc.writeSW(0x0BB6, aileron_value)
 ipc.writeSW(0x0BB2, ele_value)
 ipc.writeSW(0x0BBA, rudder_value)
-- display in FS Window
 ipc.display("X="..x_axis.."\nY="..y_axis.."\nAV="..aileron_value.."\nElev="..ele_value.."\nRV="..rudder_value)
-- end script
end
Edited by Mark Des
Link to comment
Share on other sites

As I mentioned, I'm not able to get flaps to work on this paraglider model I have.  Not having built a model in FSX myself, I have a question:  Do flaps have to be designated objects in the model in order to work or is there no association between it and the configuration file (other than the animation)?  I'm able to adjust flaps (detent position) in the Cessna model using a stepping function in LUA, but I'm not getting any effect in the paraglider model.  Another question:  Can flaps be adjusted with a  resolution of 0-16383 or do I have to convert to the resolution of the number of designated detents? 

Got my question answered elsewhere.

- Mark

Edited by Mark Des
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.