Board index FlightGear Support Flying

Differntial braking

Controlling your aircraft, using the autopilot etc.

Differntial braking

Postby Samgordon » Mon Apr 02, 2018 11:19 pm

Any way to use differential braking in FlightGear?

Thanks.

Best.
Samgordon
 
Posts: 14
Joined: Sun Mar 25, 2018 3:11 pm

Re: Differntial braking

Postby legoboyvdlp » Mon Apr 02, 2018 11:47 pm

Try comma and period keys ;)
Comma is for left brake, period is for right brake.

If you want to setup hardware for that, i'm afraid you will need to ask someone else.
User avatar
legoboyvdlp
 
Posts: 7981
Joined: Sat Jul 26, 2014 2:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: Differntial braking

Postby Samgordon » Mon Apr 02, 2018 11:50 pm

Thanks.
Samgordon
 
Posts: 14
Joined: Sun Mar 25, 2018 3:11 pm

Re: Differntial braking

Postby sim » Sun Apr 08, 2018 6:01 pm

If you have a joystick chose a button for left brake and another button for right brake. Open your stick xml file and edit.
The code box below shows how each button script is written. Just ensure you renumber button 1 and button 2
if your own choice of buttons have a different number. You can delete the pop up tips once you test in FG and it works ok.
Code: Select all
<button n="1">
    <desc>X_leftBrake</desc>
    <binding>
        <command>property-assign</command>
        <property>/controls/gear/brake-left</property>
        <value type="double">1.0</value>
    </binding>  <repeatable type="bool">false</repeatable>
    <binding>
        <command>nasal</command>
        <script>gui.popupTip("LEFT BRAKE");</script>
    </binding>
    <mod-up>
        <binding>
            <command>property-assign</command>
            <property>/controls/gear/brake-left</property>
            <value type="double">0.0</value>
        </binding>
    </mod-up>
</button>

<button n="2">
    <desc>X_rightBrake</desc>
    <binding>
        <command>property-assign</command>
        <property>/controls/gear/brake-right</property>
        <value type="double">1.0</value>
    </binding>
    <repeatable type="bool">false</repeatable>
    <binding>
        <command>nasal</command>
        <script>gui.popupTip("RIGHT BRAKE");</script>
    </binding>
    <mod-up>
        <binding>
            <command>property-assign</command>
            <property>/controls/gear/brake-right</property>
            <value type="double">0.0</value>
        </binding>
    </mod-up>
</button>
Last edited by sim on Sun Apr 08, 2018 9:13 pm, edited 1 time in total.
User avatar
sim
 
Posts: 1431
Joined: Tue Jun 30, 2009 3:13 pm
Location: Shropshire England
Callsign: Fly4Fun
Version: 0.9.10 up
OS: 64 Win 10 HD6450

Re: Differntial braking

Postby wkitty42 » Sun Apr 08, 2018 6:17 pm

FWIW: OCD kicking in... i've cleaned up the formatting of the above code...

[edit] reformatted code removed as it is cleaned up in above post [/edit]
Last edited by wkitty42 on Sun Apr 08, 2018 9:25 pm, edited 1 time in total.
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9146
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: Differntial braking

Postby sim » Sun Apr 08, 2018 9:09 pm

:? Thanks Kitty. Will substitute your cleaned up codebox into my own post so they're both identical. :wink:
User avatar
sim
 
Posts: 1431
Joined: Tue Jun 30, 2009 3:13 pm
Location: Shropshire England
Callsign: Fly4Fun
Version: 0.9.10 up
OS: 64 Win 10 HD6450

Re: Differntial braking

Postby wkitty42 » Sun Apr 08, 2018 9:23 pm

that's cool... i hate ugly formatted code... it gives me hives and makes me twitch :mrgreen:

i'll edit my previous so it isn't doubled here...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9146
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: Differntial braking

Postby guzzi948 » Thu Jul 19, 2018 1:36 am

Is it possible to use differential braking via the Rudder axis using a modifier? I only want it for steering on the ground when no tail wheel steering is avaiable, ATM I don't have a need to apply both sides at the same time.
User avatar
guzzi948
 
Posts: 50
Joined: Tue Jun 12, 2012 11:20 am
Location: Queensland Australia
Callsign: VH-948
Version: 2017.1.3
OS: Win10-64

Re: Differntial braking

Postby wkitty42 » Thu Jul 19, 2018 3:38 am

use your "," and "." keys for left and right brakes ;)
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9146
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: Differntial braking

Postby guzzi948 » Thu Jul 19, 2018 2:49 pm

ThX wkitty42, well aware of the keyboard short cuts, looking for a solution using the rudder axis, so as to get a linear effect. Using the keyboard provides a digital solution that is not what I am chasing. Have found some other threads that may have the code I am looking for.
Cheers for taking the time to respond :-)

Found/figured out that if I modify the Rudder Axis code to read:
Code: Select all
   <axis n="3">
      <desc>Rudder</desc>
      <binding>
         <command>property-scale</command>
         <property>/controls/flight/rudder</property>
         <power type="double">1.0</power>
      </binding>
      <binding>
    <command>property-scale</command>
    <property>/controls/gear/brake-steering</property>
    <power type="double">1.0</power>
      </binding>
   </axis>

looking in the Internal Properties at controls/gear/ the variable 'brake-steering' is displayed and responds to rudder input and allows brake steering/differential braking
User avatar
guzzi948
 
Posts: 50
Joined: Tue Jun 12, 2012 11:20 am
Location: Queensland Australia
Callsign: VH-948
Version: 2017.1.3
OS: Win10-64

Re: Differntial braking

Postby wkitty42 » Fri Jul 20, 2018 8:42 pm

so how does it differentiate between brake steering and rudder control?
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9146
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: Differntial braking

Postby guzzi948 » Sat Jul 21, 2018 1:56 am

It doesn't, but I've tested it with a few different aircraft, with nose wheel steering, with selectable nws, and will test it with something with no steering options today. Has no detriment on aircraft with nws other than a slight braking effect, and is good when selectable nws is not used.
In flight it is still active but has no effect/detriment.
I thought of using a modifier, but haven't found a tidy solution to suit my button setup, and haven't summoned up the brain power to sort it out.
:-)
User avatar
guzzi948
 
Posts: 50
Joined: Tue Jun 12, 2012 11:20 am
Location: Queensland Australia
Callsign: VH-948
Version: 2017.1.3
OS: Win10-64

Re: Differntial braking

Postby guzzi948 » Sat Jul 21, 2018 6:09 am

:-(
Brake steering doesn't work on the DC-3. Going to assume that is the case for all tail draggers until proven wrong. Time to look for other options to apply differential braking via the rudder axis.
User avatar
guzzi948
 
Posts: 50
Joined: Tue Jun 12, 2012 11:20 am
Location: Queensland Australia
Callsign: VH-948
Version: 2017.1.3
OS: Win10-64

Re: Differntial braking

Postby guzzi948 » Sat Jul 21, 2018 7:15 am

What does work is:
Code: Select all
     <binding>
          <command>nasal</command>
          <script>
             var rp = getprop("/controls/flight/rudder");
             if (rp > 0)  {
                setprop("/controls/gear/brake-right",rp)
             } else  {
                setprop("/controls/gear/brake-left",-rp);
             }
          </script>
      </binding>
User avatar
guzzi948
 
Posts: 50
Joined: Tue Jun 12, 2012 11:20 am
Location: Queensland Australia
Callsign: VH-948
Version: 2017.1.3
OS: Win10-64

Re: Differntial braking

Postby guzzi948 » Sat Jul 21, 2018 4:03 pm

After some in depth thought and seeing how using gear\brake-left & brake right gets ugly when taxiing a NWS enabled A/C I bit the bullet and used some modifier to enable what appears to be the two options that cover differing requirements that don't provide NWS by default. Code-wise I think it is reasonable (happy to receive constructive criticism to the contrary), physically it's a bit messy fitting in with extant key bindings , notwithstanding a major paradigm shift re. Joystick bindings/assignments I will live with it for the foreseeable future.
By default the rudder acts as per normal and any NWS that is default will be effective, option 1 suits the DC-3 and I suspect most tail draggers, the second supports trike configs that don't have NWS as the default.
This is how I did it (including Rudder binding):
Code: Select all
   <axis n="3">
      <desc>Rudder</desc>
      <binding>
         <command>property-scale</command>
         <property>/controls/flight/rudder</property>
         <power type="double">1.0</power>
      </binding>
     <binding>
          <command>nasal</command>
          <script>
           mod1 = getprop("/input/joysticks/js[0]/t-flight-hotas-x-modifier1");
             mod2 = getprop("/input/joysticks/js[0]/t-flight-hotas-x-modifier2");
             if (mod1 == 0 and mod2 == 0) {
           #
             } elsif(mod1 == 1 and mod2 == 0) {
             var rp = getprop("/controls/flight/rudder");
             if (rp > 0)  {
                setprop("/controls/gear/brake-right",rp)
             } else  {
                setprop("/controls/gear/brake-left",-rp);
             }
          } elsif(mod1==0 and mod2==1) {
          var rp = getprop("/controls/flight/rudder");
             setprop("/controls/gear/brake-steering",rp)
             } elsif(mod1==1 and mod2==1) {
              #
             }
          </script>
      </binding>
   </axis>
User avatar
guzzi948
 
Posts: 50
Joined: Tue Jun 12, 2012 11:20 am
Location: Queensland Australia
Callsign: VH-948
Version: 2017.1.3
OS: Win10-64

Next

Return to Flying

Who is online

Users browsing this forum: No registered users and 5 guests