pilotjohn Posted February 25 Report Posted February 25 So there are some aircraft where I need to use an Lvar to control an axis (throttle, rudder, aileron etc.). For these, I generally (now) declare a preset in my events.txt and do the needful scaling to make it work. However, I'm confused as to what ranges are to be expected from FSUIPC, despite the ranges shown in FSUIPC axes window as -16384 to 16384. For example, the COWS DA4X rudder range the RPN preset receives from FSUIPC appears to be this full range. However, the FFX HA420 throttle range the RPN preset receives from FSUIPC appears to be -1024 to 1024 (or 1023, whatever). Given that FSUIPC has now idea whether I'll be doing throttle, rudder or what the axis is used for, why are these ranges different?
John Dowson Posted February 25 Report Posted February 25 37 minutes ago, pilotjohn said: For these, I generally (now) declare a preset in my events.txt and do the needful scaling to make it work. However, I'm confused as to what ranges are to be expected from FSUIPC, despite the ranges shown in FSUIPC axes window as -16384 to 16384. But an axis and an lvar are two completely different things. If you are assigning an axis to a preset, it is the axis value that is sent to the preset as the parameter. It is then up to you to calibrate/adjust that value in the preset RPN to whatever is needed. An lvar can accept a range of values, and every lvar is different. Some lvars only hold a 1 or 0, others can hold a range, and that may be from 0-100, -100 to +100, 0 to 1, etc. It is up to you to determine the range and scale the axis range accordingly. The range of values an axis sends depends on the axis. Standard joystick axis usually send values in the range -16384 - +16383, but some (especially those using potentiometers) can have a range of 0-1024 or -1024 to +1024. Calibration is used to calibrate the axis range to the range expected by the control being used. 49 minutes ago, pilotjohn said: However, the FFX HA420 throttle range the RPN preset receives from FSUIPC appears to be -1024 to 1024 (or 1023, whatever). There are quite a few MF presets that calibrate to that range, and some for other ranges (0-1024 being another common range). You need to look at the preset code and description for such 'potentiometer' presets and update or change to your axes range. 1 hour ago, pilotjohn said: Given that FSUIPC has now idea whether I'll be doing throttle, rudder or what the axis is used for, why are these ranges different? Because different hardware/drivers use different ranges for axes.
pilotjohn Posted February 25 Author Report Posted February 25 6 hours ago, John Dowson said: Because different hardware/drivers use different ranges for axes. So I'm still not clear why the range of values the RPN receives is different when FSUIPC shows the same range for all the different axes when I scan them. To be more concrete: 1. I have VirtualFly Yoko+ Ruddo+ and TQ6+ (all of which are Hall effect sensors) 2. All of the axes on these show a range of -16384 to 16384 in FSUIPC Axes window 3. I assume these are the values that are pushed on the stack by the @ parameter in RPN when using "Send to preset" 4. Thus, if I have to normalize the input to an Lvar in the range of -1 to 1, I would generally divide by 16384. 5. However, for one preset, I'm receiving a range of -1024 to 1024 (even though FSUIPC is showing -16384 to 16384) and so I have to scale accordingly 6. Where does the value for "send to preset" come from? Does that come from FSUIPC's processing of the input device/joystick? If so, why is the range not -16k to 16k. For example: The COWS Rudder RPN is: COWS_DA4X_Rudder#@ -163.84 / -100 max 100 min (>L:INPUT_RUDDER, Percent) But the HJET throttle RPN didn't work with this range, and empirically it looks like the range coming in is-1k to 1k: FFX_HJET_Throttle_1#@ d -512 < if{ p 0 (>L:HA420_ThrottlePos_L) -1 (>L:THROTTLE1_SET) } els{ 20.48 / 50 + 50 max 100 min d (>L:HA420_ThrottlePos_L) 50 - 2 * 100 / (>L:THROTTLE1_SET) } So where is the scaling from -16k..16k -> -1k..1k happening? Is there a setting somewhere I'm missing?
John Dowson Posted February 26 Report Posted February 26 12 hours ago, pilotjohn said: 5. However, for one preset, I'm receiving a range of -1024 to 1024 (even though FSUIPC is showing -16384 to 16384) and so I have to scale accordingly I don't see how this can be the case. 12 hours ago, pilotjohn said: So where is the scaling from -16k..16k -> -1k..1k happening? Is there a setting somewhere I'm missing? There is no such scaling. If assigning an axis to a preset, the axis value Out value should be used as the parameter, which should also match the In value. WAPI Debug level logging should show the values being used.
pilotjohn Posted February 26 Author Report Posted February 26 5 hours ago, John Dowson said: There is no such scaling. If assigning an axis to a preset, the axis value Out value should be used as the parameter, which should also match the In value. WAPI Debug level logging should show the values being used. Ok, I'll take a look. I assume this is in same place where I log events etc.?
pilotjohn Posted February 26 Author Report Posted February 26 7 hours ago, John Dowson said: I don't see how this can be the case. 19 hours ago, pilotjohn said: So this seems to be what is happening. Attached is a screenshot with the Axes window open showing the full forward range of the throttle showing ~16k out. And turning on WAPI->Debug shows ~1000 being sent to the calculator code. Any other debug info to dig into? Log attached. FSUIPC7.zip
John Dowson Posted February 26 Report Posted February 26 Please: - turn off WAPI trace logging. Debug level logging is sufficient - also activate logging for Axes Controls and Extras - please also attach both your FSUIPC7.ini and myevents.txt files as well as a new FSUIPC7.log - please don't attach images unless requested. It is the files I need to see.
pilotjohn Posted February 26 Author Report Posted February 26 I found the culprit. I had a scaling factor as part of the axes assignment in the profile .ini from when I was using calculator code assigned to an offset. Sorry about the false alarm. (every several years I take on this hobby again, and have re-learn all this) It would be great if I could send FSUIPC calibrated values somehow. What would be the best way to do that? Is there someway to assign an axes to calibration, then use those values to send to a preset? Any chance of adding "extra"/arbitrary joystick calibration sections that could be then sent to a preset?
John Dowson Posted February 27 Report Posted February 27 20 hours ago, pilotjohn said: It would be great if I could send FSUIPC calibrated values somehow. What would be the best way to do that? You cannot calibrate when assigning to presets - this just doesn't make sense to allow this. 20 hours ago, pilotjohn said: Is there someway to assign an axes to calibration, then use those values to send to a preset? No - it doesn't make any sense to allow this. There is no way that FSUIPC can calibrate values needed for a preset. 20 hours ago, pilotjohn said: Any chance of adding "extra"/arbitrary joystick calibration sections that could be then sent to a preset? No. Just use scaling.
pilotjohn Posted February 28 Author Report Posted February 28 7 hours ago, John Dowson said: it doesn't make any sense to allow this I disagree. This is exactly what Axes and Ohs seems to be doing: 1. Get input from hardware. 2. "Calibrate", min, max, margins, dead, zone 3. Scale 4. Send to whatever you like (sim events, Lvars or whatever else) So I'll find another way. Thanks.
John Dowson Posted February 28 Report Posted February 28 It doesn't make sense to allow this in FSUIPC due to the way calibration works in FSUIPC. FSUIPC calibrates to an FS control, and as there is no specific control/event when assigning to a preset, it does not know the range to calibrate to. Max/min/scaling etc can easily be handled, either in the RPN itself. or you can just write the axis value to an offset and do whatever you want with it before using it in a preset.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now