Board index FlightGear Support Hardware

Joystick help

Joysticks, pedals, monitors.

Joystick help

Postby Trisnpod » Sat Apr 09, 2016 10:15 am

Hi, I'm having some issues setting up a joystick on flightgear. It's not really a typical joystick or controller, its an rc transmitter.I've plugged it in and assigned each axis to the right control and it works, it's flyable but the rudder settles at slightly left making ground handling and staying straight in the air very difficult. I've tried using the trims on the transmitter to sort this out, but the rudder trim seems to be the only one that flightgear doesn't respond to. Is there any way to trim a joystick within flightgear?
Also, particularly in single engine planes like the Cessna 172, there is a tendency for the plane to want to roll to the left. I put this down to torque originally but it's quite strong. I had to trim the aileron stick on the transmitter to stop this but I don't know if its supposed to be like that or not. And I have problems with the elevator either pulling up or down, it changes severity from plane to plane and although the trim works for that control I can't find a point where it makes it better and again I don't know whether it should be like this or not. I saw there is an elevator trim in some of the planes, is this supposed to be used mid flight as the elevator trim changes or something?
I am planning on getting a proper joystick soon, I've got a couple I'm looking at on ebay now, the speedlink black widow and the thrustmaster t flight hotas x. Both of these use a rudder slider thing on the back of the throttle, does anyone have experience of these and if so what is it like compared to twist yaw?
thanks for any help?
Trisnpod
 
Posts: 36
Joined: Sat Apr 09, 2016 9:54 am
Location: Sheffield, England
Version: 2016.2.1
OS: Windows 10

Re: Joystick help

Postby hamzaalloush » Sat Apr 09, 2016 11:35 am

your primary control of the aircraft pitch should be through direct control of the elevator, the need for lots of trim to control "attitude" reveals a non-linear analog axis, trim should only be used for minimal deflection of flight control surfaces(i'm not talking about countering pitch moment here, that's another subject).

it's normal for aircraft to be out of trim depending on speed, and CG, therefore it shouldn't be your primary control.

if you have a jittery/non-centered axis, for example the one that you use for the rudder, you can workaround that by using <offset> tags in the relevant xml for your input device.

see: http://wiki.flightgear.org/Bindings#property-scale

with regards to recommendations, you really can't go wrong Thrustmaster products, either the HOTAS (or the non-HOTAS variant) Thrustmaster T-Flight sticks are fine, although I've found a little on the sensitive side, but they are very precise.
hamzaalloush
 
Posts: 631
Joined: Sat Oct 26, 2013 10:31 am
OS: Windows 10

Re: Joystick help

Postby someguy » Sat Apr 09, 2016 2:39 pm

The torque effect on the C172P has been described as authentic by those who have flown the plane in real life. The need to retrim the elevator as speed increases is also correct behavior.

FG aircraft are created by amateur volunteers, and some are simply not very well made. They may exhibit nonlinear elevator response and other anomalies; I suspect their authors fly only with mouse and keyboard, and have never tested them with realistic controllers. Keep trying different planes, and you'll find many that are a joy to fly.

I use a Thrustmaster T.16000M. It does seem too sensitive in the twist yaw axis, but I think it's because the centering spring is too stiff. It's a fine stick, regardless, and after several years of daily use still performs like new.
User avatar
someguy
 
Posts: 1650
Joined: Tue Nov 25, 2008 6:54 am
Location: USA
Version: 2019.1.1
OS: Mac OS X 10.11.6

Re: Joystick help

Postby Richard » Sat Apr 09, 2016 5:49 pm

Trisnpod wrote in Sat Apr 09, 2016 10:15 am:I am planning on getting a proper joystick soon, I've got a couple I'm looking at on ebay now, the speedlink black widow and the thrustmaster t flight hotas x. Both of these use a rudder slider thing on the back of the throttle, does anyone have experience of these and if so what is it like compared to twist yaw?
thanks for any help?


I've got a fair few joysticks and pretty much all of the cheaper ones that use potentiometers are quite non linear; some are better than others and this often results in what can appear to be unrealistic flying response; sometimes calibration helps. For my Blackwidow I had to tweak the deadzone and the square in the joystick config and it made the flight experience way better. This was all using my F-15 so I knew that it had to be a joystick problem as the flight model is pretty accurate.

