Board index FlightGear Support Hardware

how to use dead-band

Joysticks, pedals, monitors.

how to use dead-band

Postby itismike » Mon Sep 27, 2010 10:09 pm

The dead-band line below is being ignored. Any tips on what I missed?
Code: Select all
<axis>
  <desc>Twist to View (Horizontal)</desc>
  <number>
   <mac>2</mac>
   <unix>2</unix>
   <windows>3</windows>
  </number>
  <dead-band type="double">=.4</dead-band>
  <binding>
    <command>property-scale</command>
    <property>/sim/current-view/goal-heading-offset-deg</property>
    <factor>-180.0</factor>
    <offset>0.0</offset>
    <power type="double">2.0</power>
  </binding>
</axis>
itismike
 
Posts: 47
Joined: Fri Sep 10, 2010 10:05 pm
Callsign: EZSPIN

Re: how to use dead-band

Postby sim » Tue Sep 28, 2010 6:44 am

0.4?
User avatar
sim
 
Posts: 1055
Joined: Tue Jun 30, 2009 2:13 pm
Location: Shropshire England
Callsign: Fly4Fun
Version: 0.9.10 up
OS: 64bit Win 7

Re: how to use dead-band

Postby itismike » Tue Sep 28, 2010 1:36 pm

sim wrote:0.4?

Well, yeah. I got that figure from the previous "axis 2" figures which were originally set for the rudder. The raw output from the joystick is from -1 to 1, so .4 is plenty to ignore the slight variation introduced during use. Not completely understanding how the calculations are performed (pre-factor or post-factor,) I also increased that number up to 200 and it still made no difference in play, so I figure that line is just being completely ignored, but I'm not certain why. I read the FAQ and see that dead-band is calculated outside of the command manager, but I'm unclear what that translates into other than that it must be placed outside of the [binding] [/binding] tags, which it is.
itismike
 
Posts: 47
Joined: Fri Sep 10, 2010 10:05 pm
Callsign: EZSPIN

Re: how to use dead-band

Postby sim » Tue Sep 28, 2010 7:17 pm

Mike, Not that clued up on this particular one but you have not explained the problem properly. What view function do you expect this rudder script to perform (Pan-View?)and is it doing what you wanted? Is your HAT busy doing something else as that will pan the view better? The deadband 0.4 is supposed to eliminate the mid axis jitter so reading between the lines I have to guess you have a jittery view when the twist is centralised and increasing the dead band doesn't cure it? Does it work ok if you revert it to controlling rudder? sim

here is the rudder script I use which looks different whether it can control panview instead of rudder I have no idea but I will see if your -180 degree view idea works. will report back shortly!

Code: Select all
<axis n="3">  <desc>Rudder</desc>
  <binding>
   <command>property-scale</command>
   <property>/controls/flight/rudder</property>
   <dead-band type="double">0.1</dead-band>
   <offset type="double">0.0</offset>
   <factor type="double">1.0</factor>
   <squared type="bool">true</squared>
  </binding>
 </axis>
User avatar
sim
 
Posts: 1055
Joined: Tue Jun 30, 2009 2:13 pm
Location: Shropshire England
Callsign: Fly4Fun
Version: 0.9.10 up
OS: 64bit Win 7

Re: how to use dead-band

Postby itismike » Tue Sep 28, 2010 7:41 pm

Hi sim. Thanks for trying to help. It amuses me that my explanation wasn't 'properly explained' when your response consisted of four characters! :lol:
But anyway, yes, this code allows me to use the yoke to look left and right rather than adjust the rudder, since I have pedals for that and leaving it mapped to rudder causes my rudders to not work. The code works very well but is a little annoying because it jitters slightly when I use the ailerons due to side-forces causing the view to jump back and forth slightly. So I'd just like to use the 'dead-band' function to make it less sensitive around the '0' spot. I've remapped the hat to perform different functions (zoom and vertical panning,) so I don't believe there is any conflict there. Let me know how the view code works for you.
Does anybody have an idea why the dead-band code I posted doesn't seem to be interpreted?
itismike
 
Posts: 47
Joined: Fri Sep 10, 2010 10:05 pm
Callsign: EZSPIN

Re: how to use dead-band

Postby sim » Tue Sep 28, 2010 8:06 pm

Yep my codebox adapts ok to panView Mike. You will note you don't get the full 180 view as pilot but in helicoptor view you do. So full twist in either direction you view directly behind. It was slightly jittery when centralised so I upped the deadzone from 0.1 to 0.8 and that cured the central jitter. Unfortunately it jitters the view on all stops along the way though 180 0 -180 are ok but in between the view is not altogether stable (potentiometer effect probably) so unless your twist axis has a super refined analogue movement you may have to put up with a less than satisfactory stable panorama around you! Dead stable picture at any viewpoint you stop at if you use HAT, which to me is far preferable. I reckon you've only done it because the foot pedals made twist redundant and you hate having anything on your stick standing idle! :lol:
Cheers, sim
Last edited by sim on Tue Sep 28, 2010 9:29 pm, edited 1 time in total.
User avatar
sim
 
