Board index FlightGear Development Aircraft

Aircraft 737-300 Reverse Trust via Saitek Pro-Flight_Yoke

Questions and discussion about creating aircraft. Flight dynamics, 3d models, cockpits, systems, animation, textures.

Aircraft 737-300 Reverse Trust via Saitek Pro-Flight_Yoke

Postby linux&os2 » Wed Feb 21, 2018 1:15 pm

Hi, all,

I am new to use a flight simulator.
First of all a tremendous thank you far al the effort done.

I am a drone pilot, and during winter I hat to find some interesting thing.
I installed Flightgear on a Linux Ubuntu 16.4.
Software is very stable. I use the development code.

After flying some time with Keyboard and mouse, I decided to get some gear:
I got the Pro-Flight_Yoke, Pro-Flight-Rudder-Pedals and the Pro-Flight-Quadrant.
After finding the "dead zone" issue I got Leo Bodnar BU0836A.

Now I want to make the reverse trust to work for the 737-300 via button 20 of the throttle quadrant.
Looking at the code in the 737-300-set.xml for the reverse trust code I found the reversethrust.togglereverser() script.
Executing this script via Debug-Nasal Console reverse thrust works as expected.
Putting this script in the Pro-Flight-Yoke.xml visually the reverse trust works. But when going back to normal trust the plane still goes backward when throttling.

Marc.
linux&os2
 
Posts: 20
Joined: Wed Feb 21, 2018 12:18 pm
Location: Belgium Zedelgem
Version: V2020.3.5
OS: Linux gentoo

Re: Aircraft 737-300 Reverse Trust via Saitek Pro-Flight_Yok

Postby Clive2670 » Wed Feb 21, 2018 2:30 pm

No need to change any xml codes just use this program in the background and bind the relevent keys from the keyboard to your joystick it's that easy! https://github.com/AntiMicro/antimicro hope this helps you in your quest!
Thanks Clive aka: G-BLS01
Can be seen flying the Boeing 777-200LR
Toshiba laptop,
Intel i5 4210U,
16Gb RAM,
AMD R7-M260 graphics 2Gb RAM
Clive2670
 
Posts: 589
Joined: Mon Feb 08, 2016 8:11 pm
Location: Anywhere in the World at some point on Flightgear!
Callsign: G-BLS01
Version: 2018.3.1
OS: Windows 10 64bit

Re: Aircraft 737-300 Reverse Trust via Saitek Pro-Flight_Yok

Postby linux&os2 » Thu Feb 22, 2018 2:05 pm

Hi all,
This is what I found out:
this is the 737-300 reversethrust xml.

Code: Select all
    throttle1 = "/controls/engines/engine/throttle";
      angle1 = "/fdm/jsbsim/propulsion/engine";
      angle2 = "/fdm/jsbsim/propulsion/engine[1]";
      control1 = "/controls/engines/engine";
      control2 = "/controls/engines/engine[1]";
      engselect = "/sim/input/selected";
      pos1 = "/engines/engine/reverser-pos-norm";
      pos2 = "/engines/engine[1]/reverser-pos-norm";

      # The reverse can only be actuated while the engine is idling
      if (getprop(throttle1) < 0.01) {
        val = getprop(pos1);
        if (val == 0 or val == nil) {
          interpolate(pos1, 1.0, 1.4);
          interpolate(pos2, 1.0, 1.4);
          setprop(angle1,"reverser-angle-rad","1.58");
          setprop(angle2,"reverser-angle-rad","1.58");
          setprop(control1,"reverser", "true");
          setprop(control2,"reverser", "true");
          setprop(engselect,"engine", "true");
          setprop(engselect,"engine[1]", "true");
        } else {
          if (val == 1.0){
            interpolate(pos1, 0.0, 1.4);
            interpolate(pos2, 0.0, 1.4);   
            setprop(angle1,"reverser-angle-rad",0);
            setprop(angle2,"reverser-angle-rad",0);
            setprop(control1,"reverser",0);
            setprop(control2,"reverser",0);
            setprop(engselect,"engine", "true");
            setprop(engselect,"engine[1]", "true");
          }
        }
      }



So,,, when engines are in forward mode following properties are observed:
/fdm/jsbsim/propulsion/engine/reverser-angle-rad is 0 .
/controls/engines/engine/reverser is false.
/sim/input/selected/engine is true.
and visually the rear part of the engines are not retracted. (Chase View Without Yaw)
aircraft moves forward when applying throttle.

Now when pressing Delete on keyboard or engaging reverse via button on throttle quadrant:
/fdm/jsbsim/propulsion/engine/reverser-angle-rad is floating around 1.8 .
/controls/engines/engine/reverser is true.
/sim/input/selected/engine is true.
visually the rear part of the engines are retracted.
aircraft moves backward when applying throttle.
---------------------------------------------
Pressing Delete when engines are in reversed mode:
/fdm/jsbsim/propulsion/engine/reverser-angle-rad is 0 .
/controls/engines/engine/reverser is false.
/sim/input/selected/engine is true.
and visually the rear part of the engines are not retracted. (Chase View Without Yaw)
aircraft moves forward when applying throttle.

But... disabling reverse via button on throttle quadrant:
/fdm/jsbsim/propulsion/engine/reverser-angle-rad stays not floating any more around 1.8 .
/controls/engines/engine/reverser is false.
/sim/input/selected/engine is true.
and visually the rear part of the engines are not retracted. (Chase View Without Yaw)
aircraft moves backward when applying throttle.

very strange that the /fdm/jsbsim/propulsion/engine/reverser-angle-rad does not go back to zero,
but the other properties do.

Now I recoded the section for button 20 in Pro-Flight-Yoke.xml

Code: Select all
 Select all
        <button n="20">
            <desc>thrust reverse</desc>
            <binding>
                <command>nasal</command>
                <script>
                      if (getprop("/sim/aircraft") == "CRJ1000-EuroLite") {
    bla bla

                      elsif (getprop("/sim/aircraft") == "737-300") {
                        reversethrust.togglereverser();
                            }
                      elsif (getprop("/sim/aircraft") == "A380") {
    blabber

                </script>
            </binding>
            <mod-up>
                <binding>
                    <command>nasal</command>
                    <script>
                    if (getprop("/sim/aircraft") == "737-300") {
                        if (getprop("/fdm/jsbsim/propulsion/engine/reverser-angle-rad") != 0 )
                            setprop("/fdm/jsbsim/propulsion/engine","reverser-angle-rad",0);
                        if (getprop("/fdm/jsbsim/propulsion/engine[1]/reverser-angle-rad") != 0 )
                            setprop("/fdm/jsbsim/propulsion/engine[1]","reverser-angle-rad",0);
                    }

    bla
                    </script>
                </binding>
            </mod-up>
        </button>


This works!!!

linux&os2

Posts: 1
Joined: Wed Feb 21, 2018 11:18 am
linux&os2
 
Posts: 20
Joined: Wed Feb 21, 2018 12:18 pm
Location: Belgium Zedelgem
Version: V2020.3.5
OS: Linux gentoo


Return to Aircraft

Who is online

Users browsing this forum: zayamatias and 19 guests