To check the linearity of the joystick I made a calibrated measure out of a piece of card cut so I could put it over the joystick and move it in quarter deflections and compared with the values reported in the joystick window. Mine was about 0.4 for the first quarter and then quite linear which resulted in twitchy aileron respose.
Richard
 
Posts: 810
Joined: Sun Nov 02, 2014 11:17 pm
Version: Git
OS: Win10

Re: Joystick help

Postby Trisnpod » Sat Apr 09, 2016 10:40 pm

Ok I just managed to get a black widow on ebay for £8 (including postage). Should be here on Thursday.
Could anyone recommend some of the better planes to download, so far I've found the cap 10b, the cessna and the boeing 707 to be the best (at least graphically) I've tried so far.
Cheers
Tristan
Trisnpod
 
Posts: 36
Joined: Sat Apr 09, 2016 9:54 am
Location: Sheffield, England
Version: 2016.2.1
OS: Windows 10

Re: Joystick help

Postby Richard » Sun Apr 10, 2016 12:00 am

Trisnpod wrote in Sat Apr 09, 2016 10:40 pm:Ok I just managed to get a black widow on ebay for £8 (including postage). Should be here on Thursday.
Could anyone recommend some of the better planes to download, so far I've found the cap 10b, the cessna and the boeing 707 to be the best (at least graphically) I've tried so far.
Cheers


In my (obviously biased) opinion

Fighters:

* F-15C/D
* F-14A/B
* JA37
* M2000

Piston
* Extra 500
* C172
* Twin Otter

Helicopters
* CH-53E

Civil / Transport
* Concorde
* A320neo
* B747-400
* B777

Spacecraft
* Space Shuttle.

see: http://wiki.flightgear.org/Airliner_Development_Status

The F-14 and F-15 I can state that the aerodynamics and flight model are very close to the aircraft because of the use of wind tunnel derived aerodynamic data.
Richard
 
Posts: 810
Joined: Sun Nov 02, 2014 11:17 pm
Version: Git
OS: Win10

Re: Joystick help

Postby hamzaalloush » Mon Apr 11, 2016 8:39 am

not to detract from your comment Richard, but i believe different kinds of aircraft require different kind of input device, joystick are for rapid movement and high amount of deflection, while GA and airliners one require slow, increment and long smooth inputs.