Posts: 1055
Joined: Tue Jun 30, 2009 2:13 pm
Location: Shropshire England
Callsign: Fly4Fun
Version: 0.9.10 up
OS: 64bit Win 7

Re: how to use dead-band

Postby itismike » Tue Sep 28, 2010 8:41 pm

I prefer the twist-to-view because it allows me to make nearly instantaneous checks out the window and automatically centers itself. Also having the zoom under my thumb means I rarely need the keyboard. BTW, you could cure your mid-jitters by introducing a little tolerance:
<tolerance type="double">0.1</tolerance>
So the dead-band in the code above works fine for you? Why would it not work for me? I'll try it for some other axis and see if I can debug what's going on here.
-Mike
itismike
 
Posts: 47
Joined: Fri Sep 10, 2010 10:05 pm
Callsign: EZSPIN

Re: how to use dead-band

Postby itismike » Tue Sep 28, 2010 9:13 pm

Wait a sec - you said you changed deadzone "from 0.1 to 0.8". The code I posted didn't have a .1 in it, but had a .4. So what code did you use? Can you share with me the code that allowed you to pan-view with the joystick and also responded to changes you made to adjust dead-band?

I find it interesting that the dead-band line in your example is located within the [command][/command] tags. According to the user's guide, dead-band must be outside of it:
*Important Note About dead-band*
------------------------------------------------
You may recall from the section about raw axis value modifiers that dead-band is implemented outside the command manager. This means that if you want to apply a dead-band, the tag *must* precede the binding tag.

Is dead-band working for your rudder? If so, the documentation may be incorrect...
itismike
 
Posts: 47
Joined: Fri Sep 10, 2010 10:05 pm
Callsign: EZSPIN

[SOLVED]: how to use dead-band

Postby itismike » Tue Sep 28, 2010 9:45 pm

it was a typo in my originally posted code. I had an equal sign in in the dead-band line. I removed the equal sign and dead-band works as expected. Also, I confirmed dead-band is ignored if it is located inside of the [binding][/binding] tags, so there is no error in the documentation. Sim, you may want to move that line up if your rudder ignores dead-band. :wink:
Thanks for making me analyze my code so carefully!
-Mike

Here's the working twist-to-view code. I ended up using both dead-band and tolerance for the smoothest result. This "may not be suitable for all viewers" because it introduces some unexpected behavior, such as: if you look far left, then quickly look far right, it looks left instead until you allow it time to re-center. It also is optimized for airplane piloting, so the view increments in smaller steps first, then when looking behind you it jumps several steps at a time (the 'power' command does that):
Code: Select all
 <axis>
  <desc>Twist to View (Horizontal)</desc>
  <number>
   <mac>2</mac>
   <unix>2</unix>
   <windows>3</windows>
  </number>
   <dead-band type="double">0.2</dead-band>
   <tolerance type="double">0.2</tolerance>
   <binding>
    <command>property-scale</command>
    <property>/sim/current-view/goal-heading-offset-deg</property>
    <factor>-180.0</factor>
    <offset>0.0</offset>
    <power type="double">2.0</power>
   </binding>
 </axis>


My full custom joystick xml file (which also remaps zoom to the hat) is located here:
custom_extreme-3d-pro.xml
beware that I may make modifications to this file at any time without warning, so ask me if you think something's hokie!
itismike
 
Posts: 47
Joined: Fri Sep 10, 2010 10:05 pm
Callsign: EZSPIN

Re: how to use dead-band

Postby sim » Thu Sep 30, 2010 8:00 pm

Glad you fixed it Mike, The 0.1 deadband you queried is in the code box you appear not to have seen in my earlier post. It does the same job but using a different construction. But that is the code I tested your -180 View on not your original. So now you fixed yours you have 2 different code-boxes, both will work with your twist axis. Thanks too for the "Tollerance" tip. Will remember that it overcomes the potentiometer jitter effect. very handy!
My stick xml too Mike, always making mods. In fact I have currently 3 stick xml files which I can swap easily. Here is my tip to quickly swap to another joystick xml because it may suit a particular flight better. Keep each different joystick xml in a zip in your manufacturer (say Saitek) folder. Then simply delete the current xml and extract the new one you choose for that flight. The old one will still be available safe in it's own zip next time you need it. Same thing if you have more than one variant of say 777-200 keep 'em in zips in Aircraft folder and extract your choice for the day!
Cheers, sim
User avatar
sim
 
Posts: 1055
Joined: Tue Jun 30, 2009 2:13 pm
Location: Shropshire England
Callsign: Fly4Fun
Version: 0.9.10 up
OS: 64bit Win 7

Re: how to use dead-band

Postby itismike » Thu Sep 30, 2010 10:02 pm

