Board index FlightGear Support Hardware

Thrustmaster Hotas Warthog calibration

Joysticks, pedals, monitors.

Thrustmaster Hotas Warthog calibration

Postby clm76 » Sun Nov 28, 2021 6:38 pm

Hi,

I bought a Thrustmaster Hotas Warthog joystick to use as a helicopter cyclic. I removed the large spring and moved the 4 small springs to remove stress. Everything is working properly.
However, I would like to remove the dead zone from axes 0 and 1.
I am on linux and the jscal command gives me this:
Code: Select all
chris@chris ~ $ jscal -c /dev/input/js0
Joystick has 4 axes and 19 buttons.
Correction for axis 0 is broken line, precision is 255.
Coeficients are: 28672, 36862, 21844, 21844
Correction for axis 1 is broken line, precision is 255.
Coeficients are: 28672, 36862, 21844, 21844

With jstest-gtk, I have the following results:
Code: Select all
Axe 0 : CenterMin = 28672 - CenterMax = 32767 - RangeMin = 4095 - RangeMax = 32767
Idem with Axe 1.

As we can see, RangeMin = CenterMax-CenterMin (32767-28672 = 4095).
Last edited by clm76 on Thu Dec 02, 2021 5:05 pm, edited 1 time in total.
clm76
 
Posts: 204
Joined: Tue Oct 30, 2012 9:18 pm
Location: France - LFOH
Callsign: F-GCLM
Version: 2020.4.0
OS: Linux Mint 20.2

Re: How to delete deadzone on a Thrustmaster Hotas Warthog

Postby SurferTim » Mon Nov 29, 2021 3:56 pm

To remove the deadzone, the CenterMin and CenterMax values should be the same. The larger the difference, the bigger the deadzone.

Edit: You should be able to change those values with jstest-gtk. Run the calibration, then set the center values the same.
You can do the same with jscal, but it requires hacking the resulting file to change the CenterMin and CenterMax values the same. I had to do this with my new STM32 joystick module.
Fly low. Fly slow. Land on a dime. Twin Otter. https://github.com/SurferTim/dhc6p
My other aircraft is a Citation-X https://github.com/SurferTim/CitationX
PirateAir videos at https://www.youtube.com/user/SurferTim850
User avatar
SurferTim
 
Posts: 1718
Joined: Sun Dec 09, 2018 6:49 pm
Location: Miramar Beach, FL
Callsign: Pirate
Version: 2020.4.0
OS: Ubuntu 18.04

Re: How to delete deadzone on a Thrustmaster Hotas Warthog

Postby clm76 » Mon Nov 29, 2021 6:22 pm

Thanks SurferTim but it doesn't seem that simple with the Thrustmaster Hotas Warthog joystick (Hall effect).

jstest-gtk works well with a Saitek joystick (and others) but not with the Hotas Warthog. When I change something in CenterMin or CenterMax, and set RangeMin to 0 for example, the joystick returns wrong values, wrong movements and, often, Centermin, Centermax, RangeMin and RangeMax return to 0.

Idem with jscale where the native values are (jscal -p) :
Code: Select all
jscal -s 4,1,255,28672,36862,21844,21844,1,255,28672,36862,21844,21844,1,0,0,0,536870912,536870912,1,0,0,0,536870912,536870912 /dev/input/js0

With evdev-joystick :
Code: Select all
Supported Absolute axes:
  Absolute axis 0x00 (0) (X Axis) (value: 30956, min: 0, max: 65535, flatness: 4095 (=6.25%), fuzz: 255)
  Absolute axis 0x01 (1) (Y Axis) (value: 32298, min: 0, max: 65535, flatness: 4095 (=6.25%), fuzz: 255)
  Absolute axis 0x10 (16) (Hat zero, x axis) (value: 0, min: -1, max: 1, flatness: 0 (=0.00%), fuzz: 0)
  Absolute axis 0x11 (17) (Hat zero, y axis) (value: 0, min: -1, max: 1, flatness: 0 (=0.00%), fuzz: 0)

I tried to set flatness (dead-band) to 0 but, here again, I got wrong moves and values.
clm76
 
Posts: 204
Joined: Tue Oct 30, 2012 9:18 pm
Location: France - LFOH
Callsign: F-GCLM
Version: 2020.4.0
OS: Linux Mint 20.2

Re: Thrustmaster Hotas Warthog calibration

Postby clm76 » Thu Dec 02, 2021 5:43 pm

Thrustmaster Hotas Warthog Flight Stick (Hall effect) calibration without deadzone.

This joystick has ranges from 0 to 65536 for the X and Y axes, with 0 to the left and 65536 to the right for the X axis, 0 forward and 65536 backward for the Y axis.
Warning: the jstest-gtk calibration program gives incorrect values by not allowing 65536 value (max 32767).

The calibration is done directly in "/var/lib/joystick/joystick.state" and you must give it writing rights in console by:
Code: Select all
sudo chmod go+w /var/lib/joystick/joystick.state

If it does not exist, connect the joystick and write to the console:
Code: Select all
sudo jscale-store /dev/input/js0

Then open the joystick.state file (text file). Example:
Code: Select all
NAME="Saitek Saitek Pro Flight Yoke"
VENDOR="06a3"
PRODUCT="0bac"
jscal -u 7,0,1,2,3,4,16,17,23,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,704,705,706,707,708,709,710
jscal -s 7,1,0,512,512,1048544,1048544,1,0,512,512,1048544,1048544,1,0,127,127,4227201,4194176,0,0,0,0,0,0,0,0

NAME="Thustmaster Joystick - HOTAS Warthog"
VENDOR="044f"
PRODUCT="0402"
jscal -u 4,0,1,16,17,19,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,704,705,706
jscal -s 4,1,255,31400,31400,19576,19576,1,255,32768,32768,19576,19576,1,0,0,0,536870912,536870912,1,0,0,0,536870912,536870912

This is the last one we will modify (HOTAS Warthog).
We will be interested in the jscal -s line:
"4" is the number of axes present on the joystick.
"1" is the start of the code strings, the first "1" is for axis 0 (X axis), the second "1", for axis 1 (Y axis) etc ...
The first number after the "1" is the precision (255).
The next number (31400) is the minimum value of the "dead zone" and the one just after (also 31400), the maximum value of the "dead zone". The two digits being equal, there is no more "dead zone".
Note : The operating range being 65536, the middle of the range should be 32768 (as on the Y axis) but my tests led me to reduce these values to correctly centre the joystick.
I used the property "/input/joysticks/js(the number of your joystick)/axis/binding/setting" (in the property tree) for this, which must be as close as possible to 0.
With my joystick, the values of 31400 for the X axis give me a "setting" of -0.0071.This is very acceptable, given the sensibility of the joystick.
The following values (19576) are coefficients making it possible to cover the whole range from -1 to +1 of the "setting" with the joystick at the maximum on each side.
The Y axis codes start at the second "1" and we can see that this is centred with the values at 32768 (half of 65536), resulting in a "setting" of -0.0074.
Probably the x-axis has a little manufacturing offset (???).

The 3rd and 4th "1", with the codes which follow, correspond to the multidirectional button of the trimmers, treated as two axes. We don't have to touch them.

Once the calibration is complete, do not forget to relock the file by:
Code: Select all
sudo chmod go-w /var/lib/joystick/joystick.state
clm76
 
Posts: 204
Joined: Tue Oct 30, 2012 9:18 pm
Location: France - LFOH
Callsign: F-GCLM
Version: 2020.4.0
OS: Linux Mint 20.2


Return to Hardware

Who is online

Users browsing this forum: No registered users and 4 guests