Also, IMO the best joystick to ever introduced(aside from TM Warthog) was the Microsoft SW joystick(FFB non-the-less) which is no longer in production sadly(but due to high market price buying used, you'll find the demand reflecting the quality)
hamzaalloush
 
Posts: 631
Joined: Sat Oct 26, 2013 10:31 am
OS: Windows 10

Re: Joystick help

Postby jaxsin » Mon Apr 11, 2016 12:54 pm

hamzaalloush wrote in Mon Apr 11, 2016 8:39 am:not to detract from your comment Richard, but i believe different kinds of aircraft require different kind of input device, joystick are for rapid movement and high amount of deflection, while GA and airliners one require slow, increment and long smooth inputs.


I'm with you, the same joystick settings I prefer for planes is way different then for helis. But it is easy to kill the sensitivity of the joystick if that is your problem and need more finer control

edit: in fact I have seen my own joystick move further in one direction then the surface in-sim that it is controlling. Not sure why this happens or if it is even as bad as I think it is. I have never tested it fully to prove my eyesight correct.
jaxsin
 
Posts: 395
Joined: Mon Dec 28, 2015 4:54 pm

Re: Joystick help

Postby rominet » Tue Apr 12, 2016 2:26 pm

Indeed, being able to easily change joystick(s) and/or mouse configuration depending on the aircraft is an important part of the FG setup IMHO (except for people always flying with the same aircraft, of course).

I can give you two ways to override specific mouse and/or joystick params, or to entirely replace a joystick configuration depending on the selected aircraft, in a way that is completely automatic:
  • The cleanest way uses FFGo's conditional config support. For instance, you can use the following conditional section after your unconditional fgfs options in FFGo's Options Window:
    Code: Select all
    [ aircraft == "ec130b4" ]
    --config=/home/flo/.fgfs/YourName/joystick-configs/heli/Logitech-attack-3-as-js-named.xml
    --prop:double:/input/mice/mouse[0]/mode[1]/x-axis/binding/factor=1.0
    --prop:double:/input/mice/mouse[0]/mode[1]/y-axis/binding/factor=-1.0
    --prop:/your-name/your-property=value

    This:
    1. loads the config for the Logitech Attack 3 joystick from a particular file (/home/flo/.fgfs/YourName/joystick-configs/heli/Logitech-attack-3-as-js-named.xml) instead of the default file. For this to work, you need to wrap the joystick config inside the <PropertyList> in such a way that it appears as a /input/joysticks/js-named node (you can have several; if several such js-named nodes are given for the same joystick and match a connected joystick, I believe that the last one wins—cf. FGDeviceConfigurationMap's constructor in flightgear/src/Input/FGDeviceConfigurationMap.cxx). For instance, the Logitech-attack-3-as-js-named.xml file mentioned here could look like this:
      Code: Select all
      <?xml version="1.0"?>

      <!--
          ************************************************************************
          Special helicopter-oriented bindings for the Logitech Attack 3 joystick.
          Part of a mouse + joystick setup, cf.
          <https://www.youtube.com/watch?v=j-Y5GoxUPr0>).

          ************************************************************************
          -->

      <PropertyList>
        <input>
          <joysticks>
            <js-named>
              <name>Logitech Attack 3</name>
              <name>Logitech Logitech Attack 3</name>

              <nasal>
                <script>
                  # Replace 3 with 5 to see the message on the terminal with the
                  # default log level.
                  logprint(
                    3, "Loading heli-specific binding file for Logitech Attack 3");
                </script>
              </nasal>

              <axis n="0">
                <desc>Rudder</desc>
                <binding>
                  <command>property-scale</command>
                  <property>/controls/flight/rudder</property>
                  <offset type="double">0.0</offset>
                  <factor type="double">0.5</factor>
                  <squared type="bool">true</squared>
                </binding>
              </axis>

              <button n="0">
                <desc>Full throttle / Set collective to zero</desc>
                <binding>
                  <command>nasal</command>
                  <script>
                    interpolate("/controls/engines/engine/throttle", 1.0, 1.25)
                  </script>
                </binding>
              </button>
            </js-named>
          </joysticks>
        </input>
      </PropertyList>
    2. sets the mouse sensitivity to 1.0 for the X axis and to -1.0 for the Y axis;
    3. sets a custom property (/your-name/your-property) that you may want to use in your joystick or mouse bindings, for instance.
    All this, only if the selected aircraft is ec130b4. To cover more aircraft, you could use a condition such as aircraft in ["ec130b4", "ec135p2", "M-XE", "s55"] (using a list and a membership test) instead of aircraft == "ec130b4". For more modularity, you can use CondConfigParser variables, like this:
    Code: Select all
    { heli_class = aircraft in \
        ["alouette2", "alouette2F", "Alouette-III_sc", "bo105",
         "ec130b4", "ec135p2", "M-XE", "s55", "s76c", "uh1", "uh60", "rah-66"]
        # You can do other variable assignments here
    }

    # Your unconditional fgfs options
    --enable-fullscreen
    --disable-hud-3d

    # Now the conditional sections
    [ heli_class ]   # heli_class is a boolean, so it can be used just as is
    --prop:...
    --other-fgfs-option
    ...

    [ aircraft == "c172p" or heli_class ]
    --whatever
    --etc.

    [ aircraft in ["707", "777-200ER", "A320neo", "A330-203", "CRJ700" ] ]
    --again-whatever-you-want
    --you-got-the-idea

    Again, this has to be put in FFGo's Options Window.
  • The second way is a pure Nasal-based solution. The main drawback compared to the method using FFGo's conditional config support is that if you load a joystick file to completely replace the binding file that would normally be loaded for a given joystick, the “normal binding file” is still loaded before the Nasal script runs, which could have side effects. In such a case, it is also necessary to reload the input subsystem to make sure the new file completely overrides the normal one, which is kind of a kludgy thing to do on every FG startup.

    Anyway, here is how it goes: create a file with a .nas extension inside $FG_HOME/Nasal, with contents similar to this:
    Code: Select all
    var currentAircraft = getprop("/sim/aircraft");
    var inputReloadRequired = 0;

    # Simplest possible way:
    # if (currentAircraft == "ec130b4") {
    #   setprop("/input/mice/mouse[0]/mode[1]/x-axis/binding/factor", 1.0);
    #   setprop("/input/mice/mouse[0]/mode[1]/y-axis/binding/factor", -1.0);
    # }

    # Let's define slightly more sophisticated conditions:
    var myHelis = [
       "alouette2", "alouette2F", "Alouette-III_sc", "bo105", "ec130b4",
       "ec135p2", "M-XE", "s55", "s76c", "uh1", "uh60", "rah-66"];

    var acNeedingSmallMouseSensitivity = std.Vector.new(
      ["f-14b", "c172p", "SenecaII"]);
    acNeedingSmallMouseSensitivity.extend(myHelis);

    if (acNeedingSmallMouseSensitivity.contains(currentAircraft)) {
      # Adjust the mouse sensitivity for these aircraft
      setprop("/input/mice/mouse[0]/mode[1]/x-axis/binding/factor", 1.0);
      setprop("/input/mice/mouse[0]/mode[1]/y-axis/binding/factor", -1.0);
    }

    # Completely override the joystick bindings for Logitech Attack 3 if the
    # current aircraft is part of 'myHelis'. More joystick configs could be
    # overridden the same way (if using several joysticks at the same time).
    if (std.Vector.new(myHelis).contains(currentAircraft)) {
        var newBindingFile = getprop("/sim/fg-home") ~
          "/YourName/joystick-configs/heli/Logitech-attack-3.xml";
        var joysticksNode = props.globals.getNode("input/joysticks");
        io.read_properties(newBindingFile,
                           joysticksNode.addChild("js-named"));
        inputReloadRequired = 1;
    }

    # If one only wants to change a few parameters of existing axis and/or button
    # bindings, it is not necessary to load an entirely new binding file and
    # reload the input subsystem: the change can be done in-place.
    if (currentAircraft == "707") {
      var jsNodes = props.globals.getNode("input/joysticks").getChildren("js");

      foreach (var jsNode; jsNodes) {
        # Name seen by libplibjs; yes, "Logitech" is repeated twice.
        if (jsNode.getValue("id") == "Logitech Logitech Attack 3") {
          # Silly change, just an example (easy to see the effect in the default
          # HUD).
          jsNode.setDoubleValue("axis[1]/binding/factor", 0.1);
          break;
        }
      }
    }

    if (inputReloadRequired) {
        # Necessary if, for instance, axis or button nodes have been removed. Also
        # runs the Nasal script from the optional <nasal> top-level element of the
        # new binding file.
        fgcommand("reinit", props.Node.new({"subsystem": "input"}));
    }

    With this method, the joystick bindings in $FG_HOME/YourName/joystick-configs/heli/Logitech-attack-3.xml don't have to be wrapped inside:
    Code: Select all
    <input>
        <joysticks>
          <js-named>

    contrary to what has to be done with the first method. The file can be a perfectly normal joystick binding file.
Adapt to your taste. :wink:

Edits:
  • in the second method, add missing 'var' specifier for 'newBindingFile';
  • also add an example of in-place editing of an axis parameter ('factor' here),
    similar to what was done with the mouse bindings (this type of modification
    doesn't require reloading of the input subsystem);
  • replace a dead link.
Last edited by rominet on Tue May 24, 2016 11:31 pm, edited 1 time in total.
rominet
 
Posts: 605
Joined: Sat Nov 01, 2014 2:33 pm
Callsign: F-KATS
Version: Git next
OS: Debian GNU/Linux

Re: Joystick help

Postby miguel » Wed Apr 13, 2016 4:00 pm

hola : sobre el tema yoyStick, yo tube el mismo problema,si no has resuelto tu problema ( yo tengo un THRUSTMASTER ) te mandaria mi XML que funciona correcto,me das la respuesta por privado vale muchas gracias.
miguel
 
Posts: 227
Joined: Wed Aug 19, 2015 5:05 pm


Return to Hardware

Who is online

Users browsing this forum: No registered users and 0 guests