Hi sim. I saw your rudder code but assumed you had tested mine. Again, according to the documentation and my test, the code you present is not formatted to handle dead-band correctly. Maybe that's why you had to take it all the way up to .8? Ignoring 0.8 of a 2.0 range (-1 to +1) means it's ignoring 40% of the joystick's input. I'm not sure how accurate dead-band is when used inside the binding statement. Thanks again for working through this problem with me, I'm glad to have it resolved.
itismike
 
Posts: 47
Joined: Fri Sep 10, 2010 10:05 pm
Callsign: EZSPIN

Re: how to use dead-band

Postby sim » Thu Sep 30, 2010 11:59 pm

Great this xml stuff Mike, What I'll do is put 'em both in my stick xml and test both out with different deadband & tolerance factors. I know thanks to our exchange on this topic just how to do that as I reckon your -180 view will be better at showing jitter than any rudder will. You sure could see even a tiny jitter using Helicoptor-View!
sim
ALL DONE and here is my conclusion
the deadband and tolerance definitely are more effective outside the bindings
The problem of not quite getting the full -180 at full twist either way can be mostly overcome by adding "low" & "high" scripts to set-prop + or -180. Note to test this I added GUI to show "LO" and "HI" when you hit each end stop. Note also how low I have been able to set deadband and tolerance factors, rudder (view) centres nicely and not a jitter in sight. So converted it back to rudder and deleted the high low bindings. Should now be the most finely tuned rudder script possible !!!

Code: Select all
<axis n="3">  <desc>Rudder/View sims</desc> <dead-band type="double">0.04</dead-band>
<tolerance type="double">0.02</tolerance> <binding> <command>property-scale</command>
<property>/sim/current-view/goal-heading-offset-deg</property>     <offset type="double">0.0</offset>
<factor>-180.0</factor>   <squared type="bool">true</squared> </binding>
<low>  <repeatable type="bool">false</repeatable> <binding> <command>nasal</command>
<script>setprop("/sim/current-view/goal-heading-offset-deg", 180);gui.popupTip("LO");</script>
</binding> </low>
<high>  <repeatable type="bool">false</repeatable> <binding> <command>nasal</command> <script>setprop("/sim/current-view/goal-heading-offset-deg", -180);gui.popupTip("HI");</script> </binding> </high> </axis>
Last edited by sim on Mon Oct 04, 2010 7:19 pm, edited 1 time in total.
User avatar
sim
 
Posts: 1055
Joined: Tue Jun 30, 2009 2:13 pm
Location: Shropshire England
Callsign: Fly4Fun
Version: 0.9.10 up
OS: 64bit Win 7

Re: how to use dead-band

Postby itismike » Fri Oct 01, 2010 5:33 am

That's really neat stuff, sim! I can't wait to get back to my place and test it! Good work putting it all together!
itismike
 
Posts: 47
Joined: Fri Sep 10, 2010 10:05 pm
Callsign: EZSPIN

Re: how to use dead-band

Postby sgofferj » Fri Dec 23, 2011 4:20 pm

Hi, I gotta pull this one up.
I have a little problem. My AV8R-02's twist rudder is always a bit right. The KDE joystick configuration says, it delivers values between -32767 and 32767 but in center position the value is 258.
I now modified the js0.xml so:

Code: Select all
  <axis n="2">
    <desc>Rudder</desc>
    <direction>right</direction>
    <binding>
      <command>property-scale</command>
      <property>/controls/flight/rudder</property>
      <factor type="double">1</factor>
      <power type="int">1</power>
    </binding>
    <dead-band type="double">258</dead-band>
  </axis>


But now the rudder doesn't work anymore at all. Any hints?
FG 3.1 GIT / Opensuse 12.3 / Phenom II X4 / GForce GTX560
Stefan's little Flightgear corner | The Finnish Weather Center | Wolves in Finland

Working on: EFTP
COM: IAX2:home.gofferje.net/stefan (MO-FR 0700-2000 UTC, SA+SU 0900-2000 UTC)
sgofferj
 
Posts: 789
Joined: Mon Dec 05, 2011 4:13 pm
Location: EFTP
Callsign: OH-SW
Version: 3.1 GIT
OS: Opensuse

Re: how to use dead-band

Postby AndersG » Fri Dec 23, 2011 7:11 pm

sgofferj wrote on Fri Dec 23, 2011 4:20 pm:But now the rudder doesn't work anymore at all. Any hints?


IIRC a deadband of 1.0 would be the full range of the axis.

/Anders
Callsign: SE-AG
Aircraft: Submarine Scout, Zeppelin NT, ZF Navy free balloon, Nordstern, Hindenburg, Short Empire flying-boat, SAAB 29F, ZNP-K, North Sea class, MTB T21 class, U.S.S. Monitor, MFI-9B, Type UB I.
AndersG
 
Posts: 1821
Joined: Wed Nov 29, 2006 9:20 am
Location: Göteborg, Sweden
Callsign: SE-AG
OS: Debian GNU Linux

Next

Return to Hardware

Who is online

Users browsing this forum: MSNbot Media and 2 guests