Board index FlightGear Support Hardware

Combine two separate joystick pedal axis for rudder

Joysticks, pedals, monitors.

Combine two separate joystick pedal axis for rudder

Postby alex.enjoy » Thu Jan 04, 2018 11:35 pm

Hello,

I want to use my racing wheel padels as second joystick for rudder control.
Unfortunately the two paddels cannot be combined to a single axis, so they act as separate axis Y and Z.
Both axis have a range from +1 (idle) to -1 (full pushed down)

I've tried to add both axis in the joystick xml as noted below, but the rudder does not act as it should.
Is the binding of two axis to a single property possible?

Thank you
Alex

Code: Select all
  <axis n="1">
    <desc>Rudder (right pedal)</desc>
    <direction>right</direction>
    <binding>
      <command>property-scale</command>
      <property>/controls/flight/rudder</property>
      <offset type="double">0.5</offset>
      <factor type="double">-1</factor>
      <power type="int">1</power>
    </binding>
    <dead-band type="double">0.05</dead-band>
  </axis>
  <axis n="3">
    <desc>Rudder (left pedal)</desc>
    <direction>left</direction>
    <binding>
      <command>property-scale</command>
      <property>/controls/flight/rudder</property>
      <offset type="double">0.5</offset>
      <factor type="double">1</factor>
      <power type="int">1</power>
    </binding>
    <dead-band type="double">0.05</dead-band>
  </axis>
alex.enjoy
 
Posts: 1
Joined: Thu Jan 04, 2018 11:25 pm

Re: Combine two separate joystick pedal axis for rudder

Postby Octal450 » Thu Jan 04, 2018 11:59 pm

Hmm, just a guess, your offset in axis 1 should be -0.5?

Also, negative is left, positive is right.

Kind Regards,
Josh
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5583
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11

Logitech Driving Force EX steering-wheel and pedals

Postby OE-LML » Sat Aug 24, 2019 6:15 pm

Split off from the topic "Combine two separate joystick pedal axis for rudder".


Hallo! :D

I just found my Logitech Driving Force EX steering-wheel and pedals from good old GT4-days.
Without programming skills but with some trial and error I managed to make gas and brake work as rudder pedals.
My whole xml-file looks as follows:

Code: Select all
<?xml version="1.0"?>

<PropertyList>
  <name type="string">Logitech Driving Force EX USB</name>
  <axis n="2">
    <desc type="string">Rudder</desc>
    <binding>
      <command type="string">property-scale</command>
      <property type="string">/controls/flight/rudder</property>
      <factor type="double">-0.5</factor>
      <offset type="double">-1</offset>
    </binding>
  </axis>
  <axis n="3">
    <desc type="string">Rudder</desc>
    <binding>
      <command type="string">property-scale</command>
      <property type="string">/controls/flight/rudder</property>
      <factor type="double">0.5</factor>
      <offset type="double">-1</offset>
    </binding>
  </axis>
</PropertyList>


It is not bad at all. In- and output are linear. So 50% of pedal way is 50% rudder deflection.
The only problem is that each pedal is one own axis. That means, one pedal will travel from -1 to +1. And that means "dead-band" or "power" will only work around 0, and that is 50% pedal way.

Is there a way to combine this two axis to one? Or is it somehow possible to set "dead-band" or "power" to "-1 position" (which is 0% pedal way)?

As always looking forward to your replies and thx in advance.
CU.

Edit: Sorry, at first it was wrong xml-file. Now it's corrected. (now factor +/- 0.5 instead of +/-1)
Last edited by Johan G on Wed Aug 28, 2019 6:45 pm, edited 2 times in total.
Reason: I did split this off to a new topic, but moved it back as it is now quite apparent to me that it was quite on topic. Sorry for the confusion.
OE-LML
 
Posts: 88
Joined: Wed Nov 14, 2018 11:18 pm
Location: irgendwo in der FIR LOVV

Re: Logitech Driving Force EX steering-wheel and pedals

Postby Johan G » Sun Aug 25, 2019 3:46 pm

