Jump to content
The simFlight Network Forums

FSUIPC, SimConnect and joystick reading


Recommended Posts

Hi Pete,

Hope all is well across the pond for you.

I have an odd issue I'm running into and I'm not sure what's going wrong, but hope that you can provide me insight.  This is all in FSX:Acceleration with your current FSUIPC.

I have set up an SimConnect interface to recieve the AXIS_THROTTLE1_SET and AXIS_THROTTLE2_SET events.  The purpose is to intercept the axis values set by the joystick, override them and transmit the corrected values to the sim via SimConnect.  I am using a Saitek X55 HOTAS which has 2 throttles.

If I don't have FSUIPC running at all (module not loaded) I see a range of -7040 to 7040 in those events.  If I have FSUIPC running, with no calibration active I see the inputs alternating between a min/max of -7040 to 7040 and a min/max of -16384 to 16383.  I have never seen a behavior like this before and to be quite honest it makes no sense to me.  If I calibrate... it still behaves that way.

Any thoughts/ideas as to why I would be seeing such odd behavior?

Link to comment
Share on other sites

1 hour ago, WarpD said:

This is all in FSX:Acceleration with your current FSUIPC.

By "current" do you mean 4.953 or 4.954c? Both are concurrently available, the latter being an interim update with additions and fixes.

1 hour ago, WarpD said:

If I don't have FSUIPC running at all (module not loaded) I see a range of -7040 to 7040 in those events.  If I have FSUIPC running, with no calibration active I see the inputs alternating between a min/max of -7040 to 7040 and a min/max of -16384 to 16383.  I have never seen a behavior like this before and to be quite honest it makes no sense to me.  If I calibrate... it still behaves that way.

Any thoughts/ideas as to why I would be seeing such odd behavior?

Sorry, not without more information, no. Where are these assigned, and what to, exactly?

How are you proposing the intercept these axes in SimConnect? FSUIPC is doing the same of course, as with all controls (events). So do PMDG aircraft, and I assume others.

And finally, why are your throttles normally only giving -7040 to +7040? If calibrated in Windows they should give -16k to +16k. Are you taking some raw data instead?  (Most digital types give such a range in any case without calibration.)

Pete

 

Link to comment
Share on other sites

I only download what's available from the main page.  It appears to be 4.953.

As I stated in my original post Saitek X55, dual throttles.  Assigned via default sim interface only for throttle 1 axis and throttle 2 axis.  I am intercepting using MapClientToSimEvent and AddClientEventToNotificationGroup and setting it to SIMCONNECT_GROUP_PRIORITY_HIGEST.  Since my code is inside a gauge, that means I get to be the last one to ask for the axis data (I loaded last).  That should allow me to intercept and control the axis values.  I don't really care whether FSUIPC touches them or not... as I know lots of us use the calibration interface.  I just want to be between the joystick and the sim so that the sim only sees what I send it.

As for the throttle values... that's the values you display in the FSUIPC calibration tab area for the data coming from the joystick.  If I disable FSUIPC so it doesn't load... I see the same range coming directly from SimConnect.  So I have to assume that's the actual data range of the stick.

Link to comment
Share on other sites

4 hours ago, WarpD said:

I only download what's available from the main page.  It appears to be 4.953.

"Main page"? Oh, you mean the Schiratti site? Yes, that only shows main releases, and even then the description is usually out of date. It isn't my page, it is Enrico Schiratti's (author of Project Magenta), who has historically had Links to my stuff there since FS2000 days.  I have no control over that, I just try to get him to update the words occasionally.  I have no website. But the links there point here, to the SimFlight place where I can upload. The "Download Links" subforum above has links to much more, and often interim updates too. That's why I always need version numbers.

4 hours ago, WarpD said:

As I stated in my original post Saitek X55, dual throttles.  Assigned via default sim interface only for throttle 1 axis and throttle 2 axis.

Ah, Saitek. Yes they seem sometimes to install odd registry entries for their devices which have odd results, even only giving half the range or only two values as if digital not analogue. Right click the device in windows'"Device and Printers", select "Game Controller Settings", then "Properties", then "Settings" then "Calibrate". Follow the wizard instructions, but check "Display raw data" when you see it.

The axes should give values 0-255. That is the full range. That value CAN be read by FSUIPC in "RAW" mode. Normal mode actually gives you the raw value x 128, centred on zero: i.e y = (x - 128) * 128. The Direct Input keywords for the two modes are DIPROPCALIBRATIONMODE_RAW  and DIPROPCALIBRATIONMODE_COOKED, respectively.

On top of this, FS assignment apply what they call "sensitivity", which entails scaling the value yet again, and another slider which creates a null zone. Applying either of those will give unreal values too. Assignment in FSUIPC bypasses those two, of course.

If you've calibrated in Windows, and get 0-255 as I am pretty sure you should, then with the slider set to max sensitivity in FS, you should get the full range -16k to +16k.

5 hours ago, WarpD said:

I am intercepting using MapClientToSimEvent and AddClientEventToNotificationGroup and setting it to SIMCONNECT_GROUP_PRIORITY_HIGEST.  Since my code is inside a gauge, that means I get to be the last one to ask for the axis data (I loaded last).

Hmm. This priority system in SimConnect is very confusing. For axes I normally use SIMCONNECT_GROUP_PRIORITY_HIGHEST_MASKABLE, which allows me to stop the values being passed on in case I am calibrating. If I didn't do that then my calibrated values and the originals would both be received at lower priority levels.  If I am calibrating I modify the values, obviously, if I am not, I leave them be. I don't recall whether "HIGHEST" is higher or lower than that.

Either way, I send them on, either using SimConnect_TransmitClientEvent or just sending them to FS as a command. If they are calibrated they will be sent on as "THROTTLEn_SET" events, not "AXIS_THROTTLE" events, because those older events allow a reverse zone whilst the ew ones don't. There IS an INI file option, for Non-Reverse-Zone calibration, to only use the AXIS_THROTTLE events. Maybe your system needs that set? I know several add-on aircraft do. See "UseAxisControlsForNRZ" on page 2 of the FSUIPC4 Advanced Users document.

However, that wouldn't do anything when the axis isn't calibrated, and the value I receive and pass on when the axis isn't even assigned in FSUIPC should be just whatever I get.

Can you look at the values shown in the calibration tab again, make sure the button above the In/Out values reads "Set" so that the axis is NOT processed, and tell me the range of In values then? There, for a Windows-calibrated Saitek Throttle Quadrant, with FS sensitivity at max, I get either 0-16k or -16k to +16k (the two axes I tried are actually different even though all the settings and calibrations everywhere are the same! I think this is a Saitek registry data difference, and one of the things I have to deal with regularly from FSUIPC users with Saitek equipment! :-( ).

BTW, even if not assigning in FSUIPC, the Assignment tab gives you the Input value read, not from SimConnect, but using DirectInput. So that shows you what is being read by FS, bypassing the sliders. So, with the sensitivity slider set half way, say, I still get the -16k to +16k OR 0-16k in the Assignment tab, but -8k to +8k or 0-8k in the calibrations tab.

I've been experimenting here, and without calibration enabled, FSUIPC is definitely ONLY passing on the value it gets, the one shown on the "In" box on the Calibration tabs.  So I'm wondering is you have the sensitivity slide down a bit below half way, giving you 7k instead of 16k, but somehow the way you are reading or transmitting it gives the full value? You can use FSUIPC's axis logging to see the controls and values being received at FS action levels.

Otherwise, sorry, I can't explain it. But I do tell folks who want to use FSUIPC it make sure those FS sliders are set right (maxsensitivity, min null zone).

Pete

 

 

 

Link to comment
Share on other sites

Wow... ok... lots of information...

First, I went into the Windows calibration routine and checked the raw values... 0 to 1023.  A better range than I had actually expected as like you said a lot of axis values are limited to 512.  After that I went into the sim and started going through things top to bottom.  First, sensitivity on the throttles wasn't at 100%.  That is where the 7040 came from, oddly enough.  Once I adjusted to full sensitivity the scale was -16193 to 16192.  However I still had values showing up that bounced back and forth.  A review of my FSUIPC.INI file revealed where it was coming from.  Apparently at some point I had used FSUIPC to assign the throttles directly through FSUIPC... which means the poor sim was getting input directly from the joystick as well as input from FSUIPC.  No wonder it was sooo confused!  I deleted the assignment entries from my INI file and now it all behaves as expected.

The one thing that really surprises me is the sensitivity setting and that -7040 to 7040 range.  Didn't expect that.

Link to comment
Share on other sites

50 minutes ago, WarpD said:

First, I went into the Windows calibration routine and checked the raw values... 0 to 1023.  A better range than I had actually expected as like you said a lot of axis values are limited to 512.

If the 0-1023 range gives 1024 discrete values, is an excellent result for a domestic analogue input. They must be using a lot better pots -- or maybe it's optical? e.g. with a disk? The Saitek Quadrant, the one with 3 levers, only has 256 discrete positions -- that's much more common. But even the much more expensive PFC one I had only has 128 (0-127)!

Anyway, glad you found the problem. That's why I did ask earlier where it was assigned. Looking at the axis assignments tab instead of calibration would have shown this too, of course.

Pete

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.