Took the liberty to split off your post into a new topic. :wink:

OE-LML wrote in Sat Aug 24, 2019 6:15 pm:Is there a way to combine this two axis to one?

There should be several ways to do it, for example using embedded Nasal scripting or maybe property rules (the latter would probably require setting them up in your user preferences, but would likely be more stable).

Consider also that you probably could combine the left and right pedal channels so that they combines into rudder control and toe breaking (though it might be a bit tricky to tune and/or get a good feel for differential breaking). ;)

(You could also potentially set up your joystick file with conditions such that it has a default behaviour and then different behaviour depending on aircraft/helicopter/car models specified in your configuration files.)

These FlightGear wiki articles could be of help:
There is also this forum topic:
tl;dr - FlightGear is extremely flexible, and there are many ways to do it. :)

Edit: Why did I split this off, he was perfectly well on topic?!
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Some YouTube videos
Johan G
Moderator
 
Posts: 6629
Joined: Fri Aug 06, 2010 6:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit

Re: Combine two separate joystick pedal axis for rudder

Postby V12 » Tue Aug 27, 2019 7:13 am

I tried this 2 years ago, but it did not worked. Join 2 pedals even with offset to 1 axis is not good idea without hardware modifications, because when You fully release pedals, both has value 0, when fully press right pedal, its value will be 1, but left is still 0.
With some kind of lever mechanism should be possible to obtain value 0.5 on both half released pedals and when full press left pedal (value 1), right pedal is fully released by lever and give value 0. But there is not integrated solution for differential brake :(

I'm still thinking about steering wheel set with 2 pedals conversion to flight control system with home made yoke & pedal construction, with USB controller and potentiometers from wheel set arranged :
- steering wheel as rudder pedals
- accelerator pedal as elevator
- brake pedal as aileron
- button 1 left brake
- button 2 right brake
Brakes on buttons is not good solution, but better than none. And I still need some kind of quadrant - thrust lever, flaps, gear or speedbrake, if it is supported in FG (in FSX + PMDG it is possible).
Fly high, fly fast - fly Concorde !
V12
 
Posts: 2757
Joined: Thu Jan 12, 2017 5:27 pm
Location: LZIB
Callsign: BAWV12

Re: Combine two separate joystick pedal axis for rudder

Postby OE-LML » Fri Aug 30, 2019 1:39 pm

Hallo!

Thanks, Johan G, for your help/reply. I already read through "Writing Joystick Code: Part 1-4" before posting my first reply. But honestly I really struggle even with the basics of HTML and any further stuff looks like runes to me.

Now I got my G27 working the same way, with the same values for "factor" and "offset" I use for the Driving Force EX.

I'm still trying to combine these two axes into one. So all further help is greatly appreciated.
Is it possible with some kind of that: http://wiki.flightgear.org/Writing_Joystick_Code:_Part_3#perIndexAxisHandler ?

Thx in advance.
CU.

PS:

Last edited by Johan G on 28 Aug 2019, 18:45, edited 2 times in total.
Reason: I did split this off to a new topic, but moved it back as it is now quite apparent to me that it was quite on topic. Sorry for the confusion.

Johan G wrote in Sun Aug 25, 2019 3:46 pm:Edit: Why did I split this off, he was perfectly well on topic?!

Never mind. Probably you celebrated the opening of the new surströmming season too exzessively and emptied too many cans? :mrgreen: :wink: :P :twisted:
OE-LML
 
Posts: 88
Joined: Wed Nov 14, 2018 11:18 pm
Location: irgendwo in der FIR LOVV

Re: Combine two separate joystick pedal axis for rudder

Postby Johan G » Fri Aug 30, 2019 5:52 pm

Lol, no. :wink: Apparently skimmed through previous posts way to quickly. :roll: :oops:
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Some YouTube videos
Johan G
Moderator
 
Posts: 6629
Joined: Fri Aug 06, 2010 6:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit


Return to Hardware

Who is online

Users browsing this forum: No registered users and 